emacs-devel
[Top][All Lists]
Advanced

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

Advising quit-window


From: Christoph Scholtes
Subject: Advising quit-window
Date: Tue, 25 Oct 2011 19:54:09 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (windows-nt)

Sorry to dwell on `quit-window', but...

I really don't like the default behavior of `quit-window' burying the
buffer instead of killing it. I'd much rather have the default be kill
than bury, especially when it is bound to `q'.

Therefore, I have this in my .emacs:

;; Advise quit-window to kill buffer instead of burying it
(defadvice quit-window (before advise-quit-window activate)
  (ad-set-arg 0 (not (ad-get-arg 0))))

This works fine for cases where `quit-window' is bound to, for example,
`q' in a keymap. However, `quit-window' is also called internally, for
example by `quit-windows-on'. The latter is then called by vc mode to
kill the log buffer after a commit. It took me a while to figure out
that my advice actually caused the log buffer to be buried now, instead
of killed.

Can we please have a user option to select whether the default behavior
is kill or bury? Or can we add a `quit-window-internal' and
`quit-window' then calls `quit-window-internal'? I can then advise
`quit-window' to get the behavior I want without affecting the internal
function.

Other solutions welcome.

Christoph



reply via email to

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