From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Sebastien Vauban" Newsgroups: gmane.emacs.help Subject: Re: Line number where eval-after-load is defined in my .emacs file Date: Fri, 15 Nov 2013 14:46:02 +0100 Organization: Sebastien Vauban Message-ID: <86r4ahsrqd.fsf@somewhere.org> References: <86mwl88d9a.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1384523413 26884 80.91.229.3 (15 Nov 2013 13:50:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 15 Nov 2013 13:50:13 +0000 (UTC) To: help-gnu-emacs-mXXj517/zsQ@public.gmane.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Fri Nov 15 14:50:18 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VhJms-00020s-Li for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Nov 2013 14:50:18 +0100 Original-Received: from localhost ([::1]:60437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhJms-0007na-Cc for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Nov 2013 08:50:18 -0500 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 39 Injection-Info: mx05.eternal-september.org; posting-host="402b34550bd938aa98825778083dce0e"; logging-data="20883"; mail-complaints-to="abuse-VVbKFVtnif8H+i2N2EyTrmui9UKz+5OX@public.gmane.org"; posting-account="U2FsdGVkX18ybPknnAKBpiIyE2fC+ESR" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt) X-Archive: encrypt Cancel-Lock: sha1:XR1IxXNfnHUZ6QMnQbqdY8ufp2E= sha1:tZuGxOqMHU8FXhY+9yrCWNXcDHg= X-Url: Under construction... Original-Xref: usenet.stanford.edu gnu.emacs.help:202228 X-BeenThere: help-gnu-emacs-mXXj517/zsQ@public.gmane.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.emacs.help:94497 Archived-At: 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