emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/annotate 87a96e186c 08/17: - explained why we need to use


From: ELPA Syncer
Subject: [nongnu] elpa/annotate 87a96e186c 08/17: - explained why we need to use 'after-hook'.
Date: Fri, 25 Feb 2022 14:57:56 -0500 (EST)

branch: elpa/annotate
commit 87a96e186c859d37e960dd229dfd21505670e91e
Author: cage <cage@invalid>
Commit: cage <cage@invalid>

    - explained why we need to use 'after-hook'.
---
 annotate.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/annotate.el b/annotate.el
index 608a4212e2..f8c47993e7 100644
--- a/annotate.el
+++ b/annotate.el
@@ -76,7 +76,10 @@
 See https://github.com/bastibe/annotate.el/ for documentation."
   :lighter " Ann"
   :group 'annotate
-  ;; FIXME: Why `:after-hook'?
+  ;; we use  `:after-hook` to prevent running  initialization code for
+  ;; this mode if  the buffer already has annotate-mode  active and to
+  ;; prevent  loading   the  annotate   in  blacklisted   modes  (see:
+  ;; `annotate-blacklist-major-mode').
   :after-hook (annotate-initialize-maybe))
 
 (defcustom annotate-file (locate-user-emacs-file "annotations" ".annotations")
@@ -314,7 +317,7 @@ annotation as defined in the database."
 
 (defun annotate-initialize-maybe ()
   "Initialize annotate mode only if buffer's major mode is not in the 
blacklist.
-See 'annotate-blacklist-major-mode'."
+See: `annotate-blacklist-major-mode'."
   (let ((annotate-allowed-p (with-current-buffer (current-buffer)
                               (not (apply #'derived-mode-p 
annotate-blacklist-major-mode)))))
     (cond



reply via email to

[Prev in Thread] Current Thread [Next in Thread]