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
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 ...
pelle's user avatar
  • 1
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 ...
0x5453's user avatar
  • 329
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 ...
mhucka's user avatar
  • 163
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 ...
The Programming M16A4's user avatar
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-...
Dilna's user avatar
  • 1
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-...
Dilna's user avatar
  • 1
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.
Dilna's user avatar
  • 1
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 ...
Dilna's user avatar
  • 1
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 ;; ...
Dilna's user avatar
  • 1
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 ...
Dilna's user avatar
  • 1
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 ...
Mariano Montone's user avatar
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-...
Eminent's user avatar
  • 67
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))...
Eminent's user avatar
  • 67
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 ...
Zoli's user avatar
  • 421
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 ...
Zorgoth's user avatar
  • 820
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 ...
Tumok A. Byrd's user avatar
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 ...
Pedro Delfino's user avatar
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 ...
Vinn's user avatar
  • 293
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 ...
Dilna's user avatar
  • 1
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 ...
tinlyx's user avatar
  • 1,338
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 ...
ComfyPotato3's user avatar
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 ...
C4ffeine Add1ct's user avatar
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 ...
Dilna's user avatar
  • 1
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.
Dilna's user avatar
  • 1
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> =&...
John Doe's user avatar
  • 169
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) ...
Saddle Point's user avatar
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 ...
Dilna's user avatar
  • 1
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 ...
Dilna's user avatar
  • 1
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 ...
Dan Drake's user avatar
  • 593
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 ...
user38135's user avatar
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/...
wieks's user avatar
  • 21
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 ...
halloleo's user avatar
  • 1,341
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 ...
Dilna's user avatar
  • 1
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?
Nathan's user avatar
  • 25
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 ...
chris-tian's user avatar
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 ...
Alessandro Bertulli's user avatar
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) '...
alper's user avatar
  • 1,350
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....
alper's user avatar
  • 1,350
0 votes
1 answer
131 views

parinfer-rust-mode doesn't get enabled automatically with clojure-mode via hook

The problem: upon opening a .clj file, the clojure-mode correctly starts. However, parinfer-rust-mode doesn't, despite being added to a clojure-mode-hook. The setup (everything related to clojure from ...
Pavel Gurkov's user avatar
4 votes
3 answers
288 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 ...
Guillaume's user avatar
  • 189
2 votes
2 answers
362 views

How to programatically detect if a minor mode is global or local?

Is there a way to programatically detect (in Elisp) if a minor mode is a global minor mode or a local minor mode? For instance I'd like to be able to detect that show-paren-mode is a global minor mode ...
PRouleau's user avatar
  • 796
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 " ...
JohnJ's user avatar
  • 517
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, ...
Timo's user avatar
  • 13
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 "...
Pedro Delfino's user avatar
1 vote
1 answer
253 views

Different abbrevs for each major mode

The https://www.emacswiki.org/emacs/AbbrevMode says You can have different abbrevs for each mode (cperl, c++, Message); but it doesn't show exactly how, yet that's exactly what I am looking for. So, ...
xpt's user avatar
  • 457
0 votes
0 answers
23 views

How to detect the difference between an application buffer and text editing?

I have created a minor mode which has the option to be enabled globally via define-globalized-minor-mode. This mode is intended to be used for text editing, however the globalized version gets enabled ...
ideasman42's user avatar
  • 8,736
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 ...
Andrii Kozytskyi's user avatar
1 vote
0 answers
44 views

Combine `flyspell-region` with`writegood-mode`

I would like to combine flyspell-region with writegood-mode, but writegood-mode does not provide a function to check a region of text. This is what I came up with to work around the limitation: (defun ...
Rudolf Adamkovic's user avatar
3 votes
3 answers
67 views

Rebinding M-q in `define-minor-mode`

I'm trying to define a minor mode that rebinds M-q to a modified version of fill-paragraph. What I've written so far: (defun myfun () (message "myfun called")) (define-minor-mode mymode &...
gosbi's user avatar
  • 133
1 vote
1 answer
162 views

How can I have the lighter of a minor mode be colored /propertized)?

How can I colorize/propertize the lighter of a minor mode in the mode line?
Gabriele Nicolardi's user avatar