help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Keybinding that loops through Major Modes


From: Jean Louis
Subject: Re: Keybinding that loops through Major Modes
Date: Tue, 3 Nov 2020 12:44:30 +0300
User-agent: Mutt/+ (1036f0e) (2020-10-18)

* Christopher Dimech <dimech@gmx.com> [2020-11-03 11:51]:
> 
> 
> 
> > Sent: Tuesday, November 03, 2020 at 9:11 AM
> > From: tomas@tuxteam.de
> > To: help-gnu-emacs@gnu.org
> > Subject: Re: Keybinding that loops through Major Modes
> >
> > On Mon, Nov 02, 2020 at 10:10:02PM +0100, Christopher Dimech wrote:
> > > I shall explain better then.  In my .texi files I customarily include 
> > > commands
> > > from other modes or want to use some hooks from other modes (e.g. 
> > > org-mode).
> > > So even after I load a file with the default mode, I would need to quickly
> > > shift to another mode temporarily, then switch back to normal-mode.
> >
> > Perhaps your problem becomes different [0] if you squint at it from
> > another angle (space vs time): do you really want your whole buffer
> > to "switch mode", or are you looking after some regions "having a
> > different mode"?
> 
> That's what I had in mind, for the whole buffer
> 
> > In the second case, look, e.g. for "multiple major modes" [1]. It's
> > a class of problems for which need exists (e.g. Org source snippets,
> > but also those PHP cum HTML cum Javascript thingies.
> 
> Indeed.  Customarily I would need to change mode on just a portion of the
> code I would be working with.


I do not know by which settings, but I do see that Org snippets with
programming language inside behave just as the mode:

If I have this in Org:

#+begin_src emacs-lisp :results output silent

Then I can see syntax highlighting and I get indentation as well. But
not all features.

Maybe soolution could be to narrow-to-region, change the mode, and
then by exiting from narrow to region to change it back to original
mode. It could be one function.



reply via email to

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