From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: Using org-capture with a template adds an unnecessary newline regardless of flags set [9.0.5 (9.0.5-elpa @ /home/igor/.emacs.d/elpa/org-20170210/)] Date: Mon, 17 Apr 2017 11:31:51 +0200 Message-ID: <87mvbfmlbs.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d030k-0005UJ-D6 for emacs-orgmode@gnu.org; Mon, 17 Apr 2017 05:31:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d030j-0002hj-I7 for emacs-orgmode@gnu.org; Mon, 17 Apr 2017 05:31:54 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:50993) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d030j-0002hE-Bk for emacs-orgmode@gnu.org; Mon, 17 Apr 2017 05:31:53 -0400 In-Reply-To: (Igor Perepelytsya's message of "Sat, 15 Apr 2017 05:57:01 -0400") 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: Igor Perepelytsya Cc: emacs-orgmode@gnu.org Hello, Igor Perepelytsya writes: > Using a template with org-capture to create a new org entry will add an > unwanted newline after it. This occurs regardless of the contents of the > template file, whether or not the 'empty-lines 1' / 'empty-lines-after > 1' checkboxes are ticked in org-customize, or `empty-lines` / > `empty-lines-after` keys are set to 0 manually. I expected that there > would be no newline added by default after a template is inserted into > an org-capture buffer. > > This appears to happen because > `org-capture-place-(entry/plain-text/etc)` defuns in org-capture.el have > `(org-capture-empty-lines-after 1)` in them by default. Changing this to > `(org-capture-empty-lines-after)` and byte-compiling the file fixes the > issue. I am not aware of any reason for 1 to be the default forced value > here. Would you want to provide a patch for that? Some tests in "test-org-capture.el" would also be highly appreciated. Regards, -- Nicolas Goaziou