From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: [PATCH] org-capture: Add a custom to control save target file or not. Date: Wed, 26 Sep 2018 13:29:42 -0400 Message-ID: References: <19dc1211.1e75.162b770bd5c.Coremail.tumashu@163.com> <87po34y2ya.fsf@nicolasgoaziou.fr> <77a63bcf.32cc.162bcc4a5d0.Coremail.tumashu@163.com> <877epap70f.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5Ddm-0007Yw-1S for emacs-orgmode@gnu.org; Wed, 26 Sep 2018 13:30:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5Ddl-0005LO-Aj for emacs-orgmode@gnu.org; Wed, 26 Sep 2018 13:30:22 -0400 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]:34962) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g5Ddl-0005Gk-2k for emacs-orgmode@gnu.org; Wed, 26 Sep 2018 13:30:21 -0400 Received: by mail-lj1-x242.google.com with SMTP id w4-v6so2600965ljd.2 for ; Wed, 26 Sep 2018 10:30:20 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: tumashu Cc: emacs-org list , Nicolas Goaziou > On Sat, Apr 14, 2018 at 5:43 AM tumashu wrote: > > > > Agree this idea, If user want to save-buffer when capture finish, they can > > add save-buffer to org-capture-after-finalize-hook or just type C-x C-s Also that suggestion to use org-capture-after-finalize-hook does not work.. I am investigating to find the right way. The reason is that the (current-buffer) when that hook is run is the buffer from where the capture is initiated (which usually is not the capture target buffer). So running save-buffer in that hook simply saves a buffer unrelated to the capture (which is not good).