瀏覽代碼

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 年之前
父節點
當前提交
d687aa1786
共有 1 個文件被更改,包括 3 次插入1 次删除
  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.
        (unless (bufferp buffer-or-file) (delete-file buffer-or-file))
        ;; 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"
                buffer-or-file (error-message-string err)))
        nil))))