GNU bug report logs -
#24901
Patch to add support for curly quotes to electric-pair-mode
Previous Next
Reported by: Reuben Thomas <rrt <at> sc3d.org>
Date: Tue, 8 Nov 2016 12:01:02 UTC
Severity: wishlist
Tags: patch
Done: Reuben Thomas <rrt <at> sc3d.org>
Bug is archived. No further changes may be made.
Full log
Message #53 received at 24901 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
João Távora <joaotavora <at> gmail.com> writes:
> Turns out it's not so simple, because electric-pair-text-pairs is autoloaded
> and thus relying on electric-quote-chars is a problem.
>
> Loading loaddefs.el (source)...
> Symbol's value as variable is void: electric-quote-chars
> Makefile:535: recipe for target 'emacs' failed
>
> I could:
>
> 1. Add an autoload to electric-quote-chars. (Unfortunately I seem to fail at that,
> just adding the cookie isn't enough, it has to go into ldefs-boot.el somehow).
Or remove the autoload from electric-pair-text-pairs?
[0001-lisp-elec-pair.el-electric-pair-text-pairs-Don-t-aut.patch (text/x-diff, inline)]
From 57a68d001c0851ce10b1b8be47bc8db12b7789f1 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Thu, 17 Aug 2017 07:06:47 -0400
Subject: [PATCH] * lisp/elec-pair.el (electric-pair-text-pairs): Don't
autoload (Bug#24901).
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Require `elec-pair'
explicitly in the interactive case.
---
lisp/elec-pair.el | 1 -
lisp/progmodes/elisp-mode.el | 9 ++++++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el
index 87e82e24fb..f990851185 100644
--- a/lisp/elec-pair.el
+++ b/lisp/elec-pair.el
@@ -42,7 +42,6 @@ electric-pair-pairs
:group 'electricity
:type '(repeat (cons character character)))
-;;;###autoload
(defcustom electric-pair-text-pairs
'((?\" . ?\" )
((nth 0 electric-quote-chars) . (nth 1 electric-quote-chars))
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 47739f5957..0bf8857960 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -231,9 +231,12 @@ emacs-lisp-mode
(defvar project-vc-external-roots-function)
(lisp-mode-variables nil nil 'elisp)
(add-hook 'after-load-functions #'elisp--font-lock-flush-elisp-buffers)
- (setq-local electric-pair-text-pairs
- (append '((?\` . ?\') (?‘ . ?’)) electric-pair-text-pairs))
- (setq-local electric-quote-string t)
+ (unless noninteractive
+ (require 'elec-pair)
+ (defvar electric-pair-text-pairs)
+ (setq-local electric-pair-text-pairs
+ (append '((?\` . ?\') (?‘ . ?’)) electric-pair-text-pairs))
+ (setq-local electric-quote-string t))
(setq imenu-case-fold-search nil)
(add-function :before-until (local 'eldoc-documentation-function)
#'elisp-eldoc-documentation-function)
--
2.14.1
This bug report was last modified 7 years and 279 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.