[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Set major mode for all visited files by extension

From: Tim Johnson
Subject: Set major mode for all visited files by extension
Date: Sat, 2 May 2020 17:00:18 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1

Using GNU Emacs 26.3, X toolkit

With my configuration, when I open emacs and load a session, it appears that a modified auto-mode-alist entry is consulted *after* the associated major-mode from the previous session is used and is therefore ignored.

A practical application is if I have been using the built-in elisp mode for .el files and then implement xah-elisp-mode, even if I code

(add-to-list 'auto-mode-alist '("\\.el$" . xah-elisp-mode))

in my init.el, the previously visited buffers that are automatically opened when I start emacs will still be in elisp-mode. The fix, of course is to invoke xah-elisp-mode from the minibuffer. This is certainly doable, even with multiple elisp buffers opened, but I'm always looking to eliminate redundancies.

It would be handy if there were a command that would set all visited buffers ending in a specific file extension to a specific mode. If such were available, it would come in handy for experimenting with alternative major modes.

Is there such a feature?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]