From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: C-x v u Date: Mon, 30 Jun 2003 09:34:32 -0600 Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3F005888.9050609@yahoo.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1056988109 8900 80.91.224.249 (30 Jun 2003 15:48:29 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 30 Jun 2003 15:48:29 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 30 17:48:27 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19X0pg-0001ta-00 for ; Mon, 30 Jun 2003 17:44:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19X0pD-0004nS-AZ for gnu-bug-gnu-emacs@m.gmane.org; Mon, 30 Jun 2003 11:44:15 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19X0jS-0002WY-UX for bug-gnu-emacs@prep.ai.mit.edu; Mon, 30 Jun 2003 11:38:18 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19X0jK-0002St-Oo for bug-gnu-emacs@prep.ai.mit.edu; Mon, 30 Jun 2003 11:38:11 -0400 Original-Received: from chi6-1.relay.mail.uu.net ([199.171.54.98]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19X0fs-0001HY-2d for bug-gnu-emacs@prep.ai.mit.edu; Mon, 30 Jun 2003 11:34:36 -0400 Original-Received: from mail.fu-berlin.de by chi6sosrv13.alter.net with ESMTP (peer crosschecked as: mail.fu-berlin.de [160.45.11.165]) id QQovik04115 for ; Mon, 30 Jun 2003 15:34:35 GMT Original-Received: by mail.fu-berlin.de (Smail3.2.0.98) from Curry.ZEDAT.FU-Berlin.DE (160.45.10.36) with esmtp id ; Mon, 30 Jun 2003 17:34:31 +0200 (MEST) Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.fu-berlin.de with bsmtp id ; Mon, 30 Jun 2003 17:34:31 +0200 (MEST) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: 170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 59 X-Orig-NNTP-Posting-Host: 170.207.51.80 X-Orig-X-Trace: fu-berlin.de 1056987270 32815802 170.207.51.80 (16 [82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:5428 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:5428 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)))))) -- Kevin Rodgers