From: "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
To: help-gnu-emacs-mXXj517/zsQ@public.gmane.org
Subject: Re: Line number where eval-after-load is defined in my .emacs file
Date: Wed, 13 Nov 2013 22:03:12 +0100 [thread overview]
Message-ID: <86mwl8m2un.fsf@somewhere.org> (raw)
In-Reply-To: 86mwl88d9a.fsf@somewhere.org
Hello,
"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,
Seb
--
Sebastien Vauban
next prev parent reply other threads:[~2013-11-13 21:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-13 16:42 Line number where eval-after-load is defined in my .emacs file Sebastien Vauban
2013-11-13 17:05 ` William G. Gardella
[not found] ` <mailman.5986.1384362332.10748.help-gnu-emacs@gnu.org>
2013-11-13 20:12 ` Sebastien Vauban
2013-11-14 8:19 ` Thien-Thi Nguyen
[not found] ` <mailman.6043.1384418405.10748.help-gnu-emacs@gnu.org>
2013-11-15 13:43 ` Sebastien Vauban
2013-11-16 1:40 ` Michael Heerdegen
2013-11-13 21:03 ` Sebastien Vauban [this message]
2013-11-13 22:09 ` Stefan Monnier
2013-11-13 23:26 ` Michael Heerdegen
[not found] ` <mailman.6018.1384385233.10748.help-gnu-emacs@gnu.org>
2013-11-15 13:46 ` Sebastien Vauban
2013-11-22 16:47 ` jack-mac
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86mwl8m2un.fsf@somewhere.org \
--to=sva-news-d0wtavr13harg/idocfnwg@public.gmane.org \
--cc=help-gnu-emacs-mXXj517/zsQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.