From 6404621c3501684b6510958d8dd0a4cb7de92d45 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Thu, 27 Jun 2024 23:55:35 -0400 Subject: [PATCH] Update to Org 9.7.5-9-ga091ca (cherry picked from commit 6cc8ffae9a6fa3bbdc71bf5eac3875000c9e7870) --- doc/misc/org.org | 2 +- etc/ORG-NEWS | 3 +++ etc/refcards/orgcard.tex | 2 +- lisp/org/ob-R.el | 2 +- lisp/org/ob-core.el | 10 +++++----- lisp/org/ob-python.el | 2 +- lisp/org/ob-shell.el | 6 +++--- lisp/org/org-colview.el | 4 ++-- lisp/org/org-element-ast.el | 2 +- lisp/org/org-element.el | 13 ++++++------- lisp/org/org-persist.el | 9 ++++++++- lisp/org/org-refile.el | 4 ++-- lisp/org/org-version.el | 4 ++-- lisp/org/org.el | 3 ++- 14 files changed, 38 insertions(+), 28 deletions(-) diff --git a/doc/misc/org.org b/doc/misc/org.org index 31431a6ffc9..fc2935ebe6d 100644 --- a/doc/misc/org.org +++ b/doc/misc/org.org @@ -23163,7 +23163,7 @@ specify a date December 1, 2005, the call might look like =(diary-date 12 1 2005)= or =(diary-date 1 12 2005)= or =(diary-date 2005 12 1)=, depending on the settings. This has been the source of much confusion. Org mode users can resort to special versions of -these functions, namely ~org-date~, ~org-anniversary~, ~org-cyclic, and +these functions, namely ~org-date~, ~org-anniversary~, ~org-cyclic~, and ~org-block~. These work just like the corresponding ~diary-~ functions, but with stable ISO order of arguments (year, month, day) wherever applicable, independent of the value of diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 519d9ca2ee9..bbf26d9515d 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -18,6 +18,9 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org. # Here, we list the *most important* changes and changes that _likely_ # require user action for most Org mode users. # Sorted from most important to least important. +*** Arbitrary shell commands may no longer run when turning on Org mode + +This is for security reasons, to avoid running malicious commands. *** =python-mode.el (MELPA)= support in =ob-python.el= is removed diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex index 3967459fd81..1860e269706 100644 --- a/etc/refcards/orgcard.tex +++ b/etc/refcards/orgcard.tex @@ -1,5 +1,5 @@ % Reference Card for Org Mode -\def\orgversionnumber{9.7.4} +\def\orgversionnumber{9.7.5} \def\versionyear{2024} % latest update \input emacsver.tex diff --git a/lisp/org/ob-R.el b/lisp/org/ob-R.el index f365a68da81..de2d27a9a70 100644 --- a/lisp/org/ob-R.el +++ b/lisp/org/ob-R.el @@ -484,7 +484,7 @@ Returns a placeholder string for insertion, to later be replaced by `org-babel-comint-async-filter'." (org-babel-comint-async-register session (current-buffer) - "^\\(?:[>.+] \\)*\\[1\\] \"ob_comint_async_R_\\(.+?\\)_\\(.+\\)\"$" + "^\\(?:[>.+] \\)*\\[1\\] \"ob_comint_async_R_\\(start\\|end\\|file\\)_\\(.+\\)\"$" 'org-babel-chomp 'ob-session-async-R-value-callback) (cl-case result-type diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el index 8ea1ff6d1a5..727ace84463 100644 --- a/lisp/org/ob-core.el +++ b/lisp/org/ob-core.el @@ -2959,9 +2959,9 @@ used as a string to be appended to #+begin_example line." (goto-char body-start) (insert body)))) -(defun org-babel-merge-params (&rest plists) - "Combine all parameter association lists in PLISTS. -Later elements of PLISTS override the values of previous elements. +(defun org-babel-merge-params (&rest alists) + "Combine all parameter association lists in ALISTS. +Later elements of ALISTS override the values of previous elements. This takes into account some special considerations for certain parameters when merging lists." (let* ((results-exclusive-groups @@ -2990,8 +2990,8 @@ parameters when merging lists." ;; Some keywords accept multiple values. We need to treat ;; them specially. vars results exports) - (dolist (plist plists) - (dolist (pair plist) + (dolist (alist alists) + (dolist (pair alist) (pcase pair (`(:var . ,value) (let ((name (cond diff --git a/lisp/org/ob-python.el b/lisp/org/ob-python.el index 3f81449ebf1..1afbcb5ded5 100644 --- a/lisp/org/ob-python.el +++ b/lisp/org/ob-python.el @@ -537,7 +537,7 @@ Returns a placeholder string for insertion, to later be replaced by `org-babel-comint-async-filter'." (org-babel-comint-async-register session (current-buffer) - "ob_comint_async_python_\\(.+\\)_\\(.+\\)" + "ob_comint_async_python_\\(start\\|end\\|file\\)_\\(.+\\)" 'org-babel-chomp 'org-babel-python-async-value-callback) (pcase result-type (`output diff --git a/lisp/org/ob-shell.el b/lisp/org/ob-shell.el index 35d9e93761b..1f3c0f9cef8 100644 --- a/lisp/org/ob-shell.el +++ b/lisp/org/ob-shell.el @@ -92,10 +92,10 @@ variables." name)) (funcall (if (fboundp 'defvar-1) #'defvar-1 #'set) ;Emacs-29 (intern (concat "org-babel-default-header-args:" name)) - nil) + org-babel-default-header-args:shell) (funcall (if (fboundp 'defvar-1) #'defvar-1 #'set) ;Emacs-29 (intern (concat "org-babel-header-args:" name)) - nil))) + org-babel-header-args:shell))) (defcustom org-babel-shell-names '("sh" "bash" "zsh" "fish" "csh" "ash" "dash" "ksh" "mksh" "posh") @@ -338,7 +338,7 @@ return the value of the last statement in BODY." (org-babel-comint-async-register session (current-buffer) - "ob_comint_async_shell_\\(.+\\)_\\(.+\\)" + "ob_comint_async_shell_\\(start\\|end\\|file\\)_\\(.+\\)" 'ob-shell-async-chunk-callback nil) (org-babel-comint-async-delete-dangling-and-eval diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el index 961ae0fbe54..bc93941e47d 100644 --- a/lisp/org/org-colview.el +++ b/lisp/org/org-colview.el @@ -1662,7 +1662,7 @@ definition." ;; Insert affiliated keywords before the table. (when content-lines (while (string-match-p "\\`[ \t]*#\\+" (car content-lines)) - (insert (pop content-lines) "\n"))) + (insert (string-trim-left (pop content-lines)) "\n"))) (save-excursion ;; Insert table at point. (insert @@ -1675,7 +1675,7 @@ definition." (let ((case-fold-search t)) (dolist (line content-lines) (when (string-match-p "\\`[ \t]*#\\+TBLFM:" line) - (insert "\n" line) + (insert "\n" (string-trim-left line)) (unless recalc (setq recalc t)))))) (when recalc (org-table-recalculate 'all t)) (org-table-align) diff --git a/lisp/org/org-element-ast.el b/lisp/org/org-element-ast.el index fba6b37e662..2c767e1ad24 100644 --- a/lisp/org/org-element-ast.el +++ b/lisp/org/org-element-ast.el @@ -270,7 +270,7 @@ Return value is the containing property name, as a keyword, or nil." "Dynamically computed value. The value can be obtained by calling FUNCTION with containing syntax -node as first argument and ARGS list as remainting arguments. +node as first argument and ARGS list as remaining arguments. If the function throws `:org-element-deferred-retry' signal, assume that the syntax node has been modified by side effect and retry diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el index 191bb5698d1..811d3227653 100644 --- a/lisp/org/org-element.el +++ b/lisp/org/org-element.el @@ -110,7 +110,7 @@ ;; to current setup. (defconst org-element-archive-tag "ARCHIVE" - "Tag marking a substree as archived.") + "Tag marking a subtree as archived.") (defconst org-element-citation-key-re (rx "@" (group (one-or-more (any word "-.:?!`'/*@+|(){}<>&_^$#%~")))) @@ -181,8 +181,7 @@ Drawer's name is located in match group 1.") (rx line-start (0+ (any ?\s ?\t)) ":" (1+ (any ?- ?_ word)) ":" (0+ (any ?\s ?\t)) line-end) - "Regexp matching opening or closing line of a drawer. -Drawer's name is located in match group 1.") + "Regexp matching opening or closing line of a drawer.") (defconst org-element-dynamic-block-open-re (rx line-start (0+ (any ?\s ?\t)) @@ -4679,7 +4678,7 @@ element it has to parse." ;; ;; In general, the checks below should be as efficient as ;; possible, especially early in the `cond' form. (The - ;; early checks will contribute to al subsequent parsers as + ;; early checks will contribute to all subsequent parsers as ;; well). (cond ;; Item. @@ -5956,7 +5955,7 @@ better to remove the commands advised in such a way from this list.") (defmacro org-element--cache-log-message (format-string &rest args) "Add a new log message for org-element-cache. -FORMAT-STRING and ARGS are the same arguments as in `foramt'." +FORMAT-STRING and ARGS are the same arguments as in `format'." `(when (or org-element--cache-diagnostics (eq org-element--cache-self-verify 'backtrace)) (let* ((format-string (concat (format "org-element-cache diagnostics(%s): " @@ -6226,7 +6225,7 @@ the cache." ;; children starting at the same pos. (not (org-element-type-p hashed '(section org-data table)))) hashed - ;; No appriate HASHED. Search the cache. + ;; No appropriate HASHED. Search the cache. (while node (let* ((element (avl-tree--node-data node)) (begin (org-element-begin element))) @@ -8323,7 +8322,7 @@ the cache." limit-count)) (cache-walk-abort)) ;; Make sure that we have a cached - ;; element at the new STAR. + ;; element at the new START. (when start (element-match-at-point))) ;; Check if the buffer or cache has been modified. (unless (org-with-base-buffer nil diff --git a/lisp/org/org-persist.el b/lisp/org/org-persist.el index 52f4b0eef27..b93e32274e9 100644 --- a/lisp/org/org-persist.el +++ b/lisp/org/org-persist.el @@ -666,7 +666,14 @@ When INNER is non-nil, do not try to match as list of containers." (fboundp 'file-attribute-inode-number)) (file-attribute-inode-number (file-attributes file)))) - (setq hash (secure-hash 'md5 associated)) + (setq hash + ;; `secure-hash' may trigger interactive dialog when it + ;; cannot determine the coding system automatically. + ;; Force coding system that works reliably for any text + ;; to avoid it. The has will be consistent anyway, as + ;; long as we use the same coding system. + (let ((coding-system-for-write 'emacs-internal)) + (secure-hash 'md5 associated))) (puthash associated (list (buffer-modified-tick associated) file inode hash) diff --git a/lisp/org/org-refile.el b/lisp/org/org-refile.el index 20b5fbd02c0..c8e64903c33 100644 --- a/lisp/org/org-refile.el +++ b/lisp/org/org-refile.el @@ -666,12 +666,12 @@ this function appends the default value from #'completing-read)) (extra (if org-refile-use-outline-path "/" "")) (cbnex (concat (buffer-name) extra)) - (filename (and cfn (expand-file-name cfn))) + (filename (and cfn (file-truename cfn))) (tbl (mapcar (lambda (x) (if (and (not (member org-refile-use-outline-path '(file full-file-path title))) - (not (equal filename (nth 1 x)))) + (not (equal filename (file-truename (nth 1 x))))) (cons (concat (car x) extra " (" (file-name-nondirectory (nth 1 x)) ")") (cdr x)) diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index 6bef3101bbe..c02aff62ec4 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -5,13 +5,13 @@ (defun org-release () "The release version of Org. Inserted by installing Org mode or when a release is made." - (let ((org-release "9.7.4")) + (let ((org-release "9.7.5")) org-release)) ;;;###autoload (defun org-git-version () "The Git version of Org mode. Inserted by installing Org or when a release is made." - (let ((org-git-version "release_9.7.4-7-g165319")) + (let ((org-git-version "release_9.7.5-9-ga091ca")) org-git-version)) (provide 'org-version) diff --git a/lisp/org/org.el b/lisp/org/org.el index 1e6c10d8011..718d53d641b 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -9,7 +9,7 @@ ;; URL: https://orgmode.org ;; Package-Requires: ((emacs "26.1")) -;; Version: 9.7.4 +;; Version: 9.7.5 ;; This file is part of GNU Emacs. ;; @@ -4541,6 +4541,7 @@ directory." ;; Fake Org mode: `org-element-at-point' ;; doesn't need full set-up. (let ((major-mode 'org-mode)) + (setq-local tab-width 8) (setq alist (org--collect-keywords-1 keywords unique directory -- 2.39.2