diff options
author | John Wiegley <johnw@newartisans.com> | 2015-12-29 21:40:28 -0800 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2015-12-29 21:40:28 -0800 |
commit | 9f2f14a0725211b13a744573344636b57b9c98b9 (patch) | |
tree | 7190e0fb3d4aa06018d8cf997f06b806fb09a9c8 /lisp/menu-bar.el | |
parent | d259328fb87db8cc67d52771efcfa653e52c5b71 (diff) | |
parent | e823c34072bf045800d91e12c7ddb61fa23c6e30 (diff) | |
download | emacs-9f2f14a0725211b13a744573344636b57b9c98b9.tar.gz |
Merge emacs-25 into master (using imerge)
Diffstat (limited to 'lisp/menu-bar.el')
-rw-r--r-- | lisp/menu-bar.el | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index b22c1eab907..1ca783ac43d 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -218,7 +218,7 @@ (cond ((and (eq menu-bar-last-search-type 'string) search-ring) - (search-forward (car search-ring))) + (nonincremental-search-forward)) ((and (eq menu-bar-last-search-type 'regexp) regexp-search-ring) (re-search-forward (car regexp-search-ring))) @@ -231,30 +231,30 @@ (cond ((and (eq menu-bar-last-search-type 'string) search-ring) - (search-backward (car search-ring))) + (nonincremental-search-backward)) ((and (eq menu-bar-last-search-type 'regexp) regexp-search-ring) (re-search-backward (car regexp-search-ring))) (t (error "No previous search")))) -(defun nonincremental-search-forward (string) +(defun nonincremental-search-forward (&optional string backward) "Read a string and search for it nonincrementally." (interactive "sSearch for string: ") (setq menu-bar-last-search-type 'string) - (if (equal string "") - (search-forward (car search-ring)) - (isearch-update-ring string nil) - (search-forward string))) - -(defun nonincremental-search-backward (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 nil)) + (if (or (equal string "") (not string)) + (funcall (isearch-search-fun-default) (car search-ring)) + (isearch-update-ring string nil) + (funcall (isearch-search-fun-default) string)))) + +(defun nonincremental-search-backward (&optional string) "Read a string and search backward for it nonincrementally." - (interactive "sSearch for string: ") - (setq menu-bar-last-search-type 'string) - (if (equal string "") - (search-backward (car search-ring)) - (isearch-update-ring string nil) - (search-backward string))) + (interactive "sSearch backwards for string: ") + (nonincremental-search-forward string 'backward)) (defun nonincremental-re-search-forward (string) "Read a regular expression and search for it nonincrementally." @@ -413,8 +413,8 @@ menu)) (defun menu-bar-goto-uses-etags-p () - (or (not (boundp 'xref-find-function)) - (eq xref-find-function 'etags-xref-find))) + (or (not (boundp 'xref-backend-functions)) + (eq (car xref-backend-functions) 'etags--xref-backend))) (defvar yank-menu (cons (purecopy "Select Yank") nil)) (fset 'yank-menu (cons 'keymap yank-menu)) |