Stack Exchange Network

Stack Exchange network consists of 175 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

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.

1
vote
0answers
42 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
51 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 ...
2
votes
2answers
89 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 ...
1
vote
1answer
39 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
18 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
24 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-...
0
votes
0answers
37 views

impatient mode javascript 'Identifier has already been declared'

Impatient-mode dosen't work with my javascript code GitHub Repo Site works on first visit, but after any change in the buffor js throws error "Identifier 'Ball' has already been declared". How I can ...
4
votes
1answer
57 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
70 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
374 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
89 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
140 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
46 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
217 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
177 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
72 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
507 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
104 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
82 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
51 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
37 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
81 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
80 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
210 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
148 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
592 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
413 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
547 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
116 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
50 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
89 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
54 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
851 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 ...
8
votes
1answer
491 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
149 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
332 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
141 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
89 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
107 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
42 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
122 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
186 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?
3
votes
1answer
111 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
214 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
317 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
88 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
396 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
52 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
95 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
107 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. ...