From: "Stuart D. Herring" <herring@lanl.gov>
Cc: emacs-devel@gnu.org
Subject: Re: Mode loaded twice with Local Variables
Date: Wed, 10 May 2006 12:59:43 -0700 (PDT) [thread overview]
Message-ID: <56589.128.165.123.132.1147291183.squirrel@webmail.lanl.gov> (raw)
In-Reply-To: <87lkt9ent8.fsf@lrde.org>
> I didn't think it was the right fix for one reason : some modes
> /may/ behave differently on startup if /some/ variables have
> /certain/ values. In other words, Local Variables would set
> variables to some value before launching the mode, expecting
> a specified behavior.
>
> My change provides this feature, AFAIK, but I do agree that it could
> be too... dangerous to patch normal-mode, and not so needed.
I'm not sure that's how major modes are supposed to behave. I don't
expect them to _do_ too much on startup; they ought to define commands and
bindings which may depend on variables, but which will execute later (well
after the application of local variables). Additionally, major modes run
`kill-all-local-variables', so it would currently be disastrous to
exchange those two activities (I now realize).
But the very existence of major mode hooks makes me doubt myself. WDOT?
If it'd be better to set up the mode last, perhaps `normal-mode' ought to:
1. Somehow discover what major mode should be set (via variable or
otherwise).
2. `kill-all-local-variables' if the major mode is going to change.
3. `hack-local-variables' without setting the mode.
4. Set the mode, if it changed.
But this is very much more complicated than just preventing double-loading
the mode, so should probably happen later if ever.
Davis
PS - For amusement, load a file with this:
-*- mode: normal; -*-
--
This product is sold by volume, not by mass. If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.
next prev parent reply other threads:[~2006-05-10 19:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-09 9:53 Mode loaded twice with Local Variables Michaël Cadilhac
2006-05-09 13:22 ` Chong Yidong
2006-05-09 13:53 ` Michaël Cadilhac
2006-05-09 16:08 ` Stuart D. Herring
2006-05-10 17:50 ` Richard Stallman
2006-05-10 18:20 ` Stuart D. Herring
2006-05-11 18:31 ` Richard Stallman
2006-05-10 18:29 ` Michaël Cadilhac
2006-05-10 19:59 ` Stuart D. Herring [this message]
2006-05-11 18:31 ` Richard Stallman
2006-05-11 19:00 ` Stuart D. Herring
2006-05-11 18:31 ` Richard Stallman
2006-06-14 23:09 ` Stuart D. Herring
2006-05-10 3:20 ` Richard Stallman
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56589.128.165.123.132.1147291183.squirrel@webmail.lanl.gov \
--to=herring@lanl.gov \
--cc=emacs-devel@gnu.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).