diff options
author | 2024-06-25 18:13:34 +0200 | |
---|---|---|
committer | 2024-06-25 18:13:34 +0200 | |
commit | 1eb7fed5c9bf51f184aae30f96e3bf9faa51b39a (patch) | |
tree | 41512248b2a7714b29d238bf9020f6e9c39e9e91 | |
parent | Version 1.71 released (diff) | |
download | ebuild-mode-1eb7fed5c9bf51f184aae30f96e3bf9faa51b39a.tar.gz ebuild-mode-1eb7fed5c9bf51f184aae30f96e3bf9faa51b39a.tar.bz2 ebuild-mode-1eb7fed5c9bf51f184aae30f96e3bf9faa51b39a.zip |
New major mode ebuild-eclass-mode
* ebuild-mode.el (ebuild-eclass-mode): New major mode for editing
of eclasses, split off from ebuild-mode.
(auto-mode-alist): Add ebuild-eclass-mode.
* ebuild-mode.texi (ebuild-eclass-mode): Chapter renamed from
eclass-mode and updated.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | ebuild-mode.el | 27 | ||||
-rw-r--r-- | ebuild-mode.texi | 19 |
3 files changed, 33 insertions, 21 deletions
@@ -1,3 +1,11 @@ +2024-06-25 Ulrich Müller <ulm@gentoo.org> + + * ebuild-mode.el (ebuild-eclass-mode): New major mode for editing + of eclasses, split off from ebuild-mode. + (auto-mode-alist): Add ebuild-eclass-mode. + * ebuild-mode.texi (ebuild-eclass-mode): Chapter renamed from + eclass-mode and updated. + 2024-06-09 Ulrich Müller <ulm@gentoo.org> * Version 1.71 released. diff --git a/ebuild-mode.el b/ebuild-mode.el index 4a086ae..772b1f3 100644 --- a/ebuild-mode.el +++ b/ebuild-mode.el @@ -405,7 +405,7 @@ Compatibility function for XEmacs." ;;;###autoload (define-derived-mode ebuild-mode sh-mode "Ebuild" - "Major mode for Gentoo .ebuild and .eclass files." + "Major mode for Gentoo .ebuild files." ;; Always enable ebuild-repo-mode, even if the ebuild is edited ;; outside an ebuild repository (ebuild-repo-mode 1) @@ -414,16 +414,7 @@ Compatibility function for XEmacs." (easy-menu-add ebuild-mode-menu)) (setq fill-column 72) (setq tab-width 4) - (setq indent-tabs-mode t) - (when (and buffer-file-name - (let ((case-fold-search t)) - (string-match "\\.eclass\\'" - (file-name-sans-versions buffer-file-name)))) - ;; Eclass documentation uses two spaces after sentence ends - (set (make-local-variable 'sentence-end-double-space) t) - ;; Don't rewrap paragraphs into a preceding eclassdoc token - (set (make-local-variable 'paragraph-separate) - (concat paragraph-start "\\|^# @")))) + (setq indent-tabs-mode t)) (defun ebuild-mode-add-font-lock () "Add `ebuild-mode' font-lock keywords for the current buffer." @@ -431,6 +422,15 @@ Compatibility function for XEmacs." (add-hook 'ebuild-mode-hook #'ebuild-mode-add-font-lock) +;;;###autoload +(define-derived-mode ebuild-eclass-mode ebuild-mode "Eclass" + "Major mode for Gentoo .eclass files." + ;; Eclass documentation uses two spaces after sentence ends + (set (make-local-variable 'sentence-end-double-space) t) + ;; Don't rewrap paragraphs into a preceding eclassdoc token + (set (make-local-variable 'paragraph-separate) + (concat paragraph-start "\\|^# @"))) + ;;; Run ebuild command. (defvar ebuild-mode-ebuild-history nil) @@ -941,7 +941,10 @@ in a Gentoo profile." (unless (derived-mode-p 'sh-mode) ad-do-it))) ;;;###autoload -(add-to-list 'auto-mode-alist '("\\.\\(ebuild\\|eclass\\)\\'" . ebuild-mode)) +(add-to-list 'auto-mode-alist '("\\.ebuild\\'" . ebuild-mode)) + +;;;###autoload +(add-to-list 'auto-mode-alist '("\\.eclass\\'" . ebuild-eclass-mode)) ;;;###autoload (add-hook diff --git a/ebuild-mode.texi b/ebuild-mode.texi index 1836e72..3268ab2 100644 --- a/ebuild-mode.texi +++ b/ebuild-mode.texi @@ -52,7 +52,7 @@ scripts and there easy to create. Eclasses are comparable to a library which provides generic functions that a set of ebuilds can use by sourcing it on request. -ebuild-mode provides a major mode to edit the above two file types. +ebuild-mode provides major modes to edit the above two file types. Other features are the execution of often needed commands (like KEYWORDS manipulation) or fast-track creation of new ebuilds by skeleton support. @@ -60,7 +60,7 @@ by skeleton support. @menu * Commands:: What ebuild-mode provides. * ebuild-mode:: Editing ebuilds. -* eclass-mode:: Editing eclasses. +* ebuild-eclass-mode:: Editing eclasses. * ebuild-repo-mode:: Minor mode for ebuild repositories. * devbook-mode:: Editing the Gentoo Devmanual. * gentoo-newsitem-mode:: Editing GLEP 42 news items. @@ -88,7 +88,7 @@ keybindings (described later) and menu entries, if the latter is activated. So every user has the choice for his/her preferred way of interfacing with Emacs. -@node ebuild-mode, eclass-mode, Commands, Top +@node ebuild-mode, ebuild-eclass-mode, Commands, Top @chapter ebuild-mode @section Writing a new ebuild Starting a completely new ebuild from scratch is best done by inserting @@ -194,12 +194,13 @@ Run a @command{pkgdev} command. Run a @command{pkgcheck} command. @end table -@node eclass-mode, ebuild-repo-mode, ebuild-mode, Top -@chapter eclass-mode -There is no special eclass-mode but ebuild-mode is used without the -commands that make no sense in eclasses. +@node ebuild-eclass-mode, ebuild-repo-mode, ebuild-mode, Top +@chapter ebuild-eclass-mode +For editing of eclasses, ebuild-eclass-mode is a derived mode of +ebuild-mode and provides all its features. In addition, highlighting +of eclass documentation keywords with font-lock is supported. -@node ebuild-repo-mode, devbook-mode, eclass-mode, Top +@node ebuild-repo-mode, devbook-mode, ebuild-eclass-mode, Top @chapter ebuild-repo-mode This is a minor mode intended for editing ebuilds and other files in an ebuild repository (except patches). @@ -228,7 +229,7 @@ is commonly used in @file{package.mask} and other files: The user's name and e-mail address can be customized with variables @code{ebuild-mode-full-name} and @code{ebuild-mode-mail-address}. -@node devbook-mode, gentoo-newsitem-mode, eclass-mode, Top +@node devbook-mode, gentoo-newsitem-mode, ebuild-eclass-mode, Top @chapter devbook-mode for the Gentoo Devmanual This is a very simple derived major mode for editing the Devmanual. Because the Devmanual is written in DevBook XML, this mode is derived |