[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Killing Buffers
From: |
Brian Palmer |
Subject: |
Re: Killing Buffers |
Date: |
12 Jan 2004 07:02:34 -0800 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Portable Code) |
Bruce Ingalls <bingalls@fit-zones.NO-SPAM.com> writes:
> > like (I release any part belonging to me into the public domain, if
> > possible, and license it for any and all use if not).
>
> This code alone is too trivial to copyright. Both ways you describe
> are public domain. In any case, this code will be available via the
> GPL at <url: http://emacro.sf.net/ >
Excellent. I just wanted to be compliant with whatever your code's
license was. (And there are differences between universal licensing
and public domain, aiui, but not worth getting into)
> > (defun kill-all-other-buffer-frames (&optional prefix)
>
> Thanks for pointing out inelegancies in the code. Unfortunately, your
> changes always leave the *scratch* buffer, and never the current
> buffer. :(
Sorry 'bout that. It's as simple as changing, in
kill-all-other-buffer-frames
(buffers-to-kill (buffer-list)))
to
(buffers-to-kill (mapcar 'buffer-name (buffer-list))))
(Tested and verified).
(defun kill-all-other-buffer-frames (&optional prefix)
"Close other open files, and kill other frames and windows. With
prefix argument, kill all buffers, leaving only the default *scratch*
buffer."
(interactive "P")
(let ((cur-buf-name (buffer-name))
(buffers-to-kill (mapcar 'buffer-name (buffer-list))))
(if (null prefix)
(setf buffers-to-kill (delete cur-buf-name buffers-to-kill)))
(mapcar 'delete-frame (cdr (visible-frame-list)))
(or (one-window-p)
(delete-window))
(mapcar 'kill-buffer buffers-to-kill)
(delete-other-windows)))
--
I'm awfully glad I'm a Beta, because I don't work so hard.