Questions tagged [multiple-modes]

Editing mixed-content files with multiple major modes in the same buffer

A buffer has a single major mode chosen according to the file format. For mixed-content files, there are ways to benefit from multiple major modes.

Related tags

  • , one of the ways to switch between major modes based on context
  • , another way to switch between major modes based on context
  • , for HTML files embedded CSS, Javascript and server-side scripts

External links

11 questions
7
votes
1 answer

Multiple major modes in one buffer (e.g., python-mode & LaTeX-mode)

Using the LaTeX-package pythontex I one can insert python code into the latex document which is executed (and printed to your latex file if you want) if you run latex. I use auctex for editing latex files, however editing the python code inside the…
student
  • 1,007
  • 9
  • 29
5
votes
1 answer

Ergonomic way to edit source code inside ReST or Markdown code blocks?

I often find myself writing ReST files with embedded source code examples (e.g. in .. code:: blocks or GFM-style triple-backticks; usually the embedded source code is Python). And this is always an exercise in frustration, because ReST mode has…
4
votes
1 answer

Change AUCTeX behavior inside an environment

I am using the LaTeX markdown package to insert quick notes in my document. I would like Emacs to switch to markdown mode inside the markdown environment so it for example won't automatically re-indent markdown nested lists. Here is an excerpt of…
Jindra Helcl
  • 143
  • 4
3
votes
1 answer

Syntax highlight embedded script

I have a bash shell script that has a fairly sizable amount of perl code in it. Is there a why to get perl syntax highlighting instead of the normal here doc coloring? Thank you for any help, I'm new to emacs and still getting the hang of elisp and…
Gary Ash
  • 41
  • 2
2
votes
0 answers

Edit a portion of YAML file (a multi-line string) with a different mode

I'm constantly editing a big yaml file with many multi-line strings, which are BASH scripts. In org-mode I would use something like: #+begin_src sh echo "cool" #+end_src And then just to C-c ' (org-edit-src-code) to edit this portion of the file in…
licorna
  • 207
  • 1
  • 8
2
votes
1 answer

Syntactic fontification of diff hunks

I'm looking for a multiple-major-modes package that doesn't remove fontification of the host mode from its inner submodes? I tried MMM Mode and Polymode, but they remove the initial fontification and put own faces with own background colors in…
link0ff
  • 1,081
  • 5
  • 14
2
votes
1 answer

Custom theme based on major mode or file type

How can I customize emacs to use a different theme based on major mode or file-type? And, could it work to have different themes active in different windows? My use case would be: have (1) one general them for code and stuff and (2) one special…
NeuronQ
  • 125
  • 4
2
votes
1 answer

Syntax highlighting inside HTML5