all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Stuart D. Herring" <herring@lanl.gov>
To: emacs-devel@gnu.org
Subject: Reminder: `set-auto-mode' adjustments
Date: Wed, 28 Feb 2007 16:44:44 -0800 (PST)	[thread overview]
Message-ID: <37118.128.165.123.18.1172709884.squirrel@webmail.lanl.gov> (raw)

[-- Attachment #1: Type: text/plain, Size: 461 bytes --]

The patch mentioned and approved here and here:

http://lists.gnu.org/archive/html/emacs-devel/2006-05/msg00489.html [me]
http://lists.gnu.org/archive/html/emacs-devel/2006-05/msg00565.html [RMS]

has never been applied, AFAICS.  I've reattached it (the exact same file)
for convenience; install, please?

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

[-- Attachment #2: mode-reapply.patch --]
[-- Type: application/octet-stream, Size: 1861 bytes --]

Index: files.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/files.el,v
retrieving revision 1.831
diff -c -r1.831 files.el
*** files.el	9 May 2006 22:55:30 -0000	1.831
--- files.el	10 May 2006 18:10:15 -0000
***************
*** 2192,2203 ****
  If optional arg KEEP-MODE-IF-SAME is non-nil, MODE is chased of
  any aliases and compared to current major mode.  If they are the
  same, do nothing and return nil."
!   (when keep-mode-if-same
!     (while (symbolp (symbol-function mode))
!       (setq mode (symbol-function mode)))
!     (if (eq mode major-mode)
! 	(setq mode nil)))
!   (when mode
      (funcall mode)
      mode))
  
--- 2192,2199 ----
  If optional arg KEEP-MODE-IF-SAME is non-nil, MODE is chased of
  any aliases and compared to current major mode.  If they are the
  same, do nothing and return nil."
!   (unless (and keep-mode-if-same
! 	       (eq (indirect-function mode) (indirect-function major-mode)))
      (funcall mode)
      mode))
  
***************
*** 2722,2731 ****
  		      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)
--- 2733,2745 ----
  		      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"))))
! 	   (unless (eq (indirect-function mode) (indirect-function major-mode))
! 	     (funcall mode))))
  	((eq var 'eval)
  	 (save-excursion (eval val)))
  	(t (make-local-variable var)

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

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

             reply	other threads:[~2007-03-01  0:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-01  0:44 Stuart D. Herring [this message]
2007-03-01 17:06 ` Reminder: `set-auto-mode' adjustments Chong Yidong

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