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
426 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
402 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" :...
2
votes
0answers
62 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 ...
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) (...
2
votes
0answers
167 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 ...
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
54 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 ...
1
vote
1answer
220 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 ...
1
vote
1answer
38 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
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 (...
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 ...
1
vote
1answer
204 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?
1
vote
2answers
23 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 ...
1
vote
1answer
93 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
1answer
62 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?
1
vote
1answer
27 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
206 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 ...
1
vote
1answer
290 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 ...
1
vote
3answers
224 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 ...
1
vote
1answer
53 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 '...
1
vote
2answers
227 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
1answer
297 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
304 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
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 (...
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 ...
1
vote
0answers
46 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 ...
1
vote
1answer
37 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
3answers
28 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
351 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
1answer
91 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 [...
0
votes
3answers
85 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 ...
0
votes
2answers
127 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
1answer
146 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 ...
0
votes
2answers
1k 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 ...
0
votes
1answer
542 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 ...
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 ...
0
votes
1answer
27 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 ...
0
votes
1answer
62 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 ...
0
votes
1answer
22 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 "...
0
votes
1answer
111 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) (...
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 ...
0
votes
1answer
142 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 ...
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 ...
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
211 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 ...
0
votes
0answers
11 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 ...
0
votes
0answers
24 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 ...