emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-datetree-insert-line and org-blank-before-new-entry
@ 2021-09-01  0:35 Richard Walker
  0 siblings, 0 replies; only message in thread
From: Richard Walker @ 2021-09-01  0:35 UTC (permalink / raw)
  To: emacs-orgmode

A follow-up to the changes made to org-datetree-insert-line
in September 2020.

The definition now begins:

(defun org-datetree-insert-line (year &optional month day text)
  (delete-region (save-excursion (skip-chars-backward " \t\n") (point)) (point))
  (when (assq 'heading org-blank-before-new-entry)
    (insert "\n"))

I'm getting blank lines inserted before new entries, and
I found a couple of sources of advice for setting org-blank-before-new-entry
( https://emacs.stackexchange.com/questions/51117/org-mode-control-whether-m-ret-inserts-a-newline-or-not-for-plain-lists
that say to do this:

(setf org-blank-before-new-entry '((heading . nil) (plain-list-item . nil)))

Such a setting seems to be consistent with the help text of
org-blank-before-new-entry, and what org--blank-before-heading-p
expects to find. But, having made this setting,
  (when (assq 'heading org-blank-before-new-entry)
    (insert "\n"))
still does the insertion, since (assq 'heading org-blank-before-new-entry)
is non-nil.

Change (assq 'heading org-blank-before-new-entry)
to (org--blank-before-heading-p) here?

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-01  0:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01  0:35 org-datetree-insert-line and org-blank-before-new-entry Richard Walker

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


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 NNTP newsgroup(s).