From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#68418: refill-mode interferes with org-mode headlines Date: Sat, 13 Jan 2024 19:13:56 +0000 Message-ID: <87r0ilt5aj.fsf@localhost> References: <87il3yqmkl.fsf@gmail.com> <83le8thchr.fsf@gnu.org> <87mst9uzv3.fsf@localhost> <835xzxgxhh.fsf@gnu.org> <87frz1uyki.fsf@localhost> <834jfhgtb5.fsf@gnu.org> <877ckduudh.fsf@localhost> <8334v1grai.fsf@gnu.org> <87wmsdt6zg.fsf@localhost> <83v87xf47s.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="838"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rustand.lars@gmail.com, 68418@debbugs.gnu.org, salutis@me.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 13 20:11:35 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rOjPr-000Ad4-1b for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Jan 2024 20:11:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rOjPP-00053M-OO; Sat, 13 Jan 2024 14:11:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOjPN-00052n-TL for bug-gnu-emacs@gnu.org; Sat, 13 Jan 2024 14:11:05 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rOjPM-0004Ym-D0 for bug-gnu-emacs@gnu.org; Sat, 13 Jan 2024 14:11:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rOjPK-0000h1-Ux for bug-gnu-emacs@gnu.org; Sat, 13 Jan 2024 14:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Jan 2024 19:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68418 X-GNU-PR-Package: emacs Original-Received: via spool by 68418-submit@debbugs.gnu.org id=B68418.17051730572642 (code B ref 68418); Sat, 13 Jan 2024 19:11:02 +0000 Original-Received: (at 68418) by debbugs.gnu.org; 13 Jan 2024 19:10:57 +0000 Original-Received: from localhost ([127.0.0.1]:41128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOjPF-0000gY-4W for submit@debbugs.gnu.org; Sat, 13 Jan 2024 14:10:57 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:50035) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOjPA-0000g8-3B for 68418@debbugs.gnu.org; Sat, 13 Jan 2024 14:10:55 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 66D1524002A for <68418@debbugs.gnu.org>; Sat, 13 Jan 2024 20:10:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1705173047; bh=2izME+7ioQxOR+tgVMO6QyGeDsXxZXduvKhZaLqTSDg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=LOQLH7efqbJiVnWrqO7jcvLLAMvObRsfpKUktGvPxzJAJum2Z2JBzi5twNQUo5ycM wtl599hEACsCDcmtYyynelLaVla7KlK++0p95dmzTruiii5nA2ijKdH8tl/Nuf8vCi UC2ftN9Kp4ZwL9ZddjVsaPH57zEU+4IAvcUApx8G4oBxSG4lahiLqy9GoabXSNRVAm FrnLmvUNaaqy0Rqr6CB5lCF2p6MDCKzgEDTloVVORlNOS8K90bEGGNReRZg7rOOsmA 7QXpVuFAyloOmFwQ1xFLqTc21McLrNukfk7ato9IFGjQACpHcmzVSyF5kI3oF67VE0 Gy3Omv65vfTYw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TC7KL48LTz6tn4; Sat, 13 Jan 2024 20:10:46 +0100 (CET) In-Reply-To: <83v87xf47s.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:278147 Archived-At: Eli Zaretskii writes: >> > Is it possible to fix that by some improvements to >> > fill-forward-paragraph-function used by Org? >> >> I doubt so. The only idea that is coming to my mind is to make Org >> mode's `fill-forward-paragraph-function' not move anywhere when not on >> paragraph - this will prevent refill-mode from filling anything but Org >> paragraphs. > > Is the problem in your example what fill-forward-paragraph-function > does, or is the problem elsewhere in refill-fill-paragraph-at and/or > refill-post-command-function? IOW, can you tell which part(s) of > refill.el fail to DTRT in an Org buffer? I don't know enough about > all the peculiarities of the Org format to tell what should be fixed > in that case, let alone how. AFAIU, the problem is in (if use-hard-newlines (fill-region oend end arg) (fill-region-as-paragraph oend end arg)) Both `fill-region' and `fill-region-as-paragraph' do not respect `fill-paragraph-function' and always act the same once the region boundaries are identified regardless of the major mode. `fill-region-as-paragraph' does not respect it as per docstring and refill mode should probably not call `fill-region-as-paragraph'. The branching for `use-hard-newlines' should belong to text-mode, IMHO. `fill-region' does not respect `fill-paragraph-function' for the reasons I do not understand. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at