GNU bug report logs - #20774
auto-fill doesn't work properly when first-line prefix differs in adaptive-fill-mode

Previous Next

Package: emacs;

Reported by: Samuel Freilich <sfreilich <at> google.com>

Date: Mon, 8 Jun 2015 23:46:02 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


Message #31 received at 20774 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Samuel Freilich <sfreilich <at> google.com>
Cc: 20774 <at> debbugs.gnu.org
Subject: Re: bug#20774: auto-fill doesn't work properly when first-line prefix
 differs in adaptive-fill-mode
Date: Thu, 24 Aug 2017 21:45:17 -0400
Samuel Freilich <sfreilich <at> google.com> writes:

> You're right about string-width, since I'm counting number of columns.
> Fixed that. (Which required me to deal with the fact that fill-prefix can
> be nil.)

Actually, it's now occuring to me that adding a position to a
string-width isn't quite correct either, since it doesn't take into
account wide characters on the current line.  I guess it should actually
be something like

    (save-excursion
      (if line-prefix
          (move-to-column (string-width line-prefix))
        (beginning-of-line))
      (point))

> I've attached the fixed version of the patch with a hopefully-improved
> commit message.

That is much better, thanks.  (One more minor formatting nitpick, there
should be 2 spaces after the period.)




This bug report was last modified 7 years and 325 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.