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 /doc/lispref | |
| parent | 7fa3e754cb7af37b0c50f253e7dec2acd0275a8a (diff) | |
| download | emacs-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 'doc/lispref')
| -rw-r--r-- | doc/lispref/modes.texi | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index fc68ee1b322..eaee56f0a32 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -1352,19 +1352,11 @@ illustrate how these modes are written. @end smallexample The three modes for Lisp share much of their code. For instance, -each calls the following function to set various variables: - -@smallexample -@group -(defun lisp-mode-variables (&optional syntax keywords-case-insensitive elisp) - (when syntax - (set-syntax-table lisp-mode-syntax-table)) - @dots{} -@end group -@end smallexample +Lisp mode and Emacs Lisp mode inherit from Lisp Data mode and Lisp +Interaction Mode inherits from Emacs Lisp mode. @noindent -Amongst other things, this function sets up the @code{comment-start} +Amongst other things, Lisp Data mode sets up the @code{comment-start} variable to handle Lisp comments: @smallexample @@ -1414,7 +1406,7 @@ Finally, here is the major mode command for Lisp mode: @smallexample @group -(define-derived-mode lisp-mode prog-mode "Lisp" +(define-derived-mode lisp-mode lisp-data-mode "Lisp" "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp. Commands: Delete converts tabs to spaces as it moves back. @@ -1425,7 +1417,6 @@ Note that `run-lisp' may be used either to start an inferior Lisp job or to switch back to an existing one." @end group @group - (lisp-mode-variables nil t) (setq-local find-tag-default-function 'lisp-find-tag-default) (setq-local comment-start-skip "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") |
