Questions tagged [major-mode]
The mode that determines the editing behavior of Emacs while that buffer is current. The mode line normally shows the name of the current major mode, in parentheses.
297
questions
0
votes
0
answers
48
views
Trying to get treesitter indents to work with multiple languages for a major mode
I am working on a major mode using treesitter as my parser. It's been pretty intuitive but I ran into an issue. When trying to use multiple languages, you have to specify ranges using nodes in the AST ...
0
votes
2
answers
73
views
before-save-hook not working with use-package and custom mode
I wrote a little derived mode for the kage shader language, it's derived from go-mode (syntax is the same). I also like to use gofmt, but it's just not loading the hook.
Here's the mode:
(define-...
0
votes
2
answers
106
views
What to do when a major mode overides keybindings set in doom emacs?
[Edit: I should specify that there are many keybindings in the major mode that overide the desired keybinding. They all start with a whereas I would like a to do something else. I already thought ...
0
votes
0
answers
19
views
How to put 'viper-change-state-to-emacs function on some hook
I am using viper-mode, which is vi emulator and can be switched to the original emacs mode with viper-change-state-to-emacs, when I edit program files.
But, sometimes I want to create some special ...
0
votes
1
answer
21
views
`tab-stop-list` being ignored
Tying to write a new mode, I am stuck at:
(define-derived-mode NEWS-mode
text-mode "NEWS"
"Major mode for NEWS file."
(setq tab-stop-list '(2 6 59 65))
(setq indent-tabs-...
0
votes
1
answer
21
views
Update content of a buffer in side window when a custom mode is on [duplicate]
I have following code which is supposed to clear existing content in a buffer and write new one.
(defun display-file-dir (path)
(text-mode)
(if buffer-read-only
(read-only-mode))
(erase-...
1
vote
0
answers
83
views
What is the advantage of major-mode-remap-alist?
I've had this in my init file about forever:
(defalias 'perl-mode 'cperl-mode) ;cperl is much nicer
Now I learned about major-mode-remap-alist in Emacs 29.1 which I had installed shortly after ...
0
votes
0
answers
25
views
Viewing a single mail file in a maildir
Is there any major mode that allows one to properly view a single mail file in a maildir?
By "properly" here I mean similar to "big" email clients, like mu4e or gnus, so allowing (...
1
vote
0
answers
73
views
Mermaid major mode not showing up after installation
I've installed mermaid-mode by using package-install and MPLA but for some reason, it's not showing up when I type it after M-x. (I get Match required). I'm running Doom Emacs. Any clue why this ...
0
votes
0
answers
20
views
Haskell Interactive mode - incorrect parsing of crammed code
When using list comprehension without white spaces, all text after vertical bar turns grey. [x| is treated like header of here-document - grey color spans for the rest of the buffer, unless sequence |...
0
votes
0
answers
26
views
Is there a major mode for editing xkb files?
I have a custom keyboard layout I'm often editing. This is a file stored in /usr/share/X11/xkb/symbols/, similar to the other language files there. Since none of these files have an extension Emacs ...
0
votes
1
answer
38
views
change major mode without hiding text or revealing hidden text (for live-coding)
Question
I am live-coding. I would like to be able to change the major mode to and from org-mode without un-hiding any of the text that org-mode has hidden. I would switch to a code mode whenever I ...
0
votes
1
answer
41
views
Different outputs from minor-mode depending on major-mode
My minor-mode is inserting text in the current buffer. I want the default format of the text to be different depending on what major-mode the buffer is in, and to allow the user to override this ...
0
votes
2
answers
2k
views
How enable tree-sitter modes (*-ts-mode) that aren't built-in?
My Emacs (29.1) comes with the some tree-sitter modes:
c-ts-mode
go-ts-mode
js-ts-mode
...
I downloaded the compiled .dll and they work out of box.
However, there are some languages that tree-sitter ...
0
votes
1
answer
31
views
set the correct major mode for script files based on interpreter
I want to make a function that will set the correct major mode based on the interpreter used for a script.
I don't want to include extensions in my scripts (because that can be annoying if making cli ...