all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: help-gnu-emacs-mXXj517/zsQ@public.gmane.org
Subject: Interesting problem: eval-after-load and local variables
Date: Tue, 16 Oct 2012 10:02:06 +0200	[thread overview]
Message-ID: <80y5j6etfl.fsf@somewhere.org> (raw)

Hello,

In order to speed up my Emacs startup, I've put many customizations in
eval-after-load's, such as:

--8<---------------cut here---------------start------------->8---
  (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")))
--8<---------------cut here---------------end--------------->8---

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 (à la LaTeX):

--8<---------------cut here---------------start------------->8---
%% common.sty -- LaTeX common commands and environments

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{common}[2012/10/15 v1.0 Common stuff between documents and 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:
--8<---------------cut here---------------end--------------->8---

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 NOT
  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

-- 
Sebastien Vauban


             reply	other threads:[~2012-10-16  8:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-16  8:02 Sebastien Vauban [this message]
2012-10-16  9:18 ` Interesting problem: eval-after-load and local variables Peter Dyballa
2012-10-16 17:54 ` Michael Heerdegen
2012-10-17  3:23 ` Kevin Rodgers
     [not found] ` <mailman.11151.1350444234.855.help-gnu-emacs@gnu.org>
2012-10-17  8:32   ` Sebastien Vauban
2012-10-18  4:09     ` Michael Heerdegen
2012-10-18 12:55     ` Kevin Rodgers
2012-10-18 17:46       ` Bob Proulx
     [not found]     ` <mailman.11221.1350564945.855.help-gnu-emacs@gnu.org>
2012-10-19  9:40       ` Sebastien Vauban

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=80y5j6etfl.fsf@somewhere.org \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@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.