1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-20 04:30:55 -08:00

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.
This commit is contained in:
Stefan Monnier 2012-06-27 17:15:13 -04:00
parent e309e2a566
commit 1ec4b7b259
14 changed files with 1226 additions and 1190 deletions

View file

@ -1,5 +1,12 @@
2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca> 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. * textmodes/rst.el (rst-adornment-faces-alist): Avoid copy-list.
* emacs-lisp/cl.el (flet): Mark obsolete. * emacs-lisp/cl.el (flet): Mark obsolete.

View file

@ -273,14 +273,34 @@ Normally nil in most modes, since there is no process to display.")
(put 'mode-line-process 'risky-local-variable t) (put 'mode-line-process 'risky-local-variable t)
(make-variable-buffer-local 'mode-line-process) (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") "\ (defvar mode-line-mode-menu (make-sparse-keymap "Minor Modes") "\
Menu of mode operations in the mode line.") Menu of mode operations in the mode line.")
(defvar mode-line-major-mode-keymap (defvar mode-line-major-mode-keymap
(let ((map (make-sparse-keymap))) (let ((map (make-sparse-keymap)))
(define-key map [mode-line down-mouse-1] (bindings--define-key map [mode-line down-mouse-1]
`(menu-item ,(purecopy "Menu Bar") ignore `(menu-item "Menu Bar" ignore
:filter (lambda (_) (mouse-menu-major-mode-map)))) :filter ,(lambda (_) (mouse-menu-major-mode-map))))
(define-key map [mode-line mouse-2] 'describe-mode) (define-key map [mode-line mouse-2] 'describe-mode)
(define-key map [mode-line down-mouse-3] mode-line-mode-menu) (define-key map [mode-line down-mouse-3] mode-line-mode-menu)
map) "\ map) "\
@ -327,13 +347,13 @@ mouse-3: Toggle minor modes"
(defvar mode-line-column-line-number-mode-map (defvar mode-line-column-line-number-mode-map
(let ((map (make-sparse-keymap)) (let ((map (make-sparse-keymap))
(menu-map (make-sparse-keymap "Toggle Line and Column Number Display"))) (menu-map (make-sparse-keymap "Toggle Line and Column Number Display")))
(define-key menu-map [line-number-mode] (bindings--define-key menu-map [line-number-mode]
`(menu-item ,(purecopy "Display Line Numbers") line-number-mode '(menu-item "Display Line Numbers" line-number-mode
:help ,(purecopy "Toggle displaying line numbers in the mode-line") :help "Toggle displaying line numbers in the mode-line"
:button (:toggle . line-number-mode))) :button (:toggle . line-number-mode)))
(define-key menu-map [column-number-mode] (bindings--define-key menu-map [column-number-mode]
`(menu-item ,(purecopy "Display Column Numbers") column-number-mode '(menu-item "Display Column Numbers" column-number-mode
:help ,(purecopy "Toggle displaying column numbers in the mode-line") :help "Toggle displaying column numbers in the mode-line"
:button (:toggle . column-number-mode))) :button (:toggle . column-number-mode)))
(define-key map [mode-line down-mouse-1] menu-map) (define-key map [mode-line down-mouse-1] menu-map)
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. ;; Use mode-line-mode-menu for local minor-modes only.
;; Global ones can go on the menubar (Options --> Show/Hide). ;; Global ones can go on the menubar (Options --> Show/Hide).
(define-key mode-line-mode-menu [overwrite-mode] (bindings--define-key mode-line-mode-menu [overwrite-mode]
`(menu-item ,(purecopy "Overwrite (Ovwrt)") overwrite-mode '(menu-item "Overwrite (Ovwrt)" overwrite-mode
:help ,(purecopy "Overwrite mode: typed characters replace existing text") :help "Overwrite mode: typed characters replace existing text"
:button (:toggle . overwrite-mode))) :button (:toggle . overwrite-mode)))
(define-key mode-line-mode-menu [outline-minor-mode] (bindings--define-key mode-line-mode-menu [outline-minor-mode]
`(menu-item ,(purecopy "Outline (Outl)") outline-minor-mode '(menu-item "Outline (Outl)" outline-minor-mode
;; XXX: This needs a good, brief description. ;; XXX: This needs a good, brief description.
:help ,(purecopy "") :help ""
:button (:toggle . (bound-and-true-p outline-minor-mode)))) :button (:toggle . (bound-and-true-p outline-minor-mode))))
(define-key mode-line-mode-menu [highlight-changes-mode] (bindings--define-key mode-line-mode-menu [highlight-changes-mode]
`(menu-item ,(purecopy "Highlight changes (Chg)") highlight-changes-mode '(menu-item "Highlight changes (Chg)" highlight-changes-mode
:help ,(purecopy "Show changes in the buffer in a distinctive color") :help "Show changes in the buffer in a distinctive color"
:button (:toggle . (bound-and-true-p highlight-changes-mode)))) :button (:toggle . (bound-and-true-p highlight-changes-mode))))
(define-key mode-line-mode-menu [hide-ifdef-mode] (bindings--define-key mode-line-mode-menu [hide-ifdef-mode]
`(menu-item ,(purecopy "Hide ifdef (Ifdef)") hide-ifdef-mode '(menu-item "Hide ifdef (Ifdef)" hide-ifdef-mode
:help ,(purecopy "Show/Hide code within #ifdef constructs") :help "Show/Hide code within #ifdef constructs"
:button (:toggle . (bound-and-true-p hide-ifdef-mode)))) :button (:toggle . (bound-and-true-p hide-ifdef-mode))))
(define-key mode-line-mode-menu [glasses-mode] (bindings--define-key mode-line-mode-menu [glasses-mode]
`(menu-item ,(purecopy "Glasses (o^o)") glasses-mode '(menu-item "Glasses (o^o)" glasses-mode
:help ,(purecopy "Insert virtual separators to make long identifiers easy to read") :help "Insert virtual separators to make long identifiers easy to read"
:button (:toggle . (bound-and-true-p glasses-mode)))) :button (:toggle . (bound-and-true-p glasses-mode))))
(define-key mode-line-mode-menu [font-lock-mode] (bindings--define-key mode-line-mode-menu [font-lock-mode]
`(menu-item ,(purecopy "Font Lock") font-lock-mode '(menu-item "Font Lock" font-lock-mode
:help ,(purecopy "Syntax coloring") :help "Syntax coloring"
:button (:toggle . font-lock-mode))) :button (:toggle . font-lock-mode)))
(define-key mode-line-mode-menu [flyspell-mode] (bindings--define-key mode-line-mode-menu [flyspell-mode]
`(menu-item ,(purecopy "Flyspell (Fly)") flyspell-mode '(menu-item "Flyspell (Fly)" flyspell-mode
:help ,(purecopy "Spell checking on the fly") :help "Spell checking on the fly"
:button (:toggle . (bound-and-true-p flyspell-mode)))) :button (:toggle . (bound-and-true-p flyspell-mode))))
(define-key mode-line-mode-menu [auto-revert-tail-mode] (bindings--define-key mode-line-mode-menu [auto-revert-tail-mode]
`(menu-item ,(purecopy "Auto revert tail (Tail)") auto-revert-tail-mode '(menu-item "Auto revert tail (Tail)" auto-revert-tail-mode
:help ,(purecopy "Revert the tail of the buffer when buffer grows") :help "Revert the tail of the buffer when buffer grows"
:enable (buffer-file-name) :enable (buffer-file-name)
:button (:toggle . (bound-and-true-p auto-revert-tail-mode)))) :button (:toggle . (bound-and-true-p auto-revert-tail-mode))))
(define-key mode-line-mode-menu [auto-revert-mode] (bindings--define-key mode-line-mode-menu [auto-revert-mode]
`(menu-item ,(purecopy "Auto revert (ARev)") auto-revert-mode '(menu-item "Auto revert (ARev)" auto-revert-mode
:help ,(purecopy "Revert the buffer when the file on disk changes") :help "Revert the buffer when the file on disk changes"
:button (:toggle . (bound-and-true-p auto-revert-mode)))) :button (:toggle . (bound-and-true-p auto-revert-mode))))
(define-key mode-line-mode-menu [auto-fill-mode] (bindings--define-key mode-line-mode-menu [auto-fill-mode]
`(menu-item ,(purecopy "Auto fill (Fill)") auto-fill-mode '(menu-item "Auto fill (Fill)" auto-fill-mode
:help ,(purecopy "Automatically insert new lines") :help "Automatically insert new lines"
:button (:toggle . auto-fill-function))) :button (:toggle . auto-fill-function)))
(define-key mode-line-mode-menu [abbrev-mode] (bindings--define-key mode-line-mode-menu [abbrev-mode]
`(menu-item ,(purecopy "Abbrev (Abbrev)") abbrev-mode '(menu-item "Abbrev (Abbrev)" abbrev-mode
:help ,(purecopy "Automatically expand abbreviations") :help "Automatically expand abbreviations"
:button (:toggle . abbrev-mode))) :button (:toggle . abbrev-mode)))
(defun mode-line-minor-mode-help (event) (defun mode-line-minor-mode-help (event)

View file

@ -2115,36 +2115,36 @@ strings returned are not."
;;;###autoload ;;;###autoload
(defvar menu-bar-bookmark-map (defvar menu-bar-bookmark-map
(let ((map (make-sparse-keymap "Bookmark functions"))) (let ((map (make-sparse-keymap "Bookmark functions")))
(define-key map [load] (bindings--define-key map [load]
`(menu-item ,(purecopy "Load a Bookmark File...") bookmark-load '(menu-item "Load a Bookmark File..." bookmark-load
:help ,(purecopy "Load bookmarks from a bookmark file)"))) :help "Load bookmarks from a bookmark file)"))
(define-key map [write] (bindings--define-key map [write]
`(menu-item ,(purecopy "Save Bookmarks As...") bookmark-write '(menu-item "Save Bookmarks As..." bookmark-write
:help ,(purecopy "Write bookmarks to a file (reading the file name with the minibuffer)"))) :help "Write bookmarks to a file (reading the file name with the minibuffer)"))
(define-key map [save] (bindings--define-key map [save]
`(menu-item ,(purecopy "Save Bookmarks") bookmark-save '(menu-item "Save Bookmarks" bookmark-save
:help ,(purecopy "Save currently defined bookmarks"))) :help "Save currently defined bookmarks"))
(define-key map [edit] (bindings--define-key map [edit]
`(menu-item ,(purecopy "Edit Bookmark List") bookmark-bmenu-list '(menu-item "Edit Bookmark List" bookmark-bmenu-list
:help ,(purecopy "Display a list of existing bookmarks"))) :help "Display a list of existing bookmarks"))
(define-key map [delete] (bindings--define-key map [delete]
`(menu-item ,(purecopy "Delete Bookmark...") bookmark-delete '(menu-item "Delete Bookmark..." bookmark-delete
:help ,(purecopy "Delete a bookmark from the bookmark list"))) :help "Delete a bookmark from the bookmark list"))
(define-key map [rename] (bindings--define-key map [rename]
`(menu-item ,(purecopy "Rename Bookmark...") bookmark-rename '(menu-item "Rename Bookmark..." bookmark-rename
:help ,(purecopy "Change the name of a bookmark"))) :help "Change the name of a bookmark"))
(define-key map [locate] (bindings--define-key map [locate]
`(menu-item ,(purecopy "Insert Location...") bookmark-locate '(menu-item "Insert Location..." bookmark-locate
:help ,(purecopy "Insert the name of the file associated with a bookmark"))) :help "Insert the name of the file associated with a bookmark"))
(define-key map [insert] (bindings--define-key map [insert]
`(menu-item ,(purecopy "Insert Contents...") bookmark-insert '(menu-item "Insert Contents..." bookmark-insert
:help ,(purecopy "Insert the text of the file pointed to by a bookmark"))) :help "Insert the text of the file pointed to by a bookmark"))
(define-key map [set] (bindings--define-key map [set]
`(menu-item ,(purecopy "Set Bookmark...") bookmark-set '(menu-item "Set Bookmark..." bookmark-set
:help ,(purecopy "Set a bookmark named inside a file."))) :help "Set a bookmark named inside a file."))
(define-key map [jump] (bindings--define-key map [jump]
`(menu-item ,(purecopy "Jump to Bookmark...") bookmark-jump '(menu-item "Jump to Bookmark..." bookmark-jump
:help ,(purecopy "Jump to a bookmark (a point in some file)"))) :help "Jump to a bookmark (a point in some file)"))
map)) map))
;;;###autoload ;;;###autoload

View file

@ -134,68 +134,68 @@ commands.")
(define-key map [follow-link] 'mouse-face) (define-key map [follow-link] 'mouse-face)
(define-key map [menu-bar Buffer-menu-mode] (cons (purecopy "Buffer-Menu") menu-map)) (define-key map [menu-bar Buffer-menu-mode] (cons (purecopy "Buffer-Menu") menu-map))
(define-key menu-map [quit] (bindings--define-key menu-map [quit]
`(menu-item ,(purecopy "Quit") quit-window '(menu-item "Quit" quit-window
:help ,(purecopy "Remove the buffer menu from the display"))) :help "Remove the buffer menu from the display"))
(define-key menu-map [rev] (bindings--define-key menu-map [rev]
`(menu-item ,(purecopy "Refresh") revert-buffer '(menu-item "Refresh" revert-buffer
:help ,(purecopy "Refresh the *Buffer List* buffer contents"))) :help "Refresh the *Buffer List* buffer contents"))
(define-key menu-map [s0] menu-bar-separator) (bindings--define-key menu-map [s0] menu-bar-separator)
(define-key menu-map [tf] (bindings--define-key menu-map [tf]
`(menu-item ,(purecopy "Show Only File Buffers") Buffer-menu-toggle-files-only '(menu-item "Show Only File Buffers" Buffer-menu-toggle-files-only
:button (:toggle . Buffer-menu-files-only) :button (:toggle . Buffer-menu-files-only)
:help ,(purecopy "Toggle whether the current buffer-menu displays only file buffers"))) :help "Toggle whether the current buffer-menu displays only file buffers"))
(define-key menu-map [s1] menu-bar-separator) (bindings--define-key menu-map [s1] menu-bar-separator)
;; FIXME: The "Select" entries could use better names... ;; FIXME: The "Select" entries could use better names...
(define-key menu-map [sel] (bindings--define-key menu-map [sel]
`(menu-item ,(purecopy "Select Marked") Buffer-menu-select '(menu-item "Select Marked" Buffer-menu-select
:help ,(purecopy "Select this line's buffer; also display buffers marked with `>'"))) :help "Select this line's buffer; also display buffers marked with `>'"))
(define-key menu-map [bm2] (bindings--define-key menu-map [bm2]
`(menu-item ,(purecopy "Select Two") Buffer-menu-2-window '(menu-item "Select Two" Buffer-menu-2-window
:help ,(purecopy "Select this line's buffer, with previous buffer in second window"))) :help "Select this line's buffer, with previous buffer in second window"))
(define-key menu-map [bm1] (bindings--define-key menu-map [bm1]
`(menu-item ,(purecopy "Select Current") Buffer-menu-1-window '(menu-item "Select Current" Buffer-menu-1-window
:help ,(purecopy "Select this line's buffer, alone, in full frame"))) :help "Select this line's buffer, alone, in full frame"))
(define-key menu-map [ow] (bindings--define-key menu-map [ow]
`(menu-item ,(purecopy "Select in Other Window") Buffer-menu-other-window '(menu-item "Select in Other Window" Buffer-menu-other-window
:help ,(purecopy "Select this line's buffer in other window, leaving buffer menu visible"))) :help "Select this line's buffer in other window, leaving buffer menu visible"))
(define-key menu-map [tw] (bindings--define-key menu-map [tw]
`(menu-item ,(purecopy "Select in Current Window") Buffer-menu-this-window '(menu-item "Select in Current Window" Buffer-menu-this-window
:help ,(purecopy "Select this line's buffer in this window"))) :help "Select this line's buffer in this window"))
(define-key menu-map [s2] menu-bar-separator) (bindings--define-key menu-map [s2] menu-bar-separator)
(define-key menu-map [is] (bindings--define-key menu-map [is]
`(menu-item ,(purecopy "Regexp Isearch Marked Buffers...") Buffer-menu-isearch-buffers-regexp '(menu-item "Regexp Isearch Marked Buffers..." Buffer-menu-isearch-buffers-regexp
:help ,(purecopy "Search for a regexp through all marked buffers using Isearch"))) :help "Search for a regexp through all marked buffers using Isearch"))
(define-key menu-map [ir] (bindings--define-key menu-map [ir]
`(menu-item ,(purecopy "Isearch Marked Buffers...") Buffer-menu-isearch-buffers '(menu-item "Isearch Marked Buffers..." Buffer-menu-isearch-buffers
:help ,(purecopy "Search for a string through all marked buffers using Isearch"))) :help "Search for a string through all marked buffers using Isearch"))
(define-key menu-map [s3] menu-bar-separator) (bindings--define-key menu-map [s3] menu-bar-separator)
(define-key menu-map [by] (bindings--define-key menu-map [by]
`(menu-item ,(purecopy "Bury") Buffer-menu-bury '(menu-item "Bury" Buffer-menu-bury
:help ,(purecopy "Bury the buffer listed on this line"))) :help "Bury the buffer listed on this line"))
(define-key menu-map [vt] (bindings--define-key menu-map [vt]
`(menu-item ,(purecopy "Set Unmodified") Buffer-menu-not-modified '(menu-item "Set Unmodified" Buffer-menu-not-modified
:help ,(purecopy "Mark buffer on this line as unmodified (no changes to save)"))) :help "Mark buffer on this line as unmodified (no changes to save)"))
(define-key menu-map [ex] (bindings--define-key menu-map [ex]
`(menu-item ,(purecopy "Execute") Buffer-menu-execute '(menu-item "Execute" Buffer-menu-execute
:help ,(purecopy "Save and/or delete buffers marked with s or k commands"))) :help "Save and/or delete buffers marked with s or k commands"))
(define-key menu-map [s4] menu-bar-separator) (bindings--define-key menu-map [s4] menu-bar-separator)
(define-key menu-map [delb] (bindings--define-key menu-map [delb]
`(menu-item ,(purecopy "Mark for Delete and Move Backwards") Buffer-menu-delete-backwards '(menu-item "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"))) :help "Mark buffer on this line to be deleted by x command and move up one line"))
(define-key menu-map [del] (bindings--define-key menu-map [del]
`(menu-item ,(purecopy "Mark for Delete") Buffer-menu-delete '(menu-item "Mark for Delete" Buffer-menu-delete
:help ,(purecopy "Mark buffer on this line to be deleted by x command"))) :help "Mark buffer on this line to be deleted by x command"))
(define-key menu-map [sv] (bindings--define-key menu-map [sv]
`(menu-item ,(purecopy "Mark for Save") Buffer-menu-save '(menu-item "Mark for Save" Buffer-menu-save
:help ,(purecopy "Mark buffer on this line to be saved by x command"))) :help "Mark buffer on this line to be saved by x command"))
(define-key menu-map [umk] (bindings--define-key menu-map [umk]
`(menu-item ,(purecopy "Unmark") Buffer-menu-unmark '(menu-item "Unmark" Buffer-menu-unmark
:help ,(purecopy "Cancel all requested operations on buffer on this line and move down"))) :help "Cancel all requested operations on buffer on this line and move down"))
(define-key menu-map [mk] (bindings--define-key menu-map [mk]
`(menu-item ,(purecopy "Mark") Buffer-menu-mark '(menu-item "Mark" Buffer-menu-mark
:help ,(purecopy "Mark buffer on this line for being displayed by v command"))) :help "Mark buffer on this line for being displayed by v command"))
map) map)
"Local keymap for `Buffer-menu-mode' buffers.") "Local keymap for `Buffer-menu-mode' buffers.")

View file

@ -264,110 +264,111 @@ font-lock keywords will not be case sensitive."
(define-key map "\e\t" 'completion-at-point) (define-key map "\e\t" 'completion-at-point)
(define-key map "\e\C-x" 'eval-defun) (define-key map "\e\C-x" 'eval-defun)
(define-key map "\e\C-q" 'indent-pp-sexp) (define-key map "\e\C-q" 'indent-pp-sexp)
(define-key map [menu-bar emacs-lisp] (cons (purecopy "Emacs-Lisp") menu-map)) (bindings--define-key map [menu-bar emacs-lisp]
(define-key menu-map [eldoc] (cons "Emacs-Lisp" menu-map))
`(menu-item ,(purecopy "Auto-Display Documentation Strings") eldoc-mode (bindings--define-key menu-map [eldoc]
'(menu-item "Auto-Display Documentation Strings" eldoc-mode
:button (:toggle . (bound-and-true-p eldoc-mode)) :button (:toggle . (bound-and-true-p eldoc-mode))
:help ,(purecopy "Display the documentation string for the item under cursor"))) :help "Display the documentation string for the item under cursor"))
(define-key menu-map [checkdoc] (bindings--define-key menu-map [checkdoc]
`(menu-item ,(purecopy "Check Documentation Strings") checkdoc '(menu-item "Check Documentation Strings" checkdoc
:help ,(purecopy "Check documentation strings for style requirements"))) :help "Check documentation strings for style requirements"))
(define-key menu-map [re-builder] (bindings--define-key menu-map [re-builder]
`(menu-item ,(purecopy "Construct Regexp") re-builder '(menu-item "Construct Regexp" re-builder
:help ,(purecopy "Construct a regexp interactively"))) :help "Construct a regexp interactively"))
(define-key menu-map [tracing] (cons (purecopy "Tracing") tracing-map)) (bindings--define-key menu-map [tracing] (cons "Tracing" tracing-map))
(define-key tracing-map [tr-a] (bindings--define-key tracing-map [tr-a]
`(menu-item ,(purecopy "Untrace All") untrace-all '(menu-item "Untrace All" untrace-all
:help ,(purecopy "Untrace all currently traced functions"))) :help "Untrace all currently traced functions"))
(define-key tracing-map [tr-uf] (bindings--define-key tracing-map [tr-uf]
`(menu-item ,(purecopy "Untrace Function...") untrace-function '(menu-item "Untrace Function..." untrace-function
:help ,(purecopy "Untrace function, and possibly activate all remaining advice"))) :help "Untrace function, and possibly activate all remaining advice"))
(define-key tracing-map [tr-sep] menu-bar-separator) (bindings--define-key tracing-map [tr-sep] menu-bar-separator)
(define-key tracing-map [tr-q] (bindings--define-key tracing-map [tr-q]
`(menu-item ,(purecopy "Trace Function Quietly...") trace-function-background '(menu-item "Trace Function Quietly..." trace-function-background
:help ,(purecopy "Trace the function with trace output going quietly to a buffer"))) :help "Trace the function with trace output going quietly to a buffer"))
(define-key tracing-map [tr-f] (bindings--define-key tracing-map [tr-f]
`(menu-item ,(purecopy "Trace Function...") trace-function '(menu-item "Trace Function..." trace-function
:help ,(purecopy "Trace the function given as an argument"))) :help "Trace the function given as an argument"))
(define-key menu-map [profiling] (cons (purecopy "Profiling") prof-map)) (bindings--define-key menu-map [profiling] (cons "Profiling" prof-map))
(define-key prof-map [prof-restall] (bindings--define-key prof-map [prof-restall]
`(menu-item ,(purecopy "Remove Instrumentation for All Functions") elp-restore-all '(menu-item "Remove Instrumentation for All Functions" elp-restore-all
:help ,(purecopy "Restore the original definitions of all functions being profiled"))) :help "Restore the original definitions of all functions being profiled"))
(define-key prof-map [prof-restfunc] (bindings--define-key prof-map [prof-restfunc]
`(menu-item ,(purecopy "Remove Instrumentation for Function...") elp-restore-function '(menu-item "Remove Instrumentation for Function..." elp-restore-function
:help ,(purecopy "Restore an instrumented function to its original definition"))) :help "Restore an instrumented function to its original definition"))
(define-key prof-map [sep-rem] menu-bar-separator) (bindings--define-key prof-map [sep-rem] menu-bar-separator)
(define-key prof-map [prof-resall] (bindings--define-key prof-map [prof-resall]
`(menu-item ,(purecopy "Reset Counters for All Functions") elp-reset-all '(menu-item "Reset Counters for All Functions" elp-reset-all
:help ,(purecopy "Reset the profiling information for all functions being profiled"))) :help "Reset the profiling information for all functions being profiled"))
(define-key prof-map [prof-resfunc] (bindings--define-key prof-map [prof-resfunc]
`(menu-item ,(purecopy "Reset Counters for Function...") elp-reset-function '(menu-item "Reset Counters for Function..." elp-reset-function
:help ,(purecopy "Reset the profiling information for a function"))) :help "Reset the profiling information for a function"))
(define-key prof-map [prof-res] (bindings--define-key prof-map [prof-res]
`(menu-item ,(purecopy "Show Profiling Results") elp-results '(menu-item "Show Profiling Results" elp-results
:help ,(purecopy "Display current profiling results"))) :help "Display current profiling results"))
(define-key prof-map [prof-pack] (bindings--define-key prof-map [prof-pack]
`(menu-item ,(purecopy "Instrument Package...") elp-instrument-package '(menu-item "Instrument Package..." elp-instrument-package
:help ,(purecopy "Instrument for profiling all function that start with a prefix"))) :help "Instrument for profiling all function that start with a prefix"))
(define-key prof-map [prof-func] (bindings--define-key prof-map [prof-func]
`(menu-item ,(purecopy "Instrument Function...") elp-instrument-function '(menu-item "Instrument Function..." elp-instrument-function
:help ,(purecopy "Instrument a function for profiling"))) :help "Instrument a function for profiling"))
(define-key menu-map [lint] (cons (purecopy "Linting") lint-map)) (bindings--define-key menu-map [lint] (cons "Linting" lint-map))
(define-key lint-map [lint-di] (bindings--define-key lint-map [lint-di]
`(menu-item ,(purecopy "Lint Directory...") elint-directory '(menu-item "Lint Directory..." elint-directory
:help ,(purecopy "Lint a directory"))) :help "Lint a directory"))
(define-key lint-map [lint-f] (bindings--define-key lint-map [lint-f]
`(menu-item ,(purecopy "Lint File...") elint-file '(menu-item "Lint File..." elint-file
:help ,(purecopy "Lint a file"))) :help "Lint a file"))
(define-key lint-map [lint-b] (bindings--define-key lint-map [lint-b]
`(menu-item ,(purecopy "Lint Buffer") elint-current-buffer '(menu-item "Lint Buffer" elint-current-buffer
:help ,(purecopy "Lint the current buffer"))) :help "Lint the current buffer"))
(define-key lint-map [lint-d] (bindings--define-key lint-map [lint-d]
`(menu-item ,(purecopy "Lint Defun") elint-defun '(menu-item "Lint Defun" elint-defun
:help ,(purecopy "Lint the function at point"))) :help "Lint the function at point"))
(define-key menu-map [edebug-defun] (bindings--define-key menu-map [edebug-defun]
`(menu-item ,(purecopy "Instrument Function for Debugging") edebug-defun '(menu-item "Instrument Function for Debugging" edebug-defun
:help ,(purecopy "Evaluate the top level form point is in, stepping through with Edebug") :help "Evaluate the top level form point is in, stepping through with Edebug"
:keys ,(purecopy "C-u C-M-x"))) :keys "C-u C-M-x"))
(define-key menu-map [separator-byte] menu-bar-separator) (bindings--define-key menu-map [separator-byte] menu-bar-separator)
(define-key menu-map [disas] (bindings--define-key menu-map [disas]
`(menu-item ,(purecopy "Disassemble Byte Compiled Object...") disassemble '(menu-item "Disassemble Byte Compiled Object..." disassemble
:help ,(purecopy "Print disassembled code for OBJECT in a buffer"))) :help "Print disassembled code for OBJECT in a buffer"))
(define-key menu-map [byte-recompile] (bindings--define-key menu-map [byte-recompile]
`(menu-item ,(purecopy "Byte-recompile Directory...") byte-recompile-directory '(menu-item "Byte-recompile Directory..." byte-recompile-directory
:help ,(purecopy "Recompile every `.el' file in DIRECTORY that needs recompilation"))) :help "Recompile every `.el' file in DIRECTORY that needs recompilation"))
(define-key menu-map [emacs-byte-compile-and-load] (bindings--define-key menu-map [emacs-byte-compile-and-load]
`(menu-item ,(purecopy "Byte-compile and Load") emacs-lisp-byte-compile-and-load '(menu-item "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"))) :help "Byte-compile the current file (if it has changed), then load compiled code"))
(define-key menu-map [byte-compile] (bindings--define-key menu-map [byte-compile]
`(menu-item ,(purecopy "Byte-compile This File") emacs-lisp-byte-compile '(menu-item "Byte-compile This File" emacs-lisp-byte-compile
:help ,(purecopy "Byte compile the file containing the current buffer"))) :help "Byte compile the file containing the current buffer"))
(define-key menu-map [separator-eval] menu-bar-separator) (bindings--define-key menu-map [separator-eval] menu-bar-separator)
(define-key menu-map [ielm] (bindings--define-key menu-map [ielm]
`(menu-item ,(purecopy "Interactive Expression Evaluation") ielm '(menu-item "Interactive Expression Evaluation" ielm
:help ,(purecopy "Interactively evaluate Emacs Lisp expressions"))) :help "Interactively evaluate Emacs Lisp expressions"))
(define-key menu-map [eval-buffer] (bindings--define-key menu-map [eval-buffer]
`(menu-item ,(purecopy "Evaluate Buffer") eval-buffer '(menu-item "Evaluate Buffer" eval-buffer
:help ,(purecopy "Execute the current buffer as Lisp code"))) :help "Execute the current buffer as Lisp code"))
(define-key menu-map [eval-region] (bindings--define-key menu-map [eval-region]
`(menu-item ,(purecopy "Evaluate Region") eval-region '(menu-item "Evaluate Region" eval-region
:help ,(purecopy "Execute the region as Lisp code") :help "Execute the region as Lisp code"
:enable mark-active)) :enable mark-active))
(define-key menu-map [eval-sexp] (bindings--define-key menu-map [eval-sexp]
`(menu-item ,(purecopy "Evaluate Last S-expression") eval-last-sexp '(menu-item "Evaluate Last S-expression" eval-last-sexp
:help ,(purecopy "Evaluate sexp before point; print value in minibuffer"))) :help "Evaluate sexp before point; print value in minibuffer"))
(define-key menu-map [separator-format] menu-bar-separator) (bindings--define-key menu-map [separator-format] menu-bar-separator)
(define-key menu-map [comment-region] (bindings--define-key menu-map [comment-region]
`(menu-item ,(purecopy "Comment Out Region") comment-region '(menu-item "Comment Out Region" comment-region
:help ,(purecopy "Comment or uncomment each line in the region") :help "Comment or uncomment each line in the region"
:enable mark-active)) :enable mark-active))
(define-key menu-map [indent-region] (bindings--define-key menu-map [indent-region]
`(menu-item ,(purecopy "Indent Region") indent-region '(menu-item "Indent Region" indent-region
:help ,(purecopy "Indent each nonblank line in the region") :help "Indent each nonblank line in the region"
:enable mark-active)) :enable mark-active))
(define-key menu-map [indent-line] (bindings--define-key menu-map [indent-line]
`(menu-item ,(purecopy "Indent Line") lisp-indent-line)) '(menu-item "Indent Line" lisp-indent-line))
map) map)
"Keymap for Emacs Lisp mode. "Keymap for Emacs Lisp mode.
All commands in `lisp-mode-shared-map' are inherited by this map.") All commands in `lisp-mode-shared-map' are inherited by this map.")
@ -430,16 +431,16 @@ if that value is non-nil."
(set-keymap-parent map lisp-mode-shared-map) (set-keymap-parent map lisp-mode-shared-map)
(define-key map "\e\C-x" 'lisp-eval-defun) (define-key map "\e\C-x" 'lisp-eval-defun)
(define-key map "\C-c\C-z" 'run-lisp) (define-key map "\C-c\C-z" 'run-lisp)
(define-key map [menu-bar lisp] (cons (purecopy "Lisp") menu-map)) (bindings--define-key map [menu-bar lisp] (cons "Lisp" menu-map))
(define-key menu-map [run-lisp] (bindings--define-key menu-map [run-lisp]
`(menu-item ,(purecopy "Run inferior Lisp") run-lisp '(menu-item "Run inferior Lisp" run-lisp
:help ,(purecopy "Run an inferior Lisp process, input and output via buffer `*inferior-lisp*'"))) :help "Run an inferior Lisp process, input and output via buffer `*inferior-lisp*'"))
(define-key menu-map [ev-def] (bindings--define-key menu-map [ev-def]
`(menu-item ,(purecopy "Eval defun") lisp-eval-defun '(menu-item "Eval defun" lisp-eval-defun
:help ,(purecopy "Send the current defun to the Lisp process made by M-x run-lisp"))) :help "Send the current defun to the Lisp process made by M-x run-lisp"))
(define-key menu-map [ind-sexp] (bindings--define-key menu-map [ind-sexp]
`(menu-item ,(purecopy "Indent sexp") indent-sexp '(menu-item "Indent sexp" indent-sexp
:help ,(purecopy "Indent each line of the list starting just after point"))) :help "Indent each line of the list starting just after point"))
map) map)
"Keymap for ordinary Lisp mode. "Keymap for ordinary Lisp mode.
All commands in `lisp-mode-shared-map' are inherited by this map.") All commands in `lisp-mode-shared-map' are inherited by this map.")
@ -487,23 +488,24 @@ if that value is non-nil."
(define-key map "\e\C-q" 'indent-pp-sexp) (define-key map "\e\C-q" 'indent-pp-sexp)
(define-key map "\e\t" 'completion-at-point) (define-key map "\e\t" 'completion-at-point)
(define-key map "\n" 'eval-print-last-sexp) (define-key map "\n" 'eval-print-last-sexp)
(define-key map [menu-bar lisp-interaction] (cons (purecopy "Lisp-Interaction") menu-map)) (bindings--define-key map [menu-bar lisp-interaction]
(define-key menu-map [eval-defun] (cons "Lisp-Interaction" menu-map))
`(menu-item ,(purecopy "Evaluate Defun") eval-defun (bindings--define-key menu-map [eval-defun]
:help ,(purecopy "Evaluate the top-level form containing point, or after point"))) '(menu-item "Evaluate Defun" eval-defun
(define-key menu-map [eval-print-last-sexp] :help "Evaluate the top-level form containing point, or after point"))
`(menu-item ,(purecopy "Evaluate and Print") eval-print-last-sexp (bindings--define-key menu-map [eval-print-last-sexp]
:help ,(purecopy "Evaluate sexp before point; print value into current buffer"))) '(menu-item "Evaluate and Print" eval-print-last-sexp
(define-key menu-map [edebug-defun-lisp-interaction] :help "Evaluate sexp before point; print value into current buffer"))
`(menu-item ,(purecopy "Instrument Function for Debugging") edebug-defun (bindings--define-key menu-map [edebug-defun-lisp-interaction]
:help ,(purecopy "Evaluate the top level form point is in, stepping through with Edebug") '(menu-item "Instrument Function for Debugging" edebug-defun
:keys ,(purecopy "C-u C-M-x"))) :help "Evaluate the top level form point is in, stepping through with Edebug"
(define-key menu-map [indent-pp-sexp] :keys "C-u C-M-x"))
`(menu-item ,(purecopy "Indent or Pretty-Print") indent-pp-sexp (bindings--define-key menu-map [indent-pp-sexp]
:help ,(purecopy "Indent each line of the list starting just after point, or prettyprint it"))) '(menu-item "Indent or Pretty-Print" indent-pp-sexp
(define-key menu-map [complete-symbol] :help "Indent each line of the list starting just after point, or prettyprint it"))
`(menu-item ,(purecopy "Complete Lisp Symbol") completion-at-point (bindings--define-key menu-map [complete-symbol]
:help ,(purecopy "Perform completion on Lisp symbol preceding point"))) '(menu-item "Complete Lisp Symbol" completion-at-point
:help "Perform completion on Lisp symbol preceding point"))
map) map)
"Keymap for Lisp Interaction mode. "Keymap for Lisp Interaction mode.
All commands in `lisp-mode-shared-map' are inherited by this map.") All commands in `lisp-mode-shared-map' are inherited by this map.")

