all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Stuart D. Herring" <herring@lanl.gov>
Cc: emacs-devel@gnu.org
Subject: Re: Mode loaded twice with Local Variables
Date: Tue, 9 May 2006 09:08:02 -0700 (PDT)	[thread overview]
Message-ID: <52339.128.165.123.132.1147190882.squirrel@webmail.lanl.gov> (raw)
In-Reply-To: <87vesfmsma.fsf@lrde.org>

>   I propose this, maybe naive, change:
> [patch to `normal-mode']

How about this?  It seems simpler to me.

Davis

PS - I copied the manual implementation of `indirect-function' from
`set-auto-mode-0'.  Is there some reason i-f isn't used?  Is it just to
avoid errors for unfbound symbols?  What if the major mode was itself an
alias, or does that not happen?

***************
*** 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)

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

  parent reply	other threads:[~2006-05-09 16:08 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 [this message]
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
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52339.128.165.123.132.1147190882.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 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.