unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#946: 23.0.60; html-mode regression ('' within a table)
@ 2008-09-09 13:35 Allan Gottlieb
  0 siblings, 0 replies; 8+ messages in thread
From: Allan Gottlieb @ 2008-09-09 13:35 UTC (permalink / raw)
  To: emacs-pretest-bug

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@gnu.org* buffer.

allan

From: Allan Gottlieb <gottlieb@nyu.edu>
To: emacs-pretest-bug@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@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@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 <>






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

* bug#946: 23.0.60; html-mode regression ('' within a table)
@ 2008-09-18  8:20 martin rudalics
  2008-09-18 13:00 ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: martin rudalics @ 2008-09-18  8:20 UTC (permalink / raw)
  To: 946; +Cc: Allan Gottlieb

[-- Attachment #1: Type: text/plain, Size: 656 bytes --]

 > 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

[-- Attachment #2: 946.diff --]
[-- Type: text/plain, Size: 1613 bytes --]

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

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

* bug#946: 23.0.60; html-mode regression ('' within a table)
  2008-09-18  8:20 bug#946: 23.0.60; html-mode regression ('' within a table) martin rudalics
@ 2008-09-18 13:00 ` Stefan Monnier
  2008-09-18 13:25   ` martin rudalics
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2008-09-18 13:00 UTC (permalink / raw)
  To: martin rudalics; +Cc: Allan Gottlieb, 946

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






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

* bug#946: 23.0.60; html-mode regression ('' within a table)
  2008-09-18 13:00 ` Stefan Monnier
@ 2008-09-18 13:25   ` martin rudalics
  2008-09-18 21:11     ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: martin rudalics @ 2008-09-18 13:25 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Allan Gottlieb, 946

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







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

* bug#946: 23.0.60; html-mode regression ('' within a table)
  2008-09-18 13:25   ` martin rudalics
@ 2008-09-18 21:11     ` Stefan Monnier
  2008-09-18 22:21       ` martin rudalics
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2008-09-18 21:11 UTC (permalink / raw)
  To: martin rudalics; +Cc: Allan Gottlieb, 946

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






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

* bug#946: 23.0.60; html-mode regression ('' within a table)
  2008-09-18 21:11     ` Stefan Monnier
@ 2008-09-18 22:21       ` martin rudalics
  2008-09-19  1:35         ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: martin rudalics @ 2008-09-18 22:21 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Allan Gottlieb, 946

 > 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







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

* bug#946: 23.0.60; html-mode regression ('' within a table)
  2008-09-18 22:21       ` martin rudalics
@ 2008-09-19  1:35         ` Stefan Monnier
  2008-09-19  6:30           ` martin rudalics
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2008-09-19  1:35 UTC (permalink / raw)
  To: martin rudalics; +Cc: Allan Gottlieb, 946

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






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

* bug#946: 23.0.60; html-mode regression ('' within a table)
  2008-09-19  1:35         ` Stefan Monnier
@ 2008-09-19  6:30           ` martin rudalics
  0 siblings, 0 replies; 8+ messages in thread
From: martin rudalics @ 2008-09-19  6:30 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Allan Gottlieb, 946

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






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

end of thread, other threads:[~2008-09-19  6:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-18  8:20 bug#946: 23.0.60; html-mode regression ('' within a table) martin rudalics
2008-09-18 13:00 ` Stefan Monnier
2008-09-18 13:25   ` martin rudalics
2008-09-18 21:11     ` Stefan Monnier
2008-09-18 22:21       ` martin rudalics
2008-09-19  1:35         ` Stefan Monnier
2008-09-19  6:30           ` martin rudalics
  -- strict thread matches above, loose matches on Subject: below --
2008-09-09 13:35 Allan Gottlieb

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