From: Stefan Kangas Date: Tue, 24 Nov 2020 16:39:11 +0000 (+0100) Subject: Make XEmacs compat aliases easy-menu-{add,remove} obsolete X-Git-Tag: emacs-28.0.90~5041 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=affe9b225de711429248a73f920dc9f38b15c932;p=emacs.git Make XEmacs compat aliases easy-menu-{add,remove} obsolete * lisp/emacs-lisp/easymenu.el (easy-menu-remove, easy-menu-add): Make XEmacs compat aliases obsolete. * lisp/allout.el (allout-setup-menubar): * lisp/cus-edit.el (Custom-mode): * lisp/gnus/gnus-art.el (gnus-article-edit-mode): * lisp/gnus/message.el (message-mode): * lisp/net/sieve.el (sieve-manage-mode): * lisp/org/org-agenda.el (org-agenda-mode): * lisp/org/org-table.el (org-table-edit-formulas, orgtbl-mode): * lisp/org/org.el: * lisp/progmodes/cperl-mode.el (cperl-mode): * lisp/progmodes/hideshow.el (hs-minor-mode): * lisp/progmodes/idlw-help.el (idlwave-help-mode): * lisp/progmodes/idlw-shell.el (idlwave-shell-mode): * lisp/progmodes/idlwave.el (idlwave-mode): * lisp/progmodes/meta-mode.el (meta-common-mode): * lisp/progmodes/octave.el (octave-mode): * lisp/progmodes/prolog.el (prolog-menu): * lisp/progmodes/tcl.el (tcl-mode): * lisp/speedbar.el (speedbar-reconfigure-keymaps): * lisp/term.el (term-mode, term-char-mode, term-process-pager): * lisp/textmodes/dns-mode.el (dns-mode): * lisp/wid-browse.el (widget-browse-mode): Don't call above obsolete aliases. * lisp/cedet/semantic/grammar.el (semantic-grammar-setup-menu-xemacs): * lisp/mh-e/mh-folder.el (mh-folder-mode): * lisp/mh-e/mh-identity.el (mh-identity-add-menu): * lisp/mh-e/mh-letter.el (mh-letter-mode): * lisp/mh-e/mh-search.el (mh-search-mode): * lisp/mh-e/mh-show.el (mh-show-mode): * lisp/obsolete/otodo-mode.el (todo-mode): * lisp/progmodes/antlr-mode.el (antlr-mode): * lisp/progmodes/cc-mode.el (c-mode, c++-mode, objc-mode) (java-mode, idl-mode, pike-mode): * lisp/progmodes/sql.el (sql-mode, sql-interactive-mode): * lisp/progmodes/vhdl-mode.el (vhdl-update-mode-menu) (vhdl-add-source-files-menu, vhdl-mode): * lisp/textmodes/reftex-index.el (reftex-index-mode) (reftex-index-phrases-mode): * lisp/textmodes/reftex-toc.el (reftex-toc-mode): * lisp/textmodes/reftex.el (reftex-mode): Only call above obsolete aliases in XEmacs. * lisp/progmodes/prolog.el (prolog-inferior-menu): * lisp/erc/erc-menu.el (erc-menu-add, erc-menu-remove): Don't call above obsolete aliases. Make obsolete. * lisp/erc/erc-menu.el (menu, erc-menu-add, erc-menu-remove): * lisp/progmodes/prolog.el (prolog-inferior-mode): Adjust callers. * lisp/speedbar.el (speedbar-previous-menu): Make obsolete. (Bug#44731) --- diff --git a/lisp/allout.el b/lisp/allout.el index a4802a1c2a6..880098c515f 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -1621,8 +1621,7 @@ So `allout-post-command-business' should not reactivate it...") cur) (while menus (setq cur (car menus) - menus (cdr menus)) - (easy-menu-add cur)))) + menus (cdr menus))))) ;;;_ > allout-overlay-preparations (defun allout-overlay-preparations () "Set the properties of the allout invisible-text overlay and others." diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el index f71ac6c413e..b7670ef44b0 100644 --- a/lisp/cedet/semantic/grammar.el +++ b/lisp/cedet/semantic/grammar.el @@ -1258,7 +1258,8 @@ common grammar menu." (unless (boundp ',symbol) (easy-menu-define ,symbol nil "Grammar Menu" (copy-sequence semantic-grammar-menu))) - (easy-menu-add ,symbol) + (when (featurep 'xemacs) + (easy-menu-add ,symbol)) (let ((,items (cdr ,mode-menu)) (,path (list (car ,symbol)))) (when ,items diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index eceba8fa4d6..cb68bae3c9b 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -5126,7 +5126,6 @@ Erase customizations; set options Entry to this mode calls the value of `Custom-mode-hook' if that value is non-nil." (use-local-map custom-mode-map) - (easy-menu-add Custom-mode-menu) (setq-local tool-bar-map (or custom-tool-bar-map ;; Set up `custom-tool-bar-map'. diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index b0198dbf8d5..7a24af7963f 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el @@ -488,17 +488,14 @@ To implement dynamic menus, either call this from `menu-bar-update-hook' or use a menu filter." (easy-menu-add-item map path (easy-menu-create-menu name items) before)) -;; XEmacs needs the following two functions to add and remove menus. -;; In Emacs this is done automatically when switching keymaps, so -;; here easy-menu-remove and easy-menu-add are a noops. -(defalias 'easy-menu-remove 'ignore +(define-obsolete-function-alias 'easy-menu-remove #'ignore "28.1" "Remove MENU from the current menu bar. Contrary to XEmacs, this is a nop on Emacs since menus are automatically \(de)activated when the corresponding keymap is (de)activated. \(fn MENU)") -(defalias 'easy-menu-add #'ignore +(define-obsolete-function-alias 'easy-menu-add #'ignore "28.1" "Add the menu to the menubar. On Emacs this is a nop, because menus are already automatically activated when the corresponding keymap is activated. On XEmacs diff --git a/lisp/erc/erc-menu.el b/lisp/erc/erc-menu.el index 9c02899057b..b36a1cb8fa9 100644 --- a/lisp/erc/erc-menu.el +++ b/lisp/erc/erc-menu.el @@ -114,22 +114,19 @@ ERC menu yet.") ;; make sure the menu only gets defined once, since Emacs 22 ;; activates it immediately (easy-menu-define erc-menu erc-mode-map "ERC menu" erc-menu-definition) - (setq erc-menu-defined t)) - (erc-menu-add)) - ((erc-menu-remove) - ;; `easy-menu-remove' is a no-op in Emacs 22 + (setq erc-menu-defined t))) + (;; `easy-menu-remove' is a no-op in Emacs 22 (message "You might have to restart Emacs to remove the ERC menu"))) -;; silence byte-compiler warning -(defvar erc-menu) - (defun erc-menu-add () "Add the ERC menu to the current buffer." - (easy-menu-add erc-menu erc-mode-map)) + (declare (obsolete nil "28.1")) + nil) (defun erc-menu-remove () "Remove the ERC menu from the current buffer." - (easy-menu-remove erc-menu)) + (declare (obsolete nil "28.1")) + nil) (provide 'erc-menu) diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 8f4ca7eb3b9..7f594c9c360 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -7251,7 +7251,6 @@ This is an extended text-mode. '(message-font-lock-keywords t)) (set (make-local-variable 'mail-header-separator) "") (set (make-local-variable 'gnus-article-edit-mode) t) - (easy-menu-add message-mode-field-menu message-mode-map) (mml-mode) (setq buffer-read-only nil) (buffer-enable-undo) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 5bdf53763a2..288ccc494c9 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -3109,8 +3109,6 @@ Like `text-mode', but with these additional commands: '(message-font-lock-keywords t)) (if (boundp 'tool-bar-map) (set (make-local-variable 'tool-bar-map) (message-make-tool-bar))) - (easy-menu-add message-mode-menu message-mode-map) - (easy-menu-add message-mode-field-menu message-mode-map) ;; Mmmm... Forbidden properties... (add-hook 'after-change-functions #'message-strip-forbidden-properties nil 'local) diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el index 0a73ff45c2a..0fb5ebf1f78 100644 --- a/lisp/mh-e/mh-folder.el +++ b/lisp/mh-e/mh-folder.el @@ -656,9 +656,10 @@ perform the operation on all messages in that region. (mh-funcall-if-exists hl-line-mode 1) (setq revert-buffer-function 'mh-undo-folder) (add-to-list 'minor-mode-alist '(mh-showing-mode " Show")) - (easy-menu-add mh-folder-sequence-menu) - (easy-menu-add mh-folder-message-menu) - (easy-menu-add mh-folder-folder-menu) + (mh-do-in-xemacs + (easy-menu-add mh-folder-sequence-menu) + (easy-menu-add mh-folder-message-menu) + (easy-menu-add mh-folder-folder-menu)) (mh-inc-spool-make) (mh-set-help mh-folder-mode-help-messages) (if (and (featurep 'xemacs) diff --git a/lisp/mh-e/mh-identity.el b/lisp/mh-e/mh-identity.el index ed239963391..23fa87de825 100644 --- a/lisp/mh-e/mh-identity.el +++ b/lisp/mh-e/mh-identity.el @@ -91,7 +91,7 @@ See `mh-identity-add-menu'." "Add the current Identity menu. See `mh-identity-make-menu'." (if mh-identity-menu - (easy-menu-add mh-identity-menu))) + (mh-do-in-xemacs (easy-menu-add mh-identity-menu)))) (defvar mh-identity-local nil "Buffer-local variable that holds the identity currently in use.") diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el index 5e1ce403188..b8aca77ddc8 100644 --- a/lisp/mh-e/mh-letter.el +++ b/lisp/mh-e/mh-letter.el @@ -330,7 +330,7 @@ order). (t ;; ...or the header only (setq font-lock-defaults '((mh-show-font-lock-keywords) t)))) - (easy-menu-add mh-letter-menu) + (mh-do-in-xemacs (easy-menu-add mh-letter-menu)) ;; Maybe we want to use the existing Mail menu from mail-mode in ;; 9.0; in the mean time, let's remove it since the redundancy will ;; only produce confusion. diff --git a/lisp/mh-e/mh-search.el b/lisp/mh-e/mh-search.el index 6fb76beff27..5cfe67865ee 100644 --- a/lisp/mh-e/mh-search.el +++ b/lisp/mh-e/mh-search.el @@ -618,7 +618,7 @@ The hook `mh-search-mode-hook' is called upon entry to this mode. \\{mh-search-mode-map}" - (easy-menu-add mh-pick-menu) + (mh-do-in-xemacs (easy-menu-add mh-pick-menu)) (mh-set-help mh-search-mode-help-messages)) diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el index 7536f949e76..48ff74131d7 100644 --- a/lisp/mh-e/mh-show.el +++ b/lisp/mh-e/mh-show.el @@ -863,9 +863,10 @@ See also `mh-folder-mode'. (when mh-decode-mime-flag (mh-make-local-hook 'kill-buffer-hook) (add-hook 'kill-buffer-hook 'mh-mime-cleanup nil t)) - (easy-menu-add mh-show-sequence-menu) - (easy-menu-add mh-show-message-menu) - (easy-menu-add mh-show-folder-menu) + (mh-do-in-xemacs + (easy-menu-add mh-show-sequence-menu) + (easy-menu-add mh-show-message-menu) + (easy-menu-add mh-show-folder-menu)) (make-local-variable 'mh-show-folder-buffer) (buffer-disable-undo) (use-local-map mh-show-mode-map)) diff --git a/lisp/net/sieve.el b/lisp/net/sieve.el index 08367c698f2..75bb4e242e2 100644 --- a/lisp/net/sieve.el +++ b/lisp/net/sieve.el @@ -143,8 +143,7 @@ require \"fileinto\"; (define-derived-mode sieve-manage-mode special-mode "Sieve-manage" "Mode used for sieve script management." (buffer-disable-undo (current-buffer)) - (setq truncate-lines t) - (easy-menu-add sieve-manage-mode-menu sieve-manage-mode-map)) + (setq truncate-lines t)) ;; Commands used in sieve-manage mode: diff --git a/lisp/obsolete/otodo-mode.el b/lisp/obsolete/otodo-mode.el index 2a4af290b6b..6aada0755ef 100644 --- a/lisp/obsolete/otodo-mode.el +++ b/lisp/obsolete/otodo-mode.el @@ -923,7 +923,8 @@ If INCLUDE-SEP is non-nil, return point after the separator." ;;;###autoload (define-derived-mode todo-mode nil "TODO" "Major mode for editing TODO lists." - (easy-menu-add todo-menu)) + (when (featurep 'xemacs) + (easy-menu-add todo-menu))) (with-suppressed-warnings ((lexical date entry)) (defvar date) diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index 689d134627e..82bf1b23f9d 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el @@ -2236,7 +2236,6 @@ The following commands are available: (setq mode-name "Org-Agenda") (setq indent-tabs-mode nil) (use-local-map org-agenda-mode-map) - (easy-menu-add org-agenda-menu) (when org-startup-truncated (setq truncate-lines t)) (setq-local line-move-visual nil) (add-hook 'post-command-hook 'org-agenda-update-agenda-type nil 'local) diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index 5c37cb1af52..4636baae73d 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el @@ -3287,7 +3287,6 @@ Parameters get priority." (setq-local org-selected-window sel-win) (use-local-map org-table-fedit-map) (add-hook 'post-command-hook #'org-table-fedit-post-command t t) - (easy-menu-add org-table-fedit-menu) (setq startline (org-current-line)) (dolist (entry eql) (let* ((type (cond @@ -5129,15 +5128,13 @@ When LOCAL is non-nil, show references for the table at point." orgtbl-line-start-regexp)) (when (fboundp 'font-lock-add-keywords) (font-lock-add-keywords nil orgtbl-extra-font-lock-keywords) - (org-restart-font-lock)) - (easy-menu-add orgtbl-mode-menu)) + (org-restart-font-lock))) (t (setq auto-fill-inhibit-regexp org-old-auto-fill-inhibit-regexp) (remove-hook 'before-change-functions 'org-before-change-function t) (when (fboundp 'font-lock-remove-keywords) (font-lock-remove-keywords nil orgtbl-extra-font-lock-keywords) (org-restart-font-lock)) - (easy-menu-remove orgtbl-mode-menu) (force-mode-line-update 'all)))) (defun orgtbl-make-binding (fun n &rest keys) diff --git a/lisp/org/org.el b/lisp/org/org.el index d2a36dd0bad..de7dded158a 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -4791,7 +4791,6 @@ This is for getting out of special buffers like capture.") (require 'time-date) (unless (fboundp 'time-subtract) (defalias 'time-subtract 'subtract-time)) (require 'easymenu) -(autoload 'easy-menu-add "easymenu") (require 'overlay) ;; (require 'org-macs) moved higher up in the file before it is first used diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index 9dacd5856cf..dc727aa3759 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el @@ -2592,7 +2592,8 @@ the default language." comment-start-skip "/\\*+ *\\|// *") ;; various ----------------------------------------------------------------- (set (make-local-variable 'font-lock-defaults) antlr-font-lock-defaults) - (easy-menu-add antlr-mode-menu) + (when (featurep 'xemacs) + (easy-menu-add antlr-mode-menu)) (set (make-local-variable 'imenu-create-index-function) 'antlr-imenu-create-index-function) (set (make-local-variable 'imenu-generic-expression) t) ; fool stupid test diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index c5201d1af54..5e8cf6161ef 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -2597,7 +2597,8 @@ Key bindings: (setq abbrev-mode t) (c-init-language-vars-for 'c-mode) (c-common-init 'c-mode) - (easy-menu-add c-c-menu) + (when (featurep 'xemacs) + (easy-menu-add c-c-menu)) (cc-imenu-init cc-imenu-c-generic-expression) (add-hook 'flymake-diagnostic-functions 'flymake-cc nil t) (c-run-mode-hooks 'c-mode-common-hook)) @@ -2688,7 +2689,8 @@ Key bindings: (setq abbrev-mode t) (c-init-language-vars-for 'c++-mode) (c-common-init 'c++-mode) - (easy-menu-add c-c++-menu) + (when (featurep 'xemacs) + (easy-menu-add c-c++-menu)) (cc-imenu-init cc-imenu-c++-generic-expression) (add-hook 'flymake-diagnostic-functions 'flymake-cc nil t) (c-run-mode-hooks 'c-mode-common-hook)) @@ -2735,7 +2737,8 @@ Key bindings: (setq abbrev-mode t) (c-init-language-vars-for 'objc-mode) (c-common-init 'objc-mode) - (easy-menu-add c-objc-menu) + (when (featurep 'xemacs) + (easy-menu-add c-objc-menu)) (cc-imenu-init nil 'cc-imenu-objc-function) (c-run-mode-hooks 'c-mode-common-hook)) @@ -2785,7 +2788,8 @@ Key bindings: (setq abbrev-mode t) (c-init-language-vars-for 'java-mode) (c-common-init 'java-mode) - (easy-menu-add c-java-menu) + (when (featurep 'xemacs) + (easy-menu-add c-java-menu)) (cc-imenu-init cc-imenu-java-generic-expression) (c-run-mode-hooks 'c-mode-common-hook)) @@ -2827,7 +2831,8 @@ Key bindings: (c-initialize-cc-mode t) (c-init-language-vars-for 'idl-mode) (c-common-init 'idl-mode) - (easy-menu-add c-idl-menu) + (when (featurep 'xemacs) + (easy-menu-add c-idl-menu)) ;;(cc-imenu-init cc-imenu-idl-generic-expression) ;TODO (c-run-mode-hooks 'c-mode-common-hook)) @@ -2872,7 +2877,8 @@ Key bindings: (setq abbrev-mode t) (c-init-language-vars-for 'pike-mode) (c-common-init 'pike-mode) - (easy-menu-add c-pike-menu) + (when (featurep 'xemacs) + (easy-menu-add c-pike-menu)) ;;(cc-imenu-init cc-imenu-pike-generic-expression) ;TODO (c-run-mode-hooks 'c-mode-common-hook)) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 30a80ea8f22..7a24bfcbeba 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -1718,8 +1718,6 @@ or as help on variables `cperl-tips', `cperl-problems', (and (boundp 'msb-menu-cond) (not cperl-msb-fixed) (cperl-msb-fix)) - (if (fboundp 'easy-menu-add) - (easy-menu-add cperl-menu)) ; A NOP in Emacs. (if cperl-hook-after-change (add-hook 'after-change-functions #'cperl-after-change-function nil t)) ;; After hooks since fontification will break this diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index 2ad66ccc5e0..4dee72c737d 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -948,7 +948,6 @@ Key bindings: (add-hook 'change-major-mode-hook #'turn-off-hideshow nil t) - (easy-menu-add hs-minor-mode-menu) (set (make-local-variable 'line-move-ignore-invisible) t) (add-to-invisibility-spec '(hs . t))) (remove-from-invisibility-spec '(hs . t)) diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el index 89296ff5b50..68809ce1fc0 100644 --- a/lisp/progmodes/idlw-help.el +++ b/lisp/progmodes/idlw-help.el @@ -306,7 +306,6 @@ Jump: [h] to function doclib header Here are all keybindings. \\{idlwave-help-mode-map}" (buffer-disable-undo) - (easy-menu-add idlwave-help-menu idlwave-help-mode-map) (setq truncate-lines t) (setq case-fold-search t) (setq mode-line-format diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index 70b94596e10..31f18457e77 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el @@ -954,7 +954,6 @@ IDL has currently stepped.") nil 'local) (add-hook 'kill-buffer-hook 'idlwave-shell-delete-temp-files nil 'local) (add-hook 'kill-emacs-hook 'idlwave-shell-delete-temp-files) - (easy-menu-add idlwave-shell-mode-menu idlwave-shell-mode-map) ;; Set the optional comint variables (when idlwave-shell-comint-settings @@ -4334,13 +4333,6 @@ Shell debugging commands are available as single key sequences." (easy-menu-define idlwave-shell-mode-menu idlwave-shell-mode-map "IDL shell menus" idlwave-shell-menu-def) -(save-current-buffer - (dolist (buf (buffer-list)) - (set-buffer buf) - (if (derived-mode-p 'idlwave-mode) - (progn - (easy-menu-remove idlwave-mode-debug-menu) - (easy-menu-add idlwave-mode-debug-menu))))) ;; The Breakpoint Glyph ------------------------------------------------------- diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 876c38da7e7..9107086b72e 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -1873,10 +1873,6 @@ The main features of this mode are (set (make-local-variable 'indent-tabs-mode) nil) (set (make-local-variable 'completion-ignore-case) t) - (when (featurep 'easymenu) - (easy-menu-add idlwave-mode-menu idlwave-mode-map) - (easy-menu-add idlwave-mode-debug-menu idlwave-mode-map)) - (setq abbrev-mode t) (set (make-local-variable idlwave-fill-function) 'idlwave-auto-fill) diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el index 4a5d872b790..87c20a2ee0e 100644 --- a/lisp/progmodes/meta-mode.el +++ b/lisp/progmodes/meta-mode.el @@ -946,10 +946,7 @@ The environment marked is the one that contains point or follows point." (set (make-local-variable 'font-lock-defaults) '(meta-font-lock-keywords nil nil ((?_ . "w")) nil - (font-lock-comment-start-regexp . "%"))) - - ;; Activate syntax table, keymap and menu. - (easy-menu-add meta-mode-menu)) + (font-lock-comment-start-regexp . "%")))) ;;;###autoload diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 55a78c6cc85..c313ad11792 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -619,9 +619,7 @@ Key bindings: (add-hook 'before-save-hook 'octave-sync-function-file-names nil t) (setq-local beginning-of-defun-function 'octave-beginning-of-defun) (and octave-font-lock-texinfo-comment (octave-font-lock-texinfo-comment)) - (add-hook 'eldoc-documentation-functions 'octave-eldoc-function nil t) - - (easy-menu-add octave-mode-menu)) + (add-hook 'eldoc-documentation-functions 'octave-eldoc-function nil t)) (defcustom inferior-octave-program "octave" diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index 75e95d9b904..a4e677ba41d 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -1292,8 +1292,7 @@ To find out what version of Prolog mode you are running, enter (setq-local shell-dirstack-query "pwd.") (setq-local compilation-error-regexp-alist prolog-inferior-error-regexp-alist) - (compilation-shell-minor-mode) - (prolog-inferior-menu)) + (compilation-shell-minor-mode)) (defun prolog-input-filter (str) (cond ((string-match "\\`\\s *\\'" str) nil) ;whitespace @@ -3378,9 +3377,6 @@ PREFIX is the prefix of the search regexp." (defun prolog-menu () "Add the menus for the Prolog editing buffers." - (easy-menu-add prolog-edit-menu-insert-move) - (easy-menu-add prolog-edit-menu-runtime) - ;; Add predicate index menu (setq-local imenu-create-index-function 'imenu-default-create-index-function) @@ -3391,9 +3387,7 @@ PREFIX is the prefix of the search regexp." (if (and prolog-imenu-flag (< (count-lines (point-min) (point-max)) prolog-imenu-max-lines)) - (imenu-add-to-menubar "Predicates")) - - (easy-menu-add prolog-menu-help)) + (imenu-add-to-menubar "Predicates"))) (easy-menu-define prolog-inferior-menu-all prolog-inferior-mode-map @@ -3436,8 +3430,8 @@ PREFIX is the prefix of the search regexp." "Create the menus for the Prolog inferior buffer. This menu is dynamically created because one may change systems during the life of an Emacs session." - (easy-menu-add prolog-inferior-menu-all) - (easy-menu-add prolog-menu-help)) + (declare (obsolete nil "28.1")) + nil) (defun prolog-mode-version () "Echo the current version of Prolog mode in the minibuffer." diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 6b0df2d700d..22099394ff0 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -4186,8 +4186,9 @@ must tell Emacs. Here's how to do that in your init file: (modify-syntax-entry ?\\\\ \"\\\\\" sql-mode-syntax-table)))" :abbrev-table sql-mode-abbrev-table - (if sql-mode-menu - (easy-menu-add sql-mode-menu)); XEmacs + (when (and (featurep 'xemacs) + sql-mode-menu) + (easy-menu-add sql-mode-menu)) ;; (smie-setup sql-smie-grammar #'sql-smie-rules) (set (make-local-variable 'comment-start) "--") @@ -4312,8 +4313,9 @@ you entered, right above the output it created. (setq mode-name (concat "SQLi[" (or (sql-get-product-feature sql-product :name) (symbol-name sql-product)) "]")) - (if sql-interactive-mode-menu - (easy-menu-add sql-interactive-mode-menu)) ; XEmacs + (when (and (featurep 'xemacs) + sql-interactive-mode-menu) + (easy-menu-add sql-interactive-mode-menu)) ;; Note that making KEYWORDS-ONLY nil will cause havoc if you try ;; SELECT 'x' FROM DUAL with SQL*Plus, because the title of the column diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index f0dd9afa4c0..ff3fb9657d6 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el @@ -654,9 +654,7 @@ already exist." #'tcl-add-log-defun) (setq-local beginning-of-defun-function #'tcl-beginning-of-defun-function) - (setq-local end-of-defun-function #'tcl-end-of-defun-function) - - (easy-menu-add tcl-mode-menu)) + (setq-local end-of-defun-function #'tcl-end-of-defun-function)) diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index f288facba50..489092f58e6 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -4205,9 +4205,11 @@ STRING are replaced by `-' and substrings are converted to lower case." (defun vhdl-update-mode-menu () "Update VHDL Mode menu." (interactive) - (easy-menu-remove vhdl-mode-menu-list) ; for XEmacs + (when (featurep 'xemacs) + (easy-menu-remove vhdl-mode-menu-list)) (setq vhdl-mode-menu-list (vhdl-create-mode-menu)) - (easy-menu-add vhdl-mode-menu-list) ; for XEmacs + (when (featurep 'xemacs) + (easy-menu-add vhdl-mode-menu-list)) (easy-menu-define vhdl-mode-menu vhdl-mode-map "Menu keymap for VHDL Mode." vhdl-mode-menu-list)) @@ -4313,7 +4315,8 @@ The directory of the current source file is scanned." (push ["*Rescan*" vhdl-add-source-files-menu t] menu-list) (push "Sources" menu-list) ;; Create menu - (easy-menu-add menu-list) + (when (featurep 'xemacs) + (easy-menu-add menu-list)) (easy-menu-define vhdl-sources-menu newmap "VHDL source files menu" menu-list)) (message "")) @@ -4926,7 +4929,8 @@ Key bindings: ;; add source file menu (if vhdl-source-file-menu (vhdl-add-source-files-menu)) ;; add VHDL menu - (easy-menu-add vhdl-mode-menu-list) ; for XEmacs + (when (featurep 'xemacs) + (easy-menu-add vhdl-mode-menu-list)) (easy-menu-define vhdl-mode-menu vhdl-mode-map "Menu keymap for VHDL Mode." vhdl-mode-menu-list) ;; initialize hideshow and add menu diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 3619b23d9e6..34687805b57 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -1144,6 +1144,7 @@ frame and window to be the currently active frame and window." (defvar speedbar-previous-menu nil "The menu before the last `speedbar-reconfigure-keymaps' was called.") +(make-obsolete-variable 'speedbar-previous-menu "no longer used." "28.1") (defun speedbar-reconfigure-keymaps () "Reconfigure the menu-bar in a speedbar frame. @@ -1195,10 +1196,7 @@ and the existence of packages." (speedbar-initial-keymap) ;; This creates a small keymap we can glom the ;; menu adjustments into. - (speedbar-make-specialized-keymap))) - ;; Delete the old menu if applicable. - (if speedbar-previous-menu (easy-menu-remove speedbar-previous-menu)) - (setq speedbar-previous-menu md) + (speedbar-make-specialized-keymap))) ;; Now add the new menu (easy-menu-define speedbar-menu-map (current-local-map) "Speedbar menu" md)) diff --git a/lisp/term.el b/lisp/term.el index 585232be6c3..ca64d28d9b3 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -1107,8 +1107,6 @@ Entry to this mode runs the hooks on `term-mode-hook'." (term--reset-scroll-region) - (easy-menu-add term-terminal-menu) - (easy-menu-add term-signals-menu) (or term-input-ring (setq term-input-ring (make-ring term-input-ring-size))) (term-update-mode-line)) @@ -1293,8 +1291,6 @@ intervention from Emacs, except for the escape character (usually C-c)." (when (term-in-line-mode) (setq term-old-mode-map (current-local-map)) (use-local-map term-raw-map) - (easy-menu-add term-terminal-menu) - (easy-menu-add term-signals-menu) ;; Don't allow changes to the buffer or to point which are not ;; caused by the process filter. @@ -3550,9 +3546,6 @@ The top-most line is line 0." ;; (stop-process process)) (setq term-pager-old-local-map (current-local-map)) (use-local-map term-pager-break-map) - (easy-menu-add term-terminal-menu) - (easy-menu-add term-signals-menu) - (easy-menu-add term-pager-menu) (make-local-variable 'term-old-mode-line-format) (setq term-old-mode-line-format mode-line-format) (setq mode-line-format diff --git a/lisp/textmodes/dns-mode.el b/lisp/textmodes/dns-mode.el index 6dfea8f1887..712955e84de 100644 --- a/lisp/textmodes/dns-mode.el +++ b/lisp/textmodes/dns-mode.el @@ -184,8 +184,7 @@ Turning on DNS mode runs `dns-mode-hook'." (set (make-local-variable 'font-lock-defaults) '(dns-mode-font-lock-keywords nil nil ((?_ . "w")))) (add-hook 'before-save-hook 'dns-mode-soa-maybe-increment-serial - nil t) - (easy-menu-add dns-mode-menu dns-mode-map)) + nil t)) ;;;###autoload (defalias 'zone-mode 'dns-mode) diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el index a1e30269d29..bebda483679 100644 --- a/lisp/textmodes/reftex-index.el +++ b/lisp/textmodes/reftex-index.el @@ -408,7 +408,8 @@ Here are all local bindings. (make-local-hook 'post-command-hook) (make-local-hook 'pre-command-hook)) (make-local-variable 'reftex-last-follow-point) - (easy-menu-add reftex-index-menu reftex-index-mode-map) + (when (featurep 'xemacs) + (easy-menu-add reftex-index-menu reftex-index-mode-map)) (add-hook 'post-command-hook 'reftex-index-post-command-hook nil t) (add-hook 'pre-command-hook 'reftex-index-pre-command-hook nil t)) @@ -1386,7 +1387,8 @@ Here are all local bindings. :syntax-table reftex-index-phrases-syntax-table (set (make-local-variable 'font-lock-defaults) reftex-index-phrases-font-lock-defaults) - (easy-menu-add reftex-index-phrases-menu reftex-index-phrases-mode-map) + (when (featurep 'xemacs) + (easy-menu-add reftex-index-phrases-menu reftex-index-phrases-mode-map)) (set (make-local-variable 'reftex-index-phrases-marker) (make-marker))) ;; (add-hook 'reftex-index-phrases-mode-hook 'turn-on-font-lock) diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el index 02e7e3a8f12..eb6ed2ff441 100644 --- a/lisp/textmodes/reftex-toc.el +++ b/lisp/textmodes/reftex-toc.el @@ -153,7 +153,8 @@ Here are all local bindings. (make-local-variable 'reftex-last-follow-point) (add-hook 'post-command-hook 'reftex-toc-post-command-hook nil t) (add-hook 'pre-command-hook 'reftex-toc-pre-command-hook nil t) - (easy-menu-add reftex-toc-menu reftex-toc-mode-map)) + (when (featurep 'xemacs) + (easy-menu-add reftex-toc-menu reftex-toc-mode-map))) (defvar reftex-last-toc-file nil "Stores the file name from which `reftex-toc' was called. For redo command.") diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index 4071c0dd074..29ebab5f9bb 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el @@ -207,7 +207,8 @@ on the menu bar. (if reftex-mode (progn ;; Mode was turned on - (easy-menu-add reftex-mode-menu) + (when (featurep 'xemacs) + (easy-menu-add reftex-mode-menu)) (and reftex-plug-into-AUCTeX (reftex-plug-into-AUCTeX)) (unless (get 'reftex-auto-view-crossref 'initialized) @@ -224,7 +225,8 @@ on the menu bar. (run-hooks 'reftex-mode-hook)) ;; Mode was turned off - (easy-menu-remove reftex-mode-menu))) + (when (featurep 'xemacs) + (easy-menu-remove reftex-mode-menu)))) (defvar reftex-docstruct-symbol) (defun reftex-kill-buffer-hook () diff --git a/lisp/wid-browse.el b/lisp/wid-browse.el index 53f918cff9c..f5c3d486f4d 100644 --- a/lisp/wid-browse.el +++ b/lisp/wid-browse.el @@ -77,8 +77,6 @@ if that value is non-nil." (setq major-mode 'widget-browse-mode mode-name "Widget") (use-local-map widget-browse-mode-map) - (easy-menu-add widget-browse-mode-customize-menu) - (easy-menu-add widget-browse-mode-menu) (run-mode-hooks 'widget-browse-mode-hook)) (put 'widget-browse-mode 'mode-class 'special)