GNU bug report logs - #32777
27.0.50; window-buffer gets wrong point

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Wed, 19 Sep 2018 23:26:02 UTC

Severity: normal

Found in version 27.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 32777 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Federico Tedin <federicotedin <at> gmail.com>
Cc: 32777 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#32777: 27.0.50; window-buffer gets wrong point
Date: Tue, 02 Oct 2018 06:21:30 +0300
> From: Federico Tedin <federicotedin <at> gmail.com>
> Date: Mon, 1 Oct 2018 23:07:41 -0300
> Cc: 32777 <at> debbugs.gnu.org
> 
> --- a/lisp/simple.el
> +++ b/lisp/simple.el
> @@ -1710,9 +1710,10 @@ read-extended-command
>  	     (lambda ()
>  	       ;; Get a command name at point in the original buffer
>  	       ;; to propose it after M-n.
> -	       (with-current-buffer (window-buffer (minibuffer-selected-window))
> -		 (and (commandp (function-called-at-point))
> -		      (format "%S" (function-called-at-point)))))))
> +	       (with-selected-window (minibuffer-selected-window)
> +                 (with-current-buffer (window-buffer (selected-window))
> +		   (and (commandp (function-called-at-point))
> +		        (format "%S" (function-called-at-point))))))))
>      ;; Read a string, completing from and restricting to the set of
>      ;; all defined commands.  Don't provide any initial input.
>      ;; Save the command read on the extended-command history list.

Can you explain the change?  The minibuffer window is already the
selected window at this point (look at the implementation of
minibuffer-selected-window), so using with-selected-window, which
seems to be the only real change in the above, should be redundant.
Also, with-selected-window makes the window's buffer current, so why
did you need with-current-buffer in addition?  What am I missing?

Thanks.




This bug report was last modified 6 years and 142 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.