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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 946 in the body.
You can then email your comments to 946 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-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#946; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Allan Gottlieb <gottlieb <at> nyu.edu>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

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

From: Allan Gottlieb <gottlieb <at> nyu.edu>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.0.60; html-mode regression ('' within a table)
Date: Tue, 09 Sep 2008 09:35:36 -0400
This mail is being sent from a different system (ajglap) from the one
on which the bug occurs (allan).  I did run report-emacs-bug on the
system with the bug and what follows is the
*mail to emacs-pretest-bug <at> gnu.org* buffer.

allan

From: Allan Gottlieb <gottlieb <at> nyu.edu>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.0.60; html-mode regression ('' within a table)
Gcc: nnml:MAIL
Date: Tue, 09 Sep 2008 09:30:49 -0400
Message-ID: <yu9od2xh2eu.fsf <at> nyu.edu>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
--text follows this line--

Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the emacs-pretest-bug <at> gnu.org mailing list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

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'

Thank you for emacs, which I have used for 20+ years.

allan gottlieb

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/share/emacs/23.0.60/etc/DEBUG for instructions.


In GNU Emacs 23.0.60.1 (x86_64-pc-linux-gnu, GTK+ Version 2.12.10)
 of 2008-09-06 on allan
Windowing system distributor `The X.Org Foundation', version 11.0.10300000
configured using `configure  '--prefix=/usr' '--host=x86_64-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--program-suffix=-emacs-23' '--infodir=/usr/share/info/emacs-23' '--with-sound' '--with-x' '--with-toolkit-scroll-bars' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xpm' '--with-freetype' '--with-xft' '--without-libotf' '--without-m17n-flt' '--with-x-toolkit=gtk' '--without-hesiod' '--with-kerberos' '--with-kerberos5' '--with-gpm' '--with-dbus' '--libdir=/usr/lib64' '--build=x86_64-pc-linux-gnu' 'build_alias=x86_64-pc-linux-gnu' 'host_alias=x86_64-pc-linux-gnu' 'CFLAGS=-march=nocona -O2 -pipe' 'LDFLAGS=-Wl,-O1''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: C
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Major mode: HTML

Minor modes in effect:
  auto-fill-function: do-auto-fill
  flyspell-mode: t
  iswitchb-mode: t
  delete-selection-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x m o n o - <backspace> 1 4 <return> C-x C-f <backspace> 
<backspace> / t m p / x . h t m l <return> C-o C-o 
C-o < h m t l <return> C-k <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> C-y C-x C-s C-c C-v <down> M-x 
v a l i d <tab> <backspace> <backspace> <backspace> 
<backspace> <backspace> C-g C-g C-h m C-s v a l i C-g 
C-g M-x s g m l - v a l i d a t e <return> <return> 
C-x 4 f ~ / c o u r s e s / o s / c l a s <tab> <return> 
<help-echo> <help-echo> <down-mouse-1> <mouse-movement> 
<mouse-1> <double-down-mouse-1> <mouse-movement> <double-drag-mouse-1> 
<help-echo> <down-mouse-1> <mouse-movement> <mouse-1> 
<down-mouse-2> <mouse-2> <return> C-x C-s M-x s g m 
SPC v SPC <return> <return> <up> <up> C-u C-k C-k <down> 
<down> <down> C-u C-u C-k C-x C-s C-x h C-M-\ M-x s 
u b m i t SPC <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> a p r <return> e m a c s . 
* b u g <return> M-x r e p o r t <return>

Recent messages:
Compilation exited abnormally with code 1
Ispell process killed
Starting new Ispell process [default] ...
Mark set
Wrote /tmp/x.html
(No files need saving)
Compilation exited abnormally with code 1
Wrote /tmp/x.html
Mark set [2 times]
Unclosed tag <>




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#946; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to martin rudalics <rudalics <at> gmx.at>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

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

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#946; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 946 <at> debbugs.gnu.org, Allan Gottlieb <gottlieb <at> nyu.edu>
Subject: Re: bug#946: 23.0.60; html-mode regression ('' within a table)
Date: Thu, 18 Sep 2008 09:00:50 -0400
>> 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.

Since this is working with sgml-tag-syntax-table, a better fix would be
to make sure that ' doesn't have prefix syntax in that table.


        Stefan "assuming this is indeed the problem"




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#946; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to martin rudalics <rudalics <at> gmx.at>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 946 <at> debbugs.gnu.org, Allan Gottlieb <gottlieb <at> nyu.edu>
Subject: Re: bug#946: 23.0.60; html-mode regression ('' within a table)
Date: Thu, 18 Sep 2008 15:25:28 +0200
> Since this is working with sgml-tag-syntax-table, a better fix would be
> to make sure that ' doesn't have prefix syntax in that table.
>
>
>         Stefan "assuming this is indeed the problem"

