Browse Source

org-persist: Display read errors in echo area

* lisp/org-persist.el (org-persist--read-elisp-file): Do not silently
ignore "Invalid read syntax" error.  Report it via message.  Yet
making the error less intrusive compared to `warn'.
Ihor Radchenko 2 years ago
parent
commit
d687aa1786
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lisp/org-persist.el

+ 3 - 1
lisp/org-persist.el

@@ -303,7 +303,9 @@ FORMAT and ARGS are passed to `message'."
        ;; Remove problematic file.
        ;; Remove problematic file.
        (unless (bufferp buffer-or-file) (delete-file buffer-or-file))
        (unless (bufferp buffer-or-file) (delete-file buffer-or-file))
        ;; Do not report the known error to user.
        ;; Do not report the known error to user.
-       (unless (string-match-p "Invalid read syntax" (error-message-string err))
+       (if (string-match-p "Invalid read syntax" (error-message-string err))
+           (message "Emacs reader failed to read data in %S. The error was: %S"
+                    buffer-or-file (error-message-string err))
          (warn "Emacs reader failed to read data in %S. The error was: %S"
          (warn "Emacs reader failed to read data in %S. The error was: %S"
                buffer-or-file (error-message-string err)))
                buffer-or-file (error-message-string err)))
        nil))))
        nil))))