unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* did syntax for setq auto-mode-alist or regexp change with 21.3.1?
@ 2005-06-30 18:09 Tom
  2005-06-30 20:48 ` Kevin Rodgers
  2005-06-30 21:00 ` Thien-Thi Nguyen
  0 siblings, 2 replies; 3+ messages in thread
From: Tom @ 2005-06-30 18:09 UTC (permalink / raw)


This worked with emacs 20.7.1 on Linux

(setq auto-mode-alist (cons
`("makefile\\(\\.aix\\|\\.hp\\|\\.sol\\|\\.linux\\|\\.gcc\\)\\'".makefile-mode)
auto-mode-alist))

With emacs 21.3.1 on Linux I get this error for the above syntax:

File mode specification error: (invalid-function (\.makefile-mode))

I had to do it this way to get it to work in emacs 21.3.1 on Linux

(setq auto-mode-alist (cons `( "makefile\\.linux" . makefile-mode )
auto-mode-alist ))
(setq auto-mode-alist (cons `( "makefile\\.sol" . makefile-mode )
auto-mode-alist ))
(setq auto-mode-alist (cons `( "makefile\\.aix" . makefile-mode )
auto-mode-alist ))
(setq auto-mode-alist (cons `( "makefile\\.hp" . makefile-mode )
auto-mode-alist ))
(setq auto-mode-alist (cons `( "makefile\\.gcc" . makefile-mode )
auto-mode-alist ))

Any ideas why the first form no longer works?

Thank you,

Tom M.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: did syntax for setq auto-mode-alist or regexp change with 21.3.1?
  2005-06-30 18:09 did syntax for setq auto-mode-alist or regexp change with 21.3.1? Tom
@ 2005-06-30 20:48 ` Kevin Rodgers
  2005-06-30 21:00 ` Thien-Thi Nguyen
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Rodgers @ 2005-06-30 20:48 UTC (permalink / raw)


Tom wrote:
 > This worked with emacs 20.7.1 on Linux
 >
 > (setq auto-mode-alist (cons
 > 
`("makefile\\(\\.aix\\|\\.hp\\|\\.sol\\|\\.linux\\|\\.gcc\\)\\'".makefile-mode)
 > auto-mode-alist))
 >
 > With emacs 21.3.1 on Linux I get this error for the above syntax:
 >
 > File mode specification error: (invalid-function (\.makefile-mode))
 >
 > I had to do it this way to get it to work in emacs 21.3.1 on Linux
 >
 > (setq auto-mode-alist (cons `( "makefile\\.linux" . makefile-mode )
 > auto-mode-alist ))
 > (setq auto-mode-alist (cons `( "makefile\\.sol" . makefile-mode )
 > auto-mode-alist ))
 > (setq auto-mode-alist (cons `( "makefile\\.aix" . makefile-mode )
 > auto-mode-alist ))
 > (setq auto-mode-alist (cons `( "makefile\\.hp" . makefile-mode )
 > auto-mode-alist ))
 > (setq auto-mode-alist (cons `( "makefile\\.gcc" . makefile-mode )
 > auto-mode-alist ))

No, you just need to put spaces around the dot that's between the
complex regexp and the function.

 > Any ideas why the first form no longer works?

To get you to clean up your code :-)

Since dot is a valid character in a symbol name, the Lisp reader
requires surrounding whitespace in order to interpret it as the infix
cons operator.

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: did syntax for setq auto-mode-alist or regexp change with 21.3.1?
  2005-06-30 18:09 did syntax for setq auto-mode-alist or regexp change with 21.3.1? Tom
  2005-06-30 20:48 ` Kevin Rodgers
@ 2005-06-30 21:00 ` Thien-Thi Nguyen
  1 sibling, 0 replies; 3+ messages in thread
From: Thien-Thi Nguyen @ 2005-06-30 21:00 UTC (permalink / raw)


"Tom" <tmarinus@yahoo.com> writes:

> This worked with emacs 20.7.1 on Linux
>
> (setq auto-mode-alist (cons
> `("makefile\\(\\.aix\\|\\.hp\\|\\.sol\\|\\.linux\\|\\.gcc\\)\\'".makefile-mode)
>
> Any ideas why the first form no longer works?

it is sufficient to add a space around the dot, and use a
forward-single-quote (instead of backtick), resulting in:

'("makefile\\(\\.aix\\|\\.hp\\|\\.sol\\|\\.linux\\|\\.gcc\\)\\'"
  . makefile-mode)

here, i added a newline and some more spaces as well -- how many
isn't as important as the presence of at least one.  this form
will work for both old and new emacs.  that the form w/o spaces
worked at all for old emacs is probably a fluke.

thi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-06-30 21:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-30 18:09 did syntax for setq auto-mode-alist or regexp change with 21.3.1? Tom
2005-06-30 20:48 ` Kevin Rodgers
2005-06-30 21:00 ` Thien-Thi Nguyen

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