* Keybinding to change Major Mode according to file type
@ 2020-09-21 7:42 Christopher Dimech
2020-09-21 8:35 ` Marcin Borkowski
0 siblings, 1 reply; 2+ messages in thread
From: Christopher Dimech @ 2020-09-21 7:42 UTC (permalink / raw)
To: Help Gnu Emacs
Can one use keybinding such as f2 loads the bluffer in Major Mode dependent on the file type.
Example:
If I have a .texi file in whicn I have changed the major mode with 'M-x org-mode'
I want to press f2 to it will check the file, in my case .texi and change
to major mode as though I keyed 'M-x texinfo-mode'
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Keybinding to change Major Mode according to file type
2020-09-21 7:42 Keybinding to change Major Mode according to file type Christopher Dimech
@ 2020-09-21 8:35 ` Marcin Borkowski
0 siblings, 0 replies; 2+ messages in thread
From: Marcin Borkowski @ 2020-09-21 8:35 UTC (permalink / raw)
To: Christopher Dimech; +Cc: Help Gnu Emacs
On 2020-09-21, at 09:42, Christopher Dimech <dimech@gmx.com> wrote:
> Can one use keybinding such as f2 loads the bluffer in Major Mode dependent on the file type.
>
> Example:
>
>
> If I have a .texi file in whicn I have changed the major mode with 'M-x org-mode'
>
> I want to press f2 to it will check the file, in my case .texi and change
> to major mode as though I keyed 'M-x texinfo-mode'
M-x normal-mode
And you can use global-set-key to bind this to f2 (although you'd have
to start with unsetting it, since it is a prefix key by default). You
can e.g. say
M-: (global-unset-key [f2]) RET
and then
M-x global-set-key RET f2 normal-mode RET.
Hth,
--
Marcin Borkowski
http://mbork.pl
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-21 8:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-21 7:42 Keybinding to change Major Mode according to file type Christopher Dimech
2020-09-21 8:35 ` Marcin Borkowski
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).