From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ralf Fassel Newsgroups: gmane.emacs.bugs Subject: tcl mode: endless loop in tcl-do-fill-paragraph Date: Thu, 11 Apr 2002 21:06:46 +0200 (MDT) Organization: Akustik Technologie Goettingen Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <200204111906.g3BJ6k1115962@jupiter.akutech-local.de> NNTP-Posting-Host: localhost.gmane.org X-Trace: main.gmane.org 1018552156 1845 127.0.0.1 (11 Apr 2002 19:09:16 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 11 Apr 2002 19:09:16 +0000 (UTC) Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16vjwa-0000Td-00 for ; Thu, 11 Apr 2002 21:09:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16vjwY-00006M-00; Thu, 11 Apr 2002 15:09:14 -0400 Original-Received: from mail.t-intra.de ([62.156.146.210]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16vjuD-0008Sr-00 for ; Thu, 11 Apr 2002 15:06:49 -0400 Original-Received: from jupiter.akutech-local.de ([80.134.78.80]) by mail.t-intra.de with Microsoft SMTPSVC(5.5.1877.507.50); Thu, 11 Apr 2002 21:06:46 +0200 Original-Received: (from ralf@localhost) by jupiter.akutech-local.de (8.11.1/8.11.1) id g3BJ6k1115962; Thu, 11 Apr 2002 21:06:46 +0200 (MDT) Original-To: bug-gnu-emacs@gnu.org Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:575 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:575 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'