mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-07-15 21:16:26 +00:00
org.el (org-file-contents): Return an empty string instead of the message
* org.el (org-file-contents): Return an empty string instead of the message.
This commit is contained in:
parent
240cd3cb40
commit
a6f81047a4
10
lisp/org.el
10
lisp/org.el
|
@ -5153,11 +5153,11 @@ Support for group tags is controlled by the option
|
||||||
|
|
||||||
(defun org-file-contents (file &optional noerror)
|
(defun org-file-contents (file &optional noerror)
|
||||||
"Return the contents of FILE, as a string."
|
"Return the contents of FILE, as a string."
|
||||||
(if (or (not file)
|
(if (or (not file) (not (file-readable-p file)))
|
||||||
(not (file-readable-p file)))
|
(if (not noerror)
|
||||||
(if noerror
|
(error "Cannot read file \"%s\"" file)
|
||||||
(message "Cannot read file \"%s\"" file)
|
(message "Cannot read file \"%s\"" file)
|
||||||
(error "Cannot read file \"%s\"" file))
|
"")
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert-file-contents file)
|
(insert-file-contents file)
|
||||||
(buffer-string))))
|
(buffer-string))))
|
||||||
|
|
Loading…
Reference in a new issue