From 563a4396b6afb6d46f0b6c2c04f2ce11625ab698 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 1 Jan 2023 22:23:43 -0500 Subject: [PATCH 1/2] org-assert-version: Deleting trailing whitespace Otherwise this fails Emacs's pre-commit check. --- lisp/org-macs.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org-macs.el b/lisp/org-macs.el index bdfca1292..72929cdd2 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -74,9 +74,9 @@ Version mismatch is commonly encountered in the following situations: loading of the newer Org version. It is recommended to put - + %s - + early in the config. Ideally, right after the straight.el bootstrap. Moving `use-package' :straight declaration may not be sufficient if the corresponding `use-package' statement is From 1cd39c9e3002b58fbe8a293a808046be92199bf5 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Mon, 2 Jan 2023 10:24:34 +0300 Subject: [PATCH 2/2] org-mode: Fix element cache updates when aligning tables during startup * lisp/org.el (org-mode): Do not suppress modification hooks when aligning tables. Otherwise, cache state may become invalid. Reported-by: Stefan Link: https://orgmode.org/list/87tu1wse45.fsf@localhost --- lisp/org.el | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 21764f3d4..286a34ba2 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4898,16 +4898,20 @@ The following commands are available: (= (point-min) (point-max))) (insert "# -*- mode: org -*-\n\n")) (unless org-inhibit-startup + (when (or org-startup-align-all-tables org-startup-shrink-all-tables) + (org-table-map-tables + (cond ((and org-startup-align-all-tables + org-startup-shrink-all-tables) + (lambda () (org-table-align) (org-table-shrink))) + (org-startup-align-all-tables #'org-table-align) + (t #'org-table-shrink)) + t)) + ;; Suppress modification hooks to speed up the startup. + ;; However, do it only when text properties/overlays, but not + ;; buffer text are actually modified. We still need to track text + ;; modifications to make cache updates work reliably. (org-unmodified (when org-startup-with-beamer-mode (org-beamer-mode)) - (when (or org-startup-align-all-tables org-startup-shrink-all-tables) - (org-table-map-tables - (cond ((and org-startup-align-all-tables - org-startup-shrink-all-tables) - (lambda () (org-table-align) (org-table-shrink))) - (org-startup-align-all-tables #'org-table-align) - (t #'org-table-shrink)) - t)) (when org-startup-with-inline-images (org-display-inline-images)) (when org-startup-with-latex-preview (org-latex-preview '(16))) (unless org-inhibit-startup-visibility-stuff (org-cycle-set-startup-visibility))