]> git.eshelyaron.com Git - emacs.git/commitdiff
Data argument to `signal` should be a list
authorMattias Engdegård <mattiase@acm.org>
Tue, 3 Jan 2023 13:03:58 +0000 (14:03 +0100)
committerMattias Engdegård <mattiase@acm.org>
Tue, 3 Jan 2023 13:03:58 +0000 (14:03 +0100)
* lisp/calendar/iso8601.el (iso8601-parse, iso8601-parse-date)
(iso8601-parse-time, iso8601-parse-zone, iso8601-parse-duration)
(iso8601-parse-interval):
* lisp/emacs-lisp/cl-lib.el (cl-values-list):
* lisp/emacs-lisp/comp.el (comp-decrypt-arg-list)
(comp-spill-lap-function, comp-emit-switch)
(comp-compute-dominator-tree, comp-final):
* lisp/image.el (image-type):
* lisp/image/exif.el (exif--parse-jpeg, exif--parse-exif-chunk)
(exif--parse-directory, exif--read-chunk, exif--read-number-be)
(exif--read-number-le):
* lisp/vc/vc.el (vc-default-last-change):
Wrap obvious non-list data arguments to `signal` in a list.

lisp/calendar/iso8601.el
lisp/emacs-lisp/cl-lib.el
lisp/emacs-lisp/comp.el
lisp/image.el
lisp/image/exif.el
lisp/vc/vc.el

