From: "Robert J. Chassell" <bob@rattlesnake.com>
Subject: Re: auto-fill-mode and docstring
Date: Mon, 13 Sep 2004 13:14:39 +0000 (UTC) [thread overview]
Message-ID: <m1C6qfH-000UNaC@rattlesnake.com> (raw)
In-Reply-To: <b9yacvuu17y.fsf@jpl.org> (message from Katsumi Yamaoka on Mon, 13 Sep 2004 15:33:53 +0900)
Katsumi Yamaoka <yamaoka@jpl.org> 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
next prev parent reply other threads:[~2004-09-13 13:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-13 6:33 auto-fill-mode and docstring Katsumi Yamaoka
2004-09-13 13:14 ` Robert J. Chassell [this message]
2004-09-14 14:07 ` Richard Stallman
2004-09-15 9:33 ` Richard Stallman
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1C6qfH-000UNaC@rattlesnake.com \
--to=bob@rattlesnake.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.