diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-02-09 14:23:10 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-02-09 14:23:10 -0800 |
commit | b3fc7a3e763fb260cd932dc6aedbe7b4c810a73c (patch) | |
tree | 72495a45c9e58f16f6b09448f6956507da6ccf89 /lisp/menu-bar.el | |
parent | c71e7cc113ed0d5f01aaa2e441a3e3c9fbeb9fa5 (diff) | |
parent | 9ffe7ddd5e1ba93f327cfe985e9476571d7a2873 (diff) | |
download | emacs-b3fc7a3e763fb260cd932dc6aedbe7b4c810a73c.tar.gz |
Merge from origin/emacs-25
9ffe7dd * lisp/isearch.el (isearch-define-mode-toggle): Improve logic
16140f7 * lisp/menu-bar.el (menu-bar-options-menu): New search submenu
3db6adb * lisp/isearch.el (search-default-mode)
4ea1ea7 * lisp/isearch.el: Rename search-default-regexp-mode to search-default-mode
c77ffc8 Use monitor's resolution for positioning tooltips
49e5749 Fix file-notify-test on MS-Windows
be1d874 Fix issues found by auditing w32notify code
87ae218 Extend etags Ruby support for accessors
aa35257 Update publicsuffix.txt.
6816bff Ensure that Gnus dribble handling allows removing entries
691feae Be consistent when using encoded strings in nnimap data
3ed423b Display the decoded Gnus group name
5428b5b Use completion-ignore-case instead of defining command
Diffstat (limited to 'lisp/menu-bar.el')
-rw-r--r-- | lisp/menu-bar.el | 57 |
1 files changed, 50 insertions, 7 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 512d65fa580..cc7233e193f 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -244,7 +244,7 @@ (setq menu-bar-last-search-type 'string) ;; Ideally, this whole command would be equivalent to `C-s RET'. (let ((isearch-forward (not backward)) - (isearch-regexp-function search-default-regexp-mode) + (isearch-regexp-function search-default-mode) (isearch-regexp nil)) (if (or (equal string "") (not string)) (funcall (isearch-search-fun-default) (car search-ring)) @@ -1256,6 +1256,52 @@ mail status in mode line")) :enable (not (truncated-partial-width-window-p)))) menu)) +(defvar menu-bar-search-options-menu + (let ((menu (make-sparse-keymap "Search Options"))) + + (dolist (x '((character-fold-to-regexp "Fold Characters" "Character folding") + (isearch-symbol-regexp "Whole Symbols" "Whole symbol") + (word-search-regexp "Whole Words" "Whole word"))) + (bindings--define-key menu (vector (nth 0 x)) + `(menu-item ,(nth 1 x) + (lambda () + (interactive) + (setq search-default-mode #',(nth 0 x)) + (message ,(format "%s search enabled" (nth 2 x)))) + :help ,(format "Enable %s search" (downcase (nth 2 x))) + :button (:radio . (eq search-default-mode #',(nth 0 x)))))) + + (bindings--define-key menu [regexp-search] + '(menu-item "Regular Expression" + (lambda () + (interactive) + (setq search-default-mode t) + (message "Regular-expression search enabled")) + :help "Enable regular-expression search" + :button (:radio . (eq search-default-mode t)))) + + (bindings--define-key menu [regular-search] + '(menu-item "Literal Search" + (lambda () + (interactive) + (when search-default-mode + (setq search-default-mode nil) + (when (symbolp search-default-mode) + (message "Literal search enabled")))) + :help "Disable special search modes" + :button (:radio . (not search-default-mode)))) + + (bindings--define-key menu [custom-separator] + menu-bar-separator) + (bindings--define-key menu [case-fold-search] + (menu-bar-make-toggle + toggle-case-fold-search case-fold-search + "Ignore Case" + "Case-Insensitive Search %s" + "Ignore letter-case in search commands")) + + menu)) + (defvar menu-bar-options-menu (let ((menu (make-sparse-keymap "Options"))) (bindings--define-key menu [customize] @@ -1367,12 +1413,9 @@ mail status in mode line")) (:visible (and (boundp 'cua-enable-cua-keys) (not cua-enable-cua-keys))))) - (bindings--define-key menu [case-fold-search] - (menu-bar-make-toggle - toggle-case-fold-search case-fold-search - "Ignore Case for Search" - "Case-Insensitive Search %s" - "Ignore letter-case in search commands")) + (bindings--define-key menu [search-options] + `(menu-item "Default Search Options" + ,menu-bar-search-options-menu)) (bindings--define-key menu [line-wrapping] `(menu-item "Line Wrapping in This Buffer" |