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

How to make ryo-modal not insert undesired keys?

According to its project page ryo-modal, ryo-modal keeps unmodified all keys that weren't allocated for it. Notice that other keys are unmodified, so pressing r would insert r into the buffer. My ...
3
votes
3answers
30 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 &...
1
vote
1answer
38 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?
1
vote
1answer
72 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 ...
0
votes
0answers
13 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?
3
votes
1answer
41 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 ...
0
votes
1answer
28 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-...
0
votes
0answers
51 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 ...
0
votes
2answers
58 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-...
0
votes
0answers
30 views

pdf-view-midnight-minor-mode does not change background color

The pdf (black text on white background) I'm currently reading in PDFView with pdf-view-midnight-minor-mode enabled only changes the color of the text from black to gray but the background remains the ...
0
votes
0answers
18 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 ...
1
vote
1answer
32 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?
4
votes
1answer
62 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 ...
3
votes
1answer
83 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 ...
1
vote
1answer
41 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 ...
0
votes
1answer
66 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: #+...
2
votes
1answer
119 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?
3
votes
1answer
55 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-...
0
votes
0answers
44 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 ...
2
votes
1answer
122 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 ...
0
votes
0answers
38 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 ...
2
votes
1answer
171 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" (...
1
vote
1answer
128 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 ...
2
votes
2answers
342 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-...
2
votes
2answers
80 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; ...
0
votes
0answers
51 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 ...
1
vote
2answers
29 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 ...
0
votes
0answers
48 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 ...
0
votes
1answer
65 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 ...
1
vote
1answer
97 views

Why is `key-chord-mode` not listed among enabled minor modes?

After starting Emacs with the following init.el file, key-chord-mode is turned on. ;; Speed up startup (setq gc-cons-threshold 402653184 gc-cons-percentage 0.6) (add-hook 'after-init-hook ...
1
vote
3answers
39 views

Swap Shift/non-shift key behavior for particular mode

I want to press - on my keyboard and have _ be inserted and vice-versa only for a particular mode. The following does this globally using the post-self-insert-hook, It checks the character just ...
0
votes
1answer
53 views

I can turn on minor modes like electric pair modes in my init, but they’re not having effect unless manually reactivated [duplicate]

So I can put a line like, (setq-default global-linum-mode t) or (setq-default electric-par-mode t) in my init file, and I can check with C-h v that the variables are in fact set to t (they are), but ...
0
votes
1answer
35 views

Treat initial numbers as argument to functions in minor mode

Is it possible to treat typed numbers similar to universal argument C-u 10 C-n, but make it so that there is no need to type C-u in a minor mode? So only 10 C-n would be needed to move 10 lines down ...
0
votes
1answer
192 views

How to set key binding for read-only-mode? in order to simplify cursor movement

moving point command: next-line, previous-line, forward-char, backward-char, etc. How to omit Ctrl key in read-only-mode? How can I combine with read-only-mode-hook to automatically enable keybind ...
1
vote
1answer
208 views

How do you automatically enable writeoom-mode when org-mode starts?

I want to enable writeroom-mode whenever I startup org-mode because I don't really ever want writeroom-mode to be disabled if I'm using org-mode.
1
vote
0answers
33 views

Keybindigs conflict between minor modes

The configuration that I have for python mode implies loading both elpy.el and python.el. The things is that I found the python.el keybindings more natural than the elpy.el ones. And most of the ...
0
votes
0answers
262 views

Disable auto-fill mode in all the major modes

When try to disable 'auto-fill-mode`, I search the following answers how to disable minor mode (enabled using prog-mode-hook) for a particular major mode This answer narrow it focus on the python-...
1
vote
1answer
115 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 '...
2
votes
1answer
74 views

How to use `recover-session` and `dired-omit-mode` in Emacs 26 and lower?

Using Emacs 26.1, I have enabled dired-omit-mode globally with (add-hook 'dired-mode-hook #'dired-omit-mode). When using recover-session, I don't see any files. How to fix this? Creating a .dir-...
2
votes
1answer
342 views

How to enable the superword minor mode globally?

I am just wondering how to enable the superword-mode globally? I tried to enable it following the answers found here: How to enable ido-mode forever? , using: (require 'superword-mode) (...
2
votes
1answer
124 views

Enabling a minor mode in all but some buffers

I want to enable display-line-numbers-mode in all buffers except pdf buffers. Can I do that without making a list of all the major modes except pdf-view mode?
0
votes
1answer
54 views

Trouble adding post-self-insert-hook in define-minor-mode

I am trying to write a minor mode that upon visiting a word, it manipulate it. There is a list of words which is parsed from a file. Here is the problem: (define-minor-mode auto-gls-mode "...
1
vote
0answers
50 views

How are unrelated modes enabled?

I've been an emacs user for about a year now and I use it for Haskell programming. I chose to go the vanilla emacs route and customized a plain init file as I went along. Over time, however, I ...
0
votes
3answers
229 views

Invoke minor mode upon visiting an org file (on a per-file basis)

I have certain org files (scientific manuscripts) that I want to automatically show in Olivetti mode with a specified width upon opening. Is it possible to enable Olivetti (or generally, any minor ...
4
votes
2answers
716 views

Are there hooks for leaving modes?

There seems to be a bug in clojure-mode (mentioned here) because it does things in a mode hook (for paredit-mode) but doesn't undo them when the mode is turned off. I understand that add-hook can ...
7
votes
1answer
348 views

How to automatically remove a hook provided by a minor mode after disabling that mode?

I want to write a minor which evaluates some code in the buffer after saving a file. I activate after-save-hook for this mode: (add-hook 'my-minor-mode-name-hook #'(lambda () (add-hook 'after-save-...
1
vote
1answer
55 views

Set prefix key on load of minor mode

I am trying to change the default prefix key C-c @ to C-c for outline-minor-mode: (define-key outline-minor-mode-map (kbd "C-c") (lookup-key outline-minor-mode-map (kbd "C-c @"))) This ...
1
vote
1answer
72 views

Remove the verbose description in mode line

I started my Emacs Venture days ago with prelude. but find that the mode line is verbose UUU:----F1 scratch All of 144 (4,0) (EL guru FlyC- company ivy EditorConfig ws Projectile super-...
5
votes
1answer
248 views

How to suppress a minor mode's key binding in only certain major modes?

Suppose that I use minor mode MIN with a whole bunch of major modes. In one of those major modes, call it MAJ1, MIN's binding for a specific key K is undesirable; I would therefore like to suppress ...
4
votes
1answer
195 views

Minor markdown-mode for comments

I like to use the markdown-mode for READMEs. And I would like to use the markdown-mode as a minor-mode for comments in other major-modes like sh-mode. Is this possible somehow?