[Top][All Lists]

[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: Wed, 13 Nov 2013 22:03:12 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt)


"Sebastien Vauban" 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 ">>>"))))
> It works well, except that line is always displayed as `1' in the Messages
> buffer.

I tried using the more "standard" function (defined in simple.el)
`line-number-at-pos', but that gives the same problem.

> Is there a way to "link" the messages to the `eval-after-load' blocks in my
> .emacs file by showing the line number where those blocks are defined?
> Or is there some other way to get such more or less the same type of
> information?

I'm sure what I ask (to access/save the line number of where the macro is
called) is possible, but there's something I clearly miss in the macro stuff...

Best regards,

Sebastien Vauban

reply via email to

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