diff options
author | João Távora <joaotavora@gmail.com> | 2020-04-18 02:46:04 +0100 |
---|---|---|
committer | João Távora <joaotavora@gmail.com> | 2020-05-01 12:11:10 +0100 |
commit | 43fded12d544ab68f493142debc5b3e437317f35 (patch) | |
tree | 19da109c5f240f97d80c8d73dc103e9fa64b19cc /lisp/net | |
parent | 7fa3e754cb7af37b0c50f253e7dec2acd0275a8a (diff) | |
download | emacs-43fded12d544ab68f493142debc5b3e437317f35.tar.gz emacs-43fded12d544ab68f493142debc5b3e437317f35.tar.bz2 emacs-43fded12d544ab68f493142debc5b3e437317f35.zip |
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/net')
-rw-r--r-- | lisp/net/eww.el | 2 | ||||
-rw-r--r-- | lisp/net/nsm.el | 1 | ||||
-rw-r--r-- | lisp/net/tramp-cache.el | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el index c83884fd259..a4544023f61 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1733,7 +1733,7 @@ If CHARSET is nil then use UTF-8." (defun eww-write-bookmarks () (with-temp-file (expand-file-name "eww-bookmarks" eww-bookmarks-directory) - (insert ";; Auto-generated file; don't edit\n") + (insert ";; Auto-generated file; don't edit -*- mode: lisp-data -*-\n") (pp eww-bookmarks (current-buffer)))) (defun eww-read-bookmarks () diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el index 2d36c5e2571..cc22427e6d1 100644 --- a/lisp/net/nsm.el +++ b/lisp/net/nsm.el @@ -964,6 +964,7 @@ protocol." (defun nsm-write-settings () (with-temp-file nsm-settings-file + (insert ";;;; -*- mode: lisp-data -*-\n") (insert "(\n") (dolist (setting nsm-permanent-host-settings) (insert " ") diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 09e30f000f4..6d87ce297bc 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -472,7 +472,7 @@ used to cache connection properties of the local machine." ;; Dump it. (with-temp-file tramp-persistency-file-name (insert - ";; -*- emacs-lisp -*-" + ";; -*- lisp-data -*-" ;; `time-stamp-string' might not exist in all Emacs flavors. (condition-case nil (progn |