diff options
Diffstat (limited to 'lisp/replace.el')
| -rw-r--r-- | lisp/replace.el | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index fb98a714dff..ee430fd9855 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -928,7 +928,7 @@ To return to ordinary Occur mode, use \\[occur-mode]." | |||
| 928 | 928 | ||
| 929 | (defalias 'occur-mode-mouse-goto 'occur-mode-goto-occurrence) | 929 | (defalias 'occur-mode-mouse-goto 'occur-mode-goto-occurrence) |
| 930 | (defun occur-mode-goto-occurrence (&optional event) | 930 | (defun occur-mode-goto-occurrence (&optional event) |
| 931 | "Go to the occurrence the current line describes." | 931 | "Go to the occurrence on the current line." |
| 932 | (interactive (list last-nonmenu-event)) | 932 | (interactive (list last-nonmenu-event)) |
| 933 | (let ((pos | 933 | (let ((pos |
| 934 | (if (null event) | 934 | (if (null event) |
| @@ -939,10 +939,8 @@ To return to ordinary Occur mode, use \\[occur-mode]." | |||
| 939 | (with-current-buffer (window-buffer (posn-window (event-end event))) | 939 | (with-current-buffer (window-buffer (posn-window (event-end event))) |
| 940 | (save-excursion | 940 | (save-excursion |
| 941 | (goto-char (posn-point (event-end event))) | 941 | (goto-char (posn-point (event-end event))) |
| 942 | (occur-mode-find-occurrence))))) | 942 | (occur-mode-find-occurrence)))))) |
| 943 | same-window-buffer-names | 943 | (pop-to-buffer (marker-buffer pos) t) |
| 944 | same-window-regexps) | ||
| 945 | (pop-to-buffer (marker-buffer pos)) | ||
| 946 | (goto-char pos) | 944 | (goto-char pos) |
| 947 | (run-hooks 'occur-mode-find-occurrence-hook))) | 945 | (run-hooks 'occur-mode-find-occurrence-hook))) |
| 948 | 946 | ||
| @@ -958,11 +956,8 @@ To return to ordinary Occur mode, use \\[occur-mode]." | |||
| 958 | "Display in another window the occurrence the current line describes." | 956 | "Display in another window the occurrence the current line describes." |
| 959 | (interactive) | 957 | (interactive) |
| 960 | (let ((pos (occur-mode-find-occurrence)) | 958 | (let ((pos (occur-mode-find-occurrence)) |
| 961 | window | 959 | window) |
| 962 | ;; Bind these to ensure `display-buffer' puts it in another window. | 960 | (setq window (display-buffer (marker-buffer pos) t)) |
| 963 | same-window-buffer-names | ||
| 964 | same-window-regexps) | ||
| 965 | (setq window (display-buffer (marker-buffer pos))) | ||
| 966 | ;; This is the way to set point in the proper window. | 961 | ;; This is the way to set point in the proper window. |
| 967 | (save-selected-window | 962 | (save-selected-window |
| 968 | (select-window window) | 963 | (select-window window) |