This is kind of a weird question, but I have a file that's a mix of perl, text, and Bourne shell. Is there some (easy) way to have emacs switch major modes at different points in the file?
Perhaps when it sees -*- Text -*-
or -*- Perl -*-
or something?
Or can I just change it for the region if I narrow-to-region
?
Thanks.
-E
I just noticed that there is a tag for "multiple-modes", so I'm hopeful.
mmm-mode
with a configuration example in that answer to another question. From my point of view this question is actually a duplicate of that other question. – Tobias Apr 02 '19 at 14:19multiple modes in one buffer
gives that answer as one of the first results. It should be relatively simple to adapt the linked solution to your problem. Side note: I found the other post by a tag search with search string[multiple-modes]
. – Tobias Apr 02 '19 at 22:07:save-matches
does. It's a different question for a different post. This is enough for me to chew on for a while. Thanks! -E – Erik Bennett Apr 02 '19 at 22:22M-: (info "(mmm) Paired Delimiters")
for a description of:save-matches
. – Tobias Apr 02 '19 at 22:43