emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#12208: closed (yes-or-no-p escapes with-current-bu


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#12208: closed (yes-or-no-p escapes with-current-buffer)
Date: Mon, 27 Aug 2012 09:17:02 +0000

Your message dated Mon, 27 Aug 2012 11:15:21 +0200
with message-id <address@hidden>
and subject line Re: bug#12208: yes-or-no-p escapes with-current-buffer
has caused the debbugs.gnu.org bug report #12208,
regarding yes-or-no-p escapes with-current-buffer
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
12208: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12208
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: yes-or-no-p escapes with-current-buffer Date: Wed, 15 Aug 2012 22:37:47 -0600
Open two buffers "buffer1" and  "buffer2" so that both are visible.

Place the following in each buffer

(with-current-buffer "buffer1"
        (goto-char (point-min))
        (yes-or-no-p "")
        (insert "X"))

C-xC-e from buffer1 places "X" at the beginning of the file, while
C-xC-e from buffer2 places an "X" wherever the point was before moving
from buffer1. This doesn't happen if only one buffer is visible; Nor
does it happen if we replace "yes-or-no-p" with "y-or-n-p".
This happens on both 23.3.1 and 24.1.



--- End Message ---
--- Begin Message --- Subject: Re: bug#12208: yes-or-no-p escapes with-current-buffer Date: Mon, 27 Aug 2012 11:15:21 +0200
=== modified file 'src/window.c'
--- src/window.c    2012-08-18 06:06:39 +0000
+++ src/window.c    2012-08-18 13:09:15 +0000
@@ -5889,7 +5889,13 @@
     }

   if (!NILP (new_current_buffer))
-    Fset_buffer (new_current_buffer);
+    {
+      Fset_buffer (new_current_buffer);
+      /* If the new current buffer doesn't appear in the selected
+     window, go to its old point.  */
+ if (!EQ (XWINDOW (data->current_window)->buffer, new_current_buffer))
+    Fgoto_char (make_number (old_point));
+    }

   Vminibuf_scroll_window = data->minibuf_scroll_window;
   minibuf_selected_window = data->minibuf_selected_window;

Installed in revision 109789 on trunk.  Bug closed.

martin



--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]