aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorStefan Monnier2012-06-27 17:15:13 -0400
committerStefan Monnier2012-06-27 17:15:13 -0400
commit1ec4b7b25979ff9ea72a3ea35bf35d5882f467f7 (patch)
tree7d3f3d3ef4a151e8a2b93b653692a4a652d2a720 /lisp/replace.el
parente309e2a56606ef774c5c366f74ea17ced46da065 (diff)
downloademacs-1ec4b7b25979ff9ea72a3ea35bf35d5882f467f7.tar.gz
emacs-1ec4b7b25979ff9ea72a3ea35bf35d5882f467f7.zip
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.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el81
1 files changed, 40 insertions, 41 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index ad87d474b8b..5baf68224c4 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -763,48 +763,47 @@ a previously found match."
763 763
764(defvar occur-menu-map 764(defvar occur-menu-map
765 (let ((map (make-sparse-keymap))) 765 (let ((map (make-sparse-keymap)))
766 (define-key map [next-error-follow-minor-mode] 766 (bindings--define-key map [next-error-follow-minor-mode]
767 `(menu-item ,(purecopy "Auto Occurrence Display") 767 '(menu-item "Auto Occurrence Display"
768 next-error-follow-minor-mode 768 next-error-follow-minor-mode
769 :help ,(purecopy 769 :help "Display another occurrence when moving the cursor"
770 "Display another occurrence when moving the cursor")
771 :button (:toggle . (and (boundp 'next-error-follow-minor-mode) 770 :button (:toggle . (and (boundp 'next-error-follow-minor-mode)
772 next-error-follow-minor-mode)))) 771 next-error-follow-minor-mode))))
773 (define-key map [separator-1] menu-bar-separator) 772 (bindings--define-key map [separator-1] menu-bar-separator)
774 (define-key map [kill-this-buffer] 773 (bindings--define-key map [kill-this-buffer]
775 `(menu-item ,(purecopy "Kill Occur Buffer") kill-this-buffer 774 '(menu-item "Kill Occur Buffer" kill-this-buffer
776 :help ,(purecopy "Kill the current *Occur* buffer"))) 775 :help "Kill the current *Occur* buffer"))
777 (define-key map [quit-window] 776 (bindings--define-key map [quit-window]
778 `(menu-item ,(purecopy "Quit Occur Window") quit-window 777 '(menu-item "Quit Occur Window" quit-window
779 :help ,(purecopy "Quit the current *Occur* buffer. Bury it, and maybe delete the selected frame"))) 778 :help "Quit the current *Occur* buffer. Bury it, and maybe delete the selected frame"))
780 (define-key map [revert-buffer] 779 (bindings--define-key map [revert-buffer]
781 `(menu-item ,(purecopy "Revert Occur Buffer") revert-buffer 780 '(menu-item "Revert Occur Buffer" revert-buffer
782 :help ,(purecopy "Replace the text in the *Occur* buffer with the results of rerunning occur"))) 781 :help "Replace the text in the *Occur* buffer with the results of rerunning occur"))
783 (define-key map [clone-buffer] 782 (bindings--define-key map [clone-buffer]
784 `(menu-item ,(purecopy "Clone Occur Buffer") clone-buffer 783 '(menu-item "Clone Occur Buffer" clone-buffer
785 :help ,(purecopy "Create and return a twin copy of the current *Occur* buffer"))) 784 :help "Create and return a twin copy of the current *Occur* buffer"))
786 (define-key map [occur-rename-buffer] 785 (bindings--define-key map [occur-rename-buffer]
787 `(menu-item ,(purecopy "Rename Occur Buffer") occur-rename-buffer 786 '(menu-item "Rename Occur Buffer" occur-rename-buffer
788 :help ,(purecopy "Rename the current *Occur* buffer to *Occur: original-buffer-name*."))) 787 :help "Rename the current *Occur* buffer to *Occur: original-buffer-name*."))
789 (define-key map [occur-edit-buffer] 788 (bindings--define-key map [occur-edit-buffer]
790 `(menu-item ,(purecopy "Edit Occur Buffer") occur-edit-mode 789 '(menu-item "Edit Occur Buffer" occur-edit-mode
791 :help ,(purecopy "Edit the *Occur* buffer and apply changes to the original buffers."))) 790 :help "Edit the *Occur* buffer and apply changes to the original buffers."))
792 (define-key map [separator-2] menu-bar-separator) 791 (bindings--define-key map [separator-2] menu-bar-separator)
793 (define-key map [occur-mode-goto-occurrence-other-window] 792 (bindings--define-key map [occur-mode-goto-occurrence-other-window]
794 `(menu-item ,(purecopy "Go To Occurrence Other Window") occur-mode-goto-occurrence-other-window 793 '(menu-item "Go To Occurrence Other Window" occur-mode-goto-occurrence-other-window
795 :help ,(purecopy "Go to the occurrence the current line describes, in another window"))) 794 :help "Go to the occurrence the current line describes, in another window"))
796 (define-key map [occur-mode-goto-occurrence] 795 (bindings--define-key map [occur-mode-goto-occurrence]
797 `(menu-item ,(purecopy "Go To Occurrence") occur-mode-goto-occurrence 796 '(menu-item "Go To Occurrence" occur-mode-goto-occurrence
798 :help ,(purecopy "Go to the occurrence the current line describes"))) 797 :help "Go to the occurrence the current line describes"))
799 (define-key map [occur-mode-display-occurrence] 798 (bindings--define-key map [occur-mode-display-occurrence]
800 `(menu-item ,(purecopy "Display Occurrence") occur-mode-display-occurrence 799 '(menu-item "Display Occurrence" occur-mode-display-occurrence
801 :help ,(purecopy "Display in another window the occurrence the current line describes"))) 800 :help "Display in another window the occurrence the current line describes"))
802 (define-key map [occur-next] 801 (bindings--define-key map [occur-next]
803 `(menu-item ,(purecopy "Move to Next Match") occur-next 802 '(menu-item "Move to Next Match" occur-next
804 :help ,(purecopy "Move to the Nth (default 1) next match in an Occur mode buffer"))) 803 :help "Move to the Nth (default 1) next match in an Occur mode buffer"))
805 (define-key map [occur-prev] 804 (bindings--define-key map [occur-prev]
806 `(menu-item ,(purecopy "Move to Previous Match") occur-prev 805 '(menu-item "Move to Previous Match" occur-prev
807 :help ,(purecopy "Move to the Nth (default 1) previous match in an Occur mode buffer"))) 806 :help "Move to the Nth (default 1) previous match in an Occur mode buffer"))
808 map) 807 map)
809 "Menu keymap for `occur-mode'.") 808 "Menu keymap for `occur-mode'.")
810 809
@@ -822,7 +821,7 @@ a previously found match."
822 (define-key map "r" 'occur-rename-buffer) 821 (define-key map "r" 'occur-rename-buffer)
823 (define-key map "c" 'clone-buffer) 822 (define-key map "c" 'clone-buffer)
824 (define-key map "\C-c\C-f" 'next-error-follow-minor-mode) 823 (define-key map "\C-c\C-f" 'next-error-follow-minor-mode)
825 (define-key map [menu-bar occur] (cons (purecopy "Occur") occur-menu-map)) 824 (bindings--define-key map [menu-bar occur] (cons "Occur" occur-menu-map))
826 map) 825 map)
827 "Keymap for `occur-mode'.") 826 "Keymap for `occur-mode'.")
828 827
@@ -870,7 +869,7 @@ Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it.
870 (define-key map "\C-c\C-c" 'occur-cease-edit) 869 (define-key map "\C-c\C-c" 'occur-cease-edit)
871 (define-key map "\C-o" 'occur-mode-display-occurrence) 870 (define-key map "\C-o" 'occur-mode-display-occurrence)
872 (define-key map "\C-c\C-f" 'next-error-follow-minor-mode) 871 (define-key map "\C-c\C-f" 'next-error-follow-minor-mode)
873 (define-key map [menu-bar occur] (cons (purecopy "Occur") occur-menu-map)) 872 (bindings--define-key map [menu-bar occur] (cons "Occur" occur-menu-map))
874 map) 873 map)
875 "Keymap for `occur-edit-mode'.") 874 "Keymap for `occur-edit-mode'.")
876 875