View file

@ -58,98 +58,98 @@
(defvar describe-language-environment-map (defvar describe-language-environment-map
(let ((map (make-sparse-keymap "Describe Language Environment"))) (let ((map (make-sparse-keymap "Describe Language Environment")))
(define-key map (bindings--define-key map
[Default] `(menu-item ,(purecopy "Default") describe-specified-language-support)) [Default] '(menu-item "Default" describe-specified-language-support))
map)) map))
(defvar setup-language-environment-map (defvar setup-language-environment-map
(let ((map (make-sparse-keymap "Set Language Environment"))) (let ((map (make-sparse-keymap "Set Language Environment")))
(define-key map (bindings--define-key map
[Default] `(menu-item ,(purecopy "Default") setup-specified-language-environment)) [Default] '(menu-item "Default" setup-specified-language-environment))
map)) map))
(defvar set-coding-system-map (defvar set-coding-system-map
(let ((map (make-sparse-keymap "Set Coding System"))) (let ((map (make-sparse-keymap "Set Coding System")))
(define-key-after map [universal-coding-system-argument] (bindings--define-key map [set-buffer-process-coding-system]
`(menu-item ,(purecopy "For Next Command") universal-coding-system-argument '(menu-item "For I/O with Subprocess" set-buffer-process-coding-system
:help ,(purecopy "Coding system to be used by next command")))
(define-key-after map [separator-1] menu-bar-separator)
(define-key-after map [set-buffer-file-coding-system]
`(menu-item ,(purecopy "For Saving This Buffer") set-buffer-file-coding-system
:help ,(purecopy "How to encode this buffer when saved")))
(define-key-after map [revert-buffer-with-coding-system]
`(menu-item ,(purecopy "For Reverting This File Now")
revert-buffer-with-coding-system
:enable buffer-file-name
:help ,(purecopy "Revisit this file immediately using specified coding system")))
(define-key-after map [set-file-name-coding-system]
`(menu-item ,(purecopy "For File Name") set-file-name-coding-system
:help ,(purecopy "How to decode/encode file names")))
(define-key-after map [separator-2] menu-bar-separator)
(define-key-after map [set-keyboard-coding-system]
`(menu-item ,(purecopy "For Keyboard") set-keyboard-coding-system
:help ,(purecopy "How to decode keyboard input")))
(define-key-after map [set-terminal-coding-system]
`(menu-item ,(purecopy "For Terminal") set-terminal-coding-system
:enable (null (memq initial-window-system '(x w32 ns)))
:help ,(purecopy "How to encode terminal output")))
(define-key-after map [separator-3] menu-bar-separator)
(define-key-after map [set-selection-coding-system]
`(menu-item ,(purecopy "For X Selections/Clipboard") set-selection-coding-system
:visible (display-selections-p)
:help ,(purecopy "How to en/decode data to/from selection/clipboard")))
(define-key-after map [set-next-selection-coding-system]
`(menu-item ,(purecopy "For Next X Selection") set-next-selection-coding-system
:visible (display-selections-p)
:help ,(purecopy "How to en/decode next selection/clipboard operation")))
(define-key-after map [set-buffer-process-coding-system]
`(menu-item ,(purecopy "For I/O with Subprocess") set-buffer-process-coding-system
:visible (fboundp 'start-process) :visible (fboundp 'start-process)
:enable (get-buffer-process (current-buffer)) :enable (get-buffer-process (current-buffer))
:help ,(purecopy "How to en/decode I/O from/to subprocess connected to this buffer"))) :help "How to en/decode I/O from/to subprocess connected to this buffer"))
(bindings--define-key map [set-next-selection-coding-system]
'(menu-item "For Next X Selection" set-next-selection-coding-system
:visible (display-selections-p)
:help "How to en/decode next selection/clipboard operation"))
(bindings--define-key map [set-selection-coding-system]
'(menu-item "For X Selections/Clipboard" set-selection-coding-system
:visible (display-selections-p)
:help "How to en/decode data to/from selection/clipboard"))
(bindings--define-key map [separator-3] menu-bar-separator)
(bindings--define-key map [set-terminal-coding-system]
'(menu-item "For Terminal" set-terminal-coding-system
:enable (null (memq initial-window-system '(x w32 ns)))
:help "How to encode terminal output"))
(bindings--define-key map [set-keyboard-coding-system]
'(menu-item "For Keyboard" set-keyboard-coding-system
:help "How to decode keyboard input"))
(bindings--define-key map [separator-2] menu-bar-separator)
(bindings--define-key map [set-file-name-coding-system]
'(menu-item "For File Name" set-file-name-coding-system
:help "How to decode/encode file names"))
(bindings--define-key map [revert-buffer-with-coding-system]
'(menu-item "For Reverting This File Now"
revert-buffer-with-coding-system
:enable buffer-file-name
:help "Revisit this file immediately using specified coding system"))
(bindings--define-key map [set-buffer-file-coding-system]
'(menu-item "For Saving This Buffer" set-buffer-file-coding-system
:help "How to encode this buffer when saved"))
(bindings--define-key map [separator-1] menu-bar-separator)
(bindings--define-key map [universal-coding-system-argument]
'(menu-item "For Next Command" universal-coding-system-argument
:help "Coding system to be used by next command"))
map)) map))
(defvar mule-menu-keymap (defvar mule-menu-keymap
(let ((map (make-sparse-keymap "Mule (Multilingual Environment)"))) (let ((map (make-sparse-keymap "Mule (Multilingual Environment)")))
(define-key-after map [set-language-environment] (bindings--define-key map [mule-diag]
`(menu-item ,(purecopy "Set Language Environment") ,setup-language-environment-map)) '(menu-item "Show All Multilingual Settings" mule-diag
(define-key-after map [separator-mule] menu-bar-separator) :help "Display multilingual environment settings"))
(bindings--define-key map [list-character-sets]
'(menu-item "List Character Sets" list-character-sets
:help "Show table of available character sets"))
(bindings--define-key map [describe-coding-system]
'(menu-item "Describe Coding System..." describe-coding-system))
(bindings--define-key map [describe-input-method]
'(menu-item "Describe Input Method..." describe-input-method
:help "Keyboard layout for a specific input method"))
(bindings--define-key map [describe-language-environment]
`(menu-item "Describe Language Environment"
,describe-language-environment-map
:help "Show multilingual settings for a specific language"))
(define-key-after map [toggle-input-method] (bindings--define-key map [separator-coding-system] menu-bar-separator)
`(menu-item ,(purecopy "Toggle Input Method") toggle-input-method)) (bindings--define-key map [view-hello-file]
(define-key-after map [set-input-method] '(menu-item "Show Multilingual Sample Text" view-hello-file
`(menu-item ,(purecopy "Select Input Method...") set-input-method))
(define-key-after map [describe-input-method]
`(menu-item ,(purecopy "Describe Input Method") describe-input-method))
(define-key-after map [separator-input-method] menu-bar-separator)
(define-key-after map [set-various-coding-system]
`(menu-item ,(purecopy "Set Coding Systems") ,set-coding-system-map
:enable (default-value 'enable-multibyte-characters)))
(define-key-after map [view-hello-file]
`(menu-item ,(purecopy "Show Multilingual Sample Text") view-hello-file
:enable (file-readable-p :enable (file-readable-p
(expand-file-name "HELLO" data-directory)) (expand-file-name "HELLO" data-directory))
:help ,(purecopy "Demonstrate various character sets"))) :help "Demonstrate various character sets"))
(define-key-after map [separator-coding-system] menu-bar-separator) (bindings--define-key map [set-various-coding-system]
`(menu-item "Set Coding Systems" ,set-coding-system-map
:enable (default-value 'enable-multibyte-characters)))
(define-key-after map [describe-language-environment] (bindings--define-key map [separator-input-method] menu-bar-separator)
`(menu-item ,(purecopy "Describe Language Environment") (bindings--define-key map [describe-input-method]
,describe-language-environment-map '(menu-item "Describe Input Method" describe-input-method))
:help ,(purecopy "Show multilingual settings for a specific language"))) (bindings--define-key map [set-input-method]
(define-key-after map [describe-input-method] '(menu-item "Select Input Method..." set-input-method))
`(menu-item ,(purecopy "Describe Input Method...") describe-input-method (bindings--define-key map [toggle-input-method]
:help ,(purecopy "Keyboard layout for a specific input method"))) '(menu-item "Toggle Input Method" toggle-input-method))
(define-key-after map [describe-coding-system]
`(menu-item ,(purecopy "Describe Coding System...") describe-coding-system)) (bindings--define-key map [separator-mule] menu-bar-separator)
(define-key-after map [list-character-sets] (bindings--define-key map [set-language-environment]
`(menu-item ,(purecopy "List Character Sets") list-character-sets `(menu-item "Set Language Environment" ,setup-language-environment-map))
:help ,(purecopy "Show table of available character sets")))
(define-key-after map [mule-diag]
`(menu-item ,(purecopy "Show All Multilingual Settings") mule-diag
:help ,(purecopy "Display multilingual environment settings")))
map) map)
"Keymap for Mule (Multilingual environment) menu specific commands.") "Keymap for Mule (Multilingual environment) menu specific commands.")

View file

@ -61,7 +61,7 @@
(if (eq t purify-flag) (if (eq t purify-flag)
;; Hash consing saved around 11% of pure space in my tests. ;; Hash consing saved around 11% of pure space in my tests.
(setq purify-flag (make-hash-table :test 'equal))) (setq purify-flag (make-hash-table :test 'equal :size 70000)))
(message "Using load-path %s" load-path) (message "Using load-path %s" load-path)

File diff suppressed because it is too large Load diff

View file

@ -763,48 +763,47 @@ a previously found match."
(defvar occur-menu-map (defvar occur-menu-map
(let ((map (make-sparse-keymap))) (let ((map (make-sparse-keymap)))
(define-key map [next-error-follow-minor-mode] (bindings--define-key map [next-error-follow-minor-mode]
`(menu-item ,(purecopy "Auto Occurrence Display") '(menu-item "Auto Occurrence Display"
next-error-follow-minor-mode next-error-follow-minor-mode
:help ,(purecopy :help "Display another occurrence when moving the cursor"
"Display another occurrence when moving the cursor")
:button (:toggle . (and (boundp 'next-error-follow-minor-mode) :button (:toggle . (and (boundp 'next-error-follow-minor-mode)
next-error-follow-minor-mode)))) next-error-follow-minor-mode))))
(define-key map [separator-1] menu-bar-separator) (bindings--define-key map [separator-1] menu-bar-separator)
(define-key map [kill-this-buffer] (bindings--define-key map [kill-this-buffer]
`(menu-item ,(purecopy "Kill Occur Buffer") kill-this-buffer '(menu-item "Kill Occur Buffer" kill-this-buffer
:help ,(purecopy "Kill the current *Occur* buffer"))) :help "Kill the current *Occur* buffer"))
(define-key map [quit-window] (bindings--define-key map [quit-window]
`(menu-item ,(purecopy "Quit Occur Window") quit-window '(menu-item "Quit Occur Window" quit-window
:help ,(purecopy "Quit the current *Occur* buffer. Bury it, and maybe delete the selected frame"))) :help "Quit the current *Occur* buffer. Bury it, and maybe delete the selected frame"))
(define-key map [revert-buffer] (bindings--define-key map [revert-buffer]
`(menu-item ,(purecopy "Revert Occur Buffer") revert-buffer '(menu-item "Revert Occur Buffer" revert-buffer
:help ,(purecopy "Replace the text in the *Occur* buffer with the results of rerunning occur"))) :help "Replace the text in the *Occur* buffer with the results of rerunning occur"))
(define-key map [clone-buffer] (bindings--define-key map [clone-buffer]
`(menu-item ,(purecopy "Clone Occur Buffer") clone-buffer '(menu-item "Clone Occur Buffer" clone-buffer
:help ,(purecopy "Create and return a twin copy of the current *Occur* buffer"))) :help "Create and return a twin copy of the current *Occur* buffer"))
(define-key map [occur-rename-buffer] (bindings--define-key map [occur-rename-buffer]
`(menu-item ,(purecopy "Rename Occur Buffer") occur-rename-buffer '(menu-item "Rename Occur Buffer" occur-rename-buffer
:help ,(purecopy "Rename the current *Occur* buffer to *Occur: original-buffer-name*."))) :help "Rename the current *Occur* buffer to *Occur: original-buffer-name*."))
(define-key map [occur-edit-buffer] (bindings--define-key map [occur-edit-buffer]
`(menu-item ,(purecopy "Edit Occur Buffer") occur-edit-mode '(menu-item "Edit Occur Buffer" occur-edit-mode
:help ,(purecopy "Edit the *Occur* buffer and apply changes to the original buffers."))) :help "Edit the *Occur* buffer and apply changes to the original buffers."))
(define-key map [separator-2] menu-bar-separator) (bindings--define-key map [separator-2] menu-bar-separator)
(define-key map [occur-mode-goto-occurrence-other-window] (bindings--define-key map [occur-mode-goto-occurrence-other-window]
`(menu-item ,(purecopy "Go To Occurrence Other Window") occur-mode-goto-occurrence-other-window '(menu-item "Go To Occurrence Other Window" occur-mode-goto-occurrence-other-window
:help ,(purecopy "Go to the occurrence the current line describes, in another window"))) :help "Go to the occurrence the current line describes, in another window"))
(define-key map [occur-mode-goto-occurrence] (bindings--define-key map [occur-mode-goto-occurrence]
`(menu-item ,(purecopy "Go To Occurrence") occur-mode-goto-occurrence '(menu-item "Go To Occurrence" occur-mode-goto-occurrence
:help ,(purecopy "Go to the occurrence the current line describes"))) :help "Go to the occurrence the current line describes"))
(define-key map [occur-mode-display-occurrence] (bindings--define-key map [occur-mode-display-occurrence]
`(menu-item ,(purecopy "Display Occurrence") occur-mode-display-occurrence '(menu-item "Display Occurrence" occur-mode-display-occurrence
:help ,(purecopy "Display in another window the occurrence the current line describes"))) :help "Display in another window the occurrence the current line describes"))
(define-key map [occur-next] (bindings--define-key map [occur-next]
`(menu-item ,(purecopy "Move to Next Match") occur-next '(menu-item "Move to Next Match" occur-next
:help ,(purecopy "Move to the Nth (default 1) next match in an Occur mode buffer"))) :help "Move to the Nth (default 1) next match in an Occur mode buffer"))
(define-key map [occur-prev] (bindings--define-key map [occur-prev]
`(menu-item ,(purecopy "Move to Previous Match") occur-prev '(menu-item "Move to Previous Match" occur-prev
:help ,(purecopy "Move to the Nth (default 1) previous match in an Occur mode buffer"))) :help "Move to the Nth (default 1) previous match in an Occur mode buffer"))
map) map)
"Menu keymap for `occur-mode'.") "Menu keymap for `occur-mode'.")
@ -822,7 +821,7 @@ a previously found match."
(define-key map "r" 'occur-rename-buffer) (define-key map "r" 'occur-rename-buffer)
(define-key map "c" 'clone-buffer) (define-key map "c" 'clone-buffer)
(define-key map "\C-c\C-f" 'next-error-follow-minor-mode) (define-key map "\C-c\C-f" 'next-error-follow-minor-mode)
(define-key map [menu-bar occur] (cons (purecopy "Occur") occur-menu-map)) (bindings--define-key map [menu-bar occur] (cons "Occur" occur-menu-map))
map) map)
"Keymap for `occur-mode'.") "Keymap for `occur-mode'.")
@ -870,7 +869,7 @@ Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it.
(define-key map "\C-c\C-c" 'occur-cease-edit) (define-key map "\C-c\C-c" 'occur-cease-edit)
(define-key map "\C-o" 'occur-mode-display-occurrence) (define-key map "\C-o" 'occur-mode-display-occurrence)
(define-key map "\C-c\C-f" 'next-error-follow-minor-mode) (define-key map "\C-c\C-f" 'next-error-follow-minor-mode)
(define-key map [menu-bar occur] (cons (purecopy "Occur") occur-menu-map)) (bindings--define-key map [menu-bar occur] (cons "Occur" occur-menu-map))
map) map)
"Keymap for `occur-edit-mode'.") "Keymap for `occur-edit-mode'.")

