aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2023-10-06 09:36:28 +0200
committerUlrich Müller <ulm@gentoo.org>2023-10-06 09:36:28 +0200
commit2f9084ac529bcd514a3546a9d7f9a376f1c4a5d5 (patch)
tree484eede868245949f49079c1253d058cf4d141cd
parentUpdate version to 1.4.27 (diff)
downloadeselect-2f9084ac529bcd514a3546a9d7f9a376f1c4a5d5.tar.gz
eselect-2f9084ac529bcd514a3546a9d7f9a376f1c4a5d5.tar.bz2
eselect-2f9084ac529bcd514a3546a9d7f9a376f1c4a5d5.zip
eselect-mode: Use named function in hook variable
* misc/eselect-mode.el (eselect-mode-add-font-lock): New function. (eselect-mode-hook): Add it, instead of an anonymous function. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--ChangeLog5
-rw-r--r--misc/eselect-mode.el7
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 65307ec..13bbc97 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-10-06 Ulrich Müller <ulm@gentoo.org>
+
+ * misc/eselect-mode.el (eselect-mode-add-font-lock): New function.
+ (eselect-mode-hook): Add it, instead of an anonymous function.
+
2023-09-13 Ulrich Müller <ulm@gentoo.org>
* configure.ac: Update version to 1.4.27.
diff --git a/misc/eselect-mode.el b/misc/eselect-mode.el
index e59c90c..06843df 100644
--- a/misc/eselect-mode.el
+++ b/misc/eselect-mode.el
@@ -148,10 +148,11 @@
(setq tab-width 4)
(setq indent-tabs-mode t))
-(add-hook 'eselect-mode-hook
- (lambda () (font-lock-add-keywords
- nil eselect-mode-font-lock-keywords)))
+(defun eselect-mode-add-font-lock ()
+ "Add `eselect-mode' font-lock keywords for the current buffer."
+ (font-lock-add-keywords nil eselect-mode-font-lock-keywords))
+(add-hook 'eselect-mode-hook 'eselect-mode-add-font-lock)
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.eselect\\'" . eselect-mode))