From 8bc5bd5b03cfc1994734b5903f98dccc0cdf004f Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 15 Dec 2020 08:43:41 +0100 Subject: [PATCH] Fix electric pairs in rst-mode * lisp/textmodes/rst.el (rst-mode-syntax-table): Mark pairs in the syntax table (bug#23413). (rst-mode): Instead of setting electric-pair-pairs. --- lisp/textmodes/rst.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index 7a7ac478b76..435de2683ef 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -1302,7 +1302,8 @@ This inherits from Text mode.") (modify-syntax-entry ?% "." st) (modify-syntax-entry ?& "." st) (modify-syntax-entry ?' "." st) - (modify-syntax-entry ?* "." st) + (modify-syntax-entry ?` "\"` " st) + (modify-syntax-entry ?* "\"* " st) (modify-syntax-entry ?+ "." st) (modify-syntax-entry ?- "." st) (modify-syntax-entry ?/ "." st) @@ -1330,7 +1331,6 @@ The hook for `text-mode' is run before this one." ;; Pull in variable definitions silencing byte-compiler. (require 'newcomment) -(defvar electric-pair-pairs) (defvar electric-indent-inhibit) ;; Use rst-mode for *.rst and *.rest files. Many ReStructured-Text files @@ -1387,8 +1387,6 @@ highlighting. (setq-local comment-region-function #'rst-comment-region) (setq-local uncomment-region-function #'rst-uncomment-region) - (setq-local electric-pair-pairs '((?\" . ?\") (?\* . ?\*) (?\` . ?\`))) - ;; Imenu and which function. ;; FIXME: Check documentation of `which-function' for alternative ways to ;; determine the current function name. -- 2.39.2