all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.