summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2024-10-05 19:41:36 +0200
committerUlrich Müller <ulm@gentoo.org>2024-10-05 19:41:36 +0200
commit25b2258ea947a50f39bd01ef8a309ed6b244c3ff (patch)
tree4f582adfc491aea6d7aa645dddec724751a29811
parentSet font-lock keywords for gentoo-newsitem-mode in the mode hook (diff)
downloadebuild-mode-25b2258ea947a50f39bd01ef8a309ed6b244c3ff.tar.gz
ebuild-mode-25b2258ea947a50f39bd01ef8a309ed6b244c3ff.tar.bz2
ebuild-mode-25b2258ea947a50f39bd01ef8a309ed6b244c3ff.zip
Update the condition for enabling bug-reference
* ebuild-mode.el (ebuild-repo-mode): Don't set the bug-reference-* variables if ebuild-mode-enable-bug-reference is nil. Test for bug-reference-prog-mode at run time instead of compile time. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--ChangeLog6
-rw-r--r--ebuild-mode.el19
2 files changed, 15 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index ef0e8c6..26bd3d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-10-05 Ulrich Müller <ulm@gentoo.org>
+
+ * ebuild-mode.el (ebuild-repo-mode): Don't set the bug-reference-*
+ variables if ebuild-mode-enable-bug-reference is nil. Test for
+ bug-reference-prog-mode at run time instead of compile time.
+
2024-09-30 Ulrich Müller <ulm@gentoo.org>
* gentoo-newsitem-mode.el (gentoo-newsitem-mode): Don't set
diff --git a/ebuild-mode.el b/ebuild-mode.el
index d826b32..768207a 100644
--- a/ebuild-mode.el
+++ b/ebuild-mode.el
@@ -1004,16 +1004,15 @@ See `bug-reference-url-format' for further details.")
(setq fill-column 72))
(unless (local-variable-p 'tab-width (current-buffer))
(setq tab-width 4))
- (static-if (fboundp 'bug-reference-prog-mode)
- (progn
- (unless (local-variable-p 'bug-reference-bug-regexp (current-buffer))
- (set (make-local-variable 'bug-reference-bug-regexp)
- ebuild-mode-bug-regexp))
- (unless (local-variable-p 'bug-reference-url-format (current-buffer))
- (set (make-local-variable 'bug-reference-url-format)
- ebuild-mode-bug-url-format))
- (if ebuild-mode-enable-bug-reference
- (bug-reference-prog-mode 1))))
+ (when (and (fboundp 'bug-reference-prog-mode)
+ ebuild-mode-enable-bug-reference)
+ (unless (local-variable-p 'bug-reference-bug-regexp (current-buffer))
+ (set (make-local-variable 'bug-reference-bug-regexp)
+ ebuild-mode-bug-regexp))
+ (unless (local-variable-p 'bug-reference-url-format (current-buffer))
+ (set (make-local-variable 'bug-reference-url-format)
+ ebuild-mode-bug-url-format))
+ (bug-reference-prog-mode 1))
(cond
((derived-mode-p 'conf-unix-mode)
(unless (local-variable-p 'paragraph-separate (current-buffer))