emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#13021: closed (24.2.90; compile eval-after-load fo


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#13021: closed (24.2.90; compile eval-after-load form)
Date: Wed, 19 Jun 2013 23:56:01 +0000

Your message dated Thu, 20 Jun 2013 00:55:27 +0100 (BST)
with message-id <address@hidden>
and subject line Re: bug#13021: 24.2.90; compile eval-after-load form
has caused the debbugs.gnu.org bug report #13021,
regarding 24.2.90; compile eval-after-load form
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
13021: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13021
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.2.90; compile eval-after-load form Date: Wed, 28 Nov 2012 15:05:56 +0000 (GMT)
severity: wishlist

I think it is a good idea to compile the form that is passed to
eval-after-load.  The advantage is that one gets compiler warnings and
errors and the form itself is executed faster.

This is what I use:

    (defmacro eal (package &rest forms)
      (declare (indent 1) (debug t))
      `(,(if (if (symbolp package)
                 (require package nil t)
               (load package t t))
             'progn
           (message "eal: cannot find %s" package)
           'with-no-warnings)
        (eval-after-load ',package
          `(funcall (function ,(lambda () ,@forms))))))

This is what Michael (Heerdegen) uses:

    (defun-safe init-file-eval-after-load (file &rest forms)
      "Like `eval-after-load', but byte-compile FORMS before eval."
      (eval-after-load file `(let ((byte-compile-log-buffer "*Warnings*")
                                   (byte-compile-current-form
                                    (format "`init-file-eval-after-load': %s" 
',file)))
                               (funcall (byte-compile (lambda () ,@forms))))))

Could vanilla eval-after-load be modified so it compiles the form?  I am
thinking of an optional third parameter, one that allows to either keep
the current behaviour (default), load the package & compile the form at
compile time or compile the form at run-time before evaling.

WDYT?

        Christopher



--- End Message ---
--- Begin Message --- Subject: Re: bug#13021: 24.2.90; compile eval-after-load form Date: Thu, 20 Jun 2013 00:55:27 +0100 (BST)
Christopher Schmidt <address@hidden> writes:
> I think it is a good idea to compile the form that is passed to
> eval-after-load.

There is with-eval-after-load now.

        Christopher


--- End Message ---

reply via email to

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