unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: michael.cadilhac@lrde.org (Michaël Cadilhac)
Cc: emacs-devel@gnu.org
Subject: Re: Mode loaded twice with Local Variables
Date: Wed, 10 May 2006 20:29:07 +0200	[thread overview]
Message-ID: <87lkt9ent8.fsf@lrde.org> (raw)
In-Reply-To: <52339.128.165.123.132.1147190882.squirrel@webmail.lanl.gov> (Stuart D. Herring's message of "Tue, 9 May 2006 09:08:02 -0700 (PDT)")


[-- Attachment #1.1: Type: text/plain, Size: 1839 bytes --]

"Stuart D. Herring" <herring@lanl.gov> writes:

> ***************
> *** 2724,2733 ****
>   		      ok)))))))
>
>   (defun hack-one-local-variable (var val)
> !   "Set local variable VAR with value VAL."
>     (cond ((eq var 'mode)
> ! 	 (funcall (intern (concat (downcase (symbol-name val))
> ! 				  "-mode"))))
>   	((eq var 'eval)
>   	 (save-excursion (eval val)))
>   	(t (make-local-variable var)
> --- 2738,2753 ----
>   		      ok)))))))
>
>   (defun hack-one-local-variable (var val)
> !   "Set local variable VAR with value VAL.
> ! If VAR is `mode', call `VAL-mode' as a
> ! function unless it's already the major mode."
>     (cond ((eq var 'mode)
> ! 	 (let ((mode (intern (concat (downcase (symbol-name val)) "-mode"))))
> ! 	   (while (symbolp (symbol-function mode))
> ! 	     (setq mode (symbol-function mode)))
> ! 	   (if (eq mode major-mode)
> ! 	       (setq mode nil))
> ! 	   (when mode (funcall mode))))
>   	((eq var 'eval)
>   	 (save-excursion (eval val)))
>   	(t (make-local-variable var)

  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.

  Regards.

-- 
 |      Michaël `Micha' Cadilhac   |   Un certain Blaise Pascal             |
 |         Epita/LRDE Promo 2007   |     etc... etc...                      |
 | http://www.lrde.org/~cadilh_m   |   -- Prévert (Les paris stupides)      |
 `--  -   JID: micha@amessage.be --'                                   -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

  parent reply	other threads:[~2006-05-10 18:29 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 [this message]
2006-05-10 19:59     ` Stuart D. Herring
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=87lkt9ent8.fsf@lrde.org \
    --to=michael.cadilhac@lrde.org \
    --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).