[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 989eed2 11/14: Add to after-change-major-mode-hook at load
From: |
Phil |
Subject: |
[elpa] master 989eed2 11/14: Add to after-change-major-mode-hook at load time |
Date: |
Sat, 11 Jul 2020 00:57:56 -0400 (EDT) |
branch: master
commit 989eed266e13997d572a459fbcf07e49c0058d3a
Author: Phil Sainty <psainty@orcon.net.nz>
Commit: Phil Sainty <psainty@orcon.net.nz>
Add to after-change-major-mode-hook at load time
This feels a little cleaner. We are already adding the related
advice at load time, so this change is consistent with that.
Unless a major mode has been delighted, neither this hook function
nor the advice have any practical effect. Both are removed by
`unload-feature'.
---
delight.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/delight.el b/delight.el
index 5e6526d..d7af68f 100644
--- a/delight.el
+++ b/delight.el
@@ -185,12 +185,13 @@ for this purpose). These FILE options are relevant to
minor modes only.
For major modes you should specify the keyword :major as the value of FILE,
to prevent the mode being treated as a minor mode."
- (add-hook 'after-change-major-mode-hook #'delight-major-mode)
(let ((glum (if (consp spec) spec (list (list spec value file)))))
(while glum
(cl-destructuring-bind (mode &optional value file) (pop glum)
(assq-delete-all mode delight-delighted-modes)
(add-to-list 'delight-delighted-modes (list mode value file))
+ ;; Major modes are handled in `after-change-major-mode-hook'.
+ ;; Minor modes are handled at load time:
(unless (eq file :major)
(eval-after-load (if (eq file t) 'emacs (or file mode))
`(when (featurep 'delight)
@@ -237,6 +238,9 @@ If the delighted VALUE is not a string and not nil, we do
nothing."
(setf (cadr menu-def) new-label)
(define-key menu-keymap (vector mode) menu-def)))))))
+;; Handle major modes at call time.
+(add-hook 'after-change-major-mode-hook #'delight-major-mode)
+
(defun delight-major-mode ()
"Delight the 'pretty name' of the current buffer's major mode
when displayed in the mode-line.
- [elpa] master 05ef4d7 03/14: Fix quote character in `delight' docstring in Emacs 25+, (continued)
- [elpa] master 05ef4d7 03/14: Fix quote character in `delight' docstring in Emacs 25+, Phil, 2020/07/11
- [elpa] master d2cc2fc 02/14: Use GNU ELPA version number formatting, Phil, 2020/07/11
- [elpa] master e3bd4c2 01/14: * delight.el: Fix copyright, Phil, 2020/07/11
- [elpa] master 8ec8a5b 05/14: Use cl-lib, nadvice, and lexical-binding, Phil, 2020/07/11
- [elpa] master 6d4a5aa 06/14: Use double-spaced sentence formatting, Phil, 2020/07/11
- [elpa] master 17cce66 04/14: Re-format the Change Log, Phil, 2020/07/11
- [elpa] master a763ec1 07/14: Rename `delight--inhibit' to `delight-mode-name-inhibit', Phil, 2020/07/11
- [elpa] master da63492 08/14: Rename `delighted-modes' to `delight-delighted-modes', Phil, 2020/07/11
- [elpa] master 088aae0 09/14: Support live updates from earlier versions, Phil, 2020/07/11
- [elpa] master 26dab6b 10/14: Support `unload-feature', Phil, 2020/07/11
- [elpa] master 989eed2 11/14: Add to after-change-major-mode-hook at load time,
Phil <=
- [elpa] master 2a774d1 14/14: Merge commit '5a0cd5ccb650d7bba1c1ea02cf67b71d7cfa6e9a' from delight, Phil, 2020/07/11
- [elpa] master 5a0cd5c 12/14: Documentation, Phil, 2020/07/11
- [elpa] master a1b7e94 13/14: * externals-list: Use https for "delight" subtree URL, Phil, 2020/07/11