[Top][All Lists]

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

Re: Advising quit-window

From: Juanma Barranquero
Subject: Re: Advising quit-window
Date: Wed, 26 Oct 2011 04:23:52 +0200

On Wed, Oct 26, 2011 at 03:54, Christoph Scholtes
<address@hidden> wrote:

> ;; 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'.

Why don't you do

(defadvice quit-window (before advise-quit-window activate)
  (when (called-interactively-p 'any)
    (ad-set-arg 0 (not (ad-get-arg 0)))))



reply via email to

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