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.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
29 views

Interactive selection of major mode

With the following function I can make a new buffer. I also want the user to be able to set the major-mode for it. I could use completing-read in this way (cseq '("sh-mode" "emacs-lisp-...
user avatar
  • 107
0 votes
0 answers
18 views

Mode for Clean (the language)?

Clean is a lazy functional language quite similar to Haskell (link below). It is not terribly active but not quite dead either - more like Sanskrit than like Latin :-) I have searched here and on all ...
user avatar
0 votes
1 answer
27 views

C-c C-c on #+PROPERTY: keyword line changes the mode from Org to TeX

Context Linux Mageia 8 GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of 2021-04-01 Issue With: this (rather long) org-mode file, open with emacs -Q, C-c ...
user avatar
1 vote
0 answers
26 views

Good mode to edit CSV files including adding and removing columns?

Looking for a mode to edit CSV files. I tried csv-mode which is great for viewing CSVs via the minor mode csv-align-mode. However I cannot find an easy way to add or delete columns in this mode. Is ...
user avatar
  • 1,041
0 votes
1 answer
48 views

Different behavior between M-! and a terminal?

I'm writing a major mode to interface with a popular but clunky Monte Carlo program. I've also written a script that makes the interface a little more tolerable, and have written the following simple ...
user avatar
  • 113
4 votes
2 answers
80 views

How can I enable electric indentation for all modes except some?

