Преглед на файлове

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.
Bastien Guerry преди 12 години
родител
ревизия
a6f81047a4
променени са 1 файла, в които са добавени 5 реда и са изтрити 5 реда
  1. 5 5
      lisp/org.el

+ 5 - 5
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))))