Never pass error message verbatim as the first argument for `message'/`error'

* lisp/org-capture.el (org-capture-store-last-position):
* lisp/org-crypt.el (org-encrypt-entry):
* lisp/org.el (org-open-file): Avoid (error string) code pattern.
Instead use (error "%s" string).  (error string) is erroneous when
STRING contains %-specs.

Reported-by: Corwin Kerr <corwin@corwinkerr.com>
Link: https://orgmode.org/list/beceaf05-ae15-487b-864b-2e23a33a3884@app.fastmail.com
This commit is contained in:
Ihor Radchenko 2024-02-25 13:15:04 +03:00
parent 9daad41ccf
commit af9100382c
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
3 changed files with 3 additions and 3 deletions

View File

@ -1508,7 +1508,7 @@ Of course, if exact position has been required, just put it there."
(condition-case err
(bookmark-set bookmark)
(error
(message (format "Bookmark set error: %S" err)))))))
(message "Bookmark set error: %S" err))))))
(move-marker org-capture-last-stored-marker (point))))))
(defun org-capture-narrow (beg end)

View File

@ -246,7 +246,7 @@ Assume `epg-context' is set."
;; contents in the buffer.
(error
(insert contents)
(error (error-message-string err)))))
(error "%s" (error-message-string err)))))
(when folded-heading
(goto-char folded-heading)
(org-fold-subtree t))

View File

@ -8494,7 +8494,7 @@ If the file does not exist, throw an error."
;; Save position before error-ing out so user
;; can easily move back to the original buffer.
(error (funcall save-position-maybe)
(error (nth 1 err)))))))
(error "%s" (error-message-string err)))))))
((functionp cmd)
(save-match-data
(set-match-data link-match-data)