APPROVE COMMIT
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1530456931 -3600
# Sun Jul 01 15:55:31 2018 +0100
# Node ID 07a9f8208583f89a291b72310b98cbc2e40f11ca
# Parent 665a83d265d76b1a23285d90efb85191f8766b6f
Don't bother to add menubar entries when noninteractive, lisp/
lisp/ChangeLog addition:
2018-07-01 Aidan Kehoe <kehoea(a)parhasard.net>
* easymenu.el:
* easymenu.el (easy-menu-do-define):
* easymenu.el (easy-menu-change):
* easymenu.el (easy-menu-add):
* easymenu.el (easy-menu-remove):
* easymenu.el (easy-menu-add-item):
* easymenu.el (easy-menu-item-present-p):
* easymenu.el (easy-menu-remove-item):
* lisp-mode.el (emacs-lisp-mode):
* lisp-mode.el (lisp-interaction-mode):
* startup.el (command-line):
If running noninteractively (e.g. byte-compiling Lisp when
building), don't bother to add menubar entries.
diff -r 665a83d265d7 -r 07a9f8208583 lisp/ChangeLog
--- a/lisp/ChangeLog Sun Jul 01 15:44:26 2018 +0100
+++ b/lisp/ChangeLog Sun Jul 01 15:55:31 2018 +0100
@@ -1,3 +1,19 @@
+2018-07-01 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * easymenu.el:
+ * easymenu.el (easy-menu-do-define):
+ * easymenu.el (easy-menu-change):
+ * easymenu.el (easy-menu-add):
+ * easymenu.el (easy-menu-remove):
+ * easymenu.el (easy-menu-add-item):
+ * easymenu.el (easy-menu-item-present-p):
+ * easymenu.el (easy-menu-remove-item):
+ * lisp-mode.el (emacs-lisp-mode):
+ * lisp-mode.el (lisp-interaction-mode):
+ * startup.el (command-line):
+ If running noninteractively (e.g. byte-compiling Lisp when
+ building), don't bother to add menubar entries.
+
2018-07-01 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-extra.el (cl-macroexpand-all):
diff -r 665a83d265d7 -r 07a9f8208583 lisp/easymenu.el
--- a/lisp/easymenu.el Sun Jul 01 15:44:26 2018 +0100
+++ b/lisp/easymenu.el Sun Jul 01 15:55:31 2018 +0100
@@ -151,7 +151,7 @@
(easy-menu-do-define (quote ,symbol) ,maps ,doc ,menu)))
(defun easy-menu-do-define (symbol maps doc menu)
- (when (featurep 'menubar)
+ (when (and (featurep 'menubar) (not noninteractive))
(set symbol menu)
(fset symbol `(lambda (e)
,doc
@@ -161,7 +161,7 @@
(popup-menu ,symbol)))))
(defun easy-menu-change (&rest args)
- (when (featurep 'menubar)
+ (when (and (featurep 'menubar) (not noninteractive))
(apply 'add-menu args)))
(defvar easy-menu-all-popups nil
@@ -190,7 +190,7 @@
; "easy-menu-all-popups is %s")
; menu mode-popup-menu (current-buffer)
; (default-value 'mode-popup-menu) easy-menu-all-popups)
- (when (featurep 'menubar)
+ (when (and (featurep 'menubar) (not noninteractive))
;; Save the existing mode-popup-menu, if it's been changed.
(when (and (eql (length easy-menu-all-popups) 0)
(not (equal (default-value 'mode-popup-menu) mode-popup-menu)))
@@ -220,7 +220,7 @@
(defun easy-menu-remove (menu)
"Remove MENU from the current menu bar."
- (when (featurep 'menubar)
+ (when (and (featurep 'menubar) (not noninteractive))
(setq
;; Remove this menu from the list of popups we know about.
easy-menu-all-popups (delete* menu easy-menu-all-popups)
@@ -260,7 +260,7 @@
ITEM is either defined as in `easy-menu-define', a menu defined earlier
by `easy-menu-define' or `easy-menu-create-menu' or an item returned
from `easy-menu-item-present-p' or `easy-menu-remove-item'."
- (when (featurep 'menubar)
+ (when (and (featurep 'menubar) (not noninteractive))
(add-menu-button path item before (easy-menu-normalize menu))))
(defun easy-menu-item-present-p (menu path name)
@@ -269,7 +269,7 @@
NAME should be a string, the name of the element to be looked for.
The return value can be used as an argument to `easy-menu-add-item'."
- (if (featurep 'menubar)
+ (if (and (featurep 'menubar) (not noninteractive))
(car (find-menu-item (or (easy-menu-normalize menu) current-menubar)
(append path (list name))))
nil))
@@ -280,7 +280,7 @@
NAME should be a string, the name of the element to be removed.
The return value can be used as an argument to `easy-menu-add-item'."
- (when (featurep 'menubar)
+ (when (and (featurep 'menubar) (not noninteractive))
(delete-menu-item (append path (list name))
(easy-menu-normalize menu))))
diff -r 665a83d265d7 -r 07a9f8208583 lisp/lisp-mode.el
--- a/lisp/lisp-mode.el Sun Jul 01 15:44:26 2018 +0100
+++ b/lisp/lisp-mode.el Sun Jul 01 15:55:31 2018 +0100
@@ -317,8 +317,7 @@
(setq major-mode 'emacs-lisp-mode
mode-popup-menu emacs-lisp-mode-popup-menu
mode-name "Emacs-Lisp")
- (if (and (featurep 'menubar)
- current-menubar)
+ (if (and (featurep 'menubar) (not noninteractive) current-menubar)
(progn
;; make a local copy of the menubar, so our modes don't
;; change the global menubar
@@ -397,7 +396,7 @@
(setq mode-name "Lisp Interaction")
(setq mode-popup-menu lisp-interaction-mode-popup-menu)
(if (and (featurep 'menubar)
- current-menubar)
+ current-menubar (not noninteractive))
(progn
;; make a local copy of the menubar, so our modes don't
;; change the global menubar
diff -r 665a83d265d7 -r 07a9f8208583 lisp/startup.el
--- a/lisp/startup.el Sun Jul 01 15:44:26 2018 +0100
+++ b/lisp/startup.el Sun Jul 01 15:55:31 2018 +0100
@@ -746,7 +746,7 @@
;; Actually using hooks within Emacs is bad for future maintenance. --rms.
;;
;; In this case, I completely agree. --ben
- (if (featurep 'menubar)
+ (if (and (not noninteractive) (featurep 'menubar))
(init-menubar-at-startup))
;;
;; We have normality, I repeat, we have normality. Anything you still
--
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after forty pints of stout’
(C. Moore)
Show replies by date