Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

4
votes
1answer
39 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 ...
1
vote
1answer
40 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?
3
votes
1answer
110 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
60 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 ...
0
votes
2answers
85 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 ...
1
vote
2answers
40 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 ...
0
votes
1answer
127 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 ...
1
vote
1answer
108 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
0answers
61 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 ...
2
votes
1answer
321 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
63 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
52 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 ...
1
vote
1answer
40 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 :...
1
vote
1answer
27 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
51 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
55 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) (...
1
vote
1answer
132 views

How to change mode-map of the minor mode?

I would like to change the mode-map of a minor mode with mode map. I mean replacing the original mode-map that was specified in the define-minor-mode call with another one. Keeping the two mode-map ...
1
vote
1answer
104 views

Syntax highlighting inside HTML5 <script> tags

I was curious if there was a way to get highlighting/indentation for any JavaScript that's inside of HTML5 tags? I don't frequently use JavaScript but for a class I'm in we're working with it. I ...
2
votes
1answer
366 views

How to make a specific read-only buffer writable?

The readonly status of the current buffer can be toggled with (read-only-mode) or pressing C-x C-q but I intend to make a buffer which is not current, writable. The below is what I am using (with-...
2
votes
1answer
255 views

Proper way to change prefix key for minor-mode map?

The package HideShow (hs-minor-mode) defines some key bindings with prefix key C-c @. What is the proper way to change this prefix key to C-c h? The new key binding should also replace the old key ...
3
votes
2answers
401 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
1answer
77 views

Save and restore variable

I am working on Spacemacs which gives you the ability toggle between Emacs "holy-mode" and Vim "evil-mode". However the evil-escape minor mode is still enabled. I am trying to find some way to disable ...
1
vote
1answer
45 views

File mode name with -mode suffix or not?

I am not sure when I should name file x-mode.el and when x.el. Note that because of established practice mode writer should put (provide 'x) or (provide x-mode) to the end of file and end-users load ...
2
votes
2answers
68 views

Disable minor mode when keys not in it's keymap are pressed

I was using this to implement line duplication in emacs and decided to bind it to C-c d and it works without problems What would be cooler though is if I can use C-c d do duplicate a line and then be ...
0
votes
0answers
51 views

Disabling automatic line highlighting

Every time I open a new file in emacs, hl-line-mode is enabled. I have put (global-hl-line-mode -1) (hl-line-mode -1) in my init.el, but to no avail. What am I doing wrong???
0
votes
2answers
699 views

How to stop a minor mode from auto-loading in Spacemacs?

The smartparens minor mode is quite annoying to me, so I want to have it disabled on default. However, I don't want to uninstall it, in case I need it someday. Can I disable a minor mode without ...
6
votes
1answer
334 views

Disabling electric-indent-mode for one mode (latex mode) only

I don't like the way electric indent mode works in latex-mode. Everywhere else (at least everywhere I use), it's great. How can I permanently disable electric indent mode for latex mode only, but ...
1
vote
1answer
101 views

Toggle minor mode with a custom keybinding

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

How replace auto-complete-mode with company-mode in all major mode using it?

How I can replace auto-complete-mode with company-mode in all major mode using it? i.e. make all modes which activating auto-complete-mode (e.g. c-mode or sh-mode etc), activate company-mode instead ...
0
votes
1answer
101 views

Create a sub-mode of an existing mode which overrides certain functions?

I want to make a few customizations to cmake-model.el. The big-picture view of this lisp file is as follows: ... ;; This function I want to modify (defun cmake-indent () ... ) ... ;; Mode ...
4
votes
1answer
75 views

save variable on exit

I have own minor-mode with 2 (for now) user specific variables (string and int). For now they are dropping to default values each emacs restart. Which is not convenient. How and where it is better to ...
0
votes
1answer
79 views

How do I change a globalized minor mode's key bindings?

I'm using drag-stuff, which defines a minor-mode (drag-stuff-mode), a corresponding keymap (drag-stuff-mode-map), and a globalized minor mode (drag-stuff-global-mode). I want to make some changes to ...
1
vote
1answer
38 views

how to autoload emacs mode if folder contains specific file?

I'm writing a custom build mode (mybuild-mode) for custom build tool and want that mode to be autoloaded in case I'm in the folder which contains mybuild.sh file. Also my mode depends on projectile (...
2
votes
3answers
113 views

pop-up a list of enabled minor modes in a readable format?

I like to keep my modeline pretty minimal, so I'm hiding most minor-mode lighters. Occasionally I want to check which minor-modes are enabled, and it would be nice if I could trigger a pop-up that ...
0
votes
1answer
99 views

How to turn on a minor mode in my init file?

I want to add global-semantic-idle-summary-mode in my .emacs file instead of calling everytime it by using M-x. I tried with (setq ...) but it doesn't work. What's the right way?
0
votes
0answers
51 views

wc-mode word counter config not working

I use wc-mode to have a word counter in the modeline. I want it to show only word count. I am using the correct syntax but I am not seeing any changes from the default behavior. Please see my emacs ...
3
votes
1answer
99 views

How can I 'layer' a keybinding?

I'm trying to create an emmet-like minor mode that will trigger on SPC (or TAB) if the previous text is expandable, but I don't want to completely override bindings that already exist for the key. ...
2
votes
1answer
141 views

how to disable minor mode (enabled using prog-mode-hook) for a particular major mode

I've enabled auto-complete-mode mode using prog-mode-hook like so: (add-hook 'prog-mode-hook 'auto-complete-mode), but I want auto-complete-mode to be disabled for python-mode. How can I achieve this ?...
2
votes
1answer
243 views

How to make changing minor-mode lighter in modeline?

In minor-mode-alist documentation it is described that lighter can be a lisp expression that is evaluated to get text used in the display of minor mode in mode line. It has the form of (:eval ...) ...
2
votes
0answers
77 views

How to make minor mode keybindings for C-c prefix?

I am trying to define a minor mode that makes 2 keybindings. This is code i am defining it with: (define-minor-mode parinfer-mode "Uses Parinfer to Format lispy code" :lighter " parinfer" :...
0
votes
1answer
313 views

Permanently disable `org-indent-mode`?

I can toggle org-indent-mode with M-x org-indent-mode, however I don't want it on by default. I tried, on my config file, (org-indent-mode -1), but I get a "undefined symbol" error. I also tried using ...
2
votes
0answers
50 views

Avoid minor modes from turning off when changing/restarting major mode

Is there a smart way to keep locally enabled minor modes enabled when changing/restarting major modes without adding it to the mode hook or enable it globally? For instance, if I usually don't use ...
1
vote
1answer
91 views

In mmm-mode can you have several classes for the same mode?

In my code I have the following to delimit regions that initiate/end whatevz-mode: (require 'mmm-mode) (setq mmm-global-mode 'maybe) (mmm-add-classes '((whatevz :submode whatevz-mode ...
4
votes
2answers
96 views

Bind several minor modes together

This has been driving me crazy, I can't get this to work. I want to link the on-off status of a handful of minor modes, in particular evil-mode, evil-quickscope-mode, hl-paren-mode, and a few others. ...
0
votes
1answer
363 views

Enable visual-fill-column-mode only in text and programming mode

I am currently using visual-fill-column-mode and visual-line-mode in emacs with the following: (add-hook 'visual-line-mode-hook 'visual-fill-column-mode) (global-visual-line-mode t) (define-key ...
2
votes
2answers
80 views

When Emacs loads variable customization?

I have a minor mode that declare a customizable variable as its keymap prefix: (defcustom mymode-keymap-prefix "C-c *" "Prefix for `mymode-mode'." :group 'mymode) (defvar mymode-mode-map (let (...
5
votes
2answers
2k views

Disable Minor Mode in Major Mode

I am trying to disable a minor mode (flycheck) for the latex major mode. This is what I have so far. (defun disable-flycheck-in-tex-src-block () (flycheck-mode -1)) (add-hook 'latex-mode-hook '...
3
votes
0answers
64 views

Canonical list of minor modes

In describe-mode's definition (in help.el), there's the following piece of code: ;; Older packages do not register in minor-mode-list but only in ;; minor-mode-alist. (dolist (x minor-mode-alist) (...
1
vote
1answer
59 views

Is it possible to associate minor modes with windows rather than buffers?

Does Emacs have some notion of associating minor modes with windows rather than setting them as "global" or "buffer-local"? For example, in a certain window layout I may wish to have a minor mode ...
2
votes
1answer
64 views

Set buffer font with minor mode

I would like my minor mode to set the buffer font, but not the frame font (the font contains special characters I need, but the hinting is abysmal). I got to this point: (define-minor-mode transcribe-...