GNU bug report logs - #946
23.0.60; html-mode regression ('' within a table)

Previous Next

Package: emacs;

Reported by: Allan Gottlieb <gottlieb <at> nyu.edu>

Date: Tue, 9 Sep 2008 13:45:04 UTC

Severity: normal

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 946 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: 946 <at> debbugs.gnu.org
Cc: Allan Gottlieb <gottlieb <at> nyu.edu>
Subject: 23.0.60; html-mode regression ('' within a table)
Date: Thu, 18 Sep 2008 10:20:45 +0200
[Message part 1 (text/plain, inline)]
> 1. Create the following 3 line file /tmp/x.html
>
> <table>
>   <tr><td>'9'</td></tr>
> </table>
>
> 2. invoke emacs -Q /tmp/x.html
>
> 3. C-x h   to mark the buffer
>
> 4. C-M-\   to indent the buffer
>
> 5. The indentation is not changed (correct), but the message
>    Unclosed tag <>
>    is generated (wrong).
>
> 6. This does not occur with emacs 22.2 and does not occur if
>    the three characters '9' are replaced with 9 or '9 but does occur if
>    they are replaced with 9'

This happens because `backward-sexp' calls `backward-prefix-chars' which
skips the "'".  Could you please try the attached patch.

Thank you, martin
[946.diff (text/plain, inline)]
*** textmodes/sgml-mode.el.~1.136.~	2008-07-05 06:26:11.000000000 +0200
--- textmodes/sgml-mode.el	2008-09-18 10:07:18.000000000 +0200
***************
*** 784,790 ****
                    (with-syntax-table sgml-tag-syntax-table
                      (up-list -1)
                      (when (sgml-skip-tag-forward 1)
!                       (backward-sexp 1)
                        (forward-char 2)
                        t))))
                 (clones (get-char-property (point) 'text-clones)))
--- 784,790 ----
                    (with-syntax-table sgml-tag-syntax-table
                      (up-list -1)
                      (when (sgml-skip-tag-forward 1)
! 		      (goto-char (or (scan-sexps (point) -1) (point-min)))
                        (forward-char 2)
                        t))))
                 (clones (get-char-property (point) 'text-clones)))
***************
*** 1223,1229 ****
                  (with-syntax-table sgml-tag-syntax-table
                    (goto-char tag-end)
                    (condition-case nil
!                       (backward-sexp)
                      (scan-error
                       ;; This > isn't really the end of a tag. Skip it.
                       (goto-char (1- tag-end))
--- 1223,1229 ----
                  (with-syntax-table sgml-tag-syntax-table
                    (goto-char tag-end)
                    (condition-case nil
! 		      (goto-char (or (scan-sexps (point) -1) (point-min)))
                      (scan-error
                       ;; This > isn't really the end of a tag. Skip it.
                       (goto-char (1- tag-end))

This bug report was last modified 16 years and 244 days ago.

Previous Next


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