From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Christoph Scholtes Newsgroups: gmane.emacs.devel Subject: Advising quit-window Date: Tue, 25 Oct 2011 19:54:09 -0600 Message-ID: <8639eg8qm6.fsf@googlemail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1319594068 21269 80.91.229.12 (26 Oct 2011 01:54:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 26 Oct 2011 01:54:28 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 26 03:54:25 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RIshE-0005Z7-G0 for ged-emacs-devel@m.gmane.org; Wed, 26 Oct 2011 03:54:24 +0200 Original-Received: from localhost ([::1]:49045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIshD-00024S-Qa for ged-emacs-devel@m.gmane.org; Tue, 25 Oct 2011 21:54:23 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:58693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIshB-00024C-8M for emacs-devel@gnu.org; Tue, 25 Oct 2011 21:54:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RIshA-0004jJ-2o for emacs-devel@gnu.org; Tue, 25 Oct 2011 21:54:21 -0400 Original-Received: from mail-yw0-f41.google.com ([209.85.213.41]:41145) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIsh9-0004jF-Tp for emacs-devel@gnu.org; Tue, 25 Oct 2011 21:54:20 -0400 Original-Received: by ywa17 with SMTP id 17so1303556ywa.0 for ; Tue, 25 Oct 2011 18:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=from:to:subject:user-agent:date:message-id:mime-version :content-type; bh=NUISLj6sVf64gZOcPV5QegqfjlmojqglXv5EhdOJOXQ=; b=jv4smatQcVg9aOEAGIFpeFBJkxOwWhIOkps4yTk1/Y8sTTzCO+Jwx3XMs3uG01CKko Hf8N9kkstd6mDM+837NLmFog+wDp3g6rQshBOfci7q26IKZShGa38XOcxeQdI8BvObUf jJ732BB92o5KxW/WoqZb66zrG3wLtbb5MqToM= Original-Received: by 10.150.69.4 with SMTP id r4mr27169904yba.53.1319594059239; Tue, 25 Oct 2011 18:54:19 -0700 (PDT) Original-Received: from MARVIN (71-212-154-245.hlrn.qwest.net. [71.212.154.245]) by mx.google.com with ESMTPS id a16sm597713ani.14.2011.10.25.18.54.16 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Oct 2011 18:54:18 -0700 (PDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (windows-nt) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.213.41 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:145540 Archived-At: 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