From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] org-capture: Add a custom to control save target file or not. Date: Thu, 12 Apr 2018 15:22:21 +0200 Message-ID: <87po34y2ya.fsf@nicolasgoaziou.fr> References: <19dc1211.1e75.162b770bd5c.Coremail.tumashu@163.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6cBg-0006tL-OZ for emacs-orgmode@gnu.org; Thu, 12 Apr 2018 09:22:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f6cBc-0001eh-No for emacs-orgmode@gnu.org; Thu, 12 Apr 2018 09:22:52 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:49347) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f6cBc-0001dN-ES for emacs-orgmode@gnu.org; Thu, 12 Apr 2018 09:22:48 -0400 In-Reply-To: <19dc1211.1e75.162b770bd5c.Coremail.tumashu@163.com> (tumashu@163.com's message of "Thu, 12 Apr 2018 09:20:41 +0800 (CST)") 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-orgmode Hello, tumashu writes: > I use org-capture to capture text to a file of my mobile phone > with the help of tramp and termux's sshd, the save buffer is very > slow, so I want to org-capture-finalize just update buffer, and > I save buffer manually when need. Thank you. Comments follow. > By the way, can we contribute org-mode with the help of PR feature in > code.orgmode.org? AFAIC, I'd rather deal with email than with a web interface. However, Bastien accepted PR from code.orgmode.org in the past. The problem with PR in code.orgmode.org is that the discussion around the patch happens somewhere else than on the ML. > +(defcustom org-capture-finalize-save-buffer t > + "When nil, org-capture-finalize will not save target file's buffer." > + :group 'org-capture > + :version "24.1" > + :type 'boolean) The :version value is incorrect. Also, it is missing ":safe #'booleanp". > (defcustom org-capture-bookmark t > "When non-nil, add a bookmark pointing at the last stored > position when capturing." > @@ -791,7 +797,10 @@ captured item after finalizing." > (org-encrypt-entry))) > > ;; Kill the indirect buffer > - (save-buffer) > + (if org-capture-finalize-save-buffer > + (save-buffer) > + (message "The capture target file is not auto saved, please save it manually.")) Would it make sense to simply not call `save-buffer' in all cases? Saving buffer after a capture is rather opinionated. Regards, -- Nicolas Goaziou