help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Line number where eval-after-load is defined in my .emacs file


From: Sebastien Vauban
Subject: Re: Line number where eval-after-load is defined in my .emacs file
Date: Fri, 15 Nov 2013 14:46:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt)

Michael, Stefan,

Thanks to you for the explanations...

Michael Heerdegen wrote:
>> As I do (sometimes) have -- for the same library -- multiple
>> "eval-after-load"
>> blocks of code at different spots of my .emacs file, I'd like to be able to
>> identify which one was called at which point when reading the Messages
>> buffer.
>>
>> To do so, I tried to (re-)define `with-eval-after-load' such as:
>>
>>   ;; wrapper around `eval-after-load'
>>   (defmacro with-eval-after-load (mode &rest body)
>>     "`eval-after-load' MODE evaluate BODY."
>>     (declare (indent defun))
>>     `(eval-after-load ,mode
>>        '(progn
>>           (message "<<< Running code block specific to library `%s' (at line 
>> %d)..."
>>                    ,mode
>>                    ,(org-current-line)) ; [1]
>>           ,@body
>>           (message ">>>"))))
>
> First, please do yourself a favor and don't redefine Emacs primitives or
> macros that are used somewhere else in Emacs.  You may break Emacs in
> unforeseeable ways, and finding out what goes wrong then will be much
> harder than finding out which of your `eval-after-load' forms is buggy.

Regarding this, note that I don't intend to use that in a "production" mode:
only when debugging my .emacs file, along with many other useful messages which
are enabled at the same time.

Best regards,
  Seb

-- 
Sebastien Vauban


reply via email to

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