emacs-diffs
[Top][All Lists]
Advanced

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

scratch/add-lisp-data-mode b527e98 1/2: Make lisp-mode-variables functio


From: João Távora
Subject: scratch/add-lisp-data-mode b527e98 1/2: Make lisp-mode-variables function less backward-incompatible
Date: Sat, 18 Apr 2020 07:59:53 -0400 (EDT)

branch: scratch/add-lisp-data-mode
commit b527e986d00d4e816f817d0d9b1e9021ac69691e
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    Make lisp-mode-variables function less backward-incompatible
    
    A small number of third-party packages rely on its arguments.  They
    shouldn't be seriously affected.
    
    * doc/lispref/modes.texi (Example Major Modes): Make example
    closer to reality.
    
    * lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables): Ignore any
    number of arguments.
---
 doc/lispref/modes.texi       | 10 +++++-----
 lisp/emacs-lisp/lisp-mode.el |  5 +++--
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index fc68ee1..df7458c 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -1356,9 +1356,9 @@ 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))
+(defun lisp-mode-variables ()
+  "Common initialization routine for lisp modes."
+  (setq-local paragraph-ignore-fill-prefix t)
   @dots{}
 @end group
 @end smallexample
@@ -1414,7 +1414,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 +1425,7 @@ 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)
+  (lisp-mode-variables)
   (setq-local find-tag-default-function 'lisp-find-tag-default)
   (setq-local comment-start-skip
               "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 8f7e6c0..18f35b6 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -611,8 +611,9 @@ Value for `adaptive-fill-function'."
   ;; a single docstring.  Let's fix it here.
   (if (looking-at "\\s-+\"[^\n\"]+\"\\s-*$") ""))
 
-(defun lisp-mode-variables ()
-  "Common initialization routine for lisp modes."
+(defun lisp-mode-variables (&rest ignored)
+  "Common initialization routine for lisp modes.
+Any number of parameters is accepted and ignored."
   (setq-local paragraph-ignore-fill-prefix t)
   (setq-local fill-paragraph-function 'lisp-fill-paragraph)
   (setq-local adaptive-fill-function #'lisp-adaptive-fill)



reply via email to

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