From: Stefan Monnier <monnier@iro.umontreal.ca>
To: martin rudalics <rudalics@gmx.at>
Cc: 8184@debbugs.gnu.org, tlh <thunkout@gmail.com>
Subject: bug#8184: 23.1.90; `menu-bar-non-minibuffer-window-p' error in calls to `kill-this-buffer'
Date: Sun, 06 Mar 2011 14:53:31 -0500 [thread overview]
Message-ID: <jwvwrkcqb9a.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <4D73D021.8070105@gmx.at> (martin rudalics's message of "Sun, 06 Mar 2011 19:19:13 +0100")
>> ??? This function is bound to the "Close" item in the "File" menu, so
>> it is definitely related to the menu bar.
> Am I right that the time for executing `kill-this-buffer-enabled-p' is
> currently always proportional to the number of live buffers? In that
> case I'd rewrite his function as
> (defun kill-this-buffer-enabled-p ()
> (or (not (menu-bar-non-minibuffer-window-p))
> (let (found-1)
> (catch 'found-2
> (dolist (buffer (buffer-list))
> (unless (string-match-p "^ " (buffer-name buffer))
> (if (not found-1)
> (setq found-1 t)
> (throw 'found-2 t))))))))
Probably a good change, yes. It'd also be good to add a comment
explaining why we do this loop searching for some non-temp buffer.
IIUC this function is used to check whether kill-this-buffer can do its
job, and if (menu-bar-non-minibuffer-window-p) is nil, then we use
abort-recursive-edit, so we need to check if abort-recursive-edit can be
used, which seems related to minibuffer-depth rather than to
non-temp buffers.
Stefan
next prev parent reply other threads:[~2011-03-06 19:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-06 5:28 bug#8184: 23.1.90; `menu-bar-non-minibuffer-window-p' error in calls to `kill-this-buffer' tlh
2011-03-06 12:45 ` Eli Zaretskii
2011-03-06 18:19 ` martin rudalics
2011-03-06 18:59 ` bug#8184: 23.1.90; `menu-bar-non-minibuffer-window-p' error in callsto `kill-this-buffer' Drew Adams
2011-03-06 19:13 ` martin rudalics
2011-03-06 19:36 ` Drew Adams
2011-03-07 8:07 ` martin rudalics
2011-03-07 15:10 ` Drew Adams
2011-03-27 12:22 ` Johan Bockgård
2011-03-29 8:31 ` martin rudalics
2011-03-06 19:53 ` Stefan Monnier [this message]
2011-03-07 8:07 ` bug#8184: 23.1.90; `menu-bar-non-minibuffer-window-p' error in calls to `kill-this-buffer' martin rudalics
2012-10-03 9:12 ` 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=jwvwrkcqb9a.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=8184@debbugs.gnu.org \
--cc=rudalics@gmx.at \
--cc=thunkout@gmail.com \
/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.