unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>,  Federico Tedin <federicotedin@gmail.com>
Cc: juri@linkov.net, 32777@debbugs.gnu.org
Subject: bug#32777: 27.0.50; window-buffer gets wrong point
Date: Sat, 13 Oct 2018 15:08:08 +0200	[thread overview]
Message-ID: <5BC1EE38.2060906@gmx.at> (raw)
In-Reply-To: <83o9byurtg.fsf@gnu.org>

 > 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





  reply	other threads:[~2018-10-13 13:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19 22:55 bug#32777: 27.0.50; window-buffer gets wrong point Juri Linkov
2018-09-30  4:03 ` Federico Tedin
2018-10-02  2:07   ` Federico Tedin
2018-10-02  3:21     ` Eli Zaretskii
2018-10-02 12:31       ` Federico Tedin
2018-10-13  9:19         ` Eli Zaretskii
2018-10-13 13:08           ` martin rudalics [this message]
2018-10-15  7:56             ` martin rudalics
2018-12-21  0:18               ` Juri Linkov
2018-12-21  9:15                 ` martin rudalics
2018-12-21 16:02                   ` Eli Zaretskii
2018-12-23  9:40                     ` martin rudalics
2018-12-29  9:59                       ` martin rudalics
2018-12-29 23:10                         ` Juri Linkov
2018-12-30  9:49                           ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5BC1EE38.2060906@gmx.at \
    --to=rudalics@gmx.at \
    --cc=32777@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=federicotedin@gmail.com \
    --cc=juri@linkov.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).