help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Difference in major mode autoload between 21.3.x and 22.0.x?


From: Markus Nißl
Subject: Re: Difference in major mode autoload between 21.3.x and 22.0.x?
Date: Fri, 14 Oct 2005 15:02:34 +0200
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

Slawomir Nowaczyk wrote:

> A question to the rest of the list: I have seen this being
> asked a couple of time recently... maybe it would make sense to
> change default value of magic-mode-alist to not include
> "xml-mode" and "html-mode" ?

Yeap, could make sense ... the problem is that an xsl file starts
the very same way an xml file does ...

> #> By far, I'm no Emacs expert ... so, can you give me a hint
> #> in which way I have to modify magic-mode-alist so that
> #> xsl-mode is being started whenever a file with the extension
> #> ".xsl" is loaded?
>
> Well, try this (not tested):
>
> (push magic-mode-alist '("<\\?xml " . nil))

Looks fine to me, but nope, this line results into the following
error:

Wrong type argument: symbolp, (quote (<\?xml ))

But I simply altered the line a bit using "setq" instead of "push":

(autoload 'xsl-mode "xslide" "Major mode for XSL stylesheets." t)
(setq auto-mode-alist (cons '("\\.xsl$" . xsl-mode) auto-mode-alist))
(setq magic-mode-alist (cons '("<\\?xml " . nil) magic-mode-alist))

> I am sure those better versed in elisp can suggest a nicer solution :)

Well, I'm fine with the solution above. Elisp is pretty weird to
code if you come from C++ or Java ...

> #> In 21.x, it was a breeze for an elisp novice to copy those two
> #> lines and to adjust them to my needs.
>
> I agree, auto-mode-alist is much easier to customise.

Yeap, although magic-mode-alist is certainly a nice
"intelli-sense" feature ;-)

Thanks a bunch for your help,
Markus


reply via email to

[Prev in Thread] Current Thread [Next in Thread]