unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'martin rudalics'" <rudalics@gmx.at>, "'Eli Zaretskii'" <eliz@gnu.org>
Cc: 8184@debbugs.gnu.org, 'tlh' <thunkout@gmail.com>
Subject: bug#8184: 23.1.90; `menu-bar-non-minibuffer-window-p' error in callsto	`kill-this-buffer'
Date: Sun, 6 Mar 2011 10:59:05 -0800	[thread overview]
Message-ID: <F6A756D061B94556B0368F78DAC7B65E@us.oracle.com> (raw)
In-Reply-To: <4D73D021.8070105@gmx.at>

> Am I right that the time for executing `kill-this-buffer-enabled-p' is
> currently always proportional to the number of live buffers?

Seems so.

> In that case I'd rewrite [t]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))))))))

`found-1' is useless here (not used).

(defun kill-this-buffer-enabled-p ()
  (or (not (menu-bar-non-minibuffer-window-p))
      (catch 'found
        (dolist (buffer  (buffer-list))
          (unless (string-match-p "^ " (buffer-name buffer))
            (throw 'found t)))
        nil)))






  reply	other threads:[~2011-03-06 18:59 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     ` Drew Adams [this message]
2011-03-06 19:13       ` bug#8184: 23.1.90; `menu-bar-non-minibuffer-window-p' error in callsto `kill-this-buffer' 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     ` bug#8184: 23.1.90; `menu-bar-non-minibuffer-window-p' error in calls to `kill-this-buffer' Stefan Monnier
2011-03-07  8:07       ` 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

  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=F6A756D061B94556B0368F78DAC7B65E@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=8184@debbugs.gnu.org \
    --cc=eliz@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 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).