emacs-diffs
[Top][All Lists]
Advanced

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

master 300c581: * lisp/emacs-lisp/lisp-mode.el: Give paren syntax to [..


From: Stefan Monnier
Subject: master 300c581: * lisp/emacs-lisp/lisp-mode.el: Give paren syntax to [...] in lisp-data-mode
Date: Sun, 6 Dec 2020 22:18:55 -0500 (EST)

branch: master
commit 300c581370073fbaad025465edc39bcbfe5e7c81
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * lisp/emacs-lisp/lisp-mode.el: Give paren syntax to [...] in lisp-data-mode
    
    (lisp-data-mode-syntax-table): Rename from lisp--mode-syntax-table.
    Adjust all users.  Set [...] to have paren syntax.
    (lisp-data-mode): Don't set `lisp-syntax` arg any more
    
    * lisp/progmodes/elisp-mode.el (emacs-lisp-mode-syntax-table):
    Don't bother setting [...] to have paren syntax any more.
    
    * lisp/progmodes/inf-lisp.el (inferior-lisp-mode): Don't use
    `lisp-syntax` arg of lisp-mode-variables any more.
---
 lisp/emacs-lisp/lisp-mode.el | 8 +++++---
 lisp/progmodes/elisp-mode.el | 7 ++++---
 lisp/progmodes/inf-lisp.el   | 9 +++++----
 3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 081ef8d..e477ef1 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -38,7 +38,7 @@
 (define-abbrev-table 'lisp-mode-abbrev-table ()
   "Abbrev table for Lisp mode.")
 
-(defvar lisp--mode-syntax-table
+(defvar lisp-data-mode-syntax-table
   (let ((table (make-syntax-table))
         (i 0))
     (while (< i ?0)
@@ -77,11 +77,13 @@
     (modify-syntax-entry ?\\ "\\   " table)
     (modify-syntax-entry ?\( "()  " table)
     (modify-syntax-entry ?\) ")(  " table)
+    (modify-syntax-entry ?\[ "(]" table)
+    (modify-syntax-entry ?\] ")[" table)
     table)
   "Parent syntax table used in Lisp modes.")
 
 (defvar lisp-mode-syntax-table
-  (let ((table (make-syntax-table lisp--mode-syntax-table)))
+  (let ((table (make-syntax-table lisp-data-mode-syntax-table)))
     (modify-syntax-entry ?\[ "_   " table)
     (modify-syntax-entry ?\] "_   " table)
     (modify-syntax-entry ?# "' 14" table)
@@ -669,7 +671,7 @@ font-lock keywords will not be case sensitive."
 (define-derived-mode lisp-data-mode prog-mode "Lisp-Data"
   "Major mode for buffers holding data written in Lisp syntax."
   :group 'lisp
-  (lisp-mode-variables t t nil)
+  (lisp-mode-variables nil t nil)
   (setq-local electric-quote-string t)
   (setq imenu-case-fold-search nil))
 
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 12788ea..fa360a8 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -38,9 +38,10 @@ It has `lisp-mode-abbrev-table' as its parent."
   :parents (list lisp-mode-abbrev-table))
 
 (defvar emacs-lisp-mode-syntax-table
-  (let ((table (make-syntax-table lisp--mode-syntax-table)))
-    (modify-syntax-entry ?\[ "(]  " table)
-    (modify-syntax-entry ?\] ")[  " table)
+  (let ((table (make-syntax-table lisp-data-mode-syntax-table)))
+    ;; These are redundant, now.
+    ;;(modify-syntax-entry ?\[ "(]  " table)
+    ;;(modify-syntax-entry ?\] ")[  " table)
     table)
   "Syntax table used in `emacs-lisp-mode'.")
 
diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el
index 59db646..93d5d0f 100644
--- a/lisp/progmodes/inf-lisp.el
+++ b/lisp/progmodes/inf-lisp.el
@@ -124,9 +124,9 @@ mode.  Default is whitespace followed by 0 or 1 
single-letter colon-keyword
 (define-key lisp-mode-map "\C-c\C-v" 'lisp-show-variable-documentation)
 
 
-;;; This function exists for backwards compatibility.
-;;; Previous versions of this package bound commands to C-c <letter>
-;;; bindings, which is not allowed by the Emacs standard.
+;; This function exists for backwards compatibility.
+;; Previous versions of this package bound commands to C-c <letter>
+;; bindings, which is not allowed by the Emacs standard.
 
 ;;;  "This function binds many inferior-lisp commands to C-c <letter> bindings,
 ;;;where they are more accessible. C-c <letter> bindings are reserved for the
@@ -274,7 +274,8 @@ If you accidentally suspend your process, use 
\\[comint-continue-subjob]
 to continue it."
   (setq comint-prompt-regexp inferior-lisp-prompt)
   (setq mode-line-process '(":%s"))
-  (lisp-mode-variables t)
+  (lisp-mode-variables)
+  (set-syntax-table lisp-mode-syntax-table)
   (setq comint-get-old-input (function lisp-get-old-input))
   (setq comint-input-filter (function lisp-input-filter)))
 



reply via email to

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