emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* 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/)]
@ 2017-04-15  9:57 Igor Perepelytsya
  2017-04-17  9:31 ` Nicolas Goaziou
  2017-05-23 16:17 ` Nicolas Goaziou
  0 siblings, 2 replies; 3+ messages in thread
From: Igor Perepelytsya @ 2017-04-15  9:57 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 948 bytes --]

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.

Emacs  : GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.30)
 of 2016-09-24
Package: Org mode version 9.0.5 (9.0.5-elpa @
/home/igor/.emacs.d/elpa/org-20170210/)

[-- Attachment #2: Type: text/html, Size: 1047 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* 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/)]
  2017-04-15  9:57 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/)] Igor Perepelytsya
@ 2017-04-17  9:31 ` Nicolas Goaziou
  2017-05-23 16:17 ` Nicolas Goaziou
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Goaziou @ 2017-04-17  9:31 UTC (permalink / raw)
  To: Igor Perepelytsya; +Cc: emacs-orgmode

Hello,

Igor Perepelytsya <igorquail@gmail.com> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* 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/)]
  2017-04-15  9:57 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/)] Igor Perepelytsya
  2017-04-17  9:31 ` Nicolas Goaziou
@ 2017-05-23 16:17 ` Nicolas Goaziou
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Goaziou @ 2017-05-23 16:17 UTC (permalink / raw)
  To: Igor Perepelytsya; +Cc: emacs-orgmode

Hello,

Igor Perepelytsya <igorquail@gmail.com> 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.
>
> Emacs  : GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.30)
>  of 2016-09-24
> Package: Org mode version 9.0.5 (9.0.5-elpa @
> /home/igor/.emacs.d/elpa/org-20170210/)

I think I fixed it. Could you confirm it?

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-23 16:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-15  9:57 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/)] Igor Perepelytsya
2017-04-17  9:31 ` Nicolas Goaziou
2017-05-23 16:17 ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).