A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

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
10
votes
1answer
774 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
205 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
386 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
198 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 ...
3
votes
1answer
121 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
143 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
44 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
129 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
357 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
130 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
433 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
404 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
92 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
500 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
63 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
103 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
126 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
544 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 ...
1
vote
2answers
96 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 (...
6
votes
2answers
3k 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 '...
2
votes
0answers
80 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
62 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
99 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-...
2
votes
0answers
168 views

How to autoload a custom group?

I put my custom js setting into zwb-js group in zwb-js.el, I want to use use-package to load it, it seems that zwb-js.el has been loaded, but the functions defined in zwb-js.el seems not be called ...
0
votes
1answer
123 views

Remapping several faces for use in minor mode

I'm using face-remap-add-relative in a tiny minor mode which, when activated, increases the size of the org-level-1 face. This function is perfect for that because when evaluated it returns a cookie ...
0
votes
1answer
214 views

How do I enable a mode, when another mode runs?

All I want to do is enable tern-mode, when I enter js-mode. I know that a hook called js-mode is run when I open a javascript file but for some reason tern-mode is not enabled. In my init.el file I ...
2
votes
3answers
732 views

List all buffers with specific mode?

list-buffers gives a list of all buffers. But, I want only buffers where a specific minor mode (say aggressive-indent-mode) mode is enabled. How can I filter them?
8
votes
3answers
2k views

Auto enable minor modes in fundamental-mode

By design, the fundamental-mode is bare bones as other major modes are supposed to derive from this one. From the info page (elisp) Major Modes, we have: This is the major mode command for ...
13
votes
2answers
461 views

How do you update a minor mode definition as you develop it?

I started coding a minor mode to provide some keybindings. My initial attempt had a typo: (define-minor-mode borked-mode "A mode defined with a broken key binding" nil nil '(([b] . 'previous-...
8
votes
2answers
861 views

How to activate semantic-mode for specific major modes only?

I've seen this question a lot. But none of the replies fixed my issue: the minor mode stays on in others modes. So far, I have tried: (use-package stickyfunc-enhance :config ;; (add-to-list '...
2
votes
1answer
218 views

Mode local variables

I frequently use file-local variables, but after writing some minor modes I find the need to implement mode-based behavior. Let's say I want to define a variable errors-list-regexp that varies ...
2
votes
0answers
449 views

No numpy, scipy, sympy and matplotlib minor-modes?

Python scientific libs are immensily popular for the last decade or so. However googling and "melping" for its emacs minor-modes reveals nothing. Basically I need just syntax highlighting. Do you ...
2
votes
0answers
213 views

Issue with python mode in 24.5 on Mac OSX Yosemite: python-rx missing?

I installed Emacs 24.5 using homebrew $ brew install emacs and the Emacs-Live package collection. Most things work really well, but I'd like to get a python IDE going in emacs (so I don't have to ...
1
vote
1answer
293 views

How to set a rule for the order of minor-mode-map-alist

Suppose we have 3 mode, one such rule is like key map for mode 1 should always come before mode 2, and mode 3 should always come before mode 1, finally mode 3 should always come before other minor ...
2
votes
1answer
415 views

Make all text of a given face invisible

Is there a straightforward way to make all text with a given face invisible? I don't believe I can make invisibility be intrinsic to the face, but can I perhaps specify a minor mode that makes sure ...
7
votes
3answers
2k views

global-auto-revert-mode doesn't seem to work?

My init file includes (setq global-auto-revert-mode t) and I can confirm it's true with C-h v. But I still have to manually revert all my files with revert-buffer whenever I change git branches. I ...
2
votes
1answer
122 views

How to detect if current major-mode supports which-function and semantic/find?

I am implementing a feature to automatically generate a bookmark name by extracting information from the current context. Many packages provide such info. For example which-func (through (which-...
12
votes
2answers
2k views

Get list of active minor modes in buffer

How get a list of active minor modes in current buffer? Docs (info "(elisp)Minor Mode Conventions") say: Define a variable whose name ends in ‘-mode’. We call this the "mode variable". The minor ...
0
votes
1answer
124 views

Tie a minor-mode to a particular major mode

I'm writing an extension to a major mode (coq-mode) that adds extra features, plus a few keybindings. To makes it easy to disable or redefine these keybindings, I packaged them in a keymap. That ...
8
votes
1answer
591 views

Is there a 'caps-lock-mode' for those of us who've rebound the key?

Rebinding your caps-lock key to control is a popular thing to do (though there are arguments against it, even if a bit pedantic). However, the language I find a lot of my time in uses runs of ...
0
votes
0answers
50 views

What completion modes am I using?

I do not curate my .emacs and packages very effectively. Right now I have an issue where, when working in the Ruby, I type def[space] and then magically two end lines appear. Obviously I have managed ...
5
votes
2answers
1k views

Can I add highlighting in a minor mode?

I'm trying to understand minor modes with the goal of adding a minor mode for Jinja2 syntax highlighting (from jinja2-mode) to stuff like YAML. I'm running into problems though. When following a ...
5
votes
1answer
985 views

Turn off fringes in text-mode

How do I turn off fringes in text-mode? The closest I've gotten is this: (add-hook 'text-mode-hook (lambda () (set-fringe-mode '(0 . 0)))) But that turns off fringes ...
8
votes
2answers
1k views

Disable hl-line-mode only for eshell and ansi-term

I have global-hl-line-mode setup in my init file: (use-package hl-line :init (global-hl-line-mode 1)) Is it possible to disable it when I am in eshell and ansi-term? I tried adding a hook like ...
1
vote
3answers
225 views

detect minor mode activation [closed]

Is there a way to detect when a minor mode is turned on. For web-mode, I would like to know when indent-tabs-mode is turned on. Please note that what I need is to detect this when the user has begun ...
4
votes
1answer
501 views

How to look up documentation for a minor mode?

I just decided that I should try the outline-minor-mode for showing and hiding Emacs lisp defun definitions in an Emacs Lisp file. So I typed M-x outline-minor-mode and then I would like to get an ...
0
votes
0answers
390 views

normal-erase-is-backspace-mode does not work over ssh when included in .emacs

In my .emacs file I have the following line: (normal-erase-is-backspace-mode) to change <backspace> to backwards delete and ^H to help over the terminal. Unfortunately when I use emacs with -...
2
votes
1answer
510 views

Global minor mode not global?

I am trying to write a global minor mode. The following illustrates my problem: (define-minor-mode global-foo-mode :global t :lighter " FOO") then run M-x global-foo-mode The message displayed is ...
4
votes
0answers
52 views

How to do searches in MediaWiki mode?

How to do searches in MediaWiki mode? If I instead do searches in Web browser, and then copy the URI of the page into Emacs, it sort of defeats the purpose of using Emacs as and MediaWiki power ...
3
votes
1answer
301 views

How to learn the stroke order of a kanji (or kana) character using Emacs

As a devoted Emacs user and a Japanese beginner learner, I've been using the Emacs' Japanese input method quite a lot during recent months. However, I've been looking for a way to leverage Emacs' ...