From: martin rudalics <rudalics@gmx.at>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: 12766@debbugs.gnu.org
Subject: bug#12766: read-from-minibuffer does not preserve current-buffer
Date: Tue, 30 Oct 2012 11:27:58 +0100 [thread overview]
Message-ID: <508FABAE.4050104@gmx.at> (raw)
In-Reply-To: <jwvhapdnhsm.fsf@faina.iro.umontreal.ca>
> % src/emacs -Q --eval "(setq initial-frame-alist '((minibuffer . nil)))"
> M-: (with-temp-buffer (list (read-string "toto: ") (current-buffer))) RET
>
> In Emacs 24.2 this always shows the current-buffer to be the temp buffer
> (which is a killed buffer by the time M-: prints its result).
> But in Emacs trunk, the result depends on whether you issue the M-:
> from the normal frame (where it works right) or from the special
> minibuffer-only frame, where current-buffer after read-string is
> *minibuf-0*!
>
> This is a serious problem, which introduces subtle bugs that can be
> pretty difficult to track down.
Two changes I made could be involved:
(1) `select-window' now always makes the window's buffer current.
(2) read_minibuf now calls set_window_buffer instead of
Fset_window_buffer.
And there's also bug#10851 where `read-char-by-name' could change the
current buffer.
Also, is this related to the comment
;; FIXME: kill-buffer can change current-buffer in some odd cases.
in `with-temp-buffer'?
martin
next prev parent reply other threads:[~2012-10-30 10:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-29 20:29 bug#12766: read-from-minibuffer does not preserve current-buffer Stefan Monnier
2012-10-30 10:27 ` martin rudalics [this message]
2012-10-30 13:51 ` Stefan Monnier
2012-10-30 18:49 ` martin rudalics
2012-10-30 19:21 ` Stefan Monnier
2012-10-31 10:27 ` martin rudalics
2012-10-31 14:07 ` Stefan Monnier
2012-11-09 9:50 ` martin rudalics
2012-11-09 14:20 ` Stefan Monnier
2012-11-10 11:07 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=508FABAE.4050104@gmx.at \
--to=rudalics@gmx.at \
--cc=12766@debbugs.gnu.org \
--cc=monnier@IRO.UMontreal.CA \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.