From: "João Távora" <joaotavora@gmail.com>
To: Reuben Thomas <rrt@sc3d.org>
Cc: 24901@debbugs.gnu.org
Subject: bug#24901: Caught mistake in elec-pair.el patch
Date: Thu, 17 Aug 2017 11:32:10 +0100 [thread overview]
Message-ID: <CALDnm51psEGj_+_zAsSeAFgBtk1kri6wr=-f9DvuwV0YOw80cw@mail.gmail.com> (raw)
In-Reply-To: <CAOnWdojZmNrAN1ioAPk_YTik0LU-qz26SrA3pmocJznuB-Bd4A@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3020 bytes --]
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).
2. Replace those (nth...) expressions with the actual quote characters.
It's no
more disconnected from a possible customized value in electric-quote-chars
than it is now.
3. Rework elec-pair.el so that lisp expressions are accepted in
electric-pair-text-pairs
and evaluated just-in-time.
Anyway, It's been more than 1 year since my last contribution to Emacs, and
I shouldn't make this decision alone. Eli, could you please weigh in or
point me
to someone who can? Emacs-devel?
Thanks,
João
On Sun, Aug 13, 2017 at 11:59 AM, Reuben Thomas <rrt@sc3d.org> wrote:
> Thanks very much, I fear that was just ineptitude on my part.
>
> --
> https://rrt.sc3d.org
>
> On 13 Aug 2017 11:57 am, "João Távora" <joaotavora@gmail.com> wrote:
>
>> Hi Reuben,
>>
>> Casually glancing at the source for lisp/elec-pair.el I have found an
>> error.
>>
>> You cannot use lists like (nth 0 electric-quote-chars) inside a quoted
>> list as
>> you did in your patch of Nov. 8 2016. The list will not be evaluated.
>> Perhaps
>> you were distracted by the grim events taking place that day :-)
>>
>> Anyway, I think you meant backquote-and-comma so I'll install this fix
>> soon,
>> unless anyone objects.
>>
>> João
>>
>>
>> diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el
>> index 87e82e2..4ede4f1 100644
>> --- a/lisp/elec-pair.el
>> +++ b/lisp/elec-pair.el
>> @@ -28,9 +28,9 @@
>> ;;; Electric pairing.
>>
>> (defcustom electric-pair-pairs
>> - '((?\" . ?\")
>> - ((nth 0 electric-quote-chars) . (nth 1 electric-quote-chars))
>> - ((nth 2 electric-quote-chars) . (nth 3 electric-quote-chars)))
>> + `((?\" . ?\")
>> + (,(nth 0 electric-quote-chars) . ,(nth 1 electric-quote-chars))
>> + (,(nth 2 electric-quote-chars) . ,(nth 3 electric-quote-chars)))
>> "Alist of pairs that should be used regardless of major mode.
>>
>> Pairs of delimiters in this list are a fallback in case they have
>> @@ -44,9 +44,9 @@ electric-pair-pairs
>>
>> ;;;###autoload
>> (defcustom electric-pair-text-pairs
>> - '((?\" . ?\" )
>> - ((nth 0 electric-quote-chars) . (nth 1 electric-quote-chars))
>> - ((nth 2 electric-quote-chars) . (nth 3 electric-quote-chars)))
>> + `((?\" . ?\" )
>> + (,(nth 0 electric-quote-chars) . ,(nth 1 electric-quote-chars))
>> + (,(nth 2 electric-quote-chars) . ,(nth 3 electric-quote-chars)))
>> "Alist of pairs that should always be used in comments and strings.
>>
>> Pairs of delimiters in this list are a fallback in case they have
>>
>>
[-- Attachment #2: Type: text/html, Size: 4554 bytes --]
next prev parent reply other threads:[~2017-08-17 10:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CALDnm513tFORnxwH7a_hn7Birk-s7z44ftxO2uitMM7Rb2dQKA@mail.gmail.com>
2017-08-13 11:03 ` bug#24901: Fwd: Caught mistake in elec-pair.el patch João Távora
[not found] ` <CAOnWdojZmNrAN1ioAPk_YTik0LU-qz26SrA3pmocJznuB-Bd4A@mail.gmail.com>
2017-08-17 10:32 ` João Távora [this message]
2017-08-17 12:35 ` bug#24901: " npostavs
2017-08-17 13:32 ` João Távora
2017-08-17 14:05 ` Noam Postavsky
2017-08-17 14:23 ` Eli Zaretskii
2017-08-17 15:36 ` João Távora
2017-08-17 15:49 ` Noam Postavsky
2017-08-17 16:57 ` João Távora
2017-08-18 1:51 ` npostavs
2017-08-18 19:21 ` Reuben Thomas
2017-08-18 22:46 ` João Távora
2017-08-19 0:41 ` Noam Postavsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALDnm51psEGj_+_zAsSeAFgBtk1kri6wr=-f9DvuwV0YOw80cw@mail.gmail.com' \
--to=joaotavora@gmail.com \
--cc=24901@debbugs.gnu.org \
--cc=rrt@sc3d.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.