From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Robert J. Chassell" Newsgroups: gmane.emacs.devel Subject: Re: auto-fill-mode and docstring Date: Mon, 13 Sep 2004 13:14:39 +0000 (UTC) Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: Reply-To: bob@rattlesnake.com NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1095081361 15630 80.91.229.6 (13 Sep 2004 13:16:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 13 Sep 2004 13:16:01 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 13 15:15:45 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C6qgK-0002N8-00 for ; Mon, 13 Sep 2004 15:15:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C6qlq-0004k2-UY for ged-emacs-devel@m.gmane.org; Mon, 13 Sep 2004 09:21:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C6qlk-0004jw-HS for emacs-devel@gnu.org; Mon, 13 Sep 2004 09:21:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C6qlk-0004jd-01 for emacs-devel@gnu.org; Mon, 13 Sep 2004 09:21:20 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C6qlj-0004ja-Op for emacs-devel@gnu.org; Mon, 13 Sep 2004 09:21:19 -0400 Original-Received: from [69.168.110.189] (helo=rattlesnake.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C6qfO-0005dp-BM for emacs-devel@gnu.org; Mon, 13 Sep 2004 09:14:46 -0400 Original-Received: by rattlesnake.com via sendmail from stdin id (Debian Smail3.2.0.115) Mon, 13 Sep 2004 13:14:39 +0000 (UTC) Original-To: emacs-devel@gnu.org In-reply-to: (message from Katsumi Yamaoka on Mon, 13 Sep 2004 15:33:53 +0900) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:27076 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:27076 Katsumi Yamaoka wrote ... auto-fill-mode ... inserts undesired spaces in the beginning of lines. For instance, when I type space just after `jumps' in the following form (defun quick-brown-fox (jumps-over &optional the-lazy-dog) "The quich brown fox jumps over the lazy dog. The quich brown fox jumps over the lazy dog. The quich brown fox jumps , it is folded as follows: ... The quich brown fox jumps over the lazy dog. The quich brown fox jumps Yes, I repeated the bug in a Lisp Interaction buffer (the `*scratch*' buffer) with auto-fill turned on. Using today's CVS snapshot, Mon, 2004 Sep 13 12:01 UTC GNU Emacs 21.3.50.35 (i686-pc-linux-gnu, GTK+ Version 2.4.9) started with /usr/local/src/emacs/src/emacs -Q The bug occurs when do-auto-fill, which is in lisp/simple.el, tries to find a fill-prefix automatically and the current fill-prefix is "". On the other hand, M-q (fill-paragraph) does the filling properly. That is because fill-paragraph, which is in lisp/textmodes/fill.el, calls fill-paragraph-function. In this mode, that function has the value of lisp-fill-paragraph (in lisp/emacs-lisp/lisp-mode.el). However, do-auto-fill does not call fill-paragraph-function. When I changed do-auto-fill to call fill-paragraph-function, it filled properly both in buffers in lisp-interaction-mode and text-mode with auto-fill-mode on, but it failed in a buffer in lisp-mode and auto-fill-mode on. (By default, neither a lisp-interaction-mode nor a lisp-mode buffer turn on auto-fill-mode.) (For the unsuccessful fix, I added the fill-paragraph-function expression from fill-paragraph to do-auto-fill like this: (defun do-auto-fill () (let (fc justify give-up (fill-prefix fill-prefix)) ! (if (or ! ;; First try fill-paragraph-function. ! (and fill-paragraph-function ! .... ) Unfortunately, I do not have time to investigate this further. -- Robert J. Chassell bob@rattlesnake.com GnuPG Key ID: 004B4AC8 http://www.rattlesnake.com http://www.teak.cc