0

Two Debian systems with different history of apt-based and local software installations. On one system, cmake-mode works, on the other not, though file /usr/local/share/emacs/site-lisp/cmake-mode.el is present on both systems.

On one system, variable auto-mode-alist contains rules for CMake, on the other system not. Via C-h v auto-mode-alist we are told that "auto-mode-alist is a variable defined in ‘files.el’", with the link pointing to /usr/share/emacs/27.1/lisp/files.el.gz. So the difference comes from that file? No, that file is identical on both systems, and does not contain any rule for CMake.

Questions thus: By what mechanism are additional rules written to variable auto-mode-alist? What could have gone wrong on the system that does not support cmake-mode?

1 Answer 1

1

I don't know how Debian does things, but...

auto-mode-alist is a variable, and (as with any variable) any and all elisp code may modify that value.

files.el merely defines its default value. What happens after that is up to the rest of the system.

For this particular variable, it's entirely expected for elisp libraries which add support for some file type to add to auto-mode-alist. As it's simply a list there are lots of ways to manipulate it, but it's commonly done with add-to-list.

file /usr/local/share/emacs/site-lisp/cmake-mode.el is present on both systems.

The file being present on the filesystem doesn't necessarily mean that Emacs has loaded it.

Does M-x load-library RET cmake-mode RET make a difference?

I don't know how Debian manages elisp packages, but the first thing I would look for is a site-start.el and/or default.el file in the site-lisp directory, as I'd expect whatever it does to be controlled from those.

1
  • After the latest Debian update, cmake-mode came back, without any action from my side. So I won't try out any of your advise. I accept your answer so that my question be marked as solved. Commented Dec 5, 2021 at 20:11

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.