From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: Interesting problem: eval-after-load and local variables Date: Tue, 16 Oct 2012 19:54:06 +0200 Message-ID: <87k3uq2thd.fsf@web.de> References: <80y5j6etfl.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1350410048 14240 80.91.229.3 (16 Oct 2012 17:54:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Oct 2012 17:54:08 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 16 19:54:14 2012 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 1TOBLG-0005sd-OS for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Oct 2012 19:54:10 +0200 Original-Received: from localhost ([::1]:57063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOBL9-0007af-Tc for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Oct 2012 13:54:03 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOBL4-0007aN-FA for help-gnu-emacs@gnu.org; Tue, 16 Oct 2012 13:53:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOBL3-0002xm-ED for help-gnu-emacs@gnu.org; Tue, 16 Oct 2012 13:53:58 -0400 Original-Received: from mout.web.de ([212.227.17.11]:53325) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOBL3-0002xb-4a for help-gnu-emacs@gnu.org; Tue, 16 Oct 2012 13:53:57 -0400 Original-Received: from drachen.dragon ([89.204.137.155]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0LlF9O-1Twgbu3yJK-00aWev; Tue, 16 Oct 2012 19:53:55 +0200 Mail-Followup-To: help-gnu-emacs@gnu.org In-Reply-To: <80y5j6etfl.fsf@somewhere.org> (Sebastien Vauban's message of "Tue, 16 Oct 2012 10:02:06 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) X-Provags-ID: V02:K0:y+qpaYbLj8cNVLCwYoUYRIx0s0AZu/+0BhOXCNJNX9p 2JWuNltwRIpgEVsz0yZzqLPKR0r/gytf3fR1/WukZ0gQKTV9+5 KELkB7L1SVru3vIxl3LFPLFGQfK0x/EBI3l5JmxCPfaFIzK2S5 6ZEj5Zs1GOYDkFuwpbi3W1f1RmYPrOfo72A07wOkD5jBRdwfnF kHdu3kc/o8BwJtOeDShaPHwb3nQ/zxkvVnw1PQOeCg= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.17.11 X-BeenThere: help-gnu-emacs@gnu.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@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:87286 Archived-At: Hello, I think you need to use `setq-default' instead of `setq' - see the manual for details. So, that should work: (eval-after-load "time-stamp" ;; format of the string inserted by `M-x time-stamp' '(setq-default time-stamp-format "%:y-%02m-%02d %3a %02H:%02M %u")) Michael. "Sebastien Vauban" writes: > Hello, > > In order to speed up my Emacs startup, I've put many customizations in > eval-after-load's, such as: > > (eval-after-load "time-stamp" > '(progn > ;; format of the string inserted by `M-x time-stamp' > (setq time-stamp-format "%:y-%02m-%02d %3a %02H:%02M %u"))) > > in order to avoid the require itself in the .emacs file. > > Now, this causes a problem, as my local variable customizations aren't > respected anymore. > > For example, I have the following local vars in my file `common.sty' > to set up > the format of the time-stamp (=C3=A0 la LaTeX): > > %% common.sty -- LaTeX common commands and environments > > \NeedsTeXFormat{LaTeX2e} > \ProvidesPackage{common}[2012/10/15 v1.0 Common stuff between documents a= nd presentations] > > % ... > > %% End of package > \endinput % very last line > > % Local Variables: > % time-stamp-format: "%:y/%02m/%02d" > % time-stamp-start: "Provides\\(Class\\|Package\\){[a-zA-Z-]+}\\[" > % time-stamp-end: " " > % End: > > The problem is the following: > > - Upon opening the file, Emacs sees it needs to load time-stamp. > > - It does it (via the predefined autoloads), but the eval-after-load > overrides > the local variables' value. > > - When saving the file, the time-stamp format provided in local vars is N= OT > applied. > > In a way, that's perfectly normal. In another, not at all: I would > expect the > local vars to win over the wide values, in any configuration (even if > my setq > were in an eval-after-load construct). > > What do you think? > > Best regards, > Seb