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


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>,  Federico Tedin <federicotedin <at> gmail.com>
Cc: 32777 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: bug#32777: 27.0.50; window-buffer gets wrong point
Date: Sat, 13 Oct 2018 15:08:08 +0200
> Martin, any comments?

+	       (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))))))))

The

+                 (with-current-buffer (window-buffer (selected-window))

should be superfluous by all our rules but we know too well how valid
these rules sometimes are.  Any other patch (for example, using an
idiom like (window-point (minibuffer-selected-window))) would be likely
longer than Federico's solution.

It would be interesting to find out why the patch works.  Federico's
earlier remark

  The problem is that when "with-current-buffer" is called with the
  resulting buffer, it that buffer has been opened on more than one
  window, the active window will be set according to a criteria which I
  haven't figured out yet, but not necessarily to the same exact window
  "minibuffer-selected-window" returned.

can't be the cause IMO because 'with-current-buffer' does not set the
"active window" and the value of point of the buffer made current
remains the previous value of point in that buffer and that should be
the value assigned by this step

4.3. put point on "next-error", type M-x M-n,

of Juri's scenario.  So far I'm clueless.

martin




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.