* Error in nested backquoting
@ 2013-06-30 22:45 Diego Sevilla Ruiz
2013-07-01 7:53 ` Andreas Schwab
0 siblings, 1 reply; 5+ messages in thread
From: Diego Sevilla Ruiz @ 2013-06-30 22:45 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 956 bytes --]
Dear all:
I think I spotted an error in backquote.el answering this question in
stackoverflow:
http://stackoverflow.com/questions/17394638/nesting-backquote-and-in-emacs-lisp
In backquote expansion, the symbol for backquote (`) is treated specially
for nested backquoting, but its alias, backquote (if it is intended for it
to be used from elisp programs) is not correctly evaluated in nesting. The
patch (I think) is straightforward, and I include it as an attachment, but
you experts out there have to judge.
I would like to contribute it myself, but at the moment I'm not sure of
the steps I have to follow to do so (sign agreement? obtain write access to
repo?).
Best regards,
diego.
--
Diego Sevilla Ruiz -- http://ditec.um.es/~dsevilla/ -- dsevilla@um.es _.___
Dep. Ingeniería y Tecnología de Computadores, Facultad de Informática D|TEC
Univ.de Murcia,Campus Espinardo,30080 Murcia (SPAIN),Tel.+34868887571
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 901 bytes --]
--- backquote-old.el 2013-07-01 00:36:28.319352290 +0200
+++ backquote.el 2013-07-01 00:37:51.550816668 +0200
@@ -161,6 +161,8 @@
(backquote-delay-process s (1- level))))
((eq (car s) backquote-backquote-symbol)
(backquote-delay-process s (1+ level)))
+ ((eq (car s) 'backquote)
+ (backquote-delay-process s (1+ level)))
(t
(let ((rest s)
item firstlist list lists expression)
@@ -177,7 +179,8 @@
;; unquote since this needs to go recursively through
;; backquote-process.
(not (or (eq (car rest) backquote-unquote-symbol)
- (eq (car rest) backquote-backquote-symbol))))
+ (eq (car rest) backquote-backquote-symbol)
+ (eq (car rest) 'backquote))))
(setq item (backquote-process (car rest) level))
(cond
((= (car item) 2)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Error in nested backquoting
2013-06-30 22:45 Error in nested backquoting Diego Sevilla Ruiz
@ 2013-07-01 7:53 ` Andreas Schwab
2013-07-01 11:00 ` Diego Sevilla Ruiz
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2013-07-01 7:53 UTC (permalink / raw)
To: Diego Sevilla Ruiz; +Cc: emacs-devel
Diego Sevilla Ruiz <dsevilla@ditec.um.es> writes:
> In backquote expansion, the symbol for backquote (`) is treated
> specially for nested backquoting, but its alias, backquote (if it is
> intended for it to be used from elisp programs) is not correctly evaluated
> in nesting.
Since backquote expansion is purely syntactical, I don't think the
backquote symbol should have any significance in the process.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Error in nested backquoting
2013-07-01 7:53 ` Andreas Schwab
@ 2013-07-01 11:00 ` Diego Sevilla Ruiz
2013-07-01 11:54 ` Andreas Schwab
0 siblings, 1 reply; 5+ messages in thread
From: Diego Sevilla Ruiz @ 2013-07-01 11:00 UTC (permalink / raw)
To: Andreas Schwab; +Cc: emacs-devel
On 01/07/13 09:53, Andreas Schwab wrote:
> Diego Sevilla Ruiz <dsevilla@ditec.um.es> writes:
>
>> In backquote expansion, the symbol for backquote (`) is treated
>> specially for nested backquoting, but its alias, backquote (if it is
>> intended for it to be used from elisp programs) is not correctly evaluated
>> in nesting.
>
> Since backquote expansion is purely syntactical, I don't think the
> backquote symbol should have any significance in the process.
So does that mean that using `backquote' as a symbol to represent ` is
disqualified? (As opposed, for example, of either using `quote' or ' for
quoting.)
Best regards,
diego.
--
Diego Sevilla Ruiz -- http://ditec.um.es/~dsevilla/ -- dsevilla@um.es _.___
Dep. Ingeniería y Tecnología de Computadores, Facultad de Informática D|TEC
Univ.de Murcia,Campus Espinardo,30080 Murcia (SPAIN),Tel.+34868887571
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Error in nested backquoting
2013-07-01 11:00 ` Diego Sevilla Ruiz
@ 2013-07-01 11:54 ` Andreas Schwab
2013-07-01 12:51 ` Andreas Röhler
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2013-07-01 11:54 UTC (permalink / raw)
To: Diego Sevilla Ruiz; +Cc: emacs-devel
Diego Sevilla Ruiz <dsevilla@ditec.um.es> writes:
> (As opposed, for example, of either using `quote' or ' for quoting.)
quote and ' are indistinguishable, unlike ` and backquote (the latter
just happens to have the same function binding as `).
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Error in nested backquoting
2013-07-01 11:54 ` Andreas Schwab
@ 2013-07-01 12:51 ` Andreas Röhler
0 siblings, 0 replies; 5+ messages in thread
From: Andreas Röhler @ 2013-07-01 12:51 UTC (permalink / raw)
To: emacs-devel
Am 01.07.2013 13:54, schrieb Andreas Schwab:
> Diego Sevilla Ruiz <dsevilla@ditec.um.es> writes:
[...]
` and backquote (the latter
> just happens to have the same function binding as `).
>
> Andreas.
>
Can you tell us what makes the diff in result as example displays?
Thanks,
Andreas
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-07-01 12:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-30 22:45 Error in nested backquoting Diego Sevilla Ruiz
2013-07-01 7:53 ` Andreas Schwab
2013-07-01 11:00 ` Diego Sevilla Ruiz
2013-07-01 11:54 ` Andreas Schwab
2013-07-01 12:51 ` Andreas Röhler
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).