unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* tcl mode: endless loop in tcl-do-fill-paragraph
@ 2002-04-11 19:06 Ralf Fassel
  2002-04-11 22:09 ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Ralf Fassel @ 2002-04-11 19:06 UTC (permalink / raw)



In GNU Emacs 21.2.1 (mips-sgi-irix6.5, X toolkit)
 of 2002-04-05 on merkur
configured using `configure  --prefix=/software/emacs/21.2 -exec-prefix=/software/emacs/21.2/IRIX-6 --with-pop --with-x-toolkit=athena'
Important settings:
  value of $LC_ALL: C
  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: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: nil

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

In TCL mode, calling `fill-paragraph' in the first line of the buffer
runs into endless loop when the first line is a comment.

Reproduce:

% emacs -q -no-site-file   # start fresh emacs
C-x C-f /tmp/foo.tcl       # should be in TCL mode now
# foobar                   # insert in buffer, keep cursor at end of
                           # first line in buffer
M-x fill-paragraph RET     # endless loop


Analysis:
`tcl-mode' binds `fill-paragraph-function' to `tcl-do-fill-paragraph',
this function tries to move before the current comment, which fails if
the comment is the first line in the buffer (or a narrowed region, FWIW).

share/emacs/21.2/lisp/progmodes/tcl.el, #1543 ff

	   ;; Search backwards.
	   (save-excursion
!	     (while (looking-at "^[ \t]*#")
!	       (forward-line -1))
	     (forward-line)
	     (setq p-start (point)))

The lines marked `!' are the endless loop.

The return-value of `forward-line' should be taken into account, if
non-zero the loop should stop.

R'

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

* Re: tcl mode: endless loop in tcl-do-fill-paragraph
  2002-04-11 19:06 tcl mode: endless loop in tcl-do-fill-paragraph Ralf Fassel
@ 2002-04-11 22:09 ` Tom Tromey
  2002-04-12  8:10   ` Ralf Fassel
  2002-04-12 17:17   ` Eli Zaretskii
  0 siblings, 2 replies; 4+ messages in thread
From: Tom Tromey @ 2002-04-11 22:09 UTC (permalink / raw)


>>>>> "Ralf" == Ralf Fassel <ralfixx@gmx.de> writes:

Ralf> In TCL mode, calling `fill-paragraph' in the first line of the
Ralf> buffer runs into endless loop when the first line is a comment.

I wrote a patch for this a couple months ago, and RMS checked it in.

Tom

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

* Re: tcl mode: endless loop in tcl-do-fill-paragraph
  2002-04-11 22:09 ` Tom Tromey
@ 2002-04-12  8:10   ` Ralf Fassel
  2002-04-12 17:17   ` Eli Zaretskii
  1 sibling, 0 replies; 4+ messages in thread
From: Ralf Fassel @ 2002-04-12  8:10 UTC (permalink / raw)


* tromey@redhat.com (Tom Tromey)
| I wrote a patch for this a couple months ago, and RMS checked it in.

Well, all I can say is that patch didn't make it into my 21.2 tcl.el.
I have:
    ;; Maintainer: FSF
    ;; Author: Tom Tromey <tromey@busco.lanl.gov>
    ;;    Chris Lindblad <cjl@lcs.mit.edu>
    ;; Keywords: languages tcl modes
    ;; Version: $Revision: 1.64.4.1 $

R'

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

* Re: tcl mode: endless loop in tcl-do-fill-paragraph
  2002-04-11 22:09 ` Tom Tromey
  2002-04-12  8:10   ` Ralf Fassel
@ 2002-04-12 17:17   ` Eli Zaretskii
  1 sibling, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2002-04-12 17:17 UTC (permalink / raw)
  Cc: bug-gnu-emacs

> From: Tom Tromey <tromey@redhat.com>
> Newsgroups: gnu.emacs.bug
> Date: 11 Apr 2002 16:09:26 -0600
> 
> >>>>> "Ralf" == Ralf Fassel <ralfixx@gmx.de> writes:
> 
> Ralf> In TCL mode, calling `fill-paragraph' in the first line of the
> Ralf> buffer runs into endless loop when the first line is a comment.
> 
> I wrote a patch for this a couple months ago, and RMS checked it in.

Thanks for mentioning that, I now checked in that patch into the
branch version as well.

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

end of thread, other threads:[~2002-04-12 17:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-11 19:06 tcl mode: endless loop in tcl-do-fill-paragraph Ralf Fassel
2002-04-11 22:09 ` Tom Tromey
2002-04-12  8:10   ` Ralf Fassel
2002-04-12 17:17   ` 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).