GNU bug report logs - #20895
[patch] lexical binding broke part of sgml-mode.el

Previous Next

Package: emacs;

Reported by: Stephen Berman <stephen.berman <at> gmx.net>

Date: Thu, 25 Jun 2015 10:44:02 UTC

Severity: normal

Tags: patch

Merged with 20386

Found in version 25.0.50

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20895 in the body.
You can then email your comments to 20895 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#20895; Package emacs. (Thu, 25 Jun 2015 10:44:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stephen Berman <stephen.berman <at> gmx.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 25 Jun 2015 10:44:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: bug-gnu-emacs <at> gnu.org
Subject: [patch] lexical binding broke part of sgml-mode.el
Date: Thu, 25 Jun 2015 12:42:35 +0200
The following change broke some functionality in sgml-mode.el:

   commit 84e0b7dad6f1a8e53261f9b96f5a9080fea681a4
   Author: Stefan Monnier <monnier <at> iro.umontreal.ca>
   Date:   Mon Apr 13 15:51:15 2015 -0400
   [...]
       * lisp/textmodes/sgml-mode.el: Use lexical-binding.

To see the bug, visit an (X)HTML file and insert a tag (`C-c C-t') that
takes an attribute, such `p' or `a'.

The following patch fixes the problems I have encountered, but I'm not
sure if further adjustments are needed, so I'll defer to whoever knows
the code better about whether to commit it as is.


2015-06-25  Stephen Berman  <stephen.berman <at> gmx.net>

	* sgml-mode.el (sgml-attributes, sgml-value): Make them work with
	lexical binding.


diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 2ffe9c1..dbb9662 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -759,9 +759,9 @@ If QUIET, do not print a message when there are no attributes for TAG."
 	    (insert ?\s)
 	    (insert (funcall skeleton-transformation-function
 			     (setq attribute
-				   (skeleton-read '(completing-read
+				   (skeleton-read `(completing-read
 						    "Attribute: "
-						    alist)))))
+						    ',alist)))))
 	    (if (string= "" attribute)
 		(setq i 0)
 	      (sgml-value (assoc (downcase attribute) alist))
@@ -1177,13 +1177,13 @@ See `sgml-tag-alist' for info about attribute rules."
     (if (and (eq (car alist) t) (not sgml-xml-mode))
 	(when (cdr alist)
 	  (insert "=\"")
-	  (setq alist (skeleton-read '(completing-read "Value: " (cdr alist))))
+	  (setq alist (skeleton-read `(completing-read "Value: " (cdr ',alist))))
 	  (if (string< "" alist)
 	      (insert alist ?\")
 	    (delete-char -2)))
       (insert "=\"")
       (if (cdr alist)
-          (insert (skeleton-read '(completing-read "Value: " alist)))
+          (insert (skeleton-read `(completing-read "Value: " ',alist)))
         (when (null alist)
           (insert (skeleton-read '(read-string "Value: ")))))
       (insert ?\"))))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20895; Package emacs. (Thu, 25 Jun 2015 13:04:02 GMT) Full text and rfc822 format available.

Message #8 received at 20895 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Stephen Berman <stephen.berman <at> gmx.net>, 20895 <at> debbugs.gnu.org
Subject: Re: bug#20895: [patch] lexical binding broke part of sgml-mode.el
Date: Thu, 25 Jun 2015 16:03:04 +0300
Hi!

On 06/25/2015 01:42 PM, Stephen Berman wrote:

> The following patch fixes the problems I have encountered, but I'm not
> sure if further adjustments are needed, so I'll defer to whoever knows
> the code better about whether to commit it as is.

Thanks for the patch, but please check out the discussion at 
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20386.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20895; Package emacs. (Thu, 25 Jun 2015 13:28:03 GMT) Full text and rfc822 format available.

Message #11 received at 20895 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 20895 <at> debbugs.gnu.org
Subject: Re: bug#20895: [patch] lexical binding broke part of sgml-mode.el
Date: Thu, 25 Jun 2015 15:27:06 +0200
On Thu, 25 Jun 2015 16:03:04 +0300 Dmitry Gutov <dgutov <at> yandex.ru> wrote:

> Hi!
>
> On 06/25/2015 01:42 PM, Stephen Berman wrote:
>
>> The following patch fixes the problems I have encountered, but I'm not
>> sure if further adjustments are needed, so I'll defer to whoever knows
>> the code better about whether to commit it as is.
>
> Thanks for the patch, but please check out the discussion at
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20386.

Oh, I missed (or forgot about) that (I've been a bit out of the Emacs
development loop lately, and only recently updated my build and hit this
bug).  Do you disagree with Stefan's suggestion or just haven't gotten
around to implementing it?  I can understand if the latter is the
reason, as I have little time myself to come up with a more involved
fix; still, it would be nice to have it fixed soon.

Steve Berman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20895; Package emacs. (Thu, 25 Jun 2015 14:35:04 GMT) Full text and rfc822 format available.

Message #14 received at 20895 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 20895 <at> debbugs.gnu.org
Subject: Re: bug#20895: [patch] lexical binding broke part of sgml-mode.el
Date: Thu, 25 Jun 2015 17:34:31 +0300
> From: Stephen Berman <stephen.berman <at> gmx.net>
> Date: Thu, 25 Jun 2015 12:42:35 +0200
> 
> The following change broke some functionality in sgml-mode.el:
> 
>    commit 84e0b7dad6f1a8e53261f9b96f5a9080fea681a4
>    Author: Stefan Monnier <monnier <at> iro.umontreal.ca>
>    Date:   Mon Apr 13 15:51:15 2015 -0400
>    [...]
>        * lisp/textmodes/sgml-mode.el: Use lexical-binding.
> 
> To see the bug, visit an (X)HTML file and insert a tag (`C-c C-t') that
> takes an attribute, such `p' or `a'.
> 
> The following patch fixes the problems I have encountered, but I'm not
> sure if further adjustments are needed, so I'll defer to whoever knows
> the code better about whether to commit it as is.

Whatever comes out of this discussion, would you please consider
adding a suitable test to sgml-mode-tests.el?  TIA.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20895; Package emacs. (Thu, 25 Jun 2015 14:48:02 GMT) Full text and rfc822 format available.

Message #17 received at 20895 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 20895 <at> debbugs.gnu.org
Subject: Re: bug#20895: [patch] lexical binding broke part of sgml-mode.el
Date: Thu, 25 Jun 2015 17:47:01 +0300
On 06/25/2015 04:27 PM, Stephen Berman wrote:
> or just haven't gotten around to implementing it?

That, more or less. And sgml-mode is not a priority for me personally, 
so if someone else takes that up, it would be welcome.




Merged 20386 20895. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 25 Jun 2015 15:43:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20895; Package emacs. (Thu, 25 Jun 2015 19:29:02 GMT) Full text and rfc822 format available.

Message #22 received at 20895 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 20895 <at> debbugs.gnu.org
Subject: Re: bug#20895: [patch] lexical binding broke part of sgml-mode.el
Date: Thu, 25 Jun 2015 21:28:12 +0200
On Thu, 25 Jun 2015 17:47:01 +0300 Dmitry Gutov <dgutov <at> yandex.ru> wrote:

> On 06/25/2015 04:27 PM, Stephen Berman wrote:
>> or just haven't gotten around to implementing it?
>
> That, more or less. And sgml-mode is not a priority for me personally, so if
> someone else takes that up, it would be welcome.

A usable sgml-mode is a priority for me, that's why I tried to fix it,
and for the time being it's good enough for me.  I probably won't be
able to try and implement the better fix in the near future, but will
take a look when I can, INOBMTI (if no one beats me to it).

On Thu, 25 Jun 2015 17:34:31 +0300 Eli Zaretskii <eliz <at> gnu.org> wrote:

> Whatever comes out of this discussion, would you please consider
> adding a suitable test to sgml-mode-tests.el?  TIA.

I'll try to do this too INOBMTI, though it may take even longer (it will
mean having to learn how to use ERT first).

Steve Berman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20895; Package emacs. (Thu, 25 Jun 2015 19:45:02 GMT) Full text and rfc822 format available.

Message #25 received at 20895 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 20895 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: Re: bug#20895: [patch] lexical binding broke part of sgml-mode.el
Date: Thu, 25 Jun 2015 22:44:27 +0300
> From: Stephen Berman <stephen.berman <at> gmx.net>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 20895 <at> debbugs.gnu.org
> Date: Thu, 25 Jun 2015 21:28:12 +0200
> 
> > Whatever comes out of this discussion, would you please consider
> > adding a suitable test to sgml-mode-tests.el?  TIA.
> 
> I'll try to do this too INOBMTI, though it may take even longer (it will
> mean having to learn how to use ERT first).

Thanks.  The tests already in sgml-mode-tests are pretty good
examples, and I'm sure you will find a way of mimicking them in no
time.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 22 Aug 2015 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 309 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.