unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Disable same window pop-to-buffer in Occur buffers
@ 2005-10-28 22:07 Juri Linkov
  2005-10-29  5:13 ` Richard M. Stallman
  0 siblings, 1 reply; 3+ messages in thread
From: Juri Linkov @ 2005-10-28 22:07 UTC (permalink / raw)


`occur-mode-mouse-goto' and `occur-mode-goto-occurrence' switch the
buffer in the same window when the buffer name is matched by
`same-window-...' variables.  There is a special command
`occur-mode-goto-occurrence-other-window' that selects the buffer in
another window, so I think these command should disregard the values
of `same-window-...':

Index: lisp/replace.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/replace.el,v
retrieving revision 1.227
diff -c -r1.227 replace.el
*** lisp/replace.el	27 Oct 2005 18:22:00 -0000	1.227
--- lisp/replace.el	28 Oct 2005 22:05:42 -0000
***************
*** 755,761 ****
        (save-excursion
  	(goto-char (posn-point (event-end event)))
  	(setq pos (occur-mode-find-occurrence))))
!     (pop-to-buffer (marker-buffer pos))
      (goto-char pos)))
  
  (defun occur-mode-find-occurrence ()
--- 755,763 ----
        (save-excursion
  	(goto-char (posn-point (event-end event)))
  	(setq pos (occur-mode-find-occurrence))))
!     (let (same-window-buffer-names
! 	  same-window-regexps)
!       (pop-to-buffer (marker-buffer pos)))
      (goto-char pos)))
  
  (defun occur-mode-find-occurrence ()
***************
*** 769,775 ****
  (defun occur-mode-goto-occurrence ()
    "Go to the occurrence the current line describes."
    (interactive)
!   (let ((pos (occur-mode-find-occurrence)))
      (pop-to-buffer (marker-buffer pos))
      (goto-char pos)))
  
--- 771,779 ----
  (defun occur-mode-goto-occurrence ()
    "Go to the occurrence the current line describes."
    (interactive)
!   (let ((pos (occur-mode-find-occurrence))
! 	same-window-buffer-names
! 	same-window-regexps)
      (pop-to-buffer (marker-buffer pos))
      (goto-char pos)))
  

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Disable same window pop-to-buffer in Occur buffers
  2005-10-28 22:07 Disable same window pop-to-buffer in Occur buffers Juri Linkov
@ 2005-10-29  5:13 ` Richard M. Stallman
  2005-11-09  9:33   ` Juri Linkov
  0 siblings, 1 reply; 3+ messages in thread
From: Richard M. Stallman @ 2005-10-29  5:13 UTC (permalink / raw)
  Cc: emacs-devel

occur-mode-goto-occurrence should always go to the SAME window.  Your
change ought to make it always go to another window, which is not
correct.

So this ought to be the correct fix.  It makes these commands in Occur
buffers work compatibly with Dired buffers.

*** replace.el	27 Oct 2005 16:30:12 -0400	1.227
--- replace.el	28 Oct 2005 21:11:51 -0400	
***************
*** 755,761 ****
        (save-excursion
  	(goto-char (posn-point (event-end event)))
  	(setq pos (occur-mode-find-occurrence))))
!     (pop-to-buffer (marker-buffer pos))
      (goto-char pos)))
  
  (defun occur-mode-find-occurrence ()
--- 755,761 ----
        (save-excursion
  	(goto-char (posn-point (event-end event)))
  	(setq pos (occur-mode-find-occurrence))))
!     (switch-to-buffer-other-window (marker-buffer pos))
      (goto-char pos)))
  
  (defun occur-mode-find-occurrence ()
***************
*** 770,776 ****
    "Go to the occurrence the current line describes."
    (interactive)
    (let ((pos (occur-mode-find-occurrence)))
!     (pop-to-buffer (marker-buffer pos))
      (goto-char pos)))
  
  (defun occur-mode-goto-occurrence-other-window ()
--- 770,776 ----
    "Go to the occurrence the current line describes."
    (interactive)
    (let ((pos (occur-mode-find-occurrence)))
!     (switch-to-buffer (marker-buffer pos))
      (goto-char pos)))
  
  (defun occur-mode-goto-occurrence-other-window ()

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Disable same window pop-to-buffer in Occur buffers
  2005-10-29  5:13 ` Richard M. Stallman
@ 2005-11-09  9:33   ` Juri Linkov
  0 siblings, 0 replies; 3+ messages in thread
From: Juri Linkov @ 2005-11-09  9:33 UTC (permalink / raw)
  Cc: emacs-devel

> occur-mode-goto-occurrence should always go to the SAME window.  Your
> change ought to make it always go to another window, which is not
> correct.

Unfortunately, the current CVS state of `occur' is broken.  Mouse-2
clicked on the *Occur* buffer works unreliably: when point is in the
source buffer's window, it switches the buffer in the Occur buffer.
But when point initially was in the Occur buffer, it goes to the
occurrence in the window with the source buffer.

> So this ought to be the correct fix.  It makes these commands in
> Occur buffers work compatibly with Dired buffers.

I think the correct analogy for Occur buffers is not Dired buffers,
but rather Compilation and Grep buffers.  Occur behaves in the same way
as compilation and grep: the user calls this command, and it outputs
results in another window.  After that the user can type a key bound
to `next-error', or select the window with search results and type
`RET' or `C-c C-c' (like in compilation and grep buffers) to visit
the result in the source buffer's window.  In any case, both windows
(source buffer's window and occur buffer's window) remain visible.

But when `RET' in the Occur buffer switches the buffer in the same
window, this causes the source buffer to be displayed in two windows.
This is very inconvenient.

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-11-09  9:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-28 22:07 Disable same window pop-to-buffer in Occur buffers Juri Linkov
2005-10-29  5:13 ` Richard M. Stallman
2005-11-09  9:33   ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).