Update to Org 9.6-81-g563a43

This commit is contained in:
Kyle Meyer 2023-01-01 22:24:28 -05:00
parent d9ed736f0a
commit 2569ede9c4
10 changed files with 118 additions and 104 deletions

View file

@ -24,7 +24,7 @@ the time being. It will be removed in the next release.
See https://orgmode.org/list/87r0yk7bx8.fsf@localhost for more details. See https://orgmode.org/list/87r0yk7bx8.fsf@localhost for more details.
*** Element cache is enabled by default and work for headings *** Element cache is enabled by default and works for headings
The old element cache code has been refactored. Emacs does not hang The old element cache code has been refactored. Emacs does not hang
anymore when the cache is enabled. anymore when the cache is enabled.

View file

@ -2461,13 +2461,18 @@ INFO may provide the values of these header arguments (in the
(insert (insert
(org-trim (org-trim
(org-list-to-org (org-list-to-org
;; We arbitrarily choose to format non-strings
;; as %S.
(cons 'unordered (cons 'unordered
(mapcar (mapcar
(lambda (e) (lambda (e)
(cond (cond
((stringp e) (list e)) ((stringp e) (list e))
((listp e) ((listp e)
(mapcar (lambda (x) (format "%S" x)) e)) (mapcar
(lambda (x)
(if (stringp x) x (format "%S" x)))
e))
(t (list (format "%S" e))))) (t (list (format "%S" e)))))
(if (listp result) result (if (listp result) result
(split-string result "\n" t)))) (split-string result "\n" t))))

View file

@ -3477,14 +3477,14 @@ This ensures the export commands can easily use it."
(setq props (plist-put props 'tags (mapconcat #'identity tmp ":")))) (setq props (plist-put props 'tags (mapconcat #'identity tmp ":"))))
(when (setq tmp (plist-get props 'date)) (when (setq tmp (plist-get props 'date))
(when (integerp tmp) (setq tmp (calendar-gregorian-from-absolute tmp))) (when (integerp tmp) (setq tmp (calendar-gregorian-from-absolute tmp)))
(let ((calendar-date-display-form '(year "-" month "-" day))) (let ((calendar-date-display-form
'((format "%4d, %9s %2s, %4s" dayname monthname day year)) '(year "-" (string-pad month 2 ?0 'left) "-" (string-pad day 2 ?0 'left))))
(setq tmp (calendar-date-string tmp))) (setq tmp (calendar-date-string tmp)))
(setq props (plist-put props 'date tmp))) (setq props (plist-put props 'date tmp)))
(when (setq tmp (plist-get props 'day)) (when (setq tmp (plist-get props 'day))
(when (integerp tmp) (setq tmp (calendar-gregorian-from-absolute tmp))) (when (integerp tmp) (setq tmp (calendar-gregorian-from-absolute tmp)))
(let ((calendar-date-display-form '(year "-" month "-" day))) (let ((calendar-date-display-form
'(year "-" (string-pad month 2 ?0 'left) "-" (string-pad day 2 ?0 'left))))
(setq tmp (calendar-date-string tmp))) (setq tmp (calendar-date-string tmp)))
(setq props (plist-put props 'day tmp)) (setq props (plist-put props 'day tmp))
(setq props (plist-put props 'agenda-day tmp))) (setq props (plist-put props 'agenda-day tmp)))
@ -4678,7 +4678,7 @@ is active."
(org-agenda-text-search-extra-files org-agenda-text-search-extra-files) (org-agenda-text-search-extra-files org-agenda-text-search-extra-files)
regexp rtn rtnall files file pos inherited-tags regexp rtn rtnall files file pos inherited-tags
marker category level tags c neg re boolean marker category level tags c neg re boolean
ee txt beg end words regexps+ regexps- hdl-only buffer beg1 str) ee txt beg end last-search-end words regexps+ regexps- hdl-only buffer beg1 str)
(unless (and (not edit-at) (unless (and (not edit-at)
(stringp string) (stringp string)
(string-match "\\S-" string)) (string-match "\\S-" string))
@ -4817,6 +4817,7 @@ is active."
(throw 'nextfile t)) (throw 'nextfile t))
(goto-char (max (point-min) (1- (point)))) (goto-char (max (point-min) (1- (point))))
(while (re-search-forward regexp nil t) (while (re-search-forward regexp nil t)
(setq last-search-end (point))
(org-back-to-heading t) (org-back-to-heading t)
(while (and (not (zerop org-agenda-search-view-max-outline-level)) (while (and (not (zerop org-agenda-search-view-max-outline-level))
(> (org-reduced-level (org-outline-level)) (> (org-reduced-level (org-outline-level))
@ -4878,7 +4879,7 @@ is active."
'priority 1000 'priority 1000
'type "search") 'type "search")
(push txt ee) (push txt ee)
(goto-char (1- end)))))))))) (goto-char (max (1- end) last-search-end))))))))))
(setq rtn (nreverse ee)) (setq rtn (nreverse ee))
(setq rtnall (append rtnall rtn))) (setq rtnall (append rtnall rtn)))
(org-agenda--insert-overriding-header (org-agenda--insert-overriding-header

View file

@ -1,6 +1,6 @@
;;; org-cycle.el --- Visibility cycling of Org entries -*- lexical-binding: t; -*- ;;; org-cycle.el --- Visibility cycling of Org entries -*- lexical-binding: t; -*-
;; ;;
;; Copyright (C) 2020, 2023-2020 Free Software Foundation, Inc. ;; Copyright (C) 2020-2023 Free Software Foundation, Inc.
;; ;;
;; Maintainer: Ihor Radchenko <yantar92 at gmail dot com> ;; Maintainer: Ihor Radchenko <yantar92 at gmail dot com>
;; Keywords: folding, visibility cycling, invisible text ;; Keywords: folding, visibility cycling, invisible text

View file

@ -1,6 +1,6 @@
;;; org-fold-core.el --- Folding buffer text -*- lexical-binding: t; -*- ;;; org-fold-core.el --- Folding buffer text -*- lexical-binding: t; -*-
;; ;;
;; Copyright (C) 2020, 2023-2020 Free Software Foundation, Inc. ;; Copyright (C) 2020-2023 Free Software Foundation, Inc.
;; ;;
;; Author: Ihor Radchenko <yantar92 at gmail dot com> ;; Author: Ihor Radchenko <yantar92 at gmail dot com>
;; Keywords: folding, invisible text ;; Keywords: folding, invisible text

View file

@ -1,6 +1,6 @@
;;; org-fold.el --- Folding of Org entries -*- lexical-binding: t; -*- ;;; org-fold.el --- Folding of Org entries -*- lexical-binding: t; -*-
;; ;;
;; Copyright (C) 2020, 2023-2020 Free Software Foundation, Inc. ;; Copyright (C) 2020-2023 Free Software Foundation, Inc.
;; ;;
;; Author: Ihor Radchenko <yantar92 at gmail dot com> ;; Author: Ihor Radchenko <yantar92 at gmail dot com>
;; Keywords: folding, invisible text ;; Keywords: folding, invisible text

View file

@ -74,11 +74,15 @@ Version mismatch is commonly encountered in the following situations:
loading of the newer Org version. loading of the newer Org version.
It is recommended to put It is recommended to put
(straight-use-package 'org)
%s
early in the config. Ideally, right after the straight.el early in the config. Ideally, right after the straight.el
bootstrap. Moving `use-package' :straight declaration may not be bootstrap. Moving `use-package' :straight declaration may not be
sufficient if the corresponding `use-package' statement is sufficient if the corresponding `use-package' statement is
deferring the loading.") deferring the loading."
;; Avoid `warn' replacing "'" with "" (see `format-message').
"(straight-use-package 'org)")
(error "Org version mismatch. Make sure that correct `load-path' is set early in init.el"))) (error "Org version mismatch. Make sure that correct `load-path' is set early in init.el")))
;; We rely on org-macs when generating Org version. Checking Org ;; We rely on org-macs when generating Org version. Checking Org