index cd3de62afdbb9be3382981c09c321f4fe8bfda12..d7d064d9c2a0ebc6136d9c58b4c2855cbd12a624 100644 (file)
@@ -129,7 +129,7 @@ well as variants like \"2008W32\" (week number) and
 
 See `decode-time' for the meaning of FORM."
   (if (not (iso8601-valid-p string))
-      (signal 'wrong-type-argument string)
+      (signal 'wrong-type-argument (list string))
     (let* ((date-string (match-string 1 string))
            (time-string (match-string 2 string))
            (zone-string (match-string 3 string))
@@ -217,7 +217,7 @@ See `decode-time' for the meaning of FORM."
    ((iso8601--match "---\\([0-9][0-9]\\)" string)
     (iso8601--decoded-time :day (string-to-number (match-string 1 string))))
    (t
-    (signal 'wrong-type-argument string))))
+    (signal 'wrong-type-argument (list string)))))
 
 (defun iso8601-parse-time (string &optional form)
   "Parse STRING, which should be an ISO 8601 time string.
@@ -226,11 +226,11 @@ hour/minute/seconds/zone fields filled in.
 
 See `decode-time' for the meaning of FORM."
   (if (not (iso8601--match iso8601--full-time-match string))
-      (signal 'wrong-type-argument string)
+      (signal 'wrong-type-argument (list string))
     (let ((time (match-string 1 string))
           (zone (match-string 2 string)))
       (if (not (iso8601--match iso8601--time-match time))
-          (signal 'wrong-type-argument string)
+          (signal 'wrong-type-argument (list string))
         (let ((hour (string-to-number (match-string 1 time)))
               (minute (and (match-string 2 time)
                            (string-to-number (match-string 2 time))))
@@ -274,7 +274,7 @@ See `decode-time' for the meaning of FORM."
   "Parse STRING, which should be an ISO 8601 time zone.
 Return the number of minutes."
   (if (not (iso8601--match iso8601--zone-match string))
-      (signal 'wrong-type-argument string)
+      (signal 'wrong-type-argument (list string))
     (if (match-string 2 string)
         ;; HH:MM-ish.
         (let ((hour (string-to-number (match-string 3 string)))
@@ -314,14 +314,14 @@ Return the number of minutes."
    ((iso8601--match iso8601--duration-combined-match string)
     (iso8601-parse (substring string 1)))
    (t
-    (signal 'wrong-type-argument string))))
+    (signal 'wrong-type-argument (list string)))))
 
 (defun iso8601-parse-interval (string)
   "Parse ISO 8601 intervals."
   (let ((bits (split-string string "/"))
         start end duration)
     (if (not (= (length bits) 2))
-        (signal 'wrong-type-argument string)
+        (signal 'wrong-type-argument (list string))
       ;; The intervals may be an explicit start/end times, or either a
       ;; start or an end, and an accompanying duration.
       (cond
@@ -338,7 +338,7 @@ Return the number of minutes."
         (setq start (iso8601-parse (car bits))
               end (iso8601-parse (cadr bits))))
        (t
-        (signal 'wrong-type-argument string))))
+        (signal 'wrong-type-argument (list string)))))
     (unless end
       (setq end (decoded-time-add start duration)))
     (unless start
index 152a1fe9434243a4f814f4dd40cdccfb0ae1ea08..95a51a4bdde59b1149f712c807c9775f38aef7da 100644 (file)
@@ -201,7 +201,7 @@ should return.
 Note that Emacs Lisp doesn't really support multiple values, so
 all this function does is return LIST."
   (unless (listp list)
-    (signal 'wrong-type-argument list))
+    (signal 'wrong-type-argument (list list)))
   list)
 
 (defsubst cl-multiple-value-list (expression)
index 49e3cdb8de75f55b667e9b6d15d3a835437f17b8..acabc31fc33ed5c7ba431703388820043016218e 100644 (file)
@@ -1220,7 +1220,7 @@ clashes."
 (defun comp-decrypt-arg-list (x function-name)
   "Decrypt argument list X for FUNCTION-NAME."
   (unless (fixnump x)
-    (signal 'native-compiler-error-dyn-func function-name))
+    (signal 'native-compiler-error-dyn-func (list function-name)))
   (let ((rest (not (= (logand x 128) 0)))
         (mandatory (logand x 127))
         (nonrest (ash x -8)))
@@ -1264,7 +1264,7 @@ clashes."
                                                              'pure))))
       (when (byte-code-function-p f)
         (signal 'native-compiler-error
-                "can't native compile an already byte-compiled function"))
+                '("can't native compile an already byte-compiled function")))
       (setf (comp-func-byte-func func)
             (byte-compile (comp-func-name func)))
       (let ((lap (byte-to-native-lambda-lap
@@ -1288,7 +1288,7 @@ clashes."
   "Byte-compile FORM, spilling data from the byte compiler."
   (unless (eq (car-safe form) 'lambda)
     (signal 'native-compiler-error
-            "Cannot native-compile, form is not a lambda"))
+            '("Cannot native-compile, form is not a lambda")))
   (unless (comp-ctxt-output comp-ctxt)
     (setf (comp-ctxt-output comp-ctxt)
           (make-temp-file "comp-lambda-" nil ".eln")))
@@ -1369,7 +1369,7 @@ clashes."
             (alist-get 'no-native-compile byte-native-qualities))
     (throw 'no-native-compile nil))
   (unless byte-to-native-top-level-forms
-    (signal 'native-compiler-error-empty-byte filename))
+    (signal 'native-compiler-error-empty-byte (list filename)))
   (unless (comp-ctxt-output comp-ctxt)
     (setf (comp-ctxt-output comp-ctxt) (comp-el-to-eln-filename
                                         filename
@@ -1740,7 +1740,7 @@ Return value is the fall-through block name."
           do (puthash ff-bb-name ff-bb (comp-func-blocks comp-func))
              (setf (comp-limplify-curr-block comp-pass) ff-bb))))
     (_ (signal 'native-ice
-               "missing previous setimm while creating a switch"))))
+               '("missing previous setimm while creating a switch")))))
 
 (defun comp-emit-set-call-subr (subr-name sp-delta)
     "Emit a call for SUBR-NAME.
@@ -2823,7 +2823,7 @@ blocks."
             (first-processed (l)
               (if-let ((p (cl-find-if (lambda (p) (comp-block-idom p)) l)))
                   p
-                (signal 'native-ice "can't find first preprocessed"))))
+                (signal 'native-ice '("can't find first preprocessed")))))
 
     (when-let ((blocks (comp-func-blocks comp-func))
                (entry (gethash 'entry blocks))
@@ -3721,7 +3721,7 @@ Prepare every function for final compilation and drive the C back-end."
                   (progn
                     (delete-file temp-file)
                     output)
-               (signal 'native-compiler-error (buffer-string)))
+               (signal 'native-compiler-error (list (buffer-string))))
             (comp-log-to-buffer (buffer-string))))))))
 
 \f
index 29c39c5dd5526782db52a616bc191d258411f8f0..2372fd1ce094a150a1ce660733ae5e7d964e9370 100644 (file)
@@ -444,7 +444,7 @@ type if we can't otherwise guess it."
                             (require 'image-converter)
                             (image-convert-p source))))))
     (unless type
-      (signal 'unknown-image-type "Cannot determine image type")))
+      (signal 'unknown-image-type '("Cannot determine image type"))))
   (when (and (not (eq type 'image-convert))
              (not (memq type (and (boundp 'image-types) image-types))))
     (error "Invalid image type `%s'" type))
index c561ea729af4a2c1c3cb4e537c31166f1f373c75..50428c3a31a992e36190f9fced6e01885ba42562 100644 (file)
@@ -151,7 +151,7 @@ If the orientation isn't present in the data, return nil."
 
 (defun exif--parse-jpeg ()
   (unless (= (exif--read-number-be 2) #xffd8) ; SOI (start of image)
-    (signal 'exif-error "Not a valid JPEG file"))
+    (signal 'exif-error '("Not a valid JPEG file")))
   (cl-loop for segment = (exif--read-number-be 2)
            for size = (exif--read-number-be 2)
            ;; Stop parsing when we get to SOS (start of stream);
@@ -168,7 +168,7 @@ If the orientation isn't present in the data, return nil."
     ;; The Exif data is in the APP1 JPEG chunk and starts with
     ;; "Exif\0\0".
     (unless (equal (exif--read-chunk 6) (string ?E ?x ?i ?f ?\0 ?\0))
-      (signal 'exif-error "Not a valid Exif chunk"))
+      (signal 'exif-error '("Not a valid Exif chunk")))
     (delete-region (point-min) (point))
     (let* ((endian-marker (exif--read-chunk 2))
            (le (cond
@@ -180,14 +180,15 @@ If the orientation isn't present in the data, return nil."
                  t)
                 (t
                  (signal 'exif-error
-                         (format "Invalid endian-ness %s" endian-marker))))))
+                         (list (format "Invalid endian-ness %s"
+                                       endian-marker)))))))
       ;; Another magical number.
       (unless (= (exif--read-number 2 le) #x002a)
-        (signal 'exif-error "Invalid TIFF header length"))
+        (signal 'exif-error '("Invalid TIFF header length")))
       (let ((offset (exif--read-number 4 le)))
         ;; Jump to where the IFD (directory) starts and parse it.
         (when (> (1+ offset) (point-max))
-          (signal 'exif-error "Invalid IFD (directory) offset"))
+          (signal 'exif-error '("Invalid IFD (directory) offset")))
         (goto-char (1+ offset))
         (exif--parse-directory le)))))
 
@@ -230,7 +231,7 @@ If the orientation isn't present in the data, return nil."
                                          (when (> (+ (1+ value) length)
                                                   (point-max))
                                            (signal 'exif-error
-                                                   "Premature end of file"))
+                                                   '("Premature end of file")))
                                          (buffer-substring
                                           (1+ value)
                                           (+ (1+ value) length)))
@@ -248,7 +249,7 @@ If the orientation isn't present in the data, return nil."
           ;; keep parsing.
           (progn
             (when (> (1+ next) (point-max))
-              (signal 'exif-error "Invalid IFD (directory) next-offset"))
+              (signal 'exif-error '("Invalid IFD (directory) next-offset")))
             (goto-char (1+ next))
             (nconc dir (exif--parse-directory le)))
         ;; We've reached the end of the directories.
@@ -283,7 +284,7 @@ VALUE is an integer representing BYTES characters."
 (defun exif--read-chunk (bytes)
   "Return BYTES octets from the buffer and advance point that much."
   (when (> (+ (point) bytes) (point-max))
-    (signal 'exif-error "Premature end of file"))
+    (signal 'exif-error '("Premature end of file")))
   (prog1
       (buffer-substring (point) (+ (point) bytes))
     (forward-char bytes)))
@@ -292,7 +293,7 @@ VALUE is an integer representing BYTES characters."
   "Read BYTES octets from the buffer as a chunk of big-endian bytes.
 Advance point to after the read bytes."
   (when (> (+ (point) bytes) (point-max))
-    (signal 'exif-error "Premature end of file"))
+    (signal 'exif-error '("Premature end of file")))
   (let ((sum 0))
     (dotimes (_ bytes)
       (setq sum (+ (* sum 256) (following-char)))
@@ -303,7 +304,7 @@ Advance point to after the read bytes."
   "Read BYTES octets from the buffer as a chunk of low-endian bytes.
 Advance point to after the read bytes."
   (when (> (+ (point) bytes) (point-max))
-    (signal 'exif-error "Premature end of file"))
+    (signal 'exif-error '("Premature end of file")))
   (let ((sum 0))
     (dotimes (i bytes)
       (setq sum (+ (* (following-char) (expt 256 i)) sum))
index a22b9531fdb864cf8412c6f1bcf255fc5b05e3fa..13124509c27c3a0c4df6b7b84070ab5d2a966a0d 100644 (file)
@@ -3630,7 +3630,7 @@ it indicates a specific revision to check out."
   "Default `last-change' implementation.
 It returns the last revision that changed LINE number in FILE."
   (unless (file-exists-p file)
-    (signal 'file-error "File doesn't exist"))
+    (signal 'file-error '("File doesn't exist")))
   (with-temp-buffer
     (vc-call-backend (vc-backend file) 'annotate-command
                      file (current-buffer))