IIUC `sgml-tag-syntax-table' inherits this from `text-mode-syntax-table'
and whatever is resonable for writing plain text should be reasonable
for writing marked up text.

martin "who wanted to fix this problem unobtrusively"





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#946; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 946 <at> debbugs.gnu.org, Allan Gottlieb <gottlieb <at> nyu.edu>
Subject: Re: bug#946: 23.0.60; html-mode regression ('' within a table)
Date: Thu, 18 Sep 2008 17:11:46 -0400
>> Since this is working with sgml-tag-syntax-table, a better fix would be
>> to make sure that ' doesn't have prefix syntax in that table.
> IIUC `sgml-tag-syntax-table' inherits this from `text-mode-syntax-table'
> and whatever is resonable for writing plain text should be reasonable
> for writing marked up text.

> martin "who wanted to fix this problem unobtrusively"

You're confusing sgml-mode-syntax-table and sgml-tag-syntax-table.
The latter is only used internally, not during normal editing.


        Stefan




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#946; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to martin rudalics <rudalics <at> gmx.at>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 946 <at> debbugs.gnu.org, Allan Gottlieb <gottlieb <at> nyu.edu>
Subject: Re: bug#946: 23.0.60; html-mode regression ('' within a table)
Date: Fri, 19 Sep 2008 00:21:14 +0200
> You're confusing sgml-mode-syntax-table and sgml-tag-syntax-table.
> The latter is only used internally, not during normal editing.

Yes, but both inherit from `text-mode-syntax-table' IIUC.  Anyway, this
and the `sgml-specials' stuff is too contrived for me so I better leave
this to you ;-)

martin





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#946; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 946 <at> debbugs.gnu.org, Allan Gottlieb <gottlieb <at> nyu.edu>
Subject: Re: bug#946: 23.0.60; html-mode regression ('' within a table)
Date: Thu, 18 Sep 2008 21:35:41 -0400
>> You're confusing sgml-mode-syntax-table and sgml-tag-syntax-table.
>> The latter is only used internally, not during normal editing.
> Yes, but both inherit from `text-mode-syntax-table' IIUC.

That's OK: sgml-tag-syntax-table is designed only to parse the inside of
html tags.  That's the only thing it should do, but it should do
it well.  So ' should definitely not have prefix syntax in it.
The inheritance relationship doesn't really matter.

> Anyway, this and the `sgml-specials' stuff is too contrived for me so
> I better leave this to you ;-)

That's fine, except I'm overwhelmed with other work these days and can't
get much Emacs work done.


        Stefan




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#946; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to martin rudalics <rudalics <at> gmx.at>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 946 <at> debbugs.gnu.org, Allan Gottlieb <gottlieb <at> nyu.edu>
Subject: Re: bug#946: 23.0.60; html-mode regression ('' within a table)
Date: Fri, 19 Sep 2008 08:30:43 +0200
>> Yes, but both inherit from `text-mode-syntax-table' IIUC.
>
> That's OK: sgml-tag-syntax-table is designed only to parse the inside of
> html tags.

Just that `backward-sexp' also operates before a tag.

> That's the only thing it should do, but it should do
> it well.  So ' should definitely not have prefix syntax in it.
> The inheritance relationship doesn't really matter.

So I'll take your word for it.

>> Anyway, this and the `sgml-specials' stuff is too contrived for me so
>> I better leave this to you ;-)
>
> That's fine, except I'm overwhelmed with other work these days and can't
> get much Emacs work done.

OK, I checked in a fix along your suggestions.

martin




Reply sent to martin rudalics <rudalics <at> gmx.at>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Allan Gottlieb <gottlieb <at> nyu.edu>:
bug acknowledged by developer. Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: 946-done <at> debbugs.gnu.org
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>,
        Allan Gottlieb <gottlieb <at> nyu.edu>
Subject: Re: bug#946: 23.0.60; html-mode regression ('' within a table)
Date: Sun, 21 Sep 2008 13:58:56 +0200
Fixed as

2008-09-19  Martin Rudalics  <rudalics <at> gmx.at>

	* textmodes/sgml-mode.el (sgml-tag-syntax-table): Remove prefix
	flag from "'" entry in sgml-tag-syntax-table.  (Bug#946)

martin





bug archived. Request was from Debbugs Internal Request <don <at> donarmstrong.com> to internal_control <at> emacsbugs.donarmstrong.com. (Sun, 19 Oct 2008 14:24:03 GMT) Full text and rfc822 format available.

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.