summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorJoão Távora <joaotavora@gmail.com>2020-04-18 02:46:04 +0100
committerJoão Távora <joaotavora@gmail.com>2020-05-01 12:11:10 +0100
commit43fded12d544ab68f493142debc5b3e437317f35 (patch)
tree19da109c5f240f97d80c8d73dc103e9fa64b19cc /lisp/files.el
parent7fa3e754cb7af37b0c50f253e7dec2acd0275a8a (diff)
downloademacs-43fded12d544ab68f493142debc5b3e437317f35.tar.gz
Add lisp-data-mode for editing non-code Lisp data
Fixes: bug#40573 The new mode can be used stand-alone or inherited from by modes intended to edit programs. The existing emacs-lisp-mode and lisp-mode are examples. Thanks to Juri Linkov and Basil L. Contovounesios for researching some data files in Emacs that can be automatically set to use the new mode. * lisp/files.el (auto-mode-alist): Add entry for ".dir-locals" and ".dir-locals-2" * lisp/emacs-lisp/lisp-mode.el: (lisp-data-mode): New major mode. (lisp-mode): Inherit from lisp-data-mode. Set special lisp-mode stuff here. * lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Inherit from lisp-data-mode. * lisp/bookmark.el (bookmark-insert-file-format-version-stamp): Use lisp-data-mode. * lisp/saveplace.el (save-place-alist-to-file): Use lisp-data-mode. * lisp/net/eww.el (eww-write-bookmarks): Use lisp-data-mode. * lisp/net/nsm.el (nsm-write-settings): Use lisp-data-mode. * lisp/net/tramp-cache.el (tramp-dump-connection-properties): Use lisp-data-mode. * etc/NEWS: Mention lisp-data-mode. * doc/lispref/modes.texi (Example Major Modes): Update example.
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/files.el b/lisp/files.el
index fa72e51c497..56d4679ad7d 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2657,6 +2657,13 @@ since only a single case-insensitive search through the alist is made."
("\\.ltx\\'" . latex-mode)
("\\.dtx\\'" . doctex-mode)
("\\.org\\'" . org-mode)
+ ;; .dir-locals.el is not really elisp. Could use the
+ ;; `dir-locals-file' constant if it weren't defined below.
+ ("\\.dir-locals\\(-2\\)?\\.el\\'" . lisp-data-mode)
+ ("eww-bookmarks\\'" . lisp-data-mode)
+ ("tramp\\'" . lisp-data-mode)
+ ("places\\'" . lisp-data-mode)
+ ("\\.emacs-places\\'" . lisp-data-mode)
("\\.el\\'" . emacs-lisp-mode)
("Project\\.ede\\'" . emacs-lisp-mode)
("\\.\\(scm\\|stk\\|ss\\|sch\\)\\'" . scheme-mode)