View file

@ -161,7 +161,7 @@
(declare-function org-at-heading-p "org" (&optional invisible-not-ok)) (declare-function org-at-heading-p "org" (&optional invisible-not-ok))
(defconst org-persist--storage-version "2.7" (defconst org-persist--storage-version "3.1"
"Persistent storage layout version.") "Persistent storage layout version.")
(defgroup org-persist nil (defgroup org-persist nil
@ -431,25 +431,27 @@ Return PLIST."
(when key (remhash (cons cont (list :key key)) org-persist--index-hash)))) (when key (remhash (cons cont (list :key key)) org-persist--index-hash))))
(setq org-persist--index (delq existing org-persist--index))))) (setq org-persist--index (delq existing org-persist--index)))))
(defun org-persist--get-collection (container &optional associated &rest misc) (defun org-persist--get-collection (container &optional associated misc)
"Return or create collection used to store CONTAINER for ASSOCIATED. "Return or create collection used to store CONTAINER for ASSOCIATED.
When ASSOCIATED is nil, it is a global CONTAINER. When ASSOCIATED is nil, it is a global CONTAINER.
ASSOCIATED can also be a (:buffer buffer) or buffer, (:file file-path) ASSOCIATED can also be a (:buffer buffer) or buffer, (:file file-path)
or file-path, (:inode inode), (:hash hash), or or (:key key). or file-path, (:inode inode), (:hash hash), or or (:key key).
MISC, if non-nil will be appended to the collection." MISC, if non-nil will be appended to the collection. It must be a plist."
(unless (and (listp container) (listp (car container))) (unless (and (listp container) (listp (car container)))
(setq container (list container))) (setq container (list container)))
(setq associated (org-persist--normalize-associated associated)) (setq associated (org-persist--normalize-associated associated))
(unless (equal misc '(nil)) (when (and misc (or (not (listp misc)) (= 1 (% (length misc) 2))))
(setq associated (append associated misc))) (error "org-persist: Not a plist: %S" misc))
(or (org-persist--find-index (or (org-persist--find-index
`( :container ,(org-persist--normalize-container container) `( :container ,(org-persist--normalize-container container)
:associated ,associated)) :associated ,associated))
(org-persist--add-to-index (org-persist--add-to-index
(list :container (org-persist--normalize-container container) (nconc
:persist-file (list :container (org-persist--normalize-container container)
(replace-regexp-in-string "^.." "\\&/" (org-id-uuid)) :persist-file
:associated associated)))) (replace-regexp-in-string "^.." "\\&/" (org-id-uuid))
:associated associated)
misc))))
;;;; Reading container data. ;;;; Reading container data.
@ -650,9 +652,10 @@ COLLECTION is the plist holding data collection."
(file-copy (org-file-name-concat (file-copy (org-file-name-concat
org-persist-directory org-persist-directory
(format "%s-%s.%s" persist-file (md5 path) ext)))) (format "%s-%s.%s" persist-file (md5 path) ext))))
(unless (file-exists-p (file-name-directory file-copy)) (unless (file-exists-p file-copy)
(make-directory (file-name-directory file-copy) t)) (unless (file-exists-p (file-name-directory file-copy))
(copy-file path file-copy 'overwrite) (make-directory (file-name-directory file-copy) t))
(copy-file path file-copy 'overwrite))
(format "%s-%s.%s" persist-file (md5 path) ext))))) (format "%s-%s.%s" persist-file (md5 path) ext)))))
(defun org-persist-write:url (c collection) (defun org-persist-write:url (c collection)
@ -719,7 +722,8 @@ last access, or a function accepting a single argument - collection.
EXPIRY key has no effect when INHERIT is non-nil. EXPIRY key has no effect when INHERIT is non-nil.
Optional key WRITE-IMMEDIATELY controls whether to save the container Optional key WRITE-IMMEDIATELY controls whether to save the container
data immediately. data immediately.
MISC will be appended to CONTAINER. MISC will be appended to the collection. It must be alternating :KEY
VALUE pairs.
When WRITE-IMMEDIATELY is non-nil, the return value will be the same When WRITE-IMMEDIATELY is non-nil, the return value will be the same
with `org-persist-write'." with `org-persist-write'."
(unless org-persist--index (org-persist--load-index)) (unless org-persist--index (org-persist--load-index))

View file

@ -629,83 +629,83 @@ Leave point in edit buffer."
"Fontify code block between START and END using LANG's syntax. "Fontify code block between START and END using LANG's syntax.
This function is called by Emacs' automatic fontification, as long This function is called by Emacs' automatic fontification, as long
as `org-src-fontify-natively' is non-nil." as `org-src-fontify-natively' is non-nil."
(let ((lang-mode (org-src-get-lang-mode lang))) (let ((modified (buffer-modified-p)))
(when (fboundp lang-mode) (remove-text-properties start end '(face nil))
(let ((string (buffer-substring-no-properties start end)) (let ((lang-mode (org-src-get-lang-mode lang)))
(modified (buffer-modified-p)) (when (fboundp lang-mode)
(org-buffer (current-buffer))) (let ((string (buffer-substring-no-properties start end))
(remove-text-properties start end '(face nil)) (org-buffer (current-buffer)))
(with-current-buffer (with-current-buffer
(get-buffer-create (get-buffer-create
(format " *org-src-fontification:%s*" lang-mode)) (format " *org-src-fontification:%s*" lang-mode))
(let ((inhibit-modification-hooks nil)) (let ((inhibit-modification-hooks nil))
(erase-buffer) (erase-buffer)
;; Add string and a final space to ensure property change. ;; Add string and a final space to ensure property change.
(insert string " ")) (insert string " "))
(unless (eq major-mode lang-mode) (funcall lang-mode)) (unless (eq major-mode lang-mode) (funcall lang-mode))
(font-lock-ensure) (font-lock-ensure)
(let ((pos (point-min)) next) (let ((pos (point-min)) next)
(while (setq next (next-property-change pos)) (while (setq next (next-property-change pos))
;; Handle additional properties from font-lock, so as to ;; Handle additional properties from font-lock, so as to
;; preserve, e.g., composition. ;; preserve, e.g., composition.
;; FIXME: We copy 'font-lock-face property explicitly because ;; FIXME: We copy 'font-lock-face property explicitly because
;; `font-lock-mode' is not enabled in the buffers starting from ;; `font-lock-mode' is not enabled in the buffers starting from
;; space and the remapping between 'font-lock-face and 'face ;; space and the remapping between 'font-lock-face and 'face
;; text properties may thus not be set. See commit ;; text properties may thus not be set. See commit
;; 453d634bc. ;; 453d634bc.
(dolist (prop (append '(font-lock-face face) font-lock-extra-managed-props)) (dolist (prop (append '(font-lock-face face) font-lock-extra-managed-props))
(let ((new-prop (get-text-property pos prop))) (let ((new-prop (get-text-property pos prop)))
(when new-prop (when new-prop
(if (not (eq prop 'invisible)) (if (not (eq prop 'invisible))
(put-text-property (put-text-property
(+ start (1- pos)) (1- (+ start next)) prop new-prop (+ start (1- pos)) (1- (+ start next)) prop new-prop
org-buffer) org-buffer)
;; Special case. `invisible' text property may ;; Special case. `invisible' text property may
;; clash with Org folding. Do not assign ;; clash with Org folding. Do not assign
;; `invisible' text property directly. Use ;; `invisible' text property directly. Use
;; property alias instead. ;; property alias instead.
(let ((invisibility-spec (let ((invisibility-spec
(or (or
;; ATOM spec. ;; ATOM spec.
(and (memq new-prop buffer-invisibility-spec) (and (memq new-prop buffer-invisibility-spec)
new-prop) new-prop)
;; (ATOM . ELLIPSIS) spec. ;; (ATOM . ELLIPSIS) spec.
(assq new-prop buffer-invisibility-spec)))) (assq new-prop buffer-invisibility-spec))))
(with-current-buffer org-buffer (with-current-buffer org-buffer
;; Add new property alias. ;; Add new property alias.
(unless (memq 'org-src-invisible (unless (memq 'org-src-invisible
(cdr (assq 'invisible char-property-alias-alist))) (cdr (assq 'invisible char-property-alias-alist)))
(setq-local (setq-local
char-property-alias-alist char-property-alias-alist
(cons (cons 'invisible (cons (cons 'invisible
(nconc (cdr (assq 'invisible char-property-alias-alist)) (nconc (cdr (assq 'invisible char-property-alias-alist))
'(org-src-invisible))) '(org-src-invisible)))
(remove (assq 'invisible char-property-alias-alist) (remove (assq 'invisible char-property-alias-alist)
char-property-alias-alist)))) char-property-alias-alist))))
;; Carry over the invisibility spec, unless ;; Carry over the invisibility spec, unless
;; already present. Note that there might ;; already present. Note that there might
;; be conflicting invisibility specs from ;; be conflicting invisibility specs from
;; different major modes. We cannot do much ;; different major modes. We cannot do much
;; about this then. ;; about this then.
(when invisibility-spec (when invisibility-spec
(add-to-invisibility-spec invisibility-spec)) (add-to-invisibility-spec invisibility-spec))
(put-text-property (put-text-property
(+ start (1- pos)) (1- (+ start next)) (+ start (1- pos)) (1- (+ start next))
'org-src-invisible new-prop 'org-src-invisible new-prop
org-buffer))))))) org-buffer)))))))
(setq pos next))) (setq pos next)))
(set-buffer-modified-p nil)) (set-buffer-modified-p nil)))))
;; Add Org faces. ;; Add Org faces.
(let ((src-face (nth 1 (assoc-string lang org-src-block-faces t)))) (let ((src-face (nth 1 (assoc-string lang org-src-block-faces t))))
(when (or (facep src-face) (listp src-face)) (when (or (facep src-face) (listp src-face))
(font-lock-append-text-property start end 'face src-face)) (font-lock-append-text-property start end 'face src-face))
(font-lock-append-text-property start end 'face 'org-block)) (font-lock-append-text-property start end 'face 'org-block))
;; Clear abbreviated link folding. ;; Clear abbreviated link folding.
(org-fold-region start end nil 'org-link) (org-fold-region start end nil 'org-link)
(add-text-properties (add-text-properties
start end start end
'(font-lock-fontified t fontified t font-lock-multiline t)) '(font-lock-fontified t fontified t font-lock-multiline t))
(set-buffer-modified-p modified))))) (set-buffer-modified-p modified)))
(defun org-fontify-inline-src-blocks (limit) (defun org-fontify-inline-src-blocks (limit)
"Try to apply `org-fontify-inline-src-blocks-1'." "Try to apply `org-fontify-inline-src-blocks-1'."

View file

@ -11,7 +11,7 @@ Inserted by installing Org mode or when a release is made."
(defun org-git-version () (defun org-git-version ()
"The Git version of Org mode. "The Git version of Org mode.
Inserted by installing Org or when a release is made." Inserted by installing Org or when a release is made."
(let ((org-git-version "release_9.6-61-g63e073f")) (let ((org-git-version "release_9.6-81-g563a43"))
org-git-version)) org-git-version))
(provide 'org-version) (provide 'org-version)