From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id WABsDtrt2F5DUQAA0tVLHw (envelope-from ) for ; Thu, 04 Jun 2020 12:49:30 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id aHkjCtrt2F5DVwAAbx9fmQ (envelope-from ) for ; Thu, 04 Jun 2020 12:49:30 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1A30D9402D6 for ; Thu, 4 Jun 2020 12:49:29 +0000 (UTC) Received: from localhost ([::1]:51226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgpJH-000056-Tg for larch@yhetil.org; Thu, 04 Jun 2020 08:49:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgpIw-00004w-BW for emacs-orgmode@gnu.org; Thu, 04 Jun 2020 08:49:06 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:35900) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgpIv-0003kJ-Hh for emacs-orgmode@gnu.org; Thu, 04 Jun 2020 08:49:06 -0400 Received: by mail-wr1-x433.google.com with SMTP id q11so5974391wrp.3 for ; Thu, 04 Jun 2020 05:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:message-id :date:mime-version; bh=56hnFGAnz0aQFSkgmFHLfyAkLXzLniC0O4VgtfgNTss=; b=KgmrYy/83saezW05yKX+HIF2mX/nbtahi6s0wqIAc9ZlIWw3U0EDvFL5oUEmAdSn5b fUWtdqJlhhK8XGHw9T+OKaL/AksUidShgU3gbdxeQHARmz93CO4dBWG4NgpHjROCizPP yOIfBohzJOErhYq7raffgmTUtwzlornv7OjGmGe4iu53ckd5ykFAlmOI+mrXf3Gw4Pu2 9YpyTQS19Tad0QfWsyV3Zts8dV1ZQ9XJzkQaXi94uTijwdvr42aVO+0q+yDkwWPMTVX+ S4y/kF1BGO8g7WVQlXogkB58Xe61xzkmEv7LkLddhVv9aTuiHbG4u/VYpz6qcExT3FIU 1OLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:message-id:date:mime-version; bh=56hnFGAnz0aQFSkgmFHLfyAkLXzLniC0O4VgtfgNTss=; b=LXDpDGjuoaaFowUG77qFgogX53xGcVLGLBwivRYjeCg4gr2SNdix7OtmT+55aZhYJ6 Hxs3khojdybfEUcD3BZlhLa48UV8mrUnBzLOSUm9WK3syLOjbdksGgfriuc/CW0Zo1ZO FZFEZreqVX8efGTY0WJbF0dGVxj609YLz/19qbieCjXhaYzOt+/NoOJMo5BlPQlNhBwY IBStmJyBrKLWA1WGNHSdfKNKu//0d1/BfuM7rWuMelP0lKOCSNS2kZihYKQBhoiPtRrA Cy/MazE19gYeH6vsPwvj344LTjEYLgmWpJE9sx7+DlyHtd5iHFxA2OBmn++DjwV9b8qC dZEw== X-Gm-Message-State: AOAM533bP8lbeqWHqwdrATC2mxzTiKTphCcH/tF33iOkywOZcozM44uz IgFNOe+5FX5uiBa/6FoN259VUZo= X-Google-Smtp-Source: ABdhPJwMciLStcYeX1uyJfhQzWqU85WrCqUhB/TmVia+awihhWB4l9PMT88Q6J/NvQQ5eTvixQNaTw== X-Received: by 2002:a05:6000:341:: with SMTP id e1mr4288550wre.1.1591274943908; Thu, 04 Jun 2020 05:49:03 -0700 (PDT) Received: from localhost (070-207.dynamic.dsl.fonira.net. [178.251.70.207]) by smtp.gmail.com with ESMTPSA id n189sm7272995wmb.43.2020.06.04.05.49.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 05:49:03 -0700 (PDT) References: <87a71jyr3m.fsf@gmail.com> <87wo4nropq.fsf@nicolasgoaziou.fr> User-agent: mu4e 1.4.8; emacs 26.3 From: Dominik Schrempf To: Nicolas Goaziou Subject: Re: Necessity of `org-fill-paragraph' In-reply-to: <87wo4nropq.fsf@nicolasgoaziou.fr> Message-ID: <87zh9j9etd.fsf@gmail.com> Date: Thu, 04 Jun 2020 14:49:02 +0200 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=dominik.schrempf@gmail.com; helo=mail-wr1-x433.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "emacs-orgmode@gnu.org" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=KgmrYy/8; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: Fay7ieD2bH7K Dear Nicolas! Thank you for your fast reply! I now use a custom =org-unfill-toggle= which does the same as =unfill-toggle= but uses =org-fill-paragraph=. It just took me a while to see where the problem lies! For cases like these, it would be advantageous if major modes could redefine certain functions. Like =fill-paragraph= in this case. Instead, they usually (have to?) rebind the keys... Kind regards, Dominik Nicolas Goaziou writes: > Hello, > > Dominik Schrempf writes: > >> I am using a global keybinding for =M-q=, so that I can fill and unfill >> paragraphs with one key stroke (unfill.el): >> >> : (global-set-key (kbd "s-q") 'unfill-toggle) >> >> For a long time, I thought that =fill-paragraph= was broken in Org mode, because >> it doesn't work well on code blocks, on lists, and on many other things [1]. >> Just now, I realized that Org mode uses a specialized version of >> `fill-paragraph`, called `org-fill-paragraph`. >> >> Hence, the aforementioned global key binding breaks behavior in Org mode, >> although the function =unfill-toggle= is just a wrapper around >> =fill-paragraph=. > > You could detect if you're in an Org document beforehand. > `org-fill-paragraph' obeys to `fill-column'. > >> Is it necessary to have the specialized function =org-fill-paragraph=? Is it >> possible to use the canonical =fill-paragraph=? > > There is `fill-paragraph-function', but it only kicks when no region is > selected. Using it would break region filling. There is also > `fill-forward-paragraph-function', but I think it is too limited. > > In a nutshell, I didn't find any way to fill correctly Org documents > using `fill-paragraph' mechanism. So I wrote the current implementation > of `org-fill-paragraph', which is a wrapper around `org-fill-element'. > > Regards,