Commit 1ec4b7b2 authored by Stefan Monnier's avatar Stefan Monnier

Get rid of all the manual purecopy calls in menu-bar definitions.

* lisp/loadup.el (purify-flag): Pre-grow the hash-table to reduce the
memory use.
* lisp/bindings.el (bindings--define-key): New function.
* lisp/vc/vc-hooks.el, lisp/replace.el, lisp/menu-bar.el:
* lisp/international/mule-cmds.el, lisp/emacs-lisp/lisp-mode.el:
* lisp/buff-menu.el, lisp/bookmark.el:
* bindings.el: Use it to purecopy define-key bindings.
* src/fns.c (maybe_resize_hash_table): Output message when growing the
purify-hashtable.
parent e309e2a5
2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
* loadup.el (purify-flag): Pre-grow the hash-table to reduce the
memory use.
* bindings.el (bindings--define-key): New function.
* vc/vc-hooks.el, replace.el, menu-bar.el, international/mule-cmds.el:
* emacs-lisp/lisp-mode.el, buff-menu.el, bookmark.el:
* bindings.el: Use it to purecopy define-key bindings.
* textmodes/rst.el (rst-adornment-faces-alist): Avoid copy-list.
* emacs-lisp/cl.el (flet): Mark obsolete.
......
......@@ -273,14 +273,34 @@ Normally nil in most modes, since there is no process to display.")
(put 'mode-line-process 'risky-local-variable t)
(make-variable-buffer-local 'mode-line-process)
(defun bindings--define-key (map key item)
"Make as much as possible of the menus pure."
(declare (indent 2))
(define-key map key
(cond
((not (consp item)) item) ;Not sure that could be other than a symbol.
;; Keymaps can't be made pure otherwise users can't remove/add elements
;; from/to them any more.
((keymapp item) item)
((stringp (car item))
(if (keymapp (cdr item))
(cons (purecopy (car item)) (cdr item))
(purecopy item)))
((eq 'menu-item (car item))
(if (keymapp (nth 2 item))
`(menu-item ,(purecopy (nth 1 item)) ,(nth 2 item)
,@(purecopy (nthcdr 3 item)))
(purecopy item)))
(t (message "non-menu-item: %S" item) item))))
(defvar mode-line-mode-menu (make-sparse-keymap "Minor Modes") "\
Menu of mode operations in the mode line.")
(defvar mode-line-major-mode-keymap
(let ((map (make-sparse-keymap)))
(define-key map [mode-line down-mouse-1]
`(menu-item ,(purecopy "Menu Bar") ignore
:filter (lambda (_) (mouse-menu-major-mode-map))))
(bindings--define-key map [mode-line down-mouse-1]
`(menu-item "Menu Bar" ignore
:filter ,(lambda (_) (mouse-menu-major-mode-map))))
(define-key map [mode-line mouse-2] 'describe-mode)
(define-key map [mode-line down-mouse-3] mode-line-mode-menu)
map) "\
......@@ -327,13 +347,13 @@ mouse-3: Toggle minor modes"
(defvar mode-line-column-line-number-mode-map
(let ((map (make-sparse-keymap))
(menu-map (make-sparse-keymap "Toggle Line and Column Number Display")))
(define-key menu-map [line-number-mode]
`(menu-item ,(purecopy "Display Line Numbers") line-number-mode
:help ,(purecopy "Toggle displaying line numbers in the mode-line")
(bindings--define-key menu-map [line-number-mode]
'(menu-item "Display Line Numbers" line-number-mode
:help "Toggle displaying line numbers in the mode-line"
:button (:toggle . line-number-mode)))
(define-key menu-map [column-number-mode]
`(menu-item ,(purecopy "Display Column Numbers") column-number-mode
:help ,(purecopy "Toggle displaying column numbers in the mode-line")
(bindings--define-key menu-map [column-number-mode]
'(menu-item "Display Column Numbers" column-number-mode
:help "Toggle displaying column numbers in the mode-line"
:button (:toggle . column-number-mode)))
(define-key map [mode-line down-mouse-1] menu-map)
map) "\
......@@ -491,51 +511,51 @@ Switch to the most recently selected buffer other than the current one."
;; Use mode-line-mode-menu for local minor-modes only.
;; Global ones can go on the menubar (Options --> Show/Hide).
(define-key mode-line-mode-menu [overwrite-mode]
`(menu-item ,(purecopy "Overwrite (Ovwrt)") overwrite-mode
:help ,(purecopy "Overwrite mode: typed characters replace existing text")
(bindings--define-key mode-line-mode-menu [overwrite-mode]
'(menu-item "Overwrite (Ovwrt)" overwrite-mode
:help "Overwrite mode: typed characters replace existing text"
:button (:toggle . overwrite-mode)))
(define-key mode-line-mode-menu [outline-minor-mode]
`(menu-item ,(purecopy "Outline (Outl)") outline-minor-mode
(bindings--define-key mode-line-mode-menu [outline-minor-mode]
'(menu-item "Outline (Outl)" outline-minor-mode
;; XXX: This needs a good, brief description.
:help ,(purecopy "")
:help ""
:button (:toggle . (bound-and-true-p outline-minor-mode))))
(define-key mode-line-mode-menu [highlight-changes-mode]
`(menu-item ,(purecopy "Highlight changes (Chg)") highlight-changes-mode
:help ,(purecopy "Show changes in the buffer in a distinctive color")
(bindings--define-key mode-line-mode-menu [highlight-changes-mode]
'(menu-item "Highlight changes (Chg)" highlight-changes-mode
:help "Show changes in the buffer in a distinctive color"
:button (:toggle . (bound-and-true-p highlight-changes-mode))))
(define-key mode-line-mode-menu [hide-ifdef-mode]
`(menu-item ,(purecopy "Hide ifdef (Ifdef)") hide-ifdef-mode
:help ,(purecopy "Show/Hide code within #ifdef constructs")
(bindings--define-key mode-line-mode-menu [hide-ifdef-mode]
'(menu-item "Hide ifdef (Ifdef)" hide-ifdef-mode
:help "Show/Hide code within #ifdef constructs"
:button (:toggle . (bound-and-true-p hide-ifdef-mode))))
(define-key mode-line-mode-menu [glasses-mode]
`(menu-item ,(purecopy "Glasses (o^o)") glasses-mode
:help ,(purecopy "Insert virtual separators to make long identifiers easy to read")
(bindings--define-key mode-line-mode-menu [glasses-mode]
'(menu-item "Glasses (o^o)" glasses-mode
:help "Insert virtual separators to make long identifiers easy to read"
:button (:toggle . (bound-and-true-p glasses-mode))))
(define-key mode-line-mode-menu [font-lock-mode]
`(menu-item ,(purecopy "Font Lock") font-lock-mode
:help ,(purecopy "Syntax coloring")
(bindings--define-key mode-line-mode-menu [font-lock-mode]
'(menu-item "Font Lock" font-lock-mode
:help "Syntax coloring"
:button (:toggle . font-lock-mode)))
(define-key mode-line-mode-menu [flyspell-mode]
`(menu-item ,(purecopy "Flyspell (Fly)") flyspell-mode
:help ,(purecopy "Spell checking on the fly")
(bindings--define-key mode-line-mode-menu [flyspell-mode]
'(menu-item "Flyspell (Fly)" flyspell-mode
:help "Spell checking on the fly"
:button (:toggle . (bound-and-true-p flyspell-mode))))
(define-key mode-line-mode-menu [auto-revert-tail-mode]
`(menu-item ,(purecopy "Auto revert tail (Tail)") auto-revert-tail-mode
:help ,(purecopy "Revert the tail of the buffer when buffer grows")
(bindings--define-key mode-line-mode-menu [auto-revert-tail-mode]
'(menu-item "Auto revert tail (Tail)" auto-revert-tail-mode
:help "Revert the tail of the buffer when buffer grows"
:enable (buffer-file-name)
:button (:toggle . (bound-and-true-p auto-revert-tail-mode))))
(define-key mode-line-mode-menu [auto-revert-mode]
`(menu-item ,(purecopy "Auto revert (ARev)") auto-revert-mode
:help ,(purecopy "Revert the buffer when the file on disk changes")
(bindings--define-key mode-line-mode-menu [auto-revert-mode]
'(menu-item "Auto revert (ARev)" auto-revert-mode
:help "Revert the buffer when the file on disk changes"
:button (:toggle . (bound-and-true-p auto-revert-mode))))
(define-key mode-line-mode-menu [auto-fill-mode]
`(menu-item ,(purecopy "Auto fill (Fill)") auto-fill-mode
:help ,(purecopy "Automatically insert new lines")
(bindings--define-key mode-line-mode-menu [auto-fill-mode]
'(menu-item "Auto fill (Fill)" auto-fill-mode
:help "Automatically insert new lines"
:button (:toggle . auto-fill-function)))
(define-key mode-line-mode-menu [abbrev-mode]
`(menu-item ,(purecopy "Abbrev (Abbrev)") abbrev-mode
:help ,(purecopy "Automatically expand abbreviations")
(bindings--define-key mode-line-mode-menu [abbrev-mode]
'(menu-item "Abbrev (Abbrev)" abbrev-mode
:help "Automatically expand abbreviations"
:button (:toggle . abbrev-mode)))
(defun mode-line-minor-mode-help (event)
......
......@@ -2115,36 +2115,36 @@ strings returned are not."
;;;###autoload
(defvar menu-bar-bookmark-map
(let ((map (make-sparse-keymap "Bookmark functions")))
(define-key map [load]
`(menu-item ,(purecopy "Load a Bookmark File...") bookmark-load
:help ,(purecopy "Load bookmarks from a bookmark file)")))
(define-key map [write]
`(menu-item ,(purecopy "Save Bookmarks As...") bookmark-write
:help ,(purecopy "Write bookmarks to a file (reading the file name with the minibuffer)")))
(define-key map [save]
`(menu-item ,(purecopy "Save Bookmarks") bookmark-save
:help ,(purecopy "Save currently defined bookmarks")))
(define-key map [edit]
`(menu-item ,(purecopy "Edit Bookmark List") bookmark-bmenu-list
:help ,(purecopy "Display a list of existing bookmarks")))
(define-key map [delete]
`(menu-item ,(purecopy "Delete Bookmark...") bookmark-delete
:help ,(purecopy "Delete a bookmark from the bookmark list")))
(define-key map [rename]
`(menu-item ,(purecopy "Rename Bookmark...") bookmark-rename
:help ,(purecopy "Change the name of a bookmark")))
(define-key map [locate]
`(menu-item ,(purecopy "Insert Location...") bookmark-locate
:help ,(purecopy "Insert the name of the file associated with a bookmark")))
(define-key map [insert]
`(menu-item ,(purecopy "Insert Contents...") bookmark-insert
:help ,(purecopy "Insert the text of the file pointed to by a bookmark")))
(define-key map [set]
`(menu-item ,(purecopy "Set Bookmark...") bookmark-set
:help ,(purecopy "Set a bookmark named inside a file.")))
(define-key map [jump]
`(menu-item ,(purecopy "Jump to Bookmark...") bookmark-jump
:help ,(purecopy "Jump to a bookmark (a point in some file)")))
(bindings--define-key map [load]
'(menu-item "Load a Bookmark File..." bookmark-load
:help "Load bookmarks from a bookmark file)"))
(bindings--define-key map [write]
'(menu-item "Save Bookmarks As..." bookmark-write
:help "Write bookmarks to a file (reading the file name with the minibuffer)"))
(bindings--define-key map [save]
'(menu-item "Save Bookmarks" bookmark-save
:help "Save currently defined bookmarks"))
(bindings--define-key map [edit]
'(menu-item "Edit Bookmark List" bookmark-bmenu-list
:help "Display a list of existing bookmarks"))
(bindings--define-key map [delete]
'(menu-item "Delete Bookmark..." bookmark-delete
:help "Delete a bookmark from the bookmark list"))
(bindings--define-key map [rename]
'(menu-item "Rename Bookmark..." bookmark-rename
:help "Change the name of a bookmark"))
(bindings--define-key map [locate]
'(menu-item "Insert Location..." bookmark-locate
:help "Insert the name of the file associated with a bookmark"))
(bindings--define-key map [insert]
'(menu-item "Insert Contents..." bookmark-insert
:help "Insert the text of the file pointed to by a bookmark"))
(bindings--define-key map [set]
'(menu-item "Set Bookmark..." bookmark-set
:help "Set a bookmark named inside a file."))
(bindings--define-key map [jump]
'(menu-item "Jump to Bookmark..." bookmark-jump
:help "Jump to a bookmark (a point in some file)"))
map))
;;;###autoload
......
......@@ -134,68 +134,68 @@ commands.")
(define-key map [follow-link] 'mouse-face)
(define-key map [menu-bar Buffer-menu-mode] (cons (purecopy "Buffer-Menu") menu-map))
(define-key menu-map [quit]
`(menu-item ,(purecopy "Quit") quit-window
:help ,(purecopy "Remove the buffer menu from the display")))
(define-key menu-map [rev]
`(menu-item ,(purecopy "Refresh") revert-buffer
:help ,(purecopy "Refresh the *Buffer List* buffer contents")))
(define-key menu-map [s0] menu-bar-separator)
(define-key menu-map [tf]
`(menu-item ,(purecopy "Show Only File Buffers") Buffer-menu-toggle-files-only
(bindings--define-key menu-map [quit]
'(menu-item "Quit" quit-window
:help "Remove the buffer menu from the display"))
(bindings--define-key menu-map [rev]
'(menu-item "Refresh" revert-buffer
:help "Refresh the *Buffer List* buffer contents"))
(bindings--define-key menu-map [s0] menu-bar-separator)
(bindings--define-key menu-map [tf]
'(menu-item "Show Only File Buffers" Buffer-menu-toggle-files-only
:button (:toggle . Buffer-menu-files-only)
:help ,(purecopy "Toggle whether the current buffer-menu displays only file buffers")))
(define-key menu-map [s1] menu-bar-separator)
:help "Toggle whether the current buffer-menu displays only file buffers"))
(bindings--define-key menu-map [s1] menu-bar-separator)
;; FIXME: The "Select" entries could use better names...
(define-key menu-map [sel]
`(menu-item ,(purecopy "Select Marked") Buffer-menu-select
:help ,(purecopy "Select this line's buffer; also display buffers marked with `>'")))
(define-key menu-map [bm2]
`(menu-item ,(purecopy "Select Two") Buffer-menu-2-window
:help ,(purecopy "Select this line's buffer, with previous buffer in second window")))
(define-key menu-map [bm1]
`(menu-item ,(purecopy "Select Current") Buffer-menu-1-window
:help ,(purecopy "Select this line's buffer, alone, in full frame")))
(define-key menu-map [ow]
`(menu-item ,(purecopy "Select in Other Window") Buffer-menu-other-window
:help ,(purecopy "Select this line's buffer in other window, leaving buffer menu visible")))
(define-key menu-map [tw]
`(menu-item ,(purecopy "Select in Current Window") Buffer-menu-this-window
:help ,(purecopy "Select this line's buffer in this window")))
(define-key menu-map [s2] menu-bar-separator)
(define-key menu-map [is]
`(menu-item ,(purecopy "Regexp Isearch Marked Buffers...") Buffer-menu-isearch-buffers-regexp
:help ,(purecopy "Search for a regexp through all marked buffers using Isearch")))
(define-key menu-map [ir]
`(menu-item ,(purecopy "Isearch Marked Buffers...") Buffer-menu-isearch-buffers
:help ,(purecopy "Search for a string through all marked buffers using Isearch")))
(define-key menu-map [s3] menu-bar-separator)
(define-key menu-map [by]
`(menu-item ,(purecopy "Bury") Buffer-menu-bury
:help ,(purecopy "Bury the buffer listed on this line")))
(define-key menu-map [vt]
`(menu-item ,(purecopy "Set Unmodified") Buffer-menu-not-modified
:help ,(purecopy "Mark buffer on this line as unmodified (no changes to save)")))
(define-key menu-map [ex]
`(menu-item ,(purecopy "Execute") Buffer-menu-execute
:help ,(purecopy "Save and/or delete buffers marked with s or k commands")))
(define-key menu-map [s4] menu-bar-separator)
(define-key menu-map [delb]
`(menu-item ,(purecopy "Mark for Delete and Move Backwards") Buffer-menu-delete-backwards
:help ,(purecopy "Mark buffer on this line to be deleted by x command and move up one line")))
(define-key menu-map [del]
`(menu-item ,(purecopy "Mark for Delete") Buffer-menu-delete
:help ,(purecopy "Mark buffer on this line to be deleted by x command")))
(define-key menu-map [sv]
`(menu-item ,(purecopy "Mark for Save") Buffer-menu-save
:help ,(purecopy "Mark buffer on this line to be saved by x command")))
(define-key menu-map [umk]
`(menu-item ,(purecopy "Unmark") Buffer-menu-unmark
:help ,(purecopy "Cancel all requested operations on buffer on this line and move down")))
(define-key menu-map [mk]
`(menu-item ,(purecopy "Mark") Buffer-menu-mark
:help ,(purecopy "Mark buffer on this line for being displayed by v command")))
(bindings--define-key menu-map [sel]
'(menu-item "Select Marked" Buffer-menu-select
:help "Select this line's buffer; also display buffers marked with `>'"))
(bindings--define-key menu-map [bm2]
'(menu-item "Select Two" Buffer-menu-2-window
:help "Select this line's buffer, with previous buffer in second window"))
(bindings--define-key menu-map [bm1]
'(menu-item "Select Current" Buffer-menu-1-window
:help "Select this line's buffer, alone, in full frame"))
(bindings--define-key menu-map [ow]
'(menu-item "Select in Other Window" Buffer-menu-other-window
:help "Select this line's buffer in other window, leaving buffer menu visible"))
(bindings--define-key menu-map [tw]
'(menu-item "Select in Current Window" Buffer-menu-this-window
:help "Select this line's buffer in this window"))
(bindings--define-key menu-map [s2] menu-bar-separator)
(bindings--define-key menu-map [is]
'(menu-item "Regexp Isearch Marked Buffers..." Buffer-menu-isearch-buffers-regexp
:help "Search for a regexp through all marked buffers using Isearch"))
(bindings--define-key menu-map [ir]
'(menu-item "Isearch Marked Buffers..." Buffer-menu-isearch-buffers
:help "Search for a string through all marked buffers using Isearch"))
(bindings--define-key menu-map [s3] menu-bar-separator)
(bindings--define-key menu-map [by]
'(menu-item "Bury" Buffer-menu-bury
:help "Bury the buffer listed on this line"))
(bindings--define-key menu-map [vt]
'(menu-item "Set Unmodified" Buffer-menu-not-modified
:help "Mark buffer on this line as unmodified (no changes to save)"))
(bindings--define-key menu-map [ex]
'(menu-item "Execute" Buffer-menu-execute
:help "Save and/or delete buffers marked with s or k commands"))
(bindings--define-key menu-map [s4] menu-bar-separator)
(bindings--define-key menu-map [delb]
'(menu-item "Mark for Delete and Move Backwards" Buffer-menu-delete-backwards
:help "Mark buffer on this line to be deleted by x command and move up one line"))
(bindings--define-key menu-map [del]
'(menu-item "Mark for Delete" Buffer-menu-delete
:help "Mark buffer on this line to be deleted by x command"))
(bindings--define-key menu-map [sv]
'(menu-item "Mark for Save" Buffer-menu-save
:help "Mark buffer on this line to be saved by x command"))
(bindings--define-key menu-map [umk]
'(menu-item "Unmark" Buffer-menu-unmark
:help "Cancel all requested operations on buffer on this line and move down"))
(bindings--define-key menu-map [mk]
'(menu-item "Mark" Buffer-menu-mark
:help "Mark buffer on this line for being displayed by v command"))
map)
"Local keymap for `Buffer-menu-mode' buffers.")
......
......@@ -264,110 +264,111 @@ font-lock keywords will not be case sensitive."
(define-key map "\e\t" 'completion-at-point)
(define-key map "\e\C-x" 'eval-defun)
(define-key map "\e\C-q" 'indent-pp-sexp)
(define-key map [menu-bar emacs-lisp] (cons (purecopy "Emacs-Lisp") menu-map))
(define-key menu-map [eldoc]
`(menu-item ,(purecopy "Auto-Display Documentation Strings") eldoc-mode
(bindings--define-key map [menu-bar emacs-lisp]
(cons "Emacs-Lisp" menu-map))
(bindings--define-key menu-map [eldoc]
'(menu-item "Auto-Display Documentation Strings" eldoc-mode
:button (:toggle . (bound-and-true-p eldoc-mode))
:help ,(purecopy "Display the documentation string for the item under cursor")))
(define-key menu-map [checkdoc]
`(menu-item ,(purecopy "Check Documentation Strings") checkdoc
:help ,(purecopy "Check documentation strings for style requirements")))
(define-key menu-map [re-builder]
`(menu-item ,(purecopy "Construct Regexp") re-builder
:help ,(purecopy "Construct a regexp interactively")))
(define-key menu-map [tracing] (cons (purecopy "Tracing") tracing-map))
(define-key tracing-map [tr-a]
`(menu-item ,(purecopy "Untrace All") untrace-all
:help ,(purecopy "Untrace all currently traced functions")))
(define-key tracing-map [tr-uf]
`(menu-item ,(purecopy "Untrace Function...") untrace-function
:help ,(purecopy "Untrace function, and possibly activate all remaining advice")))
(define-key tracing-map [tr-sep] menu-bar-separator)
(define-key tracing-map [tr-q]
`(menu-item ,(purecopy "Trace Function Quietly...") trace-function-background
:help ,(purecopy "Trace the function with trace output going quietly to a buffer")))
(define-key tracing-map [tr-f]
`(menu-item ,(purecopy "Trace Function...") trace-function
:help ,(purecopy "Trace the function given as an argument")))
(define-key menu-map [profiling] (cons (purecopy "Profiling") prof-map))
(define-key prof-map [prof-restall]
`(menu-item ,(purecopy "Remove Instrumentation for All Functions") elp-restore-all
:help ,(purecopy "Restore the original definitions of all functions being profiled")))
(define-key prof-map [prof-restfunc]
`(menu-item ,(purecopy "Remove Instrumentation for Function...") elp-restore-function
:help ,(purecopy "Restore an instrumented function to its original definition")))
(define-key prof-map [sep-rem] menu-bar-separator)
(define-key prof-map [prof-resall]
`(menu-item ,(purecopy "Reset Counters for All Functions") elp-reset-all
:help ,(purecopy "Reset the profiling information for all functions being profiled")))
(define-key prof-map [prof-resfunc]
`(menu-item ,(purecopy "Reset Counters for Function...") elp-reset-function
:help ,(purecopy "Reset the profiling information for a function")))
(define-key prof-map [prof-res]
`(menu-item ,(purecopy "Show Profiling Results") elp-results
:help ,(purecopy "Display current profiling results")))
(define-key prof-map [prof-pack]
`(menu-item ,(purecopy "Instrument Package...") elp-instrument-package
:help ,(purecopy "Instrument for profiling all function that start with a prefix")))
(define-key prof-map [prof-func]
`(menu-item ,(purecopy "Instrument Function...") elp-instrument-function
:help ,(purecopy "Instrument a function for profiling")))
(define-key menu-map [lint] (cons (purecopy "Linting") lint-map))
(define-key lint-map [lint-di]
`(menu-item ,(purecopy "Lint Directory...") elint-directory
:help ,(purecopy "Lint a directory")))
(define-key lint-map [lint-f]
`(menu-item ,(purecopy "Lint File...") elint-file
:help ,(purecopy "Lint a file")))
(define-key lint-map [lint-b]
`(menu-item ,(purecopy "Lint Buffer") elint-current-buffer
:help ,(purecopy "Lint the current buffer")))
(define-key lint-map [lint-d]
`(menu-item ,(purecopy "Lint Defun") elint-defun
:help ,(purecopy "Lint the function at point")))
(define-key menu-map [edebug-defun]
`(menu-item ,(purecopy "Instrument Function for Debugging") edebug-defun
:help ,(purecopy "Evaluate the top level form point is in, stepping through with Edebug")
:keys ,(purecopy "C-u C-M-x")))
(define-key menu-map [separator-byte] menu-bar-separator)
(define-key menu-map [disas]
`(menu-item ,(purecopy "Disassemble Byte Compiled Object...") disassemble
:help ,(purecopy "Print disassembled code for OBJECT in a buffer")))
(define-key menu-map [byte-recompile]
`(menu-item ,(purecopy "Byte-recompile Directory...") byte-recompile-directory
:help ,(purecopy "Recompile every `.el' file in DIRECTORY that needs recompilation")))
(define-key menu-map [emacs-byte-compile-and-load]
`(menu-item ,(purecopy "Byte-compile and Load") emacs-lisp-byte-compile-and-load
:help ,(purecopy "Byte-compile the current file (if it has changed), then load compiled code")))
(define-key menu-map [byte-compile]
`(menu-item ,(purecopy "Byte-compile This File") emacs-lisp-byte-compile
:help ,(purecopy "Byte compile the file containing the current buffer")))
(define-key menu-map [separator-eval] menu-bar-separator)
(define-key menu-map [ielm]
`(menu-item ,(purecopy "Interactive Expression Evaluation") ielm
:help ,(purecopy "Interactively evaluate Emacs Lisp expressions")))
(define-key menu-map [eval-buffer]
`(menu-item ,(purecopy "Evaluate Buffer") eval-buffer
:help ,(purecopy "Execute the current buffer as Lisp code")))
(define-key menu-map [eval-region]
`(menu-item ,(purecopy "Evaluate Region") eval-region
:help ,(purecopy "Execute the region as Lisp code")
:help "Display the documentation string for the item under cursor"))
(bindings--define-key menu-map [checkdoc]
'(menu-item "Check Documentation Strings" checkdoc
:help "Check documentation strings for style requirements"))
(bindings--define-key menu-map [re-builder]
'(menu-item "Construct Regexp" re-builder
:help "Construct a regexp interactively"))
(bindings--define-key menu-map [tracing] (cons "Tracing" tracing-map))
(bindings--define-key tracing-map [tr-a]
'(menu-item "Untrace All" untrace-all
:help "Untrace all currently traced functions"))
(bindings--define-key tracing-map [tr-uf]
'(menu-item "Untrace Function..." untrace-function
:help "Untrace function, and possibly activate all remaining advice"))
(bindings--define-key tracing-map [tr-sep] menu-bar-separator)
(bindings--define-key tracing-map [tr-q]
'(menu-item "Trace Function Quietly..." trace-function-background
:help "Trace the function with trace output going quietly to a buffer"))
(bindings--define-key tracing-map [tr-f]
'(menu-item "Trace Function..." trace-function
:help "Trace the function given as an argument"))
(bindings--define-key menu-map [profiling] (cons "Profiling" prof-map))
(bindings--define-key prof-map [prof-restall]
'(menu-item "Remove Instrumentation for All Functions" elp-restore-all
:help "Restore the original definitions of all functions being profiled"))
(bindings--define-key prof-map [prof-restfunc]
'(menu-item "Remove Instrumentation for Function..." elp-restore-function
:help "Restore an instrumented function to its original definition"))
(bindings--define-key prof-map [sep-rem] menu-bar-separator)
(bindings--define-key prof-map [prof-resall]
'(menu-item "Reset Counters for All Functions" elp-reset-all
:help "Reset the profiling information for all functions being profiled"))
(bindings--define-key prof-map [prof-resfunc]
'(menu-item "Reset Counters for Function..." elp-reset-function
:help "Reset the profiling information for a function"))
(bindings--define-key prof-map [prof-res]
'(menu-item "Show Profiling Results" elp-results
:help "Display current profiling results"))
(bindings--define-key prof-map [prof-pack]
'(menu-item "Instrument Package..." elp-instrument-package
:help "Instrument for profiling all function that start with a prefix"))
(bindings--define-key prof-map [prof-func]
'(menu-item "Instrument Function..." elp-instrument-function
:help "Instrument a function for profiling"))
(bindings--define-key menu-map [lint] (cons "Linting" lint-map))
(bindings--define-key lint-map [lint-di]
'(menu-item "Lint Directory..." elint-directory
:help "Lint a directory"))
(bindings--define-key lint-map [lint-f]
'(menu-item "Lint File..." elint-file
:help "Lint a file"))
(bindings--define-key lint-map [lint-b]
'(menu-item "Lint Buffer" elint-current-buffer
:help "Lint the current buffer"))
(bindings--define-key lint-map [lint-d]
'(menu-item "Lint Defun" elint-defun
:help "Lint the function at point"))
(bindings--define-key menu-map [edebug-defun]
'(menu-item "Instrument Function for Debugging" edebug-defun
:help "Evaluate the top level form point is in, stepping through with Edebug"
:keys "C-u C-M-x"))
(bindings--define-key menu-map [separator-byte] menu-bar-separator)
(bindings--define-key menu-map [disas]
'(menu-item "Disassemble Byte Compiled Object..." disassemble
:help "Print disassembled code for OBJECT in a buffer"))
(bindings--define-key menu-map [byte-recompile]
'(menu-item "Byte-recompile Directory..." byte-recompile-directory
:help "Recompile every `.el' file in DIRECTORY that needs recompilation"))
(bindings--define-key menu-map [emacs-byte-compile-and-load]
'(menu-item "Byte-compile and Load" emacs-lisp-byte-compile-and-load
:help "Byte-compile the current file (if it has changed), then load compiled code"))
(bindings--define-key menu-map [byte-compile]
'(menu-item "Byte-compile This File" emacs-lisp-byte-compile
:help "Byte compile the file containing the current buffer"))
(bindings--define-key menu-map [separator-eval] menu-bar-separator)
(bindings--define-key menu-map [ielm]
'(menu-item "Interactive Expression Evaluation" ielm
:help "Interactively evaluate Emacs Lisp expressions"))
(bindings--define-key menu-map [eval-buffer]
'(menu-item "Evaluate Buffer" eval-buffer
:help "Execute the current buffer as Lisp code"))
(bindings--define-key menu-map [eval-region]
'(menu-item "Evaluate Region" eval-region
:help "Execute the region as Lisp code"
:enable mark-active))
(define-key menu-map [eval-sexp]
`(menu-item ,(purecopy "Evaluate Last S-expression") eval-last-sexp
:help ,(purecopy "Evaluate sexp before point; print value in minibuffer")))
(define-key menu-map [separator-format] menu-bar-separator)
(define-key menu-map [comment-region]
`(menu-item ,(purecopy "Comment Out Region") comment-region
:help ,(purecopy "Comment or uncomment each line in the region")
(bindings--define-key menu-map [eval-sexp]
'(menu-item "Evaluate Last S-expression" eval-last-sexp
:help "Evaluate sexp before point; print value in minibuffer"))
(bindings--define-key menu-map [separator-format] menu-bar-separator)
(bindings--define-key menu-map [comment-region]
'(menu-item "Comment Out Region" comment-region
:help "Comment or uncomment each line in the region"
:enable mark-active))
(define-key menu-map [indent-region]
`(menu-item ,(purecopy "Indent Region") indent-region
:help ,(purecopy "Indent each nonblank line in the region")
(bindings--define-key menu-map [indent-region]
'(menu-item "Indent Region" indent-region
:help "Indent each nonblank line in the region"
:enable mark-active))
(define-key menu-map [indent-line]
`(menu-item ,(purecopy "Indent Line") lisp-indent-line))
(bindings--define-key menu-map [indent-line]
'(menu-item "Indent Line" lisp-indent-line))
map)
"Keymap for Emacs Lisp mode.
All commands in `lisp-mode-shared-map' are inherited by this map.")
......@@ -430,16 +431,16 @@ if that value is non-nil."