[PLUG] Using newly installed emacs mode

Galen Seitz galens at seitzassoc.com
Thu May 11 16:24:13 UTC 2017


On 05/11/17 06:35, Rich Shepard wrote:
>    When seeking how to have emacs use a newly installed language mode
> (js2-mode) I'm not using the appropriate web search terms. Results are many
> instances of writing emacs extensions to support languages, but not how to
> get emacs to use the mode when a language file is opened for editing.
> 
>    I used 'install-package [RET] js2-mode [RET]' to download, build, and
> install the mode. Tried 'M-x run-js2' but that was not found. I assume that
> I need to add the language to ~/.emacs but find no information on how to do
> this.

It's probably as simple as M-x js2-mode


>    Would appreciate learning how to make the mode active so I can use it now
> and in the future.

Generally modes are associated with filename endings, so .c or .h are
associated with c-mode, .py with python-mode, etc.  To make this
association, the mode is added to auto-mode-alist.  For example:

;; Any files that end in .v, .vh, .sv, or .svh should be in verilog mode
(add-to-list 'auto-mode-alist '("\\.s?vh?\\'" . verilog-mode))


galen
-- 
Galen Seitz
galens at seitzassoc.com



More information about the PLUG mailing list