emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: auto-fill-mode and docstring


From: Robert J. Chassell
Subject: Re: auto-fill-mode and docstring
Date: Mon, 13 Sep 2004 13:14:39 +0000 (UTC)

Katsumi Yamaoka <address@hidden> 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                         
    address@hidden                         GnuPG Key ID: 004B4AC8
    http://www.rattlesnake.com                  http://www.teak.cc




reply via email to

[Prev in Thread] Current Thread [Next in Thread]