]> git.eshelyaron.com Git - emacs.git/commitdiff
Revert whitespace changes. Restore a condition-case in comp.el
authorAlan Mackenzie <acm@muc.de>
Tue, 18 Jul 2023 11:04:27 +0000 (11:04 +0000)
committerAlan Mackenzie <acm@muc.de>
Tue, 18 Jul 2023 11:04:27 +0000 (11:04 +0000)
* lisp/emacs-lisp/byte-run.el (defun)
* lisp/emacs-lisp/cl-generic.el
(cl-generic-define-context-rewriter)
* lisp/emacs-lisp/pcase.el (pcase--expand)
* src/eval.c (Ffunction): Revert whitespace changes.

* lisp/emacs-lisp/comp.el (comp--native-compile): Revert
deletion of a condition-case.

* lisp/emacs-lisp/nadvice.el (advice--equal): Remove commented
out diagnostics.

lisp/emacs-lisp/byte-run.el
lisp/emacs-lisp/cl-generic.el
lisp/emacs-lisp/comp.el
lisp/emacs-lisp/nadvice.el
lisp/emacs-lisp/pcase.el
src/eval.c

index 9c86561339901e839e9f2d114c2eb7537eece901..946db634d7ed15db0742a487b266c048f0976c2f 100644 (file)
@@ -470,9 +470,9 @@ The return value is undefined.
                                   (bare-symbol name)
                                   (cons arglist body)
                                   ))))))
-                    (if declarations
-                        (cons 'prog1 (cons def (car declarations)))
-                      def))))
+      (if declarations
+          (cons 'prog1 (cons def (car declarations)))
+        def))))
 
 (defmacro lambda-arglist (l)
   "Given a lambda form L, return its arglist.
index 5ff1bcfa471570c52b4816f7fc9a9b0ef927b170..1297ce6d2e5e6bdb0e223e93bebc7afe3492eb9e 100644 (file)
@@ -466,16 +466,17 @@ the specializer used will be the one returned by BODY."
                               (apply (lambda (,@λ-lift ,@args) ,nbody)
                                      ,@λ-lift ,arglist)))))))
             (t
-             (cons t `#'(lambda ,defsym (,cnm ,@args)
-                          ,@(car parsed-body)
-                          ,(macroexp-warn-and-return
-                            "cl-defmethod used without lexical-binding"
-                            (if (not (assq nmp uses-cnm))
-                                nbody
-                              `(let ((,nmp (lambda ()
-                                             (cl--generic-isnot-nnm-p ,cnm))))
-                                 ,nbody))
-                            'lexical t)))))
+             (cons t
+                 `#'(lambda ,defsym (,cnm ,@args)
+                      ,@(car parsed-body)
+                      ,(macroexp-warn-and-return
+                        "cl-defmethod used without lexical-binding"
+                        (if (not (assq nmp uses-cnm))
+                            nbody
+                          `(let ((,nmp (lambda ()
+                                         (cl--generic-isnot-nnm-p ,cnm))))
+                             ,nbody))
+                        'lexical t)))))
            ))
         (f (error "Unexpected macroexpansion result: %S" f))))))
 
