unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#20895: [patch] lexical binding broke part of sgml-mode.el
@ 2015-06-25 10:42 Stephen Berman
  2015-06-25 13:03 ` Dmitry Gutov
  2015-06-25 14:34 ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Stephen Berman @ 2015-06-25 10:42 UTC (permalink / raw)
  To: 20895

The following change broke some functionality in sgml-mode.el:

   commit 84e0b7dad6f1a8e53261f9b96f5a9080fea681a4
   Author: Stefan Monnier <monnier@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@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 ?\"))))






^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-06-25 19:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-25 10:42 bug#20895: [patch] lexical binding broke part of sgml-mode.el Stephen Berman
2015-06-25 13:03 ` Dmitry Gutov
2015-06-25 13:27   ` Stephen Berman
2015-06-25 14:47     ` Dmitry Gutov
2015-06-25 19:28       ` Stephen Berman
2015-06-25 19:44         ` Eli Zaretskii
2015-06-25 14:34 ` Eli Zaretskii

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).