summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2014-02-05 16:15:55 +0100
committerBastien Guerry <bzg@altern.org>2014-02-05 16:15:55 +0100
commita6f81047a47737b3450081e324c33ef00e681d36 (patch)
tree3a04543cfa458f979bf024814df6acd9ce04e2eb
parent240cd3cb40fcc5f958eed7772e9520ef87bf9bd4 (diff)
downloadorg-mode-a6f81047a47737b3450081e324c33ef00e681d36.tar.gz
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.
-rw-r--r--lisp/org.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 12d3581..a28589c 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5153,11 +5153,11 @@ Support for group tags is controlled by the option
(defun org-file-contents (file &optional noerror)
"Return the contents of FILE, as a string."
- (if (or (not file)
- (not (file-readable-p file)))
- (if noerror
- (message "Cannot read file \"%s\"" file)
- (error "Cannot read file \"%s\"" file))
+ (if (or (not file) (not (file-readable-p file)))
+ (if (not noerror)
+ (error "Cannot read file \"%s\"" file)
+ (message "Cannot read file \"%s\"" file)
+ "")
(with-temp-buffer
(insert-file-contents file)
(buffer-string))))