emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110027: * lisp/emacs-lisp/advice.el


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110027: * lisp/emacs-lisp/advice.el (ad-prognify): Remove, use macroexp-progn.
Date: Fri, 14 Sep 2012 09:44:31 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110027
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Fri 2012-09-14 09:44:31 -0400
message:
  * lisp/emacs-lisp/advice.el (ad-prognify): Remove, use macroexp-progn.
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/advice.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-09-14 03:55:16 +0000
+++ b/lisp/ChangeLog    2012-09-14 13:44:31 +0000
@@ -1,5 +1,7 @@
 2012-09-14  Stefan Monnier  <address@hidden>
 
+       * emacs-lisp/advice.el (ad-prognify): Remove, use macroexp-progn.
+
        * emacs-lisp/edebug.el: Miscellaneous cleanup.
        Remove obsolete byte-compiler hack that tried to silence some warnings.
        (edebug-submit-bug-report): Remove.

=== modified file 'lisp/emacs-lisp/advice.el'
--- a/lisp/emacs-lisp/advice.el 2012-09-14 03:55:16 +0000
+++ b/lisp/emacs-lisp/advice.el 2012-09-14 13:44:31 +0000
@@ -1746,6 +1746,7 @@
 (provide 'advice-preload)
 ;; During a normal load this is a noop:
 (require 'advice-preload "advice.el")
+(require 'macroexp)
 (eval-when-compile (require 'cl-lib))
 
 ;; @@ Variable definitions:
@@ -2538,11 +2539,6 @@
         (byte-compile symbol)
         (fset function (symbol-function symbol))))))
 
-(defun ad-prognify (forms)
-  (cond ((<= (length forms) 1)
-        (car forms))
-       (t (cons 'progn forms))))
-
 ;; @@@ Accessing argument lists:
 ;; =============================
 
@@ -2954,7 +2950,7 @@
                   before-forms)
              (setq before-forms
                    `((unwind-protect
-                         ,(ad-prognify before-forms)
+                         ,(macroexp-progn before-forms)
                        ,@(ad-body-forms
                           (ad-advice-definition advice))))))
             (t (setq before-forms
@@ -2971,12 +2967,12 @@
             (ad-substitute-tree
              (function (lambda (form) (eq form 'ad-do-it)))
              (function (lambda (form) around-form))
-             (ad-prognify (ad-body-forms (ad-advice-definition advice))))))
+             (macroexp-progn (ad-body-forms (ad-advice-definition advice))))))
 
     (setq after-forms
          (if (and around-form-protected before-forms)
              `((unwind-protect
-                     ,(ad-prognify before-forms)
+                     ,(macroexp-progn before-forms)
                   ,around-form))
               (append before-forms (list around-form))))
     (dolist (advice afters)
@@ -2984,7 +2980,7 @@
                   after-forms)
              (setq after-forms
                    `((unwind-protect
-                         ,(ad-prognify after-forms)
+                         ,(macroexp-progn after-forms)
                        ,@(ad-body-forms
                           (ad-advice-definition advice))))))
             (t (setq after-forms
@@ -3013,7 +3009,7 @@
                             (ad-body-forms (ad-advice-definition advice))))
                 (ad-get-enabled-advices function hook-name))))
     (if hook-forms
-       (ad-prognify (apply 'append hook-forms)))))
+       (macroexp-progn (apply 'append hook-forms)))))
 
 
 ;; @@ Caching:


reply via email to

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