View file

@ -947,66 +947,66 @@ current, and kill the buffer that visits the link."
(let ((map (make-sparse-keymap "Version Control"))) (let ((map (make-sparse-keymap "Version Control")))
;;(define-key map [show-files] ;;(define-key map [show-files]
;; '("Show Files under VC" . (vc-directory t))) ;; '("Show Files under VC" . (vc-directory t)))
(define-key map [vc-retrieve-tag] (bindings--define-key map [vc-retrieve-tag]
`(menu-item ,(purecopy "Retrieve Tag") vc-retrieve-tag '(menu-item "Retrieve Tag" vc-retrieve-tag
:help ,(purecopy "Retrieve tagged version or branch"))) :help "Retrieve tagged version or branch"))
(define-key map [vc-create-tag] (bindings--define-key map [vc-create-tag]
`(menu-item ,(purecopy "Create Tag") vc-create-tag '(menu-item "Create Tag" vc-create-tag
:help ,(purecopy "Create version tag"))) :help "Create version tag"))
(define-key map [separator1] menu-bar-separator) (bindings--define-key map [separator1] menu-bar-separator)
(define-key map [vc-annotate] (bindings--define-key map [vc-annotate]
`(menu-item ,(purecopy "Annotate") vc-annotate '(menu-item "Annotate" vc-annotate
:help ,(purecopy "Display the edit history of the current file using colors"))) :help "Display the edit history of the current file using colors"))
(define-key map [vc-rename-file] (bindings--define-key map [vc-rename-file]
`(menu-item ,(purecopy "Rename File") vc-rename-file '(menu-item "Rename File" vc-rename-file
:help ,(purecopy "Rename file"))) :help "Rename file"))
(define-key map [vc-revision-other-window] (bindings--define-key map [vc-revision-other-window]
`(menu-item ,(purecopy "Show Other Version") vc-revision-other-window '(menu-item "Show Other Version" vc-revision-other-window
:help ,(purecopy "Visit another version of the current file in another window"))) :help "Visit another version of the current file in another window"))
(define-key map [vc-diff] (bindings--define-key map [vc-diff]
`(menu-item ,(purecopy "Compare with Base Version") vc-diff '(menu-item "Compare with Base Version" vc-diff
:help ,(purecopy "Compare file set with the base version"))) :help "Compare file set with the base version"))
(define-key map [vc-root-diff] (bindings--define-key map [vc-root-diff]
`(menu-item ,(purecopy "Compare Tree with Base Version") vc-root-diff '(menu-item "Compare Tree with Base Version" vc-root-diff
:help ,(purecopy "Compare current tree with the base version"))) :help "Compare current tree with the base version"))
(define-key map [vc-update-change-log] (bindings--define-key map [vc-update-change-log]
`(menu-item ,(purecopy "Update ChangeLog") vc-update-change-log '(menu-item "Update ChangeLog" vc-update-change-log
:help ,(purecopy "Find change log file and add entries from recent version control logs"))) :help "Find change log file and add entries from recent version control logs"))
(define-key map [vc-log-out] (bindings--define-key map [vc-log-out]
`(menu-item ,(purecopy "Show Outgoing Log") vc-log-outgoing '(menu-item "Show Outgoing Log" vc-log-outgoing
:help ,(purecopy "Show a log of changes that will be sent with a push operation"))) :help "Show a log of changes that will be sent with a push operation"))
(define-key map [vc-log-in] (bindings--define-key map [vc-log-in]
`(menu-item ,(purecopy "Show Incoming Log") vc-log-incoming '(menu-item "Show Incoming Log" vc-log-incoming
:help ,(purecopy "Show a log of changes that will be received with a pull operation"))) :help "Show a log of changes that will be received with a pull operation"))
(define-key map [vc-print-log] (bindings--define-key map [vc-print-log]
`(menu-item ,(purecopy "Show History") vc-print-log '(menu-item "Show History" vc-print-log
:help ,(purecopy "List the change log of the current file set in a window"))) :help "List the change log of the current file set in a window"))
(define-key map [vc-print-root-log] (bindings--define-key map [vc-print-root-log]
`(menu-item ,(purecopy "Show Top of the Tree History ") vc-print-root-log '(menu-item "Show Top of the Tree History " vc-print-root-log
:help ,(purecopy "List the change log for the current tree in a window"))) :help "List the change log for the current tree in a window"))
(define-key map [separator2] menu-bar-separator) (bindings--define-key map [separator2] menu-bar-separator)
(define-key map [vc-insert-header] (bindings--define-key map [vc-insert-header]
`(menu-item ,(purecopy "Insert Header") vc-insert-headers '(menu-item "Insert Header" vc-insert-headers
:help ,(purecopy "Insert headers into a file for use with a version control system. :help "Insert headers into a file for use with a version control system.
"))) "))
(define-key map [undo] (bindings--define-key map [undo]
`(menu-item ,(purecopy "Undo Last Check-In") vc-rollback '(menu-item "Undo Last Check-In" vc-rollback
:help ,(purecopy "Remove the most recent changeset committed to the repository"))) :help "Remove the most recent changeset committed to the repository"))
(define-key map [vc-revert] (bindings--define-key map [vc-revert]
`(menu-item ,(purecopy "Revert to Base Version") vc-revert '(menu-item "Revert to Base Version" vc-revert
:help ,(purecopy "Revert working copies of the selected file set to their repository contents"))) :help "Revert working copies of the selected file set to their repository contents"))
(define-key map [vc-update] (bindings--define-key map [vc-update]
`(menu-item ,(purecopy "Update to Latest Version") vc-update '(menu-item "Update to Latest Version" vc-update
:help ,(purecopy "Update the current fileset's files to their tip revisions"))) :help "Update the current fileset's files to their tip revisions"))
(define-key map [vc-next-action] (bindings--define-key map [vc-next-action]
`(menu-item ,(purecopy "Check In/Out") vc-next-action '(menu-item "Check In/Out" vc-next-action
:help ,(purecopy "Do the next logical version control operation on the current fileset"))) :help "Do the next logical version control operation on the current fileset"))
(define-key map [vc-register] (bindings--define-key map [vc-register]
`(menu-item ,(purecopy "Register") vc-register '(menu-item "Register" vc-register
:help ,(purecopy "Register file set into a version control system"))) :help "Register file set into a version control system"))
(define-key map [vc-dir] (bindings--define-key map [vc-dir]
`(menu-item ,(purecopy "VC Dir") vc-dir '(menu-item "VC Dir" vc-dir
:help ,(purecopy "Show the VC status of files in a directory"))) :help "Show the VC status of files in a directory"))
map)) map))
(defalias 'vc-menu-map vc-menu-map) (defalias 'vc-menu-map vc-menu-map)

View file

@ -1,3 +1,8 @@
2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
* fns.c (maybe_resize_hash_table): Output message when growing the
purify-hashtable.
2012-06-27 Dmitry Antipov <dmantipov@yandex.ru> 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
* alloc.c (allocate_string_data): Remove dead code. * alloc.c (allocate_string_data): Remove dead code.
@ -29,7 +34,7 @@
2012-06-26 John Wiegley <johnw@newartisans.com> 2012-06-26 John Wiegley <johnw@newartisans.com>
* unexmacosx.c (copy_data_segment): Added two section names used * unexmacosx.c (copy_data_segment): Add two section names used
on Mac OS X Lion: __mod_init_func and __mod_term_func. on Mac OS X Lion: __mod_init_func and __mod_term_func.
* alloc.c (mark_memory): Do not check with -faddress-sanitizer * alloc.c (mark_memory): Do not check with -faddress-sanitizer

View file

@ -517,7 +517,7 @@ DEFUN ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0,
return newcdr; return newcdr;
} }
/* Extract and set components of symbols */ /* Extract and set components of symbols. */
DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0, DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0,
doc: /* Return t if SYMBOL's value is not void. */) doc: /* Return t if SYMBOL's value is not void. */)

View file

@ -3749,6 +3749,17 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h)
if (INDEX_SIZE_BOUND < nsize) if (INDEX_SIZE_BOUND < nsize)
error ("Hash table too large to resize"); error ("Hash table too large to resize");
#ifdef ENABLE_CHECKING
if (HASH_TABLE_P (Vpurify_flag)
&& XHASH_TABLE (Vpurify_flag) == h)
{
Lisp_Object args[2];
args[0] = build_string ("Growing hash table to: %d");
args[1] = make_number (new_size);
Fmessage (2, args);
}
#endif
h->key_and_value = larger_vector (h->key_and_value, h->key_and_value = larger_vector (h->key_and_value,
2 * (new_size - old_size), -1); 2 * (new_size - old_size), -1);
h->next = larger_vector (h->next, new_size - old_size, -1); h->next = larger_vector (h->next, new_size - old_size, -1);

View file

@ -47,9 +47,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifndef PURESIZE_RATIO #ifndef PURESIZE_RATIO
#if EMACS_INT_MAX >> 31 != 0 #if EMACS_INT_MAX >> 31 != 0
#if PTRDIFF_MAX >> 31 != 0 #if PTRDIFF_MAX >> 31 != 0
#define PURESIZE_RATIO 10/6 /* Don't surround with `()'. */ #define PURESIZE_RATIO 10 / 6 /* Don't surround with `()'. */
#else #else
#define PURESIZE_RATIO 8/6 /* Don't surround with `()'. */ #define PURESIZE_RATIO 8 / 6 /* Don't surround with `()'. */
#endif #endif
#else #else
#define PURESIZE_RATIO 1 #define PURESIZE_RATIO 1
@ -60,7 +60,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* ENABLE_CHECKING somehow increases the purespace used, probably because /* ENABLE_CHECKING somehow increases the purespace used, probably because
it tends to cause some macro arguments to be evaluated twice. This is it tends to cause some macro arguments to be evaluated twice. This is
a bug, but it's difficult to track it down. */ a bug, but it's difficult to track it down. */
#define PURESIZE_CHECKING_RATIO 12/10 /* Don't surround with `()'. */ #define PURESIZE_CHECKING_RATIO 12 / 10 /* Don't surround with `()'. */
#else #else
#define PURESIZE_CHECKING_RATIO 1 #define PURESIZE_CHECKING_RATIO 1
#endif #endif