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
0 answers
14 views

How to make custom minor mode on logview mode?

I'm playing with Emacs logview.el to highlight the logs from Synopsys Tools. The logs I want to highlight contains ignorable lines like those below. Warning: Design 'top' contains 23 high-fanout nets. ...
user avatar
0 votes
1 answer
31 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 ...
user avatar
  • 137
2 votes
1 answer
49 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 ...
user avatar
  • 137
0 votes
1 answer
19 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 ...
user avatar
  • 299
0 votes
1 answer
41 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 ...
user avatar
0 votes
1 answer
35 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/...
user avatar
  • 1
0 votes
2 answers
35 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 ...
user avatar
  • 1,061
0 votes
0 answers
24 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 ...
user avatar
  • 159
0 votes
0 answers
29 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?
user avatar
  • 5
2 votes
1 answer
20 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 ...
user avatar
2 votes
1 answer
41 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 ...
user avatar
2 votes
1 answer
62 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) '...
user avatar
  • 1,084
1 vote
1 answer
50 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....
user avatar
  • 1,084
0 votes
1 answer
35 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 ...
user avatar
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
2 votes
2 answers
141 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 ...
user avatar
  • 621
1 vote
1 answer
75 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 " ...
user avatar
  • 477
1 vote
1 answer
131 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, ...
user avatar
  • 13
0 votes
1 answer
21 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 "...
user avatar
1 vote
1 answer
125 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, ...
user avatar
  • 387
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 ...
user avatar
  • 7,199
2 votes
1 answer
115 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 ...
user avatar
1 vote
0 answers
35 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 ...
user avatar
3 votes
3 answers
49 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 &...
user avatar
  • 133
1 vote
1 answer
73 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?
user avatar
2 votes
1 answer
188 views

Disable minor mode in specific major-modes or changing buffers (i.e. selectrum for prog-modes but not in shell)

This is similar to many other questions but nothing is leaping out.. I'm a fan of selectrum (similar to helm and ido I gather): e.g. hit M-x and start typing, it'll find matches and list them. I'd ...
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
3 votes
1 answer
49 views

How to list a newly formed emacs minor-mode?

With some help from the blog post found here, I have managed to write a small code for a test package (a minor mode) named niranjan. It is as follows. (define-minor-mode niranjan-mode "Hello ...
user avatar
  • 133
0 votes
1 answer
134 views

Automatically enable a mode with dir-locals.el

I'm trying to achieve the effect of automatically calling M-x importmagic-mode whenever I open a python file, but I need to do this in a directory specific way, using dir-locals.el. I have this in dir-...
user avatar
0 votes
0 answers
65 views

Error in Latex-mode

I keep getting an error in Latex-mode while moving up and down the lines with a cursor: wrong-type-argument stringp nil and a beep on every move. I got the newest version. What can be the problem? (I ...
user avatar
0 votes
2 answers
191 views

Defining minor-mode buffer-local variables

I want to do something VERY simple. I want to create a minor mode, which when enabled sets a buffer-local variable (say left-margin-width, for instance) with a specific value. I can do this: (define-...
user avatar
  • 93
0 votes
0 answers
20 views

Bug? Can get point into the middle of a run of characters with a replacing display spec

I'm implementing a minor mode that "folds" certain strings. It does this by adding a font-lock keywords rule to the buffer, that applies display properties that make it look like it's a ...
user avatar
  • 181
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
4 votes
1 answer
128 views

Why my minor mode bindings do not get precedence over global/major mode bindings? BUG?

EDIT: ANSWER The cause for the problem in this question was pointed out in the Emacs mailing list. It is due to the (kbd ...) forms not getting evaluated because the keymap in the define-minor-mode is ...
user avatar
  • 2,060
3 votes
1 answer
95 views

Adding new keywords delimeters

I am new to the Emacs (Doom Emacs to be precise) scene, and recently I came up with a minor mode that could come in handy for me so I decided to implement it. To achieve the full functionality of my ...
user avatar
1 vote
1 answer
89 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
0 votes
1 answer
84 views

Custom Keybindings not working

I had to reinstall emacs and completely redo my config file, but for some reason, some of the custom keybindings that used to work with "move-dup" package from Melpa. Here is what i have: #+...
user avatar
  • 143
2 votes
1 answer
215 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
3 votes
1 answer
131 views

Toggling minor modes based on other minor modes

I wrote a function to enable some minor modes when another minor mode is enabled: (defun prose-mode() (display-line-numbers-mode) (variable-pitch-mode)) I added prose-mode as a hook for olivetti-...
user avatar
  • 93
0 votes
0 answers
84 views

Add a keymap to a minor mode

The minor-mode show-paren-mode does not have a keymap. Is there a way to add such a keymap so that I can define some key-bindings that depend on this minor mode? I saw a solution here which involves ...
user avatar
  • 1,439
3 votes
1 answer
321 views

Understanding precedence of minor modes keymaps

I would like to understand when keymaps of minor modes get "applied" and how do they get applied exactly? In particular, is there a way to see a list of a active minor-mode maps? I know I can look the ...
user avatar
  • 1,439
0 votes
0 answers
59 views

Highlight matching parenthesis, only in Lisp mode (and maybe a few similar modes)

is there a way to have the global minor mode show-paren-mode functionality as a buffer-local minor mode? I love its behavior but only for Lisp. Searching for a package I can see a number of close ...
user avatar
2 votes
1 answer
249 views

eval and quotes

I am trying to execute the code here, which I copy below (defun buffer-local-set-key (key func) (interactive "KSet key on this buffer: \naCommand: ") (let ((name (format "%s-magic" (...
user avatar
  • 1,439
1 vote
1 answer
208 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 ...
user avatar
  • 348
2 votes
2 answers
688 views

How to set minor mode variables in dir-locals?

Im writing an lsp-mode purescript client and couldn't figure out how to override the default config options using a .dir-locals file. For example, I have a defcustom : defcustom lsp-purescript-use-...
user avatar
2 votes
2 answers
129 views

Enabling minor modes via customize

I see that minor modes defined via define-minor-mode have a variable that has the same name as the function and the following documentation: Setting this variable directly does not take effect; ...
user avatar
  • 201
0 votes
0 answers
70 views

mac-mwheel-scroll screws centered-positon-mode when using mouse pad on a macbook laptop

I am able to scroll using navigation buttons and external mouse on a Mac with this code that keeps the cursor at a specific line at all times. I am using this code since it is much faster than ...
user avatar
  • 554
1 vote
2 answers
32 views

Can a mode setup function fail?

If I define a new mode using define-derived-mode or define-minor-mode, can the mode setup somehow signal failure so that the mode is not activated? All of the following modes are activated despite ...
user avatar
  • 357
0 votes
0 answers
60 views

Enable prog-mode when minor mode is activated

I created a minor mode for some specific file extension to fontify the syntax and provide correct indentation. 1)The indentation doesn't work for some reason. 2) How to enable prog-mode when the ...
user avatar
  • 554
0 votes
1 answer
96 views

How to disable a minor/major mode so that mwheel-scroll don’t take effect?

I am trying to have a simple solution to center the cursor at all times. I found that centered-cursor-mode was too slow and found this simpler solution. The only problem is mouse scrolling no longer ...
user avatar
  • 554