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

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

[elpa] externals/relint c733b47 05/15: Use text quoting for all messages


From: Mattias Engdegård
Subject: [elpa] externals/relint c733b47 05/15: Use text quoting for all messages
Date: Sat, 29 Feb 2020 17:22:28 -0500 (EST)

branch: externals/relint
commit c733b4725e5c1a09234fe1f3c69535197574045d
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>

    Use text quoting for all messages
    
    Use format-message to convert the backquote-quote (grave) quoting into
    the appropriate text-quoting-style. The test reference files are kept
    in the grave style.
---
 relint-test.el  |  5 ++++-
 relint.el       | 17 ++++++++++-------
 test/1.expected |  2 +-
 3 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/relint-test.el b/relint-test.el
index 622a8fe..8dbbd54 100644
--- a/relint-test.el
+++ b/relint-test.el
@@ -98,7 +98,10 @@ and a path."
 (defun relint-test--scan-file (file)
   "Scan FILE and return the results as a string."
   (with-temp-buffer
-    (relint--scan-buffer (find-file-noselect file t) (current-buffer) t)
+    ;; The reference files (*.expected) are kept in the `grave' style,
+    ;; to make the test independent of `text-quoting-style'.
+    (let ((text-quoting-style 'grave))
+      (relint--scan-buffer (find-file-noselect file t) (current-buffer) t))
     (buffer-string)))
 
 (defun relint-test--read-file (file)
diff --git a/relint.el b/relint.el
index 00f21dc..afd6ed9 100644
--- a/relint.el
+++ b/relint.el
@@ -302,12 +302,14 @@ list of list indices to follow to target)."
           (if sym
               (if (memq sym seen)
                   (push (cons i (relint--escape-string
-                                 (format "Duplicated syntax code `%c'" c)
+                                 (format-message
+                                  "Duplicated syntax code `%c'" c)
                                  nil))
                         errs)
                 (push sym seen))
             (push (cons i (relint--escape-string
-                           (format "Invalid char `%c' in syntax string" c)
+                           (format-message
+                            "Invalid char `%c' in syntax string" c)
                            nil))
                   errs)))))
     (nreverse errs)))
@@ -1112,9 +1114,10 @@ EXPANDED is a list of expanded functions, to prevent 
recursion."
 (defun relint--check-non-regexp-provenance (skip-function form file pos path)
   (let ((reg-gen (relint--regexp-generators form nil)))
     (when reg-gen
-      (relint--report file pos path
-                      (format "`%s' cannot be used for arguments to `%s'"
-                              (car reg-gen) skip-function)))))
+      (relint--report
+       file pos path
+       (format-message "`%s' cannot be used for arguments to `%s'"
+                       (car reg-gen) skip-function)))))
 
 (defun relint--check-format-mixup (template args file pos path)
   "Look for a format expression that suggests insertion of a regexp
@@ -1150,7 +1153,7 @@ parameter is regexp-generating."
             (when reg-gen
               (relint--report
                file pos (cons (+ index 2) path)
-               (format
+               (format-message
                 "Value from `%s' cannot be spliced into `[...]'"
                 (car reg-gen))))))
         (unless (eq type ?%)
@@ -1175,7 +1178,7 @@ character alternative: `[' followed by a 
regexp-generating expression."
             (when reg-gen
               (relint--report
                file pos (cons (1+ index) path)
-               (format
+               (format-message
                 "Value from `%s' cannot be spliced into `[...]'"
                 (car reg-gen)))))))
       (setq index (1+ index))
diff --git a/test/1.expected b/test/1.expected
index e5c832d..07daa8a 100644
--- a/test/1.expected
+++ b/test/1.expected
@@ -133,7 +133,7 @@
 1.elisp:65:25: In bad-custom-5: Unescaped literal `^' (pos 2)
   "^x^"
    ..^
-1.elisp:69:25: In bad-custom-6: Error: No character class ‘[:bah:]’: 
"[[:bah:]]"
+1.elisp:69:25: In bad-custom-6: Error: No character class `[:bah:]': 
"[[:bah:]]"
 1.elisp:73:25: In bad-custom-7: Duplicated `a' inside character alternative 
(pos 2)
   "[aa]"
    ..^



reply via email to

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