diff options
| author | Paul Eggert | 2022-04-17 13:10:19 -0700 |
|---|---|---|
| committer | Paul Eggert | 2022-04-17 13:10:19 -0700 |
| commit | 6cd43d62055c9ec27cacdcaff13d4a52b7efdff2 (patch) | |
| tree | 7506846169ccf9ac740a17ec0c7c69f63650ebf1 | |
| parent | 27a4db931898b8fe3164b329658ca33a1e3c1d4c (diff) | |
| parent | 65c04e7115f329a083a16a364a8400e1685def61 (diff) | |
| download | emacs-6cd43d62055c9ec27cacdcaff13d4a52b7efdff2.tar.gz emacs-6cd43d62055c9ec27cacdcaff13d4a52b7efdff2.zip | |
Merge from origin/emacs-28
65c04e7115 Update to Org 9.5.2-38-g682ccd
| -rw-r--r-- | doc/misc/org.org | 2 | ||||
| -rw-r--r-- | lisp/org/oc-basic.el | 42 | ||||
| -rw-r--r-- | lisp/org/oc-biblatex.el | 7 | ||||
| -rw-r--r-- | lisp/org/org-agenda.el | 17 | ||||
| -rw-r--r-- | lisp/org/org-compat.el | 29 | ||||
| -rw-r--r-- | lisp/org/org-table.el | 4 | ||||
| -rw-r--r-- | lisp/org/org-version.el | 2 | ||||
| -rw-r--r-- | lisp/org/org.el | 10 | ||||
| -rw-r--r-- | lisp/org/ox-html.el | 2 |
9 files changed, 79 insertions, 36 deletions
diff --git a/doc/misc/org.org b/doc/misc/org.org index 60af81ea2cf..3dce83c936b 100644 --- a/doc/misc/org.org +++ b/doc/misc/org.org | |||
| @@ -6405,7 +6405,7 @@ special repeaters =++= and =.+=. For example: | |||
| 6405 | Marking this DONE shifts the date to one month after today. | 6405 | Marking this DONE shifts the date to one month after today. |
| 6406 | 6406 | ||
| 6407 | ,** TODO Wash my hands | 6407 | ,** TODO Wash my hands |
| 6408 | DEADLINE: <2019-04-05 08:00 Sun .+1h> | 6408 | DEADLINE: <2019-04-05 08:00 Fri .+1h> |
| 6409 | Marking this DONE shifts the date to exactly one hour from now. | 6409 | Marking this DONE shifts the date to exactly one hour from now. |
| 6410 | #+end_example | 6410 | #+end_example |
| 6411 | 6411 | ||
diff --git a/lisp/org/oc-basic.el b/lisp/org/oc-basic.el index 81b7e4471fd..775690f1767 100644 --- a/lisp/org/oc-basic.el +++ b/lisp/org/oc-basic.el | |||
| @@ -233,6 +233,8 @@ Return a hash table with citation references as keys and fields alist as values. | |||
| 233 | entries))) | 233 | entries))) |
| 234 | entries)) | 234 | entries)) |
| 235 | 235 | ||
| 236 | (defvar org-cite-basic--file-id-cache nil | ||
| 237 | "Hash table linking files to their hash.") | ||
| 236 | (defun org-cite-basic--parse-bibliography (&optional info) | 238 | (defun org-cite-basic--parse-bibliography (&optional info) |
| 237 | "List all entries available in the buffer. | 239 | "List all entries available in the buffer. |
| 238 | 240 | ||
| @@ -245,14 +247,19 @@ table where keys are references and values are association lists between fields, | |||
| 245 | as symbols, and values as strings or nil. | 247 | as symbols, and values as strings or nil. |
| 246 | 248 | ||
| 247 | Optional argument INFO is the export state, as a property list." | 249 | Optional argument INFO is the export state, as a property list." |
| 250 | (unless (hash-table-p org-cite-basic--file-id-cache) | ||
| 251 | (setq org-cite-basic--file-id-cache (make-hash-table :test #'equal))) | ||
| 248 | (if (plist-member info :cite-basic/bibliography) | 252 | (if (plist-member info :cite-basic/bibliography) |
| 249 | (plist-get info :cite-basic/bibliography) | 253 | (plist-get info :cite-basic/bibliography) |
| 250 | (let ((results nil)) | 254 | (let ((results nil)) |
| 251 | (dolist (file (org-cite-list-bibliography-files)) | 255 | (dolist (file (org-cite-list-bibliography-files)) |
| 252 | (when (file-readable-p file) | 256 | (when (file-readable-p file) |
| 253 | (with-temp-buffer | 257 | (with-temp-buffer |
| 254 | (insert-file-contents file) | 258 | (when (or (org-file-has-changed-p file) |
| 255 | (let* ((file-id (cons file (org-buffer-hash))) | 259 | (not (gethash file org-cite-basic--file-id-cache))) |
| 260 | (insert-file-contents file) | ||
| 261 | (puthash file (org-buffer-hash) org-cite-basic--file-id-cache)) | ||
| 262 | (let* ((file-id (cons file (gethash file org-cite-basic--file-id-cache))) | ||
| 256 | (entries | 263 | (entries |
| 257 | (or (cdr (assoc file-id org-cite-basic--bibliography-cache)) | 264 | (or (cdr (assoc file-id org-cite-basic--bibliography-cache)) |
| 258 | (let ((table | 265 | (let ((table |
| @@ -727,19 +734,24 @@ Return nil if there are no bibliography files or no entries." | |||
| 727 | (t | 734 | (t |
| 728 | (clrhash org-cite-basic--completion-cache) | 735 | (clrhash org-cite-basic--completion-cache) |
| 729 | (dolist (key (org-cite-basic--all-keys)) | 736 | (dolist (key (org-cite-basic--all-keys)) |
| 730 | (let ((completion | 737 | (let* ((entry (org-cite-basic--get-entry |
| 731 | (concat | 738 | key |
| 732 | (let ((author (org-cite-basic--get-field 'author key nil t))) | 739 | ;; Supply pre-calculated bibliography to avoid |
| 733 | (if author | 740 | ;; performance degradation. |
| 734 | (truncate-string-to-width | 741 | (list :cite-basic/bibliography entries))) |
| 735 | (replace-regexp-in-string " and " "; " author) | 742 | (completion |
| 736 | org-cite-basic-author-column-end nil ?\s) | 743 | (concat |
| 737 | (make-string org-cite-basic-author-column-end ?\s))) | 744 | (let ((author (org-cite-basic--get-field 'author entry nil 'raw))) |
| 738 | org-cite-basic-column-separator | 745 | (if author |
| 739 | (let ((date (org-cite-basic--get-year key nil 'no-suffix))) | 746 | (truncate-string-to-width |
| 740 | (format "%4s" (or date ""))) | 747 | (replace-regexp-in-string " and " "; " author) |
| 741 | org-cite-basic-column-separator | 748 | org-cite-basic-author-column-end nil ?\s) |
| 742 | (org-cite-basic--get-field 'title key nil t)))) | 749 | (make-string org-cite-basic-author-column-end ?\s))) |
| 750 | org-cite-basic-column-separator | ||
| 751 | (let ((date (org-cite-basic--get-year entry nil 'no-suffix))) | ||
| 752 | (format "%4s" (or date ""))) | ||
| 753 | org-cite-basic-column-separator | ||
| 754 | (org-cite-basic--get-field 'title entry nil t)))) | ||
| 743 | (puthash completion key org-cite-basic--completion-cache))) | 755 | (puthash completion key org-cite-basic--completion-cache))) |
| 744 | (unless (map-empty-p org-cite-basic--completion-cache) ;no key | 756 | (unless (map-empty-p org-cite-basic--completion-cache) ;no key |
| 745 | (puthash entries t org-cite-basic--completion-cache) | 757 | (puthash entries t org-cite-basic--completion-cache) |
diff --git a/lisp/org/oc-biblatex.el b/lisp/org/oc-biblatex.el index 3cc157ec937..174725b4244 100644 --- a/lisp/org/oc-biblatex.el +++ b/lisp/org/oc-biblatex.el | |||
| @@ -164,12 +164,7 @@ INFO is the export state, as a property list." | |||
| 164 | (mapconcat (lambda (r) | 164 | (mapconcat (lambda (r) |
| 165 | (org-cite-biblatex--atomic-arguments (list r) info)) | 165 | (org-cite-biblatex--atomic-arguments (list r) info)) |
| 166 | (org-cite-get-references citation) | 166 | (org-cite-get-references citation) |
| 167 | "") | 167 | "")))) |
| 168 | ;; According to BibLaTeX manual, left braces or brackets | ||
| 169 | ;; following a multicite command could be parsed as other | ||
| 170 | ;; arguments. So we stop any further parsing by inserting | ||
| 171 | ;; a \relax unconditionally. | ||
| 172 | "\\relax"))) | ||
| 173 | 168 | ||
| 174 | (defun org-cite-biblatex--command (citation info base &optional multi no-opt) | 169 | (defun org-cite-biblatex--command (citation info base &optional multi no-opt) |
| 175 | "Return biblatex command using BASE name for CITATION object. | 170 | "Return biblatex command using BASE name for CITATION object. |
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index ae0058e037e..71aac271f7b 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el | |||
| @@ -4859,7 +4859,7 @@ Press `\\[org-agenda-manipulate-query-add]', \ | |||
| 4859 | 4859 | ||
| 4860 | ;;;###autoload | 4860 | ;;;###autoload |
| 4861 | (defun org-todo-list (&optional arg) | 4861 | (defun org-todo-list (&optional arg) |
| 4862 | "Show all (not done) TODO entries from all agenda file in a single list. | 4862 | "Show all (not done) TODO entries from all agenda files in a single list. |
| 4863 | The prefix arg can be used to select a specific TODO keyword and limit | 4863 | The prefix arg can be used to select a specific TODO keyword and limit |
| 4864 | the list to these. When using `\\[universal-argument]', you will be prompted | 4864 | the list to these. When using `\\[universal-argument]', you will be prompted |
| 4865 | for a keyword. A numeric prefix directly selects the Nth keyword in | 4865 | for a keyword. A numeric prefix directly selects the Nth keyword in |
| @@ -5732,7 +5732,7 @@ displayed in agenda view." | |||
| 5732 | (org-before-first-heading-p) | 5732 | (org-before-first-heading-p) |
| 5733 | (and org-agenda-include-inactive-timestamps | 5733 | (and org-agenda-include-inactive-timestamps |
| 5734 | (org-at-clock-log-p)) | 5734 | (org-at-clock-log-p)) |
| 5735 | (not (eq 'timestamp (org-element-type (org-element-context))))) | 5735 | (not (org-at-timestamp-p 'agenda))) |
| 5736 | (throw :skip nil)) | 5736 | (throw :skip nil)) |
| 5737 | (org-agenda-skip)) | 5737 | (org-agenda-skip)) |
| 5738 | (let* ((pos (match-beginning 0)) | 5738 | (let* ((pos (match-beginning 0)) |
| @@ -7180,12 +7180,13 @@ The optional argument TYPE tells the agenda type." | |||
| 7180 | (concat | 7180 | (concat |
| 7181 | (substring x 0 (match-end 1)) | 7181 | (substring x 0 (match-end 1)) |
| 7182 | (unless (string= org-agenda-todo-keyword-format "") | 7182 | (unless (string= org-agenda-todo-keyword-format "") |
| 7183 | (format org-agenda-todo-keyword-format | 7183 | (format org-agenda-todo-keyword-format |
| 7184 | (match-string 2 x))) | 7184 | (match-string 2 x))) |
| 7185 | ;; Remove `display' property as the icon could leak | 7185 | (unless (string= org-agenda-todo-keyword-format "") |
| 7186 | ;; on the white space. | 7186 | ;; Remove `display' property as the icon could leak |
| 7187 | (org-add-props " " (org-plist-delete (text-properties-at 0 x) | 7187 | ;; on the white space. |
| 7188 | 'display)) | 7188 | (org-add-props " " (org-plist-delete (text-properties-at 0 x) |
| 7189 | 'display))) | ||
| 7189 | (substring x (match-end 3))))))) | 7190 | (substring x (match-end 3))))))) |
| 7190 | x))) | 7191 | x))) |
| 7191 | 7192 | ||
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el index 819ce74d93d..7ac07ce4f6b 100644 --- a/lisp/org/org-compat.el +++ b/lisp/org/org-compat.el | |||
| @@ -72,6 +72,35 @@ | |||
| 72 | (defvar org-table1-hline-regexp) | 72 | (defvar org-table1-hline-regexp) |
| 73 | 73 | ||
| 74 | 74 | ||
| 75 | ;;; Emacs < 29 compatibility | ||
| 76 | |||
| 77 | (defvar org-file-has-changed-p--hash-table (make-hash-table :test #'equal) | ||
| 78 | "Internal variable used by `org-file-has-changed-p'.") | ||
| 79 | |||
| 80 | (if (fboundp 'file-has-changed-p) | ||
| 81 | (defalias 'org-file-has-changed-p #'file-has-changed-p) | ||
| 82 | (defun org-file-has-changed-p (file &optional tag) | ||
| 83 | "Return non-nil if FILE has changed. | ||
| 84 | The size and modification time of FILE are compared to the size | ||
| 85 | and modification time of the same FILE during a previous | ||
| 86 | invocation of `org-file-has-changed-p'. Thus, the first invocation | ||
| 87 | of `org-file-has-changed-p' always returns non-nil when FILE exists. | ||
| 88 | The optional argument TAG, which must be a symbol, can be used to | ||
| 89 | limit the comparison to invocations with identical tags; it can be | ||
| 90 | the symbol of the calling function, for example." | ||
| 91 | (let* ((file (directory-file-name (expand-file-name file))) | ||
| 92 | (remote-file-name-inhibit-cache t) | ||
| 93 | (fileattr (file-attributes file 'integer)) | ||
| 94 | (attr (and fileattr | ||
| 95 | (cons (file-attribute-size fileattr) | ||
| 96 | (file-attribute-modification-time fileattr)))) | ||
| 97 | (sym (concat (symbol-name tag) "@" file)) | ||
| 98 | (cachedattr (gethash sym org-file-has-changed-p--hash-table))) | ||
| 99 | (when (not (equal attr cachedattr)) | ||
| 100 | (puthash sym attr org-file-has-changed-p--hash-table))))) | ||
| 101 | |||
| 102 | |||
| 103 | |||
| 75 | ;;; Emacs < 28.1 compatibility | 104 | ;;; Emacs < 28.1 compatibility |
| 76 | 105 | ||
| 77 | (if (fboundp 'directory-empty-p) | 106 | (if (fboundp 'directory-empty-p) |
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index c4daed16656..860fd6e5608 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el | |||
| @@ -462,14 +462,14 @@ This may be useful when columns have been shrunk." | |||
| 462 | (when pos (goto-char pos)) | 462 | (when pos (goto-char pos)) |
| 463 | (goto-char (line-beginning-position)) | 463 | (goto-char (line-beginning-position)) |
| 464 | (let ((end (line-end-position)) str) | 464 | (let ((end (line-end-position)) str) |
| 465 | (backward-char) | 465 | (goto-char (1- pos)) |
| 466 | (while (progn (forward-char 1) (< (point) end)) | 466 | (while (progn (forward-char 1) (< (point) end)) |
| 467 | (let ((ov (car (overlays-at (point))))) | 467 | (let ((ov (car (overlays-at (point))))) |
| 468 | (if (not ov) | 468 | (if (not ov) |
| 469 | (push (char-to-string (char-after)) str) | 469 | (push (char-to-string (char-after)) str) |
| 470 | (push (overlay-get ov 'display) str) | 470 | (push (overlay-get ov 'display) str) |
| 471 | (goto-char (1- (overlay-end ov)))))) | 471 | (goto-char (1- (overlay-end ov)))))) |
| 472 | (format "%s" (mapconcat #'identity (reverse str) ""))))) | 472 | (format "|%s" (mapconcat #'identity (reverse str) ""))))) |
| 473 | 473 | ||
| 474 | (defvar-local org-table-header-overlay nil) | 474 | (defvar-local org-table-header-overlay nil) |
| 475 | (defun org-table-header-set-header () | 475 | (defun org-table-header-set-header () |
diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index e82dbbf398c..5cc98e38066 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el | |||
| @@ -11,7 +11,7 @@ Inserted by installing Org mode or when a release is made." | |||
| 11 | (defun org-git-version () | 11 | (defun org-git-version () |
| 12 | "The Git version of Org mode. | 12 | "The Git version of Org mode. |
| 13 | Inserted by installing Org or when a release is made." | 13 | Inserted by installing Org or when a release is made." |
| 14 | (let ((org-git-version "release_9.5.2-25-gaf6f12")) | 14 | (let ((org-git-version "release_9.5.2-38-g682ccd")) |
| 15 | org-git-version)) | 15 | org-git-version)) |
| 16 | 16 | ||
| 17 | (provide 'org-version) | 17 | (provide 'org-version) |
diff --git a/lisp/org/org.el b/lisp/org/org.el index d656a51591e..4524812c55f 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el | |||
| @@ -199,6 +199,7 @@ Stars are put in group 1 and the trimmed body in group 2.") | |||
| 199 | (declare-function org-update-radio-target-regexp "ol" ()) | 199 | (declare-function org-update-radio-target-regexp "ol" ()) |
| 200 | 200 | ||
| 201 | (defvar org-element-paragraph-separate) | 201 | (defvar org-element-paragraph-separate) |
| 202 | (defvar org-element--timestamp-regexp) | ||
| 202 | (defvar org-indent-indentation-per-level) | 203 | (defvar org-indent-indentation-per-level) |
| 203 | (defvar org-radio-target-regexp) | 204 | (defvar org-radio-target-regexp) |
| 204 | (defvar org-target-link-regexp) | 205 | (defvar org-target-link-regexp) |
| @@ -15020,7 +15021,11 @@ When matching, the match groups are the following: | |||
| 15020 | group 4: day name | 15021 | group 4: day name |
| 15021 | group 5: hours, if any | 15022 | group 5: hours, if any |
| 15022 | group 6: minutes, if any" | 15023 | group 6: minutes, if any" |
| 15023 | (let* ((regexp (if extended org-ts-regexp3 org-ts-regexp2)) | 15024 | (let* ((regexp (if extended |
| 15025 | (if (eq extended 'agenda) | ||
| 15026 | org-element--timestamp-regexp | ||
| 15027 | org-ts-regexp3) | ||
| 15028 | org-ts-regexp2)) | ||
| 15024 | (pos (point)) | 15029 | (pos (point)) |
| 15025 | (match? | 15030 | (match? |
| 15026 | (let ((boundaries (org-in-regexp regexp))) | 15031 | (let ((boundaries (org-in-regexp regexp))) |
| @@ -15051,7 +15056,8 @@ When matching, the match groups are the following: | |||
| 15051 | ((org-pos-in-match-range pos 8) 'minute) | 15056 | ((org-pos-in-match-range pos 8) 'minute) |
| 15052 | ((or (org-pos-in-match-range pos 4) | 15057 | ((or (org-pos-in-match-range pos 4) |
| 15053 | (org-pos-in-match-range pos 5)) 'day) | 15058 | (org-pos-in-match-range pos 5)) 'day) |
| 15054 | ((and (> pos (or (match-end 8) (match-end 5))) | 15059 | ((and (or (match-end 8) (match-end 5)) |
| 15060 | (> pos (or (match-end 8) (match-end 5))) | ||
| 15055 | (< pos (match-end 0))) | 15061 | (< pos (match-end 0))) |
| 15056 | (- pos (or (match-end 8) (match-end 5)))) | 15062 | (- pos (or (match-end 8) (match-end 5)))) |
| 15057 | (t 'day)))) | 15063 | (t 'day)))) |
diff --git a/lisp/org/ox-html.el b/lisp/org/ox-html.el index 5de0b5d675c..81ef002a052 100644 --- a/lisp/org/ox-html.el +++ b/lisp/org/ox-html.el | |||
| @@ -442,7 +442,7 @@ property on the headline itself.") | |||
| 442 | { font-size: 10px; font-weight: bold; white-space: nowrap; } | 442 | { font-size: 10px; font-weight: bold; white-space: nowrap; } |
| 443 | .org-info-js_search-highlight | 443 | .org-info-js_search-highlight |
| 444 | { background-color: #ffff00; color: #000000; font-weight: bold; } | 444 | { background-color: #ffff00; color: #000000; font-weight: bold; } |
| 445 | .org-svg { width: 90%; } | 445 | .org-svg { } |
| 446 | </style>" | 446 | </style>" |
| 447 | "The default style specification for exported HTML files. | 447 | "The default style specification for exported HTML files. |
| 448 | You can use `org-html-head' and `org-html-head-extra' to add to | 448 | You can use `org-html-head' and `org-html-head-extra' to add to |