I am trying to enable electric-indent-mode for all modes except fundamental-mode, where it is just annoying. In my init file, I have the following: (electric-indent-mode +1) (add-hook 'after-change-...
user avatar
  • 41
0 votes
1 answer
31 views

How can a function check which major mode is enabled?

The accepted answer to this question says: When the function is invoked, it can test the current mode and do something appropriate. For example, for some modes, or all modes except some modes, it can ...
user avatar
  • 113
0 votes
2 answers
39 views

Is this syntax parse possible with Emacs' regex expressions?

I'm trying to write a small new mode for some input files to a specific computational physics program. I'm doing it the define-derived-mode way, and was specifying the syntax highlighting by setting ...
user avatar
  • 113
0 votes
1 answer
24 views

POVray mode minor change sought

POVray is a scripting language used to define 3-dimensional graphics. POVray mode for emacs provides text coloring, automatic indenting, etc. when developing a script on emacs. For the most part, this ...
user avatar
  • 1
0 votes
0 answers
56 views

How to add `imenu` support to a major mode that does not support it and issue and error?

When working with YANG files using the yang-mode I get a imenu-unavailable "The mode ‘YANG//l’ does not support Imenu error. The yang-mode derives from prog-mode which I believe requires imenu ...
user avatar
  • 621
3 votes
3 answers
137 views

load user-written minor mode in a specific major mode

I'm trying to use a very simple minor mode I've written to personnalize the appearance of the buffer when I'm running R in ESS. Basically, I've set the linespacing in my init file to increase it and ...
user avatar
  • 179
1 vote
1 answer
46 views

How to support `<` and `>` as balanced parens without impacting ability to use them as comparison operators?

Languages like Erlang and Elixir use << >> for binaries and bit-string syntax, but they also use the classical < and > for comparison operators as well as -> and <- in list ...
user avatar
  • 621
1 vote
0 answers
82 views

Catch popup buffers by major-mode with display-buffer-alist?

I would like to catch popup buffers with display-buffer-alist by their major-mode instead of matching the buffer name with a regexp. For example I have dired-mode buffers that popup and I can't come ...
user avatar
0 votes
0 answers
26 views

Edit wikitext using Doom Emacs

I might have to edit some wikitext files. I am using tiddlywiki but the syntax is similar to mediawiki. I looked up but could not find any specific mode to edit wikitext documents. HTML goes closest ...
user avatar
  • 1,668
1 vote
1 answer
28 views

How are program arguments handled when a program/script is launched from Emacs?

I often find myself wondering how people handle program arguments when they are developing with Emacs. Let's say we have a Python script test.py and launching it requires supplying arguments, e.g. --...
user avatar
1 vote
0 answers
19 views

Customized c-mode indentation style in Emacs 27.2

I would like to produce c code in the following format: char *ft_strdup(const char *s1) { char *h; size_t len; ... } Where I can tab after the type of the function signature and ...
user avatar
1 vote
1 answer
169 views

How to define different font-lock-variable-name-face respect to different modes

By default font-lock-variable-name-face is defined as follows: '(font-lock-variable-name-face ((t (:foreground "black" :weight bold)))) Would it be possible to change its color for ...
user avatar
  • 1,066
0 votes
1 answer
27 views

Any mode for Modula 2?

I'm (after a hiatus of some 30 years) dabbling again in Modula 2 (yes, too much time cooped up). But neither ELPA nor MELPA knows anything about a mode for GNU Emacs. This site seems not to mention ...
user avatar
  • 101
1 vote
1 answer
92 views

How to quickly cycles through buffers of the same major mode as current one?

I'd like to find a way to cycle through all buffers that use the same major mode as the current buffer. For all major modes, including the special buffers. Use case example: when refactoring code I ...
user avatar
  • 621
0 votes
2 answers
195 views

Stop major modes from overwriting my keybinding [duplicate]

By default C-x n is a prefix keymap used for narrowing. I want to bind C-x n to windmove-down. (global-set-key (kbd "C-x n") 'windmove-down) This works fine for Text mode. But many major ...
user avatar
  • 290
0 votes
0 answers
32 views

How the inner working of Mode management is actually like?

I'm aware of some way to set up my own custom mode in Emacs, but I'm wondering: How does it actually manage Mode (eg: Setting things up, then resetting them once exiting Mode, etc)? I'm guessing it ...
user avatar
1 vote
1 answer
54 views

Switch to most recent buffer in a given mode

I am trying to create a function that switches to the most recent buffer in major mode major-mode. An answer to a related question supplies a function that should require the smallest of tweaks to ...
user avatar
  • 164
0 votes
1 answer
30 views

Where does my key bind so I can unbind it in major mode

I changed my key bindings with this lines in my .init.d: (global-set-key "\C-i" 'previous-line) It works normally, but when I change to markdown-mode, key rebinds to something else, how can ...
user avatar
  • 175
2 votes
0 answers
264 views

How to set major mode localleader keybinding to both `SPC m` and `comma` in Doom

I want to be able to use both SPC m and , as major mode localleader keybinding in Doom. With my current Doom setup, I can only use , as localleader key. SPC m is undefined currently.
user avatar
1 vote
1 answer
60 views

PSGML conflicts with built-in `sgml-mode`

I’ve installed psgml 1.4.0-9 and psgml-html-mode for DTD-aware editing of HTML.* But the built-in sgml-mode/html-mode seems to be causing some problems: some tags are highlighted in font-lock-function-...
user avatar
  • 133
0 votes
0 answers
47 views

How to disable Emacs asking if user wants to save abbrevs defined with :system property in a major mode

My Emacs version is 27.1 I am developing a major mode and I want to include some abbrevs to ship with it. I noticed that Emacs asks if user wants to save the abbrevs even if abbrevs have property :...
user avatar
  • 1
0 votes
1 answer
34 views

Bindings just for text buffers created by magit?

I'm trying to create a different keybinding to abort a commit in magit. Right now, when you're editing a commit message C-c C-k is bound to with-editor-cancel, which does the trick. But I'm an evil ...
user avatar
1 vote
0 answers
21 views

Emacs Mode to edit template toolkit files

Is there a mode to edit template toolkit files ? Web-Mode works decently, but maybe some modes can be combined to proved some specific Perl-editing-Funcitonality?
user avatar
  • 794
0 votes
1 answer
37 views

How do I stop Prolog mode from jumping to the Prolog REPL when consulting the buffer?

Suppose I am using Prolog mode with the Prolog REPL started as an inferior process using CtrlcEnter. Whenever I "consult" (i.e. evaluate) the Prolog mode buffer using CtrlcCtrlb ((prolog-...
user avatar
  • 553
1 vote
1 answer
59 views

How to get the mode-specific help information or help files

No matter in which mode I am currently in, is there a general way / key combination to open the help file related to the currently active mode?
user avatar
  • 509
1 vote
2 answers
53 views

Implement modal interface in a major mode

I am creating a major mode, and would like to have modal interface (such as vi) on it. I want to have a special key that toggles the behaviour on arrow keys. So, for example, if the special key is hit,...
user avatar
  • 2,039
1 vote
3 answers
218 views

Is there command to cause emacs to rescan the buffer to determine mode?

Apologies if this has been asked before (I couldn't find an answer to this.) Frequently, when I open an existing file or create a new file with emacs, the mode is determined correctly based on the ...
user avatar
  • 19
1 vote
1 answer
88 views

How to enable org mode and evil mode for untitled buffer when creating a new frame

The code below creates a new frame with an untitled buffer, how to make this buffer default with org-mode and evil-mode? (global-set-key (kbd "s-n") 'new-empty-frame) (defun new-empty-frame ...
user avatar
2 votes
1 answer
214 views

How can I see what Major and Minor modes I'm currently in?

Is there an easy way to see what modes are currently operating in a buffer? And have a list of their names?
user avatar
  • 131
1 vote
1 answer
102 views

How to temporarily switch to another major mode in elisp (with-current-mode ?)

Is there reliable way to temporarily switch the current buffer to another major mode, perform some function, then switch back to the original mode? Basically, I was looking for something similar to ...
user avatar
  • 910
0 votes
1 answer
97 views

Apply settings in .dir-locals.el to both c and c++ major modes

Is there a way to specify the same settings for c-mode and c++-mode without repeating the alist? I have: ((c-mode . ((comment-start . "/* ") (comment-end . " */") (comment-...
user avatar
7 votes
0 answers
354 views

Emacs Mode For Editing Guitar/Bass Tablature?

I have been looking for a while, and have not been able to find an Emacs major mode for editing Guitar/Bass tablature.
user avatar
0 votes
0 answers
370 views

Setting custom font size for org-mode?

What's a recommended way to set the font size for org-mode (or any other major mode) to a certain value that is different from the global font size? By looking at documentation C-h k C-x C-+, this is ...
user avatar
  • 399
1 vote
1 answer
145 views

sage-shell-mode repeat the input in the output

I wanted to use sagemath straight in emacs instead of having a terminal open. I tried to use a shell (or eshell for that matters) in emacs and launch sage there, but every time I input a command, the ...
user avatar
  • 13
1 vote
2 answers
191 views

How to find inheritance of modes?

As an example, let's use latex-mode, that inherits from tex-mode, that inherits from text-mode. Is there a command, that would take as input latex-mode and give me parent and grand-parent? Or, other ...
user avatar
  • 217
1 vote
2 answers
142 views

How to describe-mode (but not the current major mode)?

I know that describe-mode will describe the current major mode. Is it possible to describe a mode, and I will input the mode name?
user avatar
  • 217
3 votes
1 answer
282 views

Is there a standard mode for .ini files?

After looking for a mode for .ini files, I found ini-mode via MELPA, but upon installing it in Emacs 26, there was a message about it being an obsolete mode. What are the alternatives? In my limited ...
user avatar
  • 143
1 vote
1 answer
63 views

symbol's value as variable is void: command, when using ibuffer-sidebar

I installed ibuffer-sidebar (https://github.com/jojojames/ibuffer-sidebar) and added the following to my ~/.emacs.d/init.el: (use-package "ibuffer-sidebar.el") (require 'ibuffer-sidebar) (setq ...
user avatar
  • 153
0 votes
1 answer
210 views

Highlight syntax of function names and their arguments in custom mode

I'm trying to create a major mode that handles the following syntax: function someName(value1, value2) # some contents end function I'm using the following to highlight the keywords function,...
user avatar
  • 101
3 votes
1 answer
227 views

How to activate diff-mode from command line?

Git's editor config is set to launch emacs in no-window mode and to execute lisp function diff-mode: git config --global core.editor "emacs -nw -f diff-mode" However, when I execute git commit -v to ...
user avatar
1 vote
2 answers
87 views

Change major mode for buffer without a corresponding file

I want to change the major mode from fundamental-mode to compilation-mode for a buffer which contains some generated output named for eg. *results*. I've tried to add an entry to auto-mode-alist but ...
user avatar
  • 123
0 votes
2 answers
66 views

How to overwrite a package major mode?

I'm a newcomer to Emacs from Vim, I use rsjx-mode for react files. Its major mode calls itself RJSX, but I would like to call it React, so how can I overwrite the rjsx package major mode name?
user avatar
0 votes
2 answers
67 views

Call mode-specific backspace from "smart-backspace" function

I'm writing an IntelliJ-style "smart backspace" function which does the following: If the whole of the line up to the point is whitespace Join the line to the previous line, killing that whitespace ...
user avatar
1 vote
1 answer
177 views

Create custom "mode-hook" for other programming languages

For C/C++, I have the following to be run when I do M-x compile on a .c/.cpp file (add-hook 'c++-mode-hook (lambda () (set (make-local-variable 'compile-command) ...
user avatar
  • 285
0 votes
1 answer
165 views

How to set the default of `truncate-lines` for dired buffers to `truncate`?

How can I set the default of truncate-lines for dired buffers to truncate? I.e. when I open a new dired buffer it should show the directory truncated and not wrapped into the next line.
user avatar
  • 1,041

1
2 3 4 5 6