# -*- mode: ⦠-*- string fallback
Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
So I know that I can put at the first or second line of a file a line such as:
# -*- mode: conf -*-
to tell Emacs what major mode I want the file to be opened with.
But if that mode isn't installed I wish Emacs to fallback to a different mode.
For example I wish to use the apache-mode, but if it doesn't exist I wish to fallback to conf-mode.
Is this possible, and if so how?
major-mode file-local-variables
add a comment |Â
up vote
4
down vote
favorite
So I know that I can put at the first or second line of a file a line such as:
# -*- mode: conf -*-
to tell Emacs what major mode I want the file to be opened with.
But if that mode isn't installed I wish Emacs to fallback to a different mode.
For example I wish to use the apache-mode, but if it doesn't exist I wish to fallback to conf-mode.
Is this possible, and if so how?
major-mode file-local-variables
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
So I know that I can put at the first or second line of a file a line such as:
# -*- mode: conf -*-
to tell Emacs what major mode I want the file to be opened with.
But if that mode isn't installed I wish Emacs to fallback to a different mode.
For example I wish to use the apache-mode, but if it doesn't exist I wish to fallback to conf-mode.
Is this possible, and if so how?
major-mode file-local-variables
So I know that I can put at the first or second line of a file a line such as:
# -*- mode: conf -*-
to tell Emacs what major mode I want the file to be opened with.
But if that mode isn't installed I wish Emacs to fallback to a different mode.
For example I wish to use the apache-mode, but if it doesn't exist I wish to fallback to conf-mode.
Is this possible, and if so how?
major-mode file-local-variables
edited Aug 22 at 12:12
asked Aug 22 at 12:08
Chen Levy
20816
20816
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
8
down vote
Found it:
# -*- mode: conf; mode: apache -*-
It seems that the last valid mode wins, so I need to put the my wanted mode last, and the fallback mode(s) before it.
Interesting. I suspect that will activate all the named modes (those that are available at least), one after the other. This should do no harm, but might be a bit time consuming. It's a handy trick, though.
â Harald Hanche-Olsen
Aug 23 at 8:18
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
8
down vote
Found it:
# -*- mode: conf; mode: apache -*-
It seems that the last valid mode wins, so I need to put the my wanted mode last, and the fallback mode(s) before it.
Interesting. I suspect that will activate all the named modes (those that are available at least), one after the other. This should do no harm, but might be a bit time consuming. It's a handy trick, though.
â Harald Hanche-Olsen
Aug 23 at 8:18
add a comment |Â
up vote
8
down vote
Found it:
# -*- mode: conf; mode: apache -*-
It seems that the last valid mode wins, so I need to put the my wanted mode last, and the fallback mode(s) before it.
Interesting. I suspect that will activate all the named modes (those that are available at least), one after the other. This should do no harm, but might be a bit time consuming. It's a handy trick, though.
â Harald Hanche-Olsen
Aug 23 at 8:18
add a comment |Â
up vote
8
down vote
up vote
8
down vote
Found it:
# -*- mode: conf; mode: apache -*-
It seems that the last valid mode wins, so I need to put the my wanted mode last, and the fallback mode(s) before it.
Found it:
# -*- mode: conf; mode: apache -*-
It seems that the last valid mode wins, so I need to put the my wanted mode last, and the fallback mode(s) before it.
edited Aug 22 at 12:26
answered Aug 22 at 12:08
Chen Levy
20816
20816
Interesting. I suspect that will activate all the named modes (those that are available at least), one after the other. This should do no harm, but might be a bit time consuming. It's a handy trick, though.
â Harald Hanche-Olsen
Aug 23 at 8:18
add a comment |Â
Interesting. I suspect that will activate all the named modes (those that are available at least), one after the other. This should do no harm, but might be a bit time consuming. It's a handy trick, though.
â Harald Hanche-Olsen
Aug 23 at 8:18
Interesting. I suspect that will activate all the named modes (those that are available at least), one after the other. This should do no harm, but might be a bit time consuming. It's a handy trick, though.
â Harald Hanche-Olsen
Aug 23 at 8:18
Interesting. I suspect that will activate all the named modes (those that are available at least), one after the other. This should do no harm, but might be a bit time consuming. It's a handy trick, though.
â Harald Hanche-Olsen
Aug 23 at 8:18
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f44246%2fmode-string-fallback%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password