From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#20774: auto-fill doesn't work properly when first-line prefix differs in adaptive-fill-mode Date: Wed, 23 Aug 2017 22:16:59 -0400 Message-ID: <87r2w1aew4.fsf@users.sourceforge.net> References: <878tibbwcv.fsf@users.sourceforge.net> <87wp5v9bsp.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1503540977 4587 195.159.176.226 (24 Aug 2017 02:16:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 24 Aug 2017 02:16:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) Cc: 20774@debbugs.gnu.org To: Samuel Freilich Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 24 04:16:13 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkhgj-0000Sx-Ih for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Aug 2017 04:16:05 +0200 Original-Received: from localhost ([::1]:46409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkhgo-0004xe-Lg for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Aug 2017 22:16:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkhgj-0004xY-So for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2017 22:16:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkhgg-0006Ie-OJ for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2017 22:16:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43250) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dkhgg-0006IW-JM for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2017 22:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dkhgg-0005Zx-32 for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2017 22:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Aug 2017 02:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20774 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 20774-submit@debbugs.gnu.org id=B20774.150354093021402 (code B ref 20774); Thu, 24 Aug 2017 02:16:02 +0000 Original-Received: (at 20774) by debbugs.gnu.org; 24 Aug 2017 02:15:30 +0000 Original-Received: from localhost ([127.0.0.1]:51930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkhgA-0005Z8-EY for submit@debbugs.gnu.org; Wed, 23 Aug 2017 22:15:30 -0400 Original-Received: from mail-it0-f42.google.com ([209.85.214.42]:37492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkhg8-0005Yv-RC for 20774@debbugs.gnu.org; Wed, 23 Aug 2017 22:15:29 -0400 Original-Received: by mail-it0-f42.google.com with SMTP id 190so8240537itx.0 for <20774@debbugs.gnu.org>; Wed, 23 Aug 2017 19:15:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=eDNmZpic/TzMAYALa69gjxdAILEgazZo92uSMbT/lHc=; b=pQbRrjmshlU+r1GWqPTv8oAPnqvVNYbIGwlvBcv4WRZCuHCDWUVYjxkq2tmXGmFbgJ uLS+dVfctEZ22AtJR2v536D11PBxGn8ubGuJ4RscZLIyoG4A/ztKuiXfDUiITAPesDJY hKjay6rTaU0dFJWWJiqfPaDKlHJvpyR+ji5I0maanmwOrIsFibayrg5bY70c+Imyn+xu NFzn+BC/Ga4aMEr7NwfHPRh+S8/jfF0al9B6l50av4J2lDy6RjQqL6bYjQUN+2GBzPwY E4w225BaqOjCVNGEstylBC7m3j5B7UG2hpB/I9dMPGXcVSrDnrd47Gnc9IzDSvswNhd3 vS5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=eDNmZpic/TzMAYALa69gjxdAILEgazZo92uSMbT/lHc=; b=NNxnRSsIZmUL7VOGk1bZCmPrVgjvplm0BkbvW2NW2AvsW5X7hLPzC/0uqVzuvKKi1X GSlZSm4/x9Xxb7ohhT7hKaOmA7GaAfmQ4mk+KRsBHHbwjsY+zjtBgotup5Oyabq2lZus kU/1TpgXdWHJidCOg53ztKWBknwQiJvJ89N11PkeegeUoigZ23Tno2A8ehzqMLpjRoA6 c2PFUo1CjLjs97wPaFft6U1BFJazUvFjVqXj/928ickTDjjT5rFinrMUHW1jBQHNUE6B 6ZV/zKr73tHWKfLcLJ4BYM21UYlOYg2QUug2IBuabMtVPq7JS3IUFR343b/tu9XByV6D 3xFA== X-Gm-Message-State: AHYfb5ixqSX97SaEGHmkVSU+fjX21utm7Vtm9qozTeszZxPvDM2e+/jm kwETsUmJFvE40l2s X-Received: by 10.36.241.3 with SMTP id c3mr4478913iti.116.1503540923096; Wed, 23 Aug 2017 19:15:23 -0700 (PDT) Original-Received: from zony ([45.2.119.49]) by smtp.googlemail.com with ESMTPSA id i13sm1407752ioo.48.2017.08.23.19.15.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Aug 2017 19:15:21 -0700 (PDT) In-Reply-To: (Samuel Freilich's message of "Wed, 23 Aug 2017 14:20:20 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:136132 Archived-At: Samuel Freilich writes: > tab-width = 4 seems consistent with how the rest of the file is formatted. > I didn't want to change the spacing in lines not touched by my diff. Hmm, somehow the code that landed in my buffer looked wrongly indented. Something got messed up somewhere (possibly by the email system, possibly during patch application, I've been experimenting with various forms of automation for that), but since the indentation in your next patch looks fine there's not really much point in worrying about it. > I added tests and a change description, and formatted the patch according > to the current instructions. Thanks! > I made the patch a bit more minimal. I pruned the part that dealt with > adaptive-fill-first-line-regexp didn't work as well as expected, since > that didn't work as well as expected (it didn't deal with all the > complexity possible with adaptive-fill-function). The updated version > at least handles cases where the fill-prefix isn't shorter than the > first-line prefix. That allowed me to simplify the code quite a bit, > since that makes the previous logic for skipping the exact fill-prefix > redundant, fill-move-to-break-point already handles the logic of > trying to skip at least one word after the start position passed to > it. Please take another look. Your commit message is a bit too focused on the problems of what was there previously rather than how your new code is correct. This description in your email is better, but I'm still struggling a bit (I'm realizing I was probably a bit too superficial previously, there are a lot of interacting options which makes things tricky). If I understand correctly, the previous code would take the fill-prefix as non-breakable if the current line started with the fill-prefix. Your new code takes the first N characters of the line as non-breakable (where N is the length of fill-prefix, should this be based on string-width instead?). Is that correct (for both adaptive-fill-mode and otherwise)? If so, please add an explanation of why it's correct to the commit message. If not, I hope we can elaborate the commit message until even I can understand what's happening ;) (Minor commit message format nitpick: the part explaining the changes to the function should start with "* lisp/simple.el (do-auto-fill):".)