From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id aHHuGZc5YmIpvgAAbAwnHQ (envelope-from ) for ; Fri, 22 Apr 2022 07:13:59 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id qC3AGZc5YmLoRgEAauVa8A (envelope-from ) for ; Fri, 22 Apr 2022 07:13:59 +0200 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 0891DADB4 for ; Fri, 22 Apr 2022 07:13:59 +0200 (CEST) Received: from localhost ([::1]:60192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhlcE-00067q-5C for larch@yhetil.org; Fri, 22 Apr 2022 01:13:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhlb3-00067i-Hk for emacs-orgmode@gnu.org; Fri, 22 Apr 2022 01:12:45 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]:41948) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhlaz-0001X5-SR for emacs-orgmode@gnu.org; Fri, 22 Apr 2022 01:12:44 -0400 Received: by mail-pl1-x62f.google.com with SMTP id s14so8404868plk.8 for ; Thu, 21 Apr 2022 22:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=5m12uHwLFwgv7qtJcBkdBahYMhsiwEv1vsSbW04bT0s=; b=UVASqYs57UUGU7kKPqcxuCA/3zgWvrx2BMK9TzHyhXrog4J/upTuq4AJlBx4/crRAg agi9gNYTwsXOOe4kj/u29yTSzkyhQ56ULXTgrM71HYFirrx+nM+AghALHTXDmf0nsuqm rgHrYRIjlry3CMNDm9Abf/1D3RTUpXsQlQaQ3eYw2brM994SOwNHZ08Gek7TuNah8M0L kdTE3//FLQt0Co4HcSATlFYuRIHsoOjKvwh+oqC+dqGOBZqM/NZGEpJZBbfimp/xOcEH R+h2STnWGMGytvL7nI7U7gRdVrcC+RrCJuMz2Q7/sfNXDJagWmTBqjovffoPz2/hHvpm J/Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=5m12uHwLFwgv7qtJcBkdBahYMhsiwEv1vsSbW04bT0s=; b=gyiib/RBHbJfE3U3nuJERF8k6Pl/+V1qGxqZBsXhRNWXUzhvr/Tv6K3gsZeJHvqR/l uHttyBJueAa/5uZkUimTmH4xJrVAkN9nMGBN22dAtx1291CARFm/MwYg2y3Q5LeIyJ4z 1VQuSOXLfU4fw3DNgehYprtLPZ3YJJU4EHNeBAwypCKYhb9H116SGKqW9Yo8qF6tNIH1 iYnRg9qDGXnGLDYgiTzvQasBEeb1itVHflN0tYLa/Nft0tWSg/mRRMMSL4ZD/TcdhQXx lLPB+2eP/y9bjWBBSpMP+p09auU034FlEazxmFy6FW85Wf0dJ1v1azfv3vCnUIu2kTS+ 2KZw== X-Gm-Message-State: AOAM530oA01WLuySrM01tcJm9wS49s8kv3yb2Xo434g44/zeobuZPTnl Z94TFOx3aiOPbjxyQkmruLE= X-Google-Smtp-Source: ABdhPJwxyDZqmGKcqqXLCukAwr3j4VNSkO3X4WanOe7vD1053l0YVvB/tDWfPy/sfYPjgiqzC1OEaQ== X-Received: by 2002:a17:90b:1c07:b0:1d4:ad4a:9ef9 with SMTP id oc7-20020a17090b1c0700b001d4ad4a9ef9mr12077106pjb.187.1650604360321; Thu, 21 Apr 2022 22:12:40 -0700 (PDT) Received: from localhost ([103.125.234.62]) by smtp.gmail.com with ESMTPSA id bu10-20020a056a00410a00b0050a641fc685sm821755pfb.115.2022.04.21.22.12.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 22:12:39 -0700 (PDT) From: Ihor Radchenko To: Javier Olaechea Subject: Re: Fix M-j with default fill-prefix value In-Reply-To: References: Date: Fri, 22 Apr 2022 13:13:32 +0800 Message-ID: <87a6cdu2df.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=yantar92@gmail.com; helo=mail-pl1-x62f.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 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-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1650604439; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=5m12uHwLFwgv7qtJcBkdBahYMhsiwEv1vsSbW04bT0s=; b=YJ6sT2QSvqRlkjSN3RtA2FsSiFBsZQuZA+XNe6WJwRVP/YJaFEOktmd9S6U0qjnh0AsPej xYjXgXZIyuVsP84gkaGQpoDA3ztAZyqOo8AequEVJzSyt6h1i8IRcsFDcqz4eVTmawzJI4 eLPcgnkS3TmmmKPcNkuAAJBTZDyorN/PmEojSnw3djKKQGY0RI/C2q7rF46+bCLxd+Auix sZYtvgK/kTNJwYuF5Yozvxyi+CUDzuNUM+8xquoSAzj/hIpOXuqZlVsAe3DHGTutXp+9Bz dUrlU/U0d3PHRn3f36/iFVy8f0lZLV0HikU6TGJo2cOHzjFUX10nV0hyJ3xrXQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650604439; a=rsa-sha256; cv=none; b=gGzOrEIt7k/qJAC52ajGLSLGZzUZlVHR3gycj4sqmYq9pcdf/57Tn2+qiHp3cCBpQ4mwaT NbtMiSYMGaQ4dTlRZFlHbSMHdrUEF2w03EEZZEY0Wn9assFye1nAtQxTOe7QWyNkGisASF Cdo6hJuoR0a9RxhLdWT/Dt5Jbkgkr/d+F1G+3JKoYk/iWyzMNEpsgOXmkNwnZVd7GYbTNO 2oIMIQW/rkBW0Uu2GPf6qrMw7Yuwt0q2zaKef8BxM6/SarKWPwE35ufLNcZx8oNPtgOuHh oUIRIO/MpBUOZsoRfxBWpTHlTtwu8F71R5woYh0rGxAtdkF/YWdzRpk0H00Esw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=UVASqYs5; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -5.33 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=UVASqYs5; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 0891DADB4 X-Spam-Score: -5.33 X-Migadu-Scanner: scn0.migadu.com X-TUID: mGvgV3/949N9 Javier Olaechea writes: > org-comment-line-break-function does not handle fill-prefix being set to > nil, which is the default value for fill-prefix. This means that pressing > M-j inside an org-mode buffer in a vanilla installation of Emacs results in > an error. From looking at other callers of > insert-before-markers-and-inherit it is clear that a guard against > fill-prefix being nil is missing. I guess this is fine to fix the immediate error, but I do not see much point in the whole org-comment-line-break function. AFAIU, it does not even recognise whether we are inside comment or not. I just tried to use the default comment-indent-new-line and it correctly indents paragraphs and also comments. On the other hand, it does not indent item lists and src-blocks. Rather than applying this patch I would remove org-comment-line-break-function alltogether. It will already be better than the current state. Alternatively, it should be rewritten to take into account current element context, similar to org-insert-comment. Best, Ihor