all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Kill other buffers
@ 2005-12-11 17:52 Pedro Sa da Costa
  2005-12-12 16:52 ` Kevin Rodgers
       [not found] ` <mailman.18999.1134409322.20277.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 8+ messages in thread
From: Pedro Sa da Costa @ 2005-12-11 17:52 UTC (permalink / raw)


Suppose that i have 3 files opened in emacs.

Now, i'm in file 1 and i want to close file 2 and file 3. There is any 
short- key to close (kill) other buffers opened, while i'm in file 1?

Thanks,
Pedro

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Kill other buffers
       [not found] <mailman.18814.1134323599.20277.help-gnu-emacs@gnu.org>
@ 2005-12-11 21:08 ` roodwriter
  2005-12-12  6:25   ` Xiangqian Liu
  2005-12-12 12:06 ` Alan Mackenzie
  1 sibling, 1 reply; 8+ messages in thread
From: roodwriter @ 2005-12-11 21:08 UTC (permalink / raw)


Pedro Sa da Costa <pedrosadacosta@netcabo.pt> writes:

> Suppose that i have 3 files opened in emacs.
> 
> Now, i'm in file 1 and i want to close file 2 and file 3. There is
any
> short- key to close (kill) other buffers opened, while i'm in file
1?
> 
> Thanks,
> Pedro

You can kill the other buffers the same way you kill the one you're
in--with the C-x k command. When you use it just type in the name of
the buffer you want killed. It'll delete that one rather than the one
you're in.

--Rod

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Kill other buffers
  2005-12-11 21:08 ` roodwriter
@ 2005-12-12  6:25   ` Xiangqian Liu
  2005-12-12  6:47     ` Drew Adams
  0 siblings, 1 reply; 8+ messages in thread
From: Xiangqian Liu @ 2005-12-12  6:25 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 961 bytes --]

You can use C-x 1 to close all other buffers except the one you current in
You also can use C-x 0 to close your current active buffer

11 Dec 2005 16:08:50 -0500, roodwriter@core.com <roodwriter@core.com>:
>
> Pedro Sa da Costa <pedrosadacosta@netcabo.pt> writes:
>
> > Suppose that i have 3 files opened in emacs.
> >
> > Now, i'm in file 1 and i want to close file 2 and file 3. There is
> any
> > short- key to close (kill) other buffers opened, while i'm in file
> 1?
> >
> > Thanks,
> > Pedro
>
> You can kill the other buffers the same way you kill the one you're
> in--with the C-x k command. When you use it just type in the name of
> the buffer you want killed. It'll delete that one rather than the one
> you're in.
>
> --Rod
>
> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
>



--
不管如何伟大的恋情,都有结局,何况是我这微不足道的痴恋

[-- Attachment #1.2: Type: text/html, Size: 1481 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: Kill other buffers
  2005-12-12  6:25   ` Xiangqian Liu
@ 2005-12-12  6:47     ` Drew Adams
  0 siblings, 0 replies; 8+ messages in thread
From: Drew Adams @ 2005-12-12  6:47 UTC (permalink / raw)


  You can use C-x 1 to close all other buffers except the one you current in
  You also can use C-x 0 to close your current active buffer

I almost replied with the same advice earlier, but I think the poster asked
about "closing files", which in Emacs corresponds closest to killing their
buffers.

What you describe does not kill the buffers; it merely deletes the windows
displaying them. Maybe that's good enough for the OP, but it is not really
what was requested.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Kill other buffers
       [not found] <mailman.18814.1134323599.20277.help-gnu-emacs@gnu.org>
  2005-12-11 21:08 ` roodwriter
@ 2005-12-12 12:06 ` Alan Mackenzie
  1 sibling, 0 replies; 8+ messages in thread
From: Alan Mackenzie @ 2005-12-12 12:06 UTC (permalink / raw)


Pedro Sa da Costa <pedrosadacosta@netcabo.pt> wrote on Sun, 11 Dec 2005
17:52:35 +0000:
> Suppose that i have 3 files opened in emacs.

> Now, i'm in file 1 and i want to close file 2 and file 3. There is any 
> short- key to close (kill) other buffers opened, while i'm in file 1?

No.  At least, not a standard one.

As an alternative, try this:  With C-x C-b, get a list of buffers, and
with C-x o (that's "control-x oh") go to that list.  Use D to mark each
buffer you want to kill.  (C-d can be useful, too; use U to unmark
buffers you didn't really mean to mark.)  Finally, type X to delete the
lot of them.

> Thanks,
> Pedro



-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Kill other buffers
  2005-12-11 17:52 Kill other buffers Pedro Sa da Costa
@ 2005-12-12 16:52 ` Kevin Rodgers
       [not found] ` <mailman.18999.1134409322.20277.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 8+ messages in thread
From: Kevin Rodgers @ 2005-12-12 16:52 UTC (permalink / raw)


Pedro Sa da Costa wrote:
> Suppose that i have 3 files opened in emacs.
> 
> Now, i'm in file 1 and i want to close file 2 and file 3. There is any 
> short- key to close (kill) other buffers opened, while i'm in file 1?

Try `M-x electric-buffer-list'.  I prefer it to list-buffers, so I
override the default binding:

(global-set-key "\C-x\C-b" 'electric-buffer-list)

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Kill other buffers
       [not found] ` <mailman.18999.1134409322.20277.help-gnu-emacs@gnu.org>
@ 2005-12-12 20:35   ` Andreas Röhler
  2005-12-13  8:15     ` Alan Mackenzie
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Röhler @ 2005-12-12 20:35 UTC (permalink / raw)


Kevin Rodgers wrote:

> Pedro Sa da Costa wrote:
>> Suppose that i have 3 files opened in emacs.
>> 
>> Now, i'm in file 1 and i want to close file 2 and file 3. There is any
>> short- key to close (kill) other buffers opened, while i'm in file 1?
> 
> Try `M-x electric-buffer-list'.  I prefer it to list-buffers, so I
> override the default binding:
> 
> (global-set-key "\C-x\C-b" 'electric-buffer-list)
> 

Right, or try that:

(defun kill-all-buffers (&optional arg)
  "with arg, save all buffers before deleting them"
  (interactive "P")
  (if arg
      (save-some-buffers))
  (let ((pufferliste (buffer-list)))
    (while pufferliste
      (progn
        (if (not (equal (car pufferliste) (current-buffer)))
            (kill-buffer (car pufferliste)))
        (setq pufferliste (cdr pufferliste))))))

;; make a key at `C-c k' 
(global-set-key "\C-ck" 'kill-all-buffers)

ar

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Kill other buffers
  2005-12-12 20:35   ` Andreas Röhler
@ 2005-12-13  8:15     ` Alan Mackenzie
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Mackenzie @ 2005-12-13  8:15 UTC (permalink / raw)


Andreas R?hler <andreas.roehler@online.de> wrote on Mon, 12 Dec 2005
21:35:30 +0100:

> Right, or try that:

> (defun kill-all-buffers (&optional arg)
>   "with arg, save all buffers before deleting them"
>   (interactive "P")
>   (if arg
>       (save-some-buffers))
>   (let ((pufferliste (buffer-list)))
>     (while pufferliste
>       (progn
>         (if (not (equal (car pufferliste) (current-buffer)))
>             (kill-buffer (car pufferliste)))
>         (setq pufferliste (cdr pufferliste))))))

> ;; make a key at `C-c k' 
> (global-set-key "\C-ck" 'kill-all-buffers)

Wow!  You're a brave, brave man!  With a binding like that in my .emacs,
I'd be trembling in fear every time I did C-x k, lest I accidentally
wiped out everything.

> ar

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-12-13  8:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-11 17:52 Kill other buffers Pedro Sa da Costa
2005-12-12 16:52 ` Kevin Rodgers
     [not found] ` <mailman.18999.1134409322.20277.help-gnu-emacs@gnu.org>
2005-12-12 20:35   ` Andreas Röhler
2005-12-13  8:15     ` Alan Mackenzie
     [not found] <mailman.18814.1134323599.20277.help-gnu-emacs@gnu.org>
2005-12-11 21:08 ` roodwriter
2005-12-12  6:25   ` Xiangqian Liu
2005-12-12  6:47     ` Drew Adams
2005-12-12 12:06 ` Alan Mackenzie

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.