Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable mode

Tags:

emacs

I was wondering if there is a way to permanently remove a major mode let's say vhdl-mode from Emacs? I have already checked " How do I turn off vhdl-mode in emacs? " but I am wondering if I want to write my own distribution how can I removed some of these modes permanently from Emacs?

-- Experimental only and so no licensing issues or etc.

like image 745
Daniel Avatar asked Dec 16 '22 21:12

Daniel


2 Answers

You can effectively disable a mode by removing it from the auto-mode-alist variable. Once removed, the mode will never be automatically chosen by emacs but it may still be started manually. This removes vhdl-mode:

(rassq-delete-all 'vhdl-mode auto-mode-alist)
like image 196
ataylor Avatar answered Dec 26 '22 05:12

ataylor


All modes are available as files. On my machine, VHDL mode is at /usr/share/emacs/23.4/lisp/progmodes/vhdl-mode.el.gz. If you delete this file, there's no way to turn that on at all. If other modes depend on functionality implemented in this mode, they will suffer too.

Also, modes might be spread across mutliple files so you might have to remove more than one.

like image 36
Noufal Ibrahim Avatar answered Dec 26 '22 05:12

Noufal Ibrahim