[Top][All Lists]

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

Re: Specifying mode in file variables trouble

From: Lennart Borgman (gmail)
Subject: Re: Specifying mode in file variables trouble
Date: Wed, 24 Sep 2008 18:23:10 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20071031 Thunderbird/ Mnenhy/

Richard M. Stallman wrote:
>     > I'm not sure whether majmodpri is a useful feature, because I am not
>     > convinced there is a real problem to be solved.  What is a real case
>     > of the problem, and is there another solution?
>     I tried to describe the problem in the comment in majmodpri.el. Is that
>     comment not clear?
> I can see what feature the file implements, for controlling the order
> of `auto-mode-alist' and a few other variables.  I do not see that the
> feature is useful.
> If you show me a REAL case in which this is useful, that might convice me.

When I wrote the majmodpri.el I had third party elisp files in mind. For
files inside Emacs we can perhaps use a simpler mechanism.

It is quite common that third party files adds themselves to
auto-mode-alist when they are loaded. At least some of the php-mode.el
varianst that are available does that; they bind .php to the php-mode
the supply. This will then be the default major mode for .php files.

We can of course say that should not have this side effect, but that
does not help all times. (We have already done that.)

This problem actually exists inside Emacs too. Today there are two major
modes for editing XML files.

majmodpri.el offers a way to solve this type of problem through custom
(though it may of course need some changes).

> I am not impressed by imaginary hypothetical cases.
>     > But if we want such a facility, we should implement it right.  The
>     > right way is to insert these elements in the proper position the first
>     > time.
>     Unfortunately that can't be done. Please see the comment above.
> Of course it can be done.

Yes, but this is a misunderstanding. I was thinking of the problems I
wrote about above.

> It is easy to write a function that would
> add an item to `auto-mode-alist' and choose where to put it based on
> whatever criteria we like.  It could take four three arguments, one
> being the major mode that the elements are for, and the other three
> being elements to add to the three variables that majmodpri sorts.
> And it could insert them in the proper order.
> I don't know if it is useful, but it is not hard.

reply via email to

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