emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/bug-hunter eed96f1 89/95: Explain invalid-modifier erro


From: Stefan Monnier
Subject: [elpa] externals/bug-hunter eed96f1 89/95: Explain invalid-modifier errors
Date: Fri, 27 Nov 2020 22:07:03 -0500 (EST)

branch: externals/bug-hunter
commit eed96f10341fd4c8e41f6c467f456a119b7dca74
Author: Artur Malabarba <bruce.connor.am@gmail.com>
Commit: Artur Malabarba <bruce.connor.am@gmail.com>

    Explain invalid-modifier errors
---
 bug-hunter.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/bug-hunter.el b/bug-hunter.el
index c7e3c36..4a9222d 100644
--- a/bug-hunter.el
+++ b/bug-hunter.el
@@ -143,7 +143,10 @@ file.")
               nil)
           (end-of-file `(bug-caught (end-of-file) ,line ,col))
           (invalid-read-syntax `(bug-caught ,er ,line ,col))
-          (error (error "Ran into an error we don't understand, please file a 
bug report: %S" er)))
+          (error
+           (if (string= (elt er 1) "Invalid modifier in string")
+               `(bug-caught (invalid-modifier) ,line ,col)
+             (error "Ran into an error we don't understand, please file a bug 
report: %S" er))))
         (nreverse out))))
 
 (defun bug-hunter--read-contents (file)
@@ -215,6 +218,9 @@ the file."
     (cl-case (car error)
       (end-of-file
        "There's a missing closing parenthesis, the expression on this line 
never ends.")
+      (invalid-modifier (concat "There's a string on this line with an invalid 
modifier."
+                                "\n  A \"modifier\" is a \\ followed by a few 
characters."
+                                "\n  For example, \\C-; is an invalid 
modifier."))
       (invalid-read-syntax
        (let ((char (cadr error)))
          (if (member char '("]" ")"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]