bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8184: 23.1.90; `menu-bar-non-minibuffer-window-p' error in calls to


From: martin rudalics
Subject: bug#8184: 23.1.90; `menu-bar-non-minibuffer-window-p' error in calls to `kill-this-buffer'
Date: Sun, 06 Mar 2011 19:19:13 +0100
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

> ??? 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))))))))

martin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]