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
317 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
371 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
455 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
61 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
97 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
118 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
491 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
93 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
76 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
61 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
91 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
157 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
105 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
191 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
654 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?
7
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 ...
12
votes
2answers
427 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
811 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
192 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
439 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
211 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
258 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
393 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 ...
8
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
119 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-...
9
votes
2answers
1k 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 ...
1
vote
1answer
119 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
551 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
48 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 ...
4
votes
1answer
906 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 ...
6
votes
2answers
975 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
191 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
463 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
374 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
478 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
51 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
289 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' ...
4
votes
1answer
1k views

(setq yas-snippet-dirs …) not working

I am unable to set up yasnippet the way I want to set it up. I only want to use yasnippet for a particular set of modes, so I don't want to use yas-global-mode. I only want to use my own snippets, ...
6
votes
3answers
822 views

How to make electric-pair-mode buffer local?

I would like electric-pair-mode to be enabled only in the buffers where I am editing, say, Emacs Lisp. But it seems that electric-pair-mode is a "global minor mode": if it is activated in one buffer, ...
30
votes
3answers
5k views

Is there an Emacs mode which highlights differences from the committed version?

One feature that Xcode has which I think is pretty neat is a "Comparison" mode, which continually shows differences between the current buffer and the most recent commit. Is there anything like this ...
1
vote
1answer
206 views

Line break/word wrap setup for writing a book/journal

I've just started learning Org-Mode and have comes across the issue of unending lines while journalling. All the different minor modes for line breaking and word wrapping have me confused. I want ...
12
votes
1answer
1k views

Disable minor mode in all open buffers

Often I have many buffers open and, for whatever reason, I no longer wish to use a particular minor mode with them. Is there currently a built-in way to disable a particular minor mode for all open ...
24
votes
3answers
5k views

Proper way to enable minor mode

I have foo-mode and would enable bar-minor-mode for it. So which way is more common and preferable? A (add-hook 'foo-mode-hook 'bar-minor-mode) B (add-hook 'foo-mode-hook (lambda () ...
7
votes
1answer
477 views

Enabling a minor mode with a file-local variable prop line

The first line of a plain-text file reads: # -*- eval: (auto-revert-tail-mode 1); -*- Yet Emacs does not enable auto-revert-tail-mode after opening this file. What is wrong?
20
votes
8answers
6k views

Hide list of minor modes in mode-line

I use quite a few minor modes and usually I know which minor mode is enabled in every major mode. If I really want to see the full list, I can run C-h v minor-mode-list. At the same time, my mode ...
0
votes
1answer
88 views

Is there a mode for phpBB?

I'm using the "It's all Text" addon for Firefox so I can edit textarea's in Emacs. As I spend some time on a phpBB forum, I was wondering if there is an Emacs mode for phpBB with it's syntax of using [...
37
votes
4answers
8k views

How to override major mode bindings

Sometimes my global keybindings are overridden by a major mode. An easy example is the following setting in my init file (global-set-key (kbd "C-j") 'newline-and-indent) But annoyingly this ...