GNU bug report logs - #8184
23.1.90; `menu-bar-non-minibuffer-window-p' error in calls to `kill-this-buffer'

Previous Next

Package: emacs;

Reported by: tlh <thunkout <at> gmail.com>

Date: Sun, 6 Mar 2011 05:29:02 UTC

Severity: normal

Found in version 23.1.90

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 'Eli Zaretskii' <eliz <at> gnu.org>, 8184 <at> debbugs.gnu.org, 'tlh' <thunkout <at> gmail.com>
Subject: bug#8184: 23.1.90; `menu-bar-non-minibuffer-window-p' error in callsto	`kill-this-buffer'
Date: Sun, 06 Mar 2011 20:13:52 +0100
>> (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)))

The idea is that at least _two_ interesting buffers are needed to enable
`kill-this-buffer'.  found-1 is initially nil and set to t when the
first interesting buffer is found.  The throw to found-2 occurs when the
second interesting buffer has been found.

martin




This bug report was last modified 12 years and 235 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.