unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ralf Fassel <ralfixx@gmx.de>
Subject: tcl mode: endless loop in tcl-do-fill-paragraph
Date: Thu, 11 Apr 2002 21:06:46 +0200 (MDT)	[thread overview]
Message-ID: <200204111906.g3BJ6k1115962@jupiter.akutech-local.de> (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'

             reply	other threads:[~2002-04-11 19:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-11 19:06 Ralf Fassel [this message]
2002-04-11 22:09 ` tcl mode: endless loop in tcl-do-fill-paragraph Tom Tromey
2002-04-12  8:10   ` Ralf Fassel
2002-04-12 17:17   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200204111906.g3BJ6k1115962@jupiter.akutech-local.de \
    --to=ralfixx@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).