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
1answer
68 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
38 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
28 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
47 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
32 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
82 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" (...
0
votes
0answers
29 views

Emacs text-mode as generic, 2-space-<TAB>, plaintext editor: Trouble disabling relative-indent in text-mode, or auto-triggering outline-mode

I need some help getting custom indentation behavior with my .emacs config. In emacs text-mode / Fundamental Mode, by default a tab will take me to the location of the top line's next word (non ...
1
vote
1answer
84 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 ...
1
vote
2answers
110 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
44 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
23 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
25 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
35 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
48 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
69 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
35 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
39 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
32 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
0answers
25 views

how to get line wrap to had return at puncuation

I've see a few similar questions: Editing files with one-sentence-per-line https://stackoverflow.com/questions/41637313/how-to-make-a-function-that-straights-out-each-sentence-in-a-paragraph-to-...
0
votes
1answer
93 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
133 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
22 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
162 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
74 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
60 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
199 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
81 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
36 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
48 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
145 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 ...
3
votes
2answers
381 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 ...
2
votes
1answer
184 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
39 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
49 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-...
4
votes
1answer
161 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 ...
3
votes
1answer
152 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?
4
votes
1answer
973 views

how to disable all the minor modes (when a specific major mode is enabled) with elisp

Is there any function do disable all the minor modes if I enable a specific major mode (let's take the text-mode as an example)?
0
votes
2answers
159 views

Disabling a minor mode in a specific buffer

Running spacemacs 0.200.13 on emacs 25.2.2 on Kubuntu 18.04. I have globally enabled golden-ratio-mode (a minor mode). But I would like to disable it in a particular buffer, *Org Agenda* to be ...
1
vote
2answers
251 views

cscope-minor-mode not enabled for C in emacs 25

I'm using Emacs 25 on Ubuntu 16.04, after a while spent on Emacs 24. One thing that I've noticed changed in version 25 is, cscope minor mode is not enabled by default when I edit C files, while it was ...
2
votes
2answers
74 views

How to conditionally abort a minor-mode invocation?

I have a minor mode definition like this, and I want to prevent it from being enabled when the config variable example-mode-config has not been defined. ;;; .... ;;;###autoload (define-minor-mode ...
1
vote
1answer
349 views

Bindings for source code when debugging in gdb/gud

We can define a bunch of bindings for gud-mode through gud-mode-map. But it seems these bindings only hold when the active window is one of the dedicated gdb windows (or simply the comint window if ...
2
votes
1answer
355 views

buffer-local advice

I am trying to create a buffer local advice to run some code when a minor mode is disabled. I looked through the documentation for add-function and saw this If PLACE is a symbol, its `default-value' ...
0
votes
1answer
98 views

lose reftex-isearch-minor-mode after refresh

I want to activate reftex-isearch-minor-mode and tried the solution in this post offered by giordano, (add-hook 'TeX-mode-hook (lambda () (reftex-isearch-minor-mode))) ; for AUCTeX it works when I ...
3
votes
1answer
857 views

How to disable `abbrev-mode`?

I am using Spacemacs and it always ask me to save .cache/abbrev_defs which is very annoying. I tried to put (abbrev-mode -1) in dotspacemacs/user-config function. But it still ask for save the ...
0
votes
0answers
194 views

term without line numbers and highlight for current line

I have the following settings in ~/.emacs: (setq linum-relative-current-symbol "") (linum-mode) (linum-relative-global-mode) (global-hl-line-mode t) In order to supress both these features in ...
2
votes
2answers
153 views

Keybinding in Julia minor mode

I am unable to change keybinding in a minor mode. Initiaton of minor mode: (add-hook 'julia-mode-hook 'julia-repl-mode) I tried a view variatons for the keybinding: (add-hook 'julia-repl-mode ...
2
votes
1answer
82 views

Global minor mode that requires another during its lifetime

Say I'm developing a minor mode A that happens to need minor mode B enabled during its lifetime. The most straightforward way is to do something like: (define-minor-mode A-mode :global t :...
2
votes
1answer
49 views

Enable minor-mode during function call

Similar to the somewhat neat, but in the end too clunky, hydra-goto-line, I'd like to customize goto-line to enable linum-mode, but only during the function call. I tried add-advice, :before and :...
0
votes
0answers
140 views

Create a minor mode only for prog-mode major modes

I am working on a minor-mode and I'd like it to be active only for major modes derived from prog-mode. So far I know that the macro define-minor-mode takes a argument :global to decide whether or not ...
0
votes
1answer
122 views

How to enable multiple minor modes in one shot?

In order to perform some debugging, I'd like to enable multiple (say n) modes: mode-1, mode-2, ..., mode-n. This can be done thanks to a C-x C-e at the end of each of the following lines: (mode-1 t) (...