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."
(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
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'.
`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
;; 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)
'(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)
'(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)
(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)
"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.")
(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.
\\{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))
\f
(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))
(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:
;;;###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)
(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)
(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
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)
(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
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
(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))
(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))
(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))
(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))
(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))
(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))
(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
(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))
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
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
(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 -------------------------------------------------------
(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)
(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
(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))
\f
(defcustom inferior-octave-program "octave"
(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
(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)
(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
"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."
(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) "--")
(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
#'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))
\f
(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))
(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 ""))
;; 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
(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.
(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))
(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))
(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.
;; (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
(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)
(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))
: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)
(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.")
(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)
(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 ()
(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)