diff options
author | Stefan Kangas <stefan@marxist.se> | 2022-07-25 06:30:18 +0200 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2022-07-25 06:30:18 +0200 |
commit | 14d8c6f7b13f3237aa5e54f5c16ef0a9189c0459 (patch) | |
tree | 89a192337c56ed3f117650ac242ce55705eb0144 | |
parent | 948275b4d4e30d98c7ebd215d6b8cc14ce8a6019 (diff) | |
parent | ba70d0f77c52d471bceb2ad2cc7bc172db348abb (diff) | |
download | emacs-14d8c6f7b13f3237aa5e54f5c16ef0a9189c0459.tar.gz emacs-14d8c6f7b13f3237aa5e54f5c16ef0a9189c0459.tar.bz2 emacs-14d8c6f7b13f3237aa5e54f5c16ef0a9189c0459.zip |
Merge from origin/emacs-28
ba70d0f77c Update to Org 9.5.4-17-g6e991f
-rw-r--r-- | lisp/org/ob-tangle.el | 5 | ||||
-rw-r--r-- | lisp/org/oc-basic.el | 1 | ||||
-rw-r--r-- | lisp/org/org-compat.el | 5 | ||||
-rw-r--r-- | lisp/org/org-plot.el | 7 | ||||
-rw-r--r-- | lisp/org/org-src.el | 4 | ||||
-rw-r--r-- | lisp/org/org-version.el | 2 | ||||
-rw-r--r-- | lisp/org/org.el | 2 | ||||
-rw-r--r-- | lisp/org/ox-ascii.el | 18 | ||||
-rw-r--r-- | lisp/org/ox-md.el | 10 | ||||
-rw-r--r-- | lisp/org/ox.el | 6 |
10 files changed, 39 insertions, 21 deletions
diff --git a/lisp/org/ob-tangle.el b/lisp/org/ob-tangle.el index 566258eba4a..525d27bc070 100644 --- a/lisp/org/ob-tangle.el +++ b/lisp/org/ob-tangle.el @@ -581,7 +581,10 @@ which enable the original code blocks to be found." (error "Not in tangled code")) (setq body (buffer-substring body-start end))) ;; Go to the beginning of the relative block in Org file. - (org-link-open-from-string link) + ;; Explicitly allow fuzzy search even if user customized + ;; otherwise. + (let (org-link-search-must-match-exact-headline) + (org-link-open-from-string link)) (setq target-buffer (current-buffer)) (if (string-match "[^ \t\n\r]:\\([[:digit:]]+\\)" block-name) (let ((n (string-to-number (match-string 1 block-name)))) diff --git a/lisp/org/oc-basic.el b/lisp/org/oc-basic.el index 9ed1b810fab..8c76e200e4f 100644 --- a/lisp/org/oc-basic.el +++ b/lisp/org/oc-basic.el @@ -73,6 +73,7 @@ (require 'seq) (declare-function org-open-at-point "org" (&optional arg)) +(declare-function org-open-file "org" (path &optional in-emacs line search)) (declare-function org-element-interpret-data "org-element" (data)) (declare-function org-element-property "org-element" (property element)) diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el index 3e394fbab1c..a65bf6f677a 100644 --- a/lisp/org/org-compat.el +++ b/lisp/org/org-compat.el @@ -113,6 +113,11 @@ the symbol of the calling function, for example." ;;; Emacs < 27.1 compatibility +(if (version< emacs-version "27.1") + (defsubst org-replace-buffer-contents (source &optional _max-secs _max-costs) + (replace-buffer-contents source)) + (defalias 'org-replace-buffer-contents #'replace-buffer-contents)) + (unless (fboundp 'proper-list-p) ;; `proper-list-p' was added in Emacs 27.1. The function below is ;; taken from Emacs subr.el 200195e824b^. diff --git a/lisp/org/org-plot.el b/lisp/org/org-plot.el index 7cce678a81b..c2da24266ab 100644 --- a/lisp/org/org-plot.el +++ b/lisp/org/org-plot.el @@ -682,9 +682,10 @@ line directly before or after the table." (looking-at "[[:space:]]*#\\+")) (setf params (org-plot/collect-options params)))) ;; Dump table to datafile - (if-let ((dump-func (plist-get type :data-dump))) - (funcall dump-func table data-file num-cols params) - (org-plot/gnuplot-to-data table data-file params)) + (let ((dump-func (plist-get type :data-dump))) + (if dump-func + (funcall dump-func table data-file num-cols params) + (org-plot/gnuplot-to-data table data-file params))) ;; Check type of ind column (timestamp? text?) (when (plist-get params :check-ind-type) (let* ((ind (1- (plist-get params :ind))) diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el index 54f901252f2..89d0c28a432 100644 --- a/lisp/org/org-src.el +++ b/lisp/org/org-src.el @@ -1235,7 +1235,7 @@ Throw an error if there is no such buffer." (insert (with-current-buffer write-back-buf (buffer-string)))) (save-restriction (narrow-to-region beg end) - (replace-buffer-contents write-back-buf 0.1 nil) + (org-replace-buffer-contents write-back-buf 0.1 nil) (goto-char (point-max)))) (when (and expecting-bol (not (bolp))) (insert "\n"))) (kill-buffer write-back-buf) @@ -1283,7 +1283,7 @@ Throw an error if there is no such buffer." (buffer-string)))) (save-restriction (narrow-to-region beg end) - (replace-buffer-contents write-back-buf 0.1 nil) + (org-replace-buffer-contents write-back-buf 0.1 nil) (goto-char (point-max)))) (when (and expecting-bol (not (bolp))) (insert "\n"))))) (when write-back-buf (kill-buffer write-back-buf)) diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index 2a500fe5106..915c3f63c7d 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.5.4-3-g6dc785")) + (let ((org-git-version "release_9.5.4-17-g6e991f")) org-git-version)) (provide 'org-version) diff --git a/lisp/org/org.el b/lisp/org/org.el index 008230500d7..d5dfc36e048 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -1694,7 +1694,7 @@ OK to kill that hidden subtree. When nil, kill without remorse." (const :tag "Never kill a hidden subtree with C-k" error))) (defcustom org-special-ctrl-o t - "Non-nil means, make `C-o' insert a row in tables." + "Non-nil means, make `open-line' (\\[open-line]) insert a row in tables." :group 'org-edit-structure :type 'boolean) diff --git a/lisp/org/ox-ascii.el b/lisp/org/ox-ascii.el index 38b2a5772c1..76a1a71fabe 100644 --- a/lisp/org/ox-ascii.el +++ b/lisp/org/ox-ascii.el @@ -948,12 +948,18 @@ channel." (when description (let ((dest (if (equal type "fuzzy") (org-export-resolve-fuzzy-link link info) - (org-export-resolve-id-link link info)))) - (concat - (org-ascii--fill-string - (format "[%s] %s" anchor (org-ascii--describe-datum dest info)) - width info) - "\n\n")))) + ;; Ignore broken links. On broken link, + ;; `org-export-resolve-id-link' will throw an + ;; error and we will return nil. + (condition-case nil + (org-export-resolve-id-link link info) + (org-link-broken nil))))) + (when dest + (concat + (org-ascii--fill-string + (format "[%s] %s" anchor (org-ascii--describe-datum dest info)) + width info) + "\n\n"))))) ;; Do not add a link that cannot be resolved and doesn't have ;; any description: destination is already visible in the ;; paragraph. diff --git a/lisp/org/ox-md.el b/lisp/org/ox-md.el index ad684d80333..3551e4184e5 100644 --- a/lisp/org/ox-md.el +++ b/lisp/org/ox-md.el @@ -193,11 +193,11 @@ of contents can refer to headlines." ;; A link refers internally to HEADLINE. (org-element-map (plist-get info :parse-tree) 'link (lambda (link) - (eq headline - (pcase (org-element-property :type link) - ((or "custom-id" "id") (org-export-resolve-id-link link info)) - ("fuzzy" (org-export-resolve-fuzzy-link link info)) - (_ nil)))) + (equal headline + ;; Ignore broken links. + (condition-case nil + (org-export-resolve-id-link link info) + (org-link-broken nil)))) info t)))) (defun org-md--headline-title (style level title &optional anchor tags) diff --git a/lisp/org/ox.el b/lisp/org/ox.el index ae7e41e576b..55258bc79da 100644 --- a/lisp/org/ox.el +++ b/lisp/org/ox.el @@ -1908,8 +1908,10 @@ Return a string." (org-element-property :archivedp data))) (let ((transcoder (org-export-transcoder data info))) (or (and (functionp transcoder) - (broken-link-handler - (funcall transcoder data nil info))) + (if (eq type 'link) + (broken-link-handler + (funcall transcoder data nil info)) + (funcall transcoder data nil info))) ;; Export snippets never return a nil value so ;; that white spaces following them are never ;; ignored. |