[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C-x v u
From: |
Kevin Rodgers |
Subject: |
Re: C-x v u |
Date: |
Mon, 30 Jun 2003 09:34:32 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 |
Paul Pogonyshev wrote:
This is not actually a bug, but rather a wish for a change.
When i use C-x v u to revert a buffer, Emacs shows changes that
have been made in another window. The problem is that M-next
(M-pgdown) and M-prior (M-pgup) scroll the window with the buffer
being reverted, not the window with changes (as far as i understand
this means that the window with changes is active). Scrolling
changes would be more logical i think.
I agree, but I can't see how to change the relevant code:
(unless (vc-workfile-unchanged-p file)
;; vc-diff selects the new window, which is not what we want:
;; if the new window is on another frame, that'd require the user
;; moving her mouse to answer the yes-or-no-p question.
(let ((win (save-selected-window
(setq status (vc-diff nil t)) (selected-window))))
(vc-exec-after `(message nil))
(when status
(unwind-protect
(unless (yes-or-no-p "Discard changes? ")
(error "Revert canceled"))
(select-window win)
(if (one-window-p t)
(if (window-dedicated-p (selected-window))
(make-frame-invisible))
(delete-window))))))
The problem is that you can't bind minibuffer-scroll-window around the
call to yes-or-no-p like this, because that calls read_minibuf (via
Fread_from_minibuffer ), which resets it to the selected window (which
we don't want to change, as explained in the comment):
(unless (vc-workfile-unchanged-p file)
;; vc-diff selects the new window, which is not what we want:
;; if the new window is on another frame, that'd require the user
;; moving her mouse to answer the yes-or-no-p question.
(let ((win (selected-window))
(status (vc-diff nil t))
(minibuffer-scroll-window (selected-window)))
(when (window-live-p win)
(select-window win))
(vc-exec-after `(message nil))
(when status
(unwind-protect
(unless (yes-or-no-p "Discard changes? ")
(error "Revert canceled"))
(select-window win)
(if (one-window-p t)
(if (window-dedicated-p (selected-window))
(make-frame-invisible))
(delete-window))))))
--
<a href="mailto:<kevin.rodgers@ihs.com>">Kevin Rodgers</a>
- C-x v u, Paul Pogonyshev, 2003/06/28
- Re: C-x v u,
Kevin Rodgers <=