From: Stefan Monnier Date: Mon, 7 Dec 2020 03:18:48 +0000 (-0500) Subject: * lisp/emacs-lisp/lisp-mode.el: Give paren syntax to [...] in lisp-data-mode X-Git-Tag: emacs-28.0.90~4895 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=300c581370073fbaad025465edc39bcbfe5e7c81;p=emacs.git * 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. --- diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 081ef8d441a..e477ef17000 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 12788eacf1b..fa360a8f3f8 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 59db646ff32..93d5d0fbcc2 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 -;;; 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 +;; bindings, which is not allowed by the Emacs standard. ;;; "This function binds many inferior-lisp commands to C-c bindings, ;;;where they are more accessible. C-c 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)))