index f228523d801c45b827a8fda2ecde374de6fa9afe..375f003592c3adb30b6fda33db34ed9ffe5fa69c 100644 (file)
@@ -4171,26 +4171,45 @@ the deferred compilation mechanism."
         (comp-log "\n\f\n" 1)
         (unwind-protect
             (progn
-              (cl-loop
-               with report = nil
-               for t0 = (current-time)
-               for pass in comp-passes
-               unless (memq pass comp-disabled-passes)
-               do
-               (comp-log (format "(%s) Running pass %s:\n"
-                                 function-or-file pass)
-                         2)
-               (setf data (funcall pass data))
-               (push (cons pass (float-time (time-since t0))) report)
-               (cl-loop for f in (alist-get pass comp-post-pass-hooks)
-                        do (funcall f data))
-               finally
-               (when comp-log-time-report
-                 (comp-log (format "Done compiling %s" data) 0)
-                 (cl-loop for (pass . time) in (reverse report)
-                          do (comp-log (format "Pass %s took: %fs."
-                                               pass time)
-                                       0))))
+              (condition-case err
+                  (cl-loop
+                   with report = nil
+                   for t0 = (current-time)
+                   for pass in comp-passes
+                   unless (memq pass comp-disabled-passes)
+                   do
+                   (comp-log (format "(%s) Running pass %s:\n"
+                                     function-or-file pass)
+                             2)
+                   (setf data (funcall pass data))
+                   (push (cons pass (float-time (time-since t0))) report)
+                   (cl-loop for f in (alist-get pass comp-post-pass-hooks)
+                            do (funcall f data))
+                   finally
+                   (when comp-log-time-report
+                     (comp-log (format "Done compiling %s" data) 0)
+                     (cl-loop for (pass . time) in (reverse report)
+                              do (comp-log (format "Pass %s took: %fs."
+                                                   pass time) 0))))
+                (native-compiler-skip)
+                (t
+                 (let ((err-val (cdr err)))
+                   ;; If we are doing an async native compilation print the
+                   ;; error in the correct format so is parsable and abort.
+                   (if (and comp-async-compilation
+                            (not (eq (car err) 'native-compiler-error)))
+                       (progn
+                         (message (if err-val
+                                      "%s: Error: %s %s"
+                                    "%s: Error %s")
+                                  function-or-file
+                                  (get (car err) 'error-message)
+                                  (car-safe err-val))
+                         (kill-emacs -1))
+                     ;; Otherwise re-signal it adding the compilation input.
+                    (signal (car err) (if (consp err-val)
+                                          (cons function-or-file err-val)
+                                        (list function-or-file err-val)))))))
               (if (stringp function-or-file)
                   data
                 ;; So we return the compiled function.
index 7700927bd67eecd3ad0bfa6c9a0d036918875473..6ccc8aa71c9b20ed039d8f85795229e40be43cae 100644 (file)
@@ -292,9 +292,7 @@ On such sameness, ADV is returned, otherwise nil."
 
 (defun advice--member-p (function use-name definition)
   (let ((found nil))
-    ;; (message "advice--member-p: function: %S" function)
     (while (and (not found) (advice--p definition))
-      ;; (message "advice--member-p: elt:      %S" (advice--car definition))
       (if (if (eq use-name :use-both)
              (or (advice--equal
                    function
index 00cda84ab402e4a59f1a06c7f17fc77f1f4cb903..1a4beb452686d90bb97aa91f8cc160dce3160a81 100644 (file)
@@ -475,13 +475,13 @@ This can be nil, meaning never create such a function.")
                            ,@code)
                     ;; Several occurrence of this non-small branch in
                     ;; the output.
-                      (unless bsym
-                        (setq bsym (make-symbol
-                                    (format "pcase-%d" (length defs))))
-                        (push `(,bsym (lambda ,(mapcar #'car varvals)
-                                        ,@ignores ,@code))
-                              defs))
-                      `(funcall ,bsym ,@(mapcar #'cadr varvals)))))))))
+                    (unless bsym
+                      (setq bsym (make-symbol
+                                  (format "pcase-%d" (length defs))))
+                      (push `(,bsym (lambda ,(mapcar #'car varvals)
+                                      ,@ignores ,@code))
+                            defs))
+                    `(funcall ,bsym ,@(mapcar #'cadr varvals)))))))))
          (main
           (pcase-compile-patterns
            exp
index 83877008d8fa2f49fcf1d09d6a5d773326b1b1ab..4cd26afbf3e3cef9c7e1ebed9ba1aaf58e25e93b 100644 (file)
@@ -564,9 +564,9 @@ usage: (function ARG)  */)
       if (NILP (Vinternal_make_interpreted_closure_function))
         return Fcons (Qclosure, Fcons (Vinternal_interpreter_environment, cdr));
       else
-       return call2 (Vinternal_make_interpreted_closure_function,
+        return call2 (Vinternal_make_interpreted_closure_function,
                       Fcons (Qlambda, cdr),
-                     Vinternal_interpreter_environment);
+                      Vinternal_interpreter_environment);
     }
   else
     /* Simply quote the argument.  */