From e04b3d41bb41ccca3d403345b12b9a614213d488 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 7 Jan 2023 23:50:54 -0500 Subject: [PATCH] Update to Org 9.6-90-ga6523f --- doc/misc/org.org | 11 ++++++----- lisp/org/ob-core.el | 14 ++++---------- lisp/org/ob-shell.el | 2 +- lisp/org/org-macs.el | 11 ++++++++--- lisp/org/org-persist.el | 2 +- lisp/org/org-table.el | 1 + lisp/org/org-version.el | 2 +- lisp/org/org.el | 22 +++++++++++++--------- lisp/org/ox.el | 1 - 9 files changed, 35 insertions(+), 31 deletions(-) diff --git a/doc/misc/org.org b/doc/misc/org.org index ed3eb0626f2..7ca2cce9e7f 100644 --- a/doc/misc/org.org +++ b/doc/misc/org.org @@ -1249,11 +1249,12 @@ After the drawer. #+findex: org-insert-drawer You can interactively insert a drawer at point by calling ~org-insert-drawer~, which is bound to {{{kbd(C-c C-x d)}}}. With an -active region, this command puts the region inside the drawer. With -a prefix argument, this command calls ~org-insert-property-drawer~, -which creates a =PROPERTIES= drawer right below the current headline. -Org mode uses this special drawer for storing properties (see -[[*Properties and Columns]]). You cannot use it for anything else. +active region, this command puts the region inside the drawer. With a +prefix argument, this command calls non-interactive function +~org-insert-property-drawer~, which creates a =PROPERTIES= drawer +right below the current headline. Org mode uses this special drawer +for storing properties (see [[*Properties and Columns]]). You cannot use +it for anything else. Completion over drawer keywords is also possible using {{{kbd(M-TAB)}}}[fn:6]. diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el index 9bb77f7920b..93cdf6ae868 100644 --- a/lisp/org/ob-core.el +++ b/lisp/org/ob-core.el @@ -1690,6 +1690,7 @@ shown below. (append (split-string (if (stringp raw-result) raw-result + ;; FIXME: Arbitrary code evaluation. (eval raw-result t))) (cdr (assq :result-params params)))))) (append @@ -2860,6 +2861,7 @@ parameters when merging lists." (split-string (cond ((stringp value) value) ((functionp value) (funcall value)) + ;; FIXME: Arbitrary code evaluation. (t (eval value t))))))) (`(:exports . ,value) (setq exports (funcall merge @@ -3188,16 +3190,8 @@ situations in which is it not appropriate." ((and (not inhibit-lisp-eval) (or (memq (string-to-char cell) '(?\( ?' ?` ?\[)) (string= cell "*this*"))) - ;; Prevent arbitrary function calls. - (if (and (memq (string-to-char cell) '(?\( ?`)) - (not (org-babel-confirm-evaluate - ;; See `org-babel-get-src-block-info'. - (list "emacs-lisp" cell - '((:eval . yes)) nil (format "%s" cell) - nil nil)))) - ;; Not allowed. - (user-error "Evaluation of elisp code %S aborted." cell) - (eval (read cell) t))) + ;; FIXME: Arbitrary code evaluation. + (eval (read cell) t)) ((save-match-data (and (string-match "^[[:space:]]*\"\\(.*\\)\"[[:space:]]*$" cell) (not (string-match "[^\\]\"" (match-string 1 cell))))) diff --git a/lisp/org/ob-shell.el b/lisp/org/ob-shell.el index 4a60186cd5d..2c30a26056b 100644 --- a/lisp/org/ob-shell.el +++ b/lisp/org/ob-shell.el @@ -79,7 +79,7 @@ is modified outside the Customize interface." ,(format "Execute a block of %s commands with Babel." name) (let ((shell-file-name ,name) (org-babel-prompt-command - (or (alist-get ,name org-babel-shell-set-prompt-commands) + (or (cdr (assoc ,name org-babel-shell-set-prompt-commands)) (alist-get t org-babel-shell-set-prompt-commands)))) (org-babel-execute:shell body params)))) (eval `(defalias ',(intern (concat "org-babel-variable-assignments:" name)) diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el index 72929cdd26c..07c668a807d 100644 --- a/lisp/org/org-macs.el +++ b/lisp/org/org-macs.el @@ -372,18 +372,23 @@ be set to a buffer or a buffer name. `shell-command' then uses it for output." (let* ((base-name (file-name-base source)) (full-name (file-truename source)) - (out-dir (or (file-name-directory source) "./")) + (relative-name (file-relative-name source)) + (out-dir (if (file-name-directory source) + ;; Expand "~". Shell expansion will be disabled + ;; in the shell command call. + (file-name-directory full-name) + "./")) (output (expand-file-name (concat base-name "." ext) out-dir)) (time (file-attribute-modification-time (file-attributes output))) (err-msg (if (stringp err-msg) (concat ". " err-msg) ""))) (save-window-excursion (pcase process - ((pred functionp) (funcall process (shell-quote-argument source))) + ((pred functionp) (funcall process (shell-quote-argument relative-name))) ((pred consp) (let ((log-buf (and log-buf (get-buffer-create log-buf))) (spec (append spec `((?b . ,(shell-quote-argument base-name)) - (?f . ,(shell-quote-argument source)) + (?f . ,(shell-quote-argument relative-name)) (?F . ,(shell-quote-argument full-name)) (?o . ,(shell-quote-argument out-dir)) (?O . ,(shell-quote-argument output)))))) diff --git a/lisp/org/org-persist.el b/lisp/org/org-persist.el index c3650c167e2..336496efbfb 100644 --- a/lisp/org/org-persist.el +++ b/lisp/org/org-persist.el @@ -753,12 +753,12 @@ with `org-persist-write'." When ASSOCIATED is `all', unregister CONTAINER everywhere." (unless org-persist--index (org-persist--load-index)) (setq container (org-persist--normalize-container container)) - (setq associated (org-persist--normalize-associated associated)) (if (eq associated 'all) (mapc (lambda (collection) (when (member container (plist-get collection :container)) (org-persist-unregister container (plist-get collection :associated)))) org-persist--index) + (setq associated (org-persist--normalize-associated associated)) (let ((collection (org-persist--find-index `(:container ,container :associated ,associated)))) (when collection (if (= (length (plist-get collection :container)) 1) diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index 06cf919db76..fac9e68c124 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el @@ -2614,6 +2614,7 @@ location of point." (if lispp (setq ev (condition-case nil + ;; FIXME: Arbitrary code evaluation. (eval (eval (read form))) (error "#ERROR")) ev (if (numberp ev) (number-to-string ev) ev) diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index dd6d92d8e58..942cc4eae8b 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." (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.6-81-g563a43")) + (let ((org-git-version "release_9.6-90-ga6523f")) org-git-version)) (provide 'org-version) diff --git a/lisp/org/org.el b/lisp/org/org.el index 21764f3d434..8d226c2c5ab 100644 --- a/lisp/org/org.el +++ b/lisp/org/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)) @@ -8855,7 +8859,7 @@ keywords relative to each registered export back-end." "EXCLUDE_TAGS:" "FILETAGS:" "INCLUDE:" "INDEX:" "KEYWORDS:" "LANGUAGE:" "MACRO:" "OPTIONS:" "PROPERTY:" "PRINT_BIBLIOGRAPHY" "PRIORITIES:" "SELECT_TAGS:" "SEQ_TODO:" "SETUPFILE:" "STARTUP:" "TAGS:" "TITLE:" "TODO:" - "TYP_TODO:" "SELECT_TAGS:" "EXCLUDE_TAGS:")) + "TYP_TODO:" "SELECT_TAGS:" "EXCLUDE_TAGS:" "EXPORT_FILE_NAME:")) (defcustom org-structure-template-alist '(("a" . "export ascii") diff --git a/lisp/org/ox.el b/lisp/org/ox.el index 62fc8d583e4..12767267a71 100644 --- a/lisp/org/ox.el +++ b/lisp/org/ox.el @@ -6757,7 +6757,6 @@ Return file name as a string." (cond (pub-dir (concat (file-name-as-directory pub-dir) (file-name-nondirectory base-name))) - ((file-name-absolute-p base-name) base-name) (t base-name)))) ;; If writing to OUTPUT-FILE would overwrite original file, append ;; EXTENSION another time to final name. -- 2.39.2