Questions tagged [minor-mode]

provides optional features that users may enable or disable independently of the choice of major mode. Minor modes can be enabled individually or in combination with other modes.

Filter by
Sorted by
Tagged with
2 votes
1 answer
573 views

No numpy, scipy, sympy and matplotlib minor-modes?

Python scientific libs are immensily popular for the last decade or so. However googling and "melping" for its emacs minor-modes reveals nothing. Basically I need just syntax highlighting. Do you ...
6 votes
3 answers
2k views

Can I add highlighting in a minor mode?

I'm trying to understand minor modes with the goal of adding a minor mode for Jinja2 syntax highlighting (from jinja2-mode) to stuff like YAML. I'm running into problems though. When following a ...
0 votes
1 answer
35 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 ...
1 vote
1 answer
706 views

How to disable `tree-sitter-hl-mode` for `org-mode`/`markdown-mode` code blocks?

My tree-sitter setting is ;; Tree-sitter highlight ;; Base framework, syntax highlighting. (use-package tree-sitter :diminish (tree-sitter-mode) :hook ((after-init . global-tree-sitter-mode) ...
0 votes
3 answers
69 views

Method separators

Does anybody know of a function/package/etc. to draw visual separators between "high-level" blocks of code, like class and function definitions? Similar to the horizontal lines in these ...
1 vote
0 answers
14 views

What is the correct way to make js2-next-error available when using js2-mode as major mode?

I'm using js2-mode. It provides js2-next-error, but apparently only when using js2-minor-mode and not when using js2-mode as a major mode. This is clear from the code in js2-mode.el (in version ...
6 votes
5 answers
2k views

Making it clearer I'm in god-mode

I've been using emacs for a while, but am being quite dismayed by some quite hectic pinky-pain, so have just started using Chris Done's god-mode, which is great, I like it so far. The problem is that ...
0 votes
1 answer
41 views

Creating Bindings for Rectangle Mark Mode Doesn't Work

I want to create bindings for rectangle-mark-mode though the methods described above haven't worked for me. I've tried using an alist that I thought it possessed, but Emacs returned a bug saying its ...
0 votes
1 answer
147 views

Using hooks in minor modes

I have introduced the following hook function inside a minor mode. The intention is to activate the minor mode for a number of major modes. I would also need to activate outline-minor-mode once tika-...
1 vote
1 answer
375 views

disable minor mode inside source blocks

i have org mode set up with typo minor mode and pretty entities enabled by default. but when i work on programming, these two are totally useless inside the source code blocks i insert into org ...
0 votes
0 answers
70 views

Setting outline-regexp and outline-heading-alist according to major mode

I have made a minor mode that is supposed to customise outline-minor-mode. (defun tematika-tools () "Define Heading Patterns and Levels for different major modes" (require 'tematika-...
0 votes
1 answer
65 views

How to automatically turn on one minor mode when another is turned on?

I have a minor mode called tematika-minor-mode. When I turn it on, I want to enable outline-minor-mode automatically. And turn it off when tematika-minor-mode is disabled.
0 votes
1 answer
44 views

Changing the definitions of outline-minor-mode headings

I would like to change the pattern for heading in outline-minor-mode. Have came up with the following implementation for emacs-lisp-mode that uses a minor-mode called taxocask-minor-mode. (defvar ...
1 vote
1 answer
135 views

Activating a minor mode for outline-minor-mode for elisp files

I am working on a minor mode that adds functionality to outline-minor-mode associated with different major modes (e.g. emacs-lisp-mode, fortran-mode). This is the minor mode file taxocalc.el ;; ...
0 votes
0 answers
19 views

Accessing functions for a minor-mode from another file [duplicate]

Have made two files, the first (komis.el) has the definition of the minor-mode (komis-minor-mode), whereas the second file (komis-luna.el) contains some additional functionalities that should be ...
2 votes
2 answers
59 views

Mode for attaching (clickable) actions to matching text

I'm looking for a minor mode that would let me attach actions to text that matches some pattern. Like, for example, match urls, emails and pathnames (or any other thing) and create buttons that run ...
3 votes
1 answer
143 views

Is it possible to have a minor mode re-evaluate its keymap?

My code: ;;; foo.el --- Example minor mode ;; Mode developer code. (defvar hello-key (kbd "C-c C-f")) (defun print-hello () (interactive) (message "Hello!")) (defun make-my-...
1 vote
2 answers
509 views

Disabling visual-line-mode only in org-agenda-mode

My emacs configuration has global visual line mode enabled via (global-visual-line-mode 1). I want to disable this mode, but only when in org-agenda-mode. When I do this manually, via M-x org-agenda, ...
1 vote
1 answer
58 views

Does define-globalized-minor-mode detect changes in fundamental mode too?

I am using Emacs 28.2. Here is my code: ;;; foo.el (define-minor-mode foo-mode "Foo mode" :lighter " Foo" (message "foo-mode %s in buffer %s" foo-mode (buffer-name))...
3 votes
2 answers
75 views

How can I toggle between two functions in Elisp?

I would like to use the F9 key to toggle between the modus-themes-select and ef-themes-select functions. When I call the ef-themes-select, a minibuffer pops up to select an Ef theme: Now when I press ...
55 votes
6 answers
15k views

How to override major mode bindings

Sometimes my global keybindings are overridden by a major mode. An easy example is the following setting in my init file (global-set-key (kbd "C-j") 'newline-and-indent) But annoyingly this ...
2 votes
1 answer
475 views

Enable minor mode for specific files

I have a specific file which I want to always open with visual-line-mode activated. This file cannot be distinguished from others for which I want visual-line-mode deactivated, either by file name/...
0 votes
1 answer
62 views

How to never auto-save large files — or, how to run a function whenever any buffer starts — or, how to abort loading a minor mode in one of its hooks

I want to tell Emacs to never auto-save files bigger than ~1MB. I know how to turn off auto-save-mode when the file size is above a certain limit, but not how to make that function run automatically ...
0 votes
1 answer
72 views

Building a minor mode which makes buffer appear modified

You are an American in a British company. The company requires all your saved files to use the spelling "colour". You can't bear to look at anything other than "color" so you want ...
0 votes
1 answer
47 views

Why is `paredit-kill` (`C-k`) not working in the minibuffer?

This is my config file. I frequently use C-k which is bounded to paredit-kill. In general, it works. However, it does not work when I am typing in the minibuffer. For instance, after executing C-x C-f ...
0 votes
1 answer
36 views

How to make this mode work in all buffers except for the SLIME's REPL buffer?

I have this minor mode set to work on all buffers: ;; John Mercouris centered point mode ;; Homepage: https://github.com/jmercouris/emacs-centered-point (define-minor-mode centered-point-mode "...
3 votes
1 answer
212 views

Define new key binding for new minor mode

I am writing my first minor mode, and would like to understand how to bind a key to an action in that mode. (define-minor-mode hello-mode "My Mode" :init-value nil :lighter " ...
1 vote
1 answer
406 views

How can I turn off Company mode in only some major modes? [duplicate]

I use company when coding. I currently have it set to global. I would like to turn it off for a few major modes. However, instead of turning it off globally, I only want to deactivate company for 2 or ...
0 votes
0 answers
24 views

Minor-mode launched by a parent minor-mode

I want to have a minor-mode (tika) that launches another minor-mode (ramona). How can such thing be handled? The following is the child minor-mode ;; File: ramona.el (child) (define-minor-mode ...
2 votes
1 answer
156 views

How to automatically turn off conflicting minor modes when activating a new minor mode?

I am trying to use a certain minor mode (inferior-scheme-mode), which is activated by M-x run-scheme. But its key combinations are masked by another competing minor mode (geiser-mode). How can I ...
0 votes
2 answers
107 views

Are C-[0-9] and M-[0-9] completely interchangeable?

In all my exploration, it seems that M-[0-9] and C-[0-9] apply numeric prefixes in the same way everywhere. Does this change for any common modes? I'm considering overwriting one of the sets of ...
2 votes
2 answers
224 views

Change the order of Minor Modes on the Modeline

I've recently been using the delight package to override mode line strings and control whether or not they're displayed, and it's great, but I'd like also to control the order in which minor mode ...
0 votes
0 answers
39 views

Dealing with minor-mode lighter and mode disabling

Have made a very simple minor-mode. But calling (add-to-list 'load-path "~/bin/toro") (require 'toro) (toro-enable)) does not show Tna in the mode line. I also need a way to disable the ...
0 votes
1 answer
121 views

highlight-changes-mode: clear displayed changes after saving

I currently use this mode like so : (global-highlight-changes-mode t) (setq highlight-changes-visibility-initial-state nil); initially hide ;; toggle visibility (global-set-key (kbd "<f2> =&...
0 votes
2 answers
221 views

Determining whether a mode was enabled

Is it possible to determine whether global-display-fill-column-indicator-mode or display-fill-column-indicator-mode was enabled? I am running Emacs 27.2.
1 vote
1 answer
37 views

how to re-enable a variable after a package overwrites it? (in particular, mark-even-if-inactive and Hyperbole)

I have mark-even-if-inactive set to t in my init.el; I've found that I that so (interative "r") works as expected; if that variable is nil, I get "The mark is not active now" when ...
0 votes
1 answer
35 views

Removing minor mode name from showing in emacs buffer window

How can I remove a minor mode name from the buffer window menu located at the window bottom. More useful, is there a way to include or exclude the minor mode name in the buffer window by just calling ...
2 votes
1 answer
87 views

When to make a minor-mode

Have got some elisp functions. When is it proper to include them in a minor-mode rather than using just a simple elisp file. What functionality do minor modes provide that cannot be achieved with ...
0 votes
1 answer
254 views

How to enable a minor mode immediately after a buffer is open?

I have been using a pdf-tools fork with a image-roll.el support, this fork and file make it possible to scroll continuously from the end of a page to the beginning of the other without jumping from ...
0 votes
2 answers
182 views

In huge CSV files how can I easily find out in which CSV column the cursor is?

I use csv-mode with csv-align-mode to look at CSVs with header rows. For small CSVs (not many columns, not many rows) it is easy to determining in which column the current cell (i.e. the cell with the ...
1 vote
1 answer
199 views

How to turn typopunct minor mode on globally

I want to be able to use typopunct minor mode globally. I have tried to add (global-typopunct-mode 1) to my init file, like so ;; Typopunct mode (require 'typopunct) (typopunct-change-language '...
0 votes
0 answers
27 views

Introducing functionality stored in a file into another file defining a minor-mode

I am debugging a minor-mode and have split the file into two files. How would one introduce the functionality in the second file into the minor-mode file? I have my minor-mode called rk-bracemarks ...
1 vote
0 answers
109 views

Enable minor mode given org-mode tag

Is it possible to set a minor mode only when viewing org-mode files with a certain tag? If so, how could I achieve this?
2 votes
1 answer
54 views

Key binding to `C-<` and `C->` not working when creating minor mode

I wrote a couple of functions to automatically convert sequences like "<<" in «. (Yeah, I know that input methods can do the same, but I don't want the extra bindings: I'm planning to ...
2 votes
1 answer
35 views

Minor Mode / Description

I'm using a minor mode for my key bindings. But I want to set the documentation string dynamically. Instead of: (define-minor-mode mesys-mode "Text" ...) I want something like ...
3 votes
1 answer
213 views

How can I apply diminish to apheleia-mode

I am using diminish for minor modes. But I was not able to apply it for apheleia-mode. (apheleia-global-mode +1) (with-eval-after-load 'apheleia (setf (alist-get 'isort apheleia-formatters) '...
2 votes
1 answer
444 views

New line and indent without electric mode

I have come to hate the inconsistency of the electric indent mode and I haven't much of a clue about how it works anyways, so I've disabled it and am trying to get the desired behavior from scratch. I ...
2 votes
1 answer
629 views

How can I apply ansi-color to complete buffer?

I am using following code to apply colorize text in emacs, such as for ^[ characters to apply color. In order to use this code I have to select text to apply it reference: https://unix.stackexchange....
2 votes
1 answer
450 views

Toggle a minor mode with a custom key binding

I'd like to be able to toggle M-x font-lock-mode with a custom key binding like C-c l for example (or any minor mode for that matter). Can this be done relatively easily?
2 votes
2 answers
350 views

Key binding in Julia minor mode

I am unable to change key binding in a minor mode. Initiation of minor mode: (add-hook 'julia-mode-hook 'julia-repl-mode) I tried a view variations for the key binding: (add-hook 'julia-repl-mode ...