all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: martin rudalics <rudalics@gmx.at>
Cc: Christoph Scholtes <cschol2112@googlemail.com>, emacs-devel@gnu.org
Subject: Re: quit-window
Date: Mon, 24 Oct 2011 08:12:45 +0300	[thread overview]
Message-ID: <87mxcrjbre.fsf@mail.jurta.org> (raw)
In-Reply-To: <4EA463EC.8030707@gmx.at> (martin rudalics's message of "Sun, 23 Oct 2011 20:58:52 +0200")

>>   (define-key dired-mode-map "q" 'quit-window-kill-buffer)
>>
>> Or even better to add a new customizable variable with a list of modes
>> where `q' kills the buffer, e.g. `quit-window-kill-buffer-modes'
>> that could be customized to add modes like `dired-mode'.
>
> Is there any reason why one should not use C-x k here?

Actually both are necessary: `quit-window-kill-buffer' and
`kill-this-buffer' (I consider it instead of `kill-buffer'
because it's easier to use in .emacs and it doesn't require
confirmation from the user to kill the current buffer).

There are use cases where one of them is more suitable:

`quit-window-kill-buffer' is useful when you need to return to the
initial window from which this buffer was displayed and also to delete
the window when the current buffer is last in its window history.

Sometimes this behavior is dangerous, e.g. when wanting to
kill all buffers visited in the selected window one by one,
I start typing a key bound to `quit-window-kill-buffer'
repeatedly, and sometimes it jumps to another window, and
not noticing this jump, the next keypress kills the wrong buffer.
`kill-this-buffer' doesn't jump to another window, so it's safer
to use it to kill all previously visited buffers in the selected window.



  reply	other threads:[~2011-10-24  5:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-22 20:43 quit-window Christoph Scholtes
2011-10-23  7:23 ` quit-window Chong Yidong
2011-10-23 15:02   ` quit-window Christoph Scholtes
2011-10-23 23:49     ` quit-window Chong Yidong
2011-10-24 16:39     ` quit-window Richard Stallman
2011-10-24 17:18       ` quit-window Eli Zaretskii
2011-10-24 17:40         ` quit-window martin rudalics
2011-10-25 12:19         ` quit-window Richard Stallman
2011-10-25  1:24       ` quit-window Christoph Scholtes
2011-10-25 13:01         ` quit-window martin rudalics
2011-10-25 18:55         ` quit-window Richard Stallman
2011-10-23  9:20 ` quit-window martin rudalics
2011-10-23 13:27   ` quit-window Juri Linkov
2011-10-23 16:04     ` quit-window Christoph Scholtes
2011-10-23 18:58     ` quit-window martin rudalics
2011-10-24  5:12       ` Juri Linkov [this message]
2011-10-25  3:59         ` quit-window Chong Yidong
2011-10-25  4:28           ` quit-window Juri Linkov
2011-10-23 16:01   ` quit-window Christoph Scholtes
2011-10-23 19:00     ` quit-window martin rudalics
2011-10-25  1:00       ` quit-window Christoph Scholtes
2011-10-25 10:04         ` quit-window martin rudalics
  -- strict thread matches above, loose matches on Subject: below --
2007-10-19  9:00 quit-window 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mxcrjbre.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=cschol2112@googlemail.com \
    --cc=emacs-devel@gnu.org \
    --cc=rudalics@gmx.at \
    /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 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.