summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2024-08-22 18:29:37 +0200
committerUlrich Müller <ulm@gentoo.org>2024-08-25 16:38:05 +0200
commitb69136433e789e2215b5220f4dfebecb4a3d5104 (patch)
treebb0957e404e6cf93072eed8db964cc624c6792f9
parentMore portable syntax for menus (diff)
downloadebuild-mode-b69136433e789e2215b5220f4dfebecb4a3d5104.tar.gz
ebuild-mode-b69136433e789e2215b5220f4dfebecb4a3d5104.tar.bz2
ebuild-mode-b69136433e789e2215b5220f4dfebecb4a3d5104.zip
Activate ebuild-repo-mode-menu in XEmacs
* ebuild-mode.el (ebuild-repo-mode): Activate the menu in XEmacs. Use positive condition for feature. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--ChangeLog3
-rw-r--r--ebuild-mode.el17
2 files changed, 13 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index f8f2a4e..fcf2379 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2024-08-22 Ulrich Müller <ulm@gentoo.org>
+ * ebuild-mode.el (ebuild-repo-mode): Activate the menu in XEmacs.
+ Use positive condition for feature.
+
* ebuild-mode.el (ebuild-mode-menu): Drop :active keyword because
the three-element vector form of menu items is more portable.
(ebuild-repo-mode-menu): Rename menu bar item to "Ebuild-Repo".
diff --git a/ebuild-mode.el b/ebuild-mode.el
index 302e271..fc781ae 100644
--- a/ebuild-mode.el
+++ b/ebuild-mode.el
@@ -248,8 +248,9 @@ Returns non-nil if A is less than B by Gentoo keyword ordering."
'("cache" "ci" "replay" "scan" "show")
"List of pkgcheck sub-commands.")
-;; suppress byte-compiler warning in XEmacs
+;; suppress byte-compiler warnings in XEmacs
(defvar ebuild-mode-menu)
+(defvar ebuild-repo-mode-menu)
;;; Compatibility code.
@@ -968,12 +969,14 @@ for the format of the tag line.")
(if (ignore-errors (check-coding-system 'utf-8-unix))
;; utf-8-unix doesn't exist in XEmacs 21.4
(setq buffer-file-coding-system 'utf-8-unix))
- (static-if (not (featurep 'xemacs))
- (add-hook 'write-contents-functions
- #'ebuild-repo-mode-before-save t t)
- ;; make-local-hook gives a byte-compiler warning in GNU Emacs
- (make-local-hook 'write-contents-hooks)
- (add-hook 'write-contents-hooks
+ (static-if (featurep 'xemacs)
+ (progn
+ (easy-menu-add ebuild-repo-mode-menu)
+ ;; make-local-hook gives a byte-compiler warning in GNU Emacs
+ (make-local-hook 'write-contents-hooks)
+ (add-hook 'write-contents-hooks
+ #'ebuild-repo-mode-before-save t t))
+ (add-hook 'write-contents-functions
#'ebuild-repo-mode-before-save t t))
(unless (local-variable-p 'fill-column (current-buffer)) ; XEmacs wants 2 args
(setq fill-column 72))