diff options
author | Ulrich Müller <ulm@gentoo.org> | 2023-08-26 21:18:15 +0200 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2023-08-26 21:18:15 +0200 |
commit | 3cb4bffc8af42fa55b7d6dfbe8f28793c995ce71 (patch) | |
tree | 5fa9a0937343daf388065f5b3e251912c592de0e /ebuild-mode.el | |
parent | Enable lexical binding (diff) | |
download | ebuild-mode-3cb4bffc8af42fa55b7d6dfbe8f28793c995ce71.tar.gz ebuild-mode-3cb4bffc8af42fa55b7d6dfbe8f28793c995ce71.tar.bz2 ebuild-mode-3cb4bffc8af42fa55b7d6dfbe8f28793c995ce71.zip |
Set paragraph-separate when editing eclasses
* ebuild-mode.el (ebuild-mode): Set paragraph-separate for
eclasses, in order to prevent rewrapping of paragraphs into a
preceding eclass documentation token.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'ebuild-mode.el')
-rw-r--r-- | ebuild-mode.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ebuild-mode.el b/ebuild-mode.el index 546ca61..6206ccf 100644 --- a/ebuild-mode.el +++ b/ebuild-mode.el @@ -412,12 +412,15 @@ Compatibility function for XEmacs." (setq fill-column 72) (setq tab-width 4) (setq indent-tabs-mode t) - (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))) + (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 "\\|^# @")))) (add-hook 'ebuild-mode-hook (lambda () (font-lock-add-keywords |