From: gareth.rees@pobox.com (Gareth Rees)
Subject: Re: Modes within modes
Date: 7 Nov 2003 09:27:46 -0800 [thread overview]
Message-ID: <e867ce6d.0311070927.786dfd91@posting.google.com> (raw)
In-Reply-To: mailman.3281.1068080002.21628.help-gnu-emacs@gnu.org
Dan Anderson wrote:
> Often times I'll have an e-mail message with some code in it, or code
> with some text in comments. Is it possible to highlight a region and
> tell Emacs to (use A-mode instead of B-mode)?
The simplest way to do this is to use 'clone-indirect-buffer' (C-x 4 c)
and use A-mode in the original buffer and B-mode in the cloned buffer.
Put the two buffers in adjacent windows and switch between them when you
want the features of the other mode. See the Info node (emacs)Indirect
Buffers.
There are third-party add-ons that claim to support multiple major modes
in the same buffer (I don't know how they work, but if they have any
sense they will work by automatically switching to the appropriate
indirect buffer depending on the value of point). See
http://www.emacswiki.org/cgi-bin/wiki?MultipleModes for a selection of
possibilities.
--
Gareth Rees
next parent reply other threads:[~2003-11-07 17:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.3281.1068080002.21628.help-gnu-emacs@gnu.org>
2003-11-07 17:27 ` Gareth Rees [this message]
2003-11-07 18:01 ` Modes within modes Kevin Rodgers
2003-11-07 18:29 ` lawrence mitchell
2003-11-07 20:52 ` Peter Lee
2003-11-06 0:52 Dan Anderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e867ce6d.0311070927.786dfd91@posting.google.com \
--to=gareth.rees@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).