From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id WNhZICWzUF++IwAA0tVLHw (envelope-from ) for ; Thu, 03 Sep 2020 09:11:01 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id eNpUHCWzUF/OPAAAbx9fmQ (envelope-from ) for ; Thu, 03 Sep 2020 09:11:01 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AA94D9403C8 for ; Thu, 3 Sep 2020 09:11:00 +0000 (UTC) Received: from localhost ([::1]:37978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDlGl-0002fd-IW for larch@yhetil.org; Thu, 03 Sep 2020 05:10:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDkxd-0001RY-Kq for emacs-orgmode@gnu.org; Thu, 03 Sep 2020 04:51:13 -0400 Received: from mout-p-101.mailbox.org ([2001:67c:2050::465:101]:41652) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1kDkxW-00046d-EU for emacs-orgmode@gnu.org; Thu, 03 Sep 2020 04:51:12 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4BhvfW0DjYzKmmq for ; Thu, 3 Sep 2020 10:50:59 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id f09sdJolV76s for ; Thu, 3 Sep 2020 10:50:55 +0200 (CEST) Date: Thu, 3 Sep 2020 10:50:54 +0200 From: Vasilij Schneidermann To: emacs-orgmode@gnu.org Subject: Bug: [PATCH] org-datetree-insert-line doesn't honor headline spacing customization [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)] Message-ID: <20200903085054.GA21638@odonien.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1UWUbFP1cBYEclgG" Content-Disposition: inline X-MBO-SPAM-Probability: X-Rspamd-Score: -7.85 / 15.00 / 15.00 X-Rspamd-Queue-Id: 043C717B5 X-Rspamd-UID: d0a09b Received-SPF: pass client-ip=2001:67c:2050::465:101; envelope-from=mail@vasilij.de; helo=mout-p-101.mailbox.org X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 03 Sep 2020 05:09:27 -0400 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -3.11 X-TUID: NByxfcdXuNjm --1UWUbFP1cBYEclgG Content-Type: multipart/mixed; boundary="/04w6evG8XlLl3ft" Content-Disposition: inline --/04w6evG8XlLl3ft Content-Type: text/plain; charset=utf-8 Content-Disposition: inline When doing org captures using the datetree format, newly added headlines do not follow the value of `org-blank-before-new-entry'. This seems to be the fault of `org-datetree-insert-line' using `insert' as opposed to `org-insert-heading' to do its work. See the attachment for a proposed fix. ------------------------------------------------------------------------ Emacs : GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22) of 2020-08-13 Package: Org mode version 9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/) current state: ============== (setq org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-link-shell-confirm-function 'yes-or-no-p org-metadown-hook '(org-babel-pop-to-session-maybe) org-clock-out-hook '(org-clock-remove-empty-clock-drawer) org-enforce-todo-dependencies t org-time-stamp-rounding-minutes '(0 15) org-reveal-start-hook '(org-decrypt-entry) org-blocker-hook '(org-block-todo-from-checkboxes org-block-todo-from-children-or-siblings-or-parent) org-cycle-include-plain-lists 'integrate org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-show-all append local] 5] #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes) org-archive-hook '(org-attach-archive-delete-maybe) org-confirm-elisp-link-function 'yes-or-no-p org-startup-indented t org-agenda-before-write-hook '(org-agenda-add-entry-text) org-metaup-hook '(org-babel-load-in-session-maybe) org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn ENTRY)"] org-babel-pre-tangle-hook '(save-buffer) org-file-apps '(("pdf" . system) (auto-mode . emacs) (system . "xdg-open %s") (t . system)) org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-export-backends '(ascii beamer html latex md) org-ellipsis 'org-ellipsis org-src-preserve-indentation t org-catch-invisible-edits 'error org-occur-hook '(org-first-headline-recenter) org-enforce-todo-checkbox-dependencies t org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate) org-capture-mode-hook '(evil-insert-state) org-M-RET-may-split-line nil org-return-follows-link t org-confirm-shell-link-function 'yes-or-no-p org-link-parameters '(("attachment" :follow org-attach-open-link :export org-attach-export-link :complete org-attach-complete-link) ("id" :follow org-id-open) ("eww" :follow eww :store org-eww-store-link) ("rmail" :follow org-rmail-open :store org-rmail-store-link) ("mhe" :follow org-mhe-open :store org-mhe-store-link) ("irc" :follow org-irc-visit :store org-irc-store-link :export org-irc-export) ("info" :follow org-info-open :export org-info-export :store org-info-store-link) ("gnus" :follow org-gnus-open :store org-gnus-store-link) ("docview" :follow org-docview-open :export org-docview-export :store org-docview-store-link) ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link) ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete org-bbdb-complete-link :store org-bbdb-store-link) ("w3m" :store org-w3m-store-link) ("file+sys") ("file+emacs") ("shell" :follow org-link--open-shell) ("news" :follow #[257 "\301\300\302Q!\207" ["news" browse-url ":"] 5 "\n\n(fn URL)"] ) ("mailto" :follow #[257 "\301\300\302Q!\207" ["mailto" browse-url ":"] 5 "\n\n(fn URL)"] ) ("https" :follow #[257 "\301\300\302Q!\207" ["https" browse-url ":"] 5 "\n\n(fn URL)"] ) ("http" :follow #[257 "\301\300\302Q!\207" ["http" browse-url ":"] 5 "\n\n(fn URL)"] ) ("ftp" :follow #[257 "\301\300\302Q!\207" ["ftp" browse-url ":"] 5 "\n\n(fn URL)"] ) ("help" :follow org-link--open-help) ("file" :complete org-link-complete-file) ("elisp" :follow org-link--open-elisp) ("doi" :follow org-link--open-doi)) org-capture-templates '(("j" "Journal" entry (file+olp+datetree "~/org/journal.org.gpg") "* %<%H:%M>\n\n%?" :empty-lines 1) ) org-link-elisp-confirm-function 'yes-or-no-p org-latex-packages-alist '(("" "tabu" t) ("" "minted" t) ("english" "babel" t)) org-clock-into-drawer nil org-link-frame-setup '((file . find-file)) org-directory "~/org/" org-default-notes-file "~/org/notes.org" ) --/04w6evG8XlLl3ft Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0001-Use-org-insert-heading-to-add-new-heading.patch" Content-Transfer-Encoding: quoted-printable =46rom b00f00b4493d369f6ce56075f1de77d65aca4fdd Mon Sep 17 00:00:00 2001 =46rom: Vasilij Schneidermann Date: Thu, 3 Sep 2020 10:47:04 +0200 Subject: [PATCH] Use org-insert-heading to add new heading --- lisp/org-datetree.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/org-datetree.el b/lisp/org-datetree.el index ce91591f1..33e7c9304 100644 --- a/lisp/org-datetree.el +++ b/lisp/org-datetree.el @@ -185,8 +185,9 @@ inserted into the buffer." =20 (defun org-datetree-insert-line (year &optional month day text) (delete-region (save-excursion (skip-chars-backward " \t\n") (point)) (p= oint)) - (insert "\n" (make-string org-datetree-base-level ?*) " \n") - (backward-char) + (org-insert-heading) + (while (> (org-current-level) 1) + (org-do-promote)) (when month (org-do-demote)) (when day (org-do-demote)) (if text --=20 2.28.0 --/04w6evG8XlLl3ft-- --1UWUbFP1cBYEclgG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEE0dAcySl3bqM8O17WFmfJg6zCifoFAl9QrmUACgkQFmfJg6zC ifpKlgf/WarSoTEJ9u8l4KegkJsC0+qWPRNxix6HwbZed7yk5isig6sBDm8kbJhR UG01RSyp7Vx9bpJy26POrCB9QhQV6TKBV65yTbm0kLLtMvSDiZNDfdT/L8lY3dqT ei/dq3y+ArRUj3r4cED4OYuCjlpsAq9i0iWG70VUNFE5dlzHNkL8JHM8h15FHKqK sw5fk/1+5Bvzgbe4tMQNmNcodZDv/4oRa2o9P39HXNTdiIgfcOJexJxd+secJvIg SICw+OxFb2SEmK+rZ7XAmdJtvL8/gva+JDYXPy5upfVlvdyoXwYQQyMdBjf0fxEN LcfNo81saqj61h3mHWPK2Azdg8/BnA== =HmdM -----END PGP SIGNATURE----- --1UWUbFP1cBYEclgG--