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 ms9.migadu.com with LMTPS id 8OYqMGUVkGTNhwAASxT56A (envelope-from ) for ; Mon, 19 Jun 2023 10:44:21 +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 uKbVL2UVkGR0iwAAauVa8A (envelope-from ) for ; Mon, 19 Jun 2023 10:44:21 +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 73AF734074 for ; Mon, 19 Jun 2023 10:44:21 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qBAU6-0007s7-RN; Mon, 19 Jun 2023 04:43:38 -0400 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 1qBAU5-0007rs-RF for emacs-orgmode@gnu.org; Mon, 19 Jun 2023 04:43:37 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qBAU3-0000zk-QF for emacs-orgmode@gnu.org; Mon, 19 Jun 2023 04:43:37 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 44B7E240028 for ; Mon, 19 Jun 2023 10:43:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.eu; s=2017; t=1687164212; bh=qMTdxfnVjLNybiAviO90ugp5YSv7OPdLoQu2kyGraaU=; h=Message-ID:Date:MIME-Version:Reply-To:Subject:To:Cc:From: Content-Transfer-Encoding:From; b=O0XCz68TPSLTmjZSi3Nhr9dbH0xOjrlbZQYQILypYp+vo5J+0iuts10mzmcpXimtQ LndhB+5XDujLnT4YvkrFxKhq1hbmNoNfffNx8YiRD0ePQTOZP8Q7wdtYJ7LZx2LGif gHE3yQSY0Xo63XQK0NOpmNzuoM7gypWOr89h9GqsujO91c41//fRW7IPR/zbASiiTO DLNm+9cY0542uPj3LY5oCF1Aqr7Fh5zTcfeL3p2DHNbrmppEKMYTqd6/4TLC/jJ2/p QavgF+TdynZyGKFZ8KZ0ynYkhcfZWC5/TTfRkvawL4h4FfCMLJdHta0RPWl5By4S30 2EJyDN1CRmotQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Ql3Fb3yMJz9rxM; Mon, 19 Jun 2023 10:43:31 +0200 (CEST) Message-ID: Date: Mon, 19 Jun 2023 08:43:31 +0000 MIME-Version: 1.0 Subject: Re: [BUG] Source block indentation does not work properly for yaml-mode [9.6.6 ( @ /home/user/.emacs.d/elpa/org-9.6.6/)] Content-Language: fr To: Ihor Radchenko Cc: wolf , emacs-orgmode@gnu.org References: <87ttva8chx.fsf@localhost> <8d8642c9-ced3-b254-0f49-f7b9c06311ff@posteo.eu> <87352p9g13.fsf@localhost> From: =?UTF-8?Q?S=c3=a9bastien_Miquel?= In-Reply-To: <87352p9g13.fsf@localhost> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.67.36.65; envelope-from=sebastien.miquel@posteo.eu; helo=mout01.posteo.de X-Spam_score_int: -53 X-Spam_score: -5.4 X-Spam_bar: ----- X-Spam_report: (-5.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: , Reply-To: sebastien.miquel@posteo.eu Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1687164261; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=31bMge2EyF8eSoMwNz0PD4HakL7xICelAG8mCI2qZ8Y=; b=MP7cylKJYaccqAVyDsYc455Malz0VnqthTmhnY66sDQBwTktz4/+1x8QICPXFzYJbbQQdx I9JQYtoy2gkn6iu/sYgzB37tEnuvJc2jNQlRhSTeiO1z/A7qOxhPDm/lc5ZrpS8FgTrR5J qCV22uoRBFlH2kztlk+gL9nPuodhz+5WABgGtUbkva3YgNQSfJthRCcfpXICd73fTSPh6/ Jf+EOA3PFjBIwsgGjnVSbT1HARc5BCpmJvJJCHGNFfc27YRhk9c8DfiiWn6d2H6HeMzALl mDZp3rycqamx91lXWJ/+5gG/lvkCQm4ZVFRXHwRiRcB4oGag/sR1w2dX8uL8TA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=O0XCz68T; dmarc=pass (policy=none) header.from=posteo.eu; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1687164261; a=rsa-sha256; cv=none; b=is0ln/zSoO58VSn0aajgpOl+erOyvmb7c0dpNUsmPHS3b4f4CzNwNan41uFXVKPKZllNCi M1e1xMiSJqzzz/E6TrOtcShEQ5Ehx5ukAUtH5YgZIC+36LqrRnBxsd+JCMFRNQ/ANgmuMn Gj+T/KvfEdLSXbKVvc1ARSt06O2sVEpRZfJFO2UQSaVk4eulTz0Tz9BQzz1PjBMqVOleEJ ARbkm/bu/FJRuZ5Fg92Hb5vDBpQYuZ29uLPJiSt5NbTaJBRefa8mUlsN3ra7EeA98PPE21 Rc2mX/YDjoo6ItHIapar6/oHZ8VAXeUUqY/u5CqCgRwI3pU2Wmj5yaICjSICGw== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -2.95 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=O0XCz68T; dmarc=pass (policy=none) header.from=posteo.eu; 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: 73AF734074 X-Spam-Score: -2.95 X-TUID: HWLKmjj+D2px Ihor Radchenko writes: > I feel that we will be getting various edge cases like the original > report and like the one I made up above if we keep trying to convert > tabs/spaces. Just retaining the original code indentation will be much > more robust, IMHO. Python code being broken with the default configuration is problematic, and fixing that seems worth the downsides (the indentation in an org file will now partially depend on the =indent-tabs-mode= settings of other modes, which cannot be set using buffer local variables). >> - =preserve-fl= is an isolated issue, and only concerns LaTeX >> fragments. I will attach a test with the issue it solves with >> multiline LaTeX fragments. I think LaTeX fragments are particular >> because in the org buffer they do not need to start at the >> beginning of a line. >> ... "- Item $abc\n efg$" > Shouldn't newlines be removed completely before editing the body here? > Just like what we do for inline src blocks. See `org-babel--normalize-body'. I was not aware of how we treated inline src blocks, but I don't think so. LaTeX fragments, in particular $$…$$ fragments, can have significant (for the user) newlines. >> Here are three patches attached. >> 1. Two tests : about editing LaTeX fragments, and preserving empty >> lines. > LGTM. > >> 2. Renaming of =preserve-blank-line=, for clarity. > My concern is for `newline-and-indent'. Current line is _previous_ line > in such scenario, not the newly inserted line. The way =newline-and-indent= works, I think, is that a newline is inserted, then =org-indent-line= is called, which preindents the line to the common org indentation, then calls =TAB= in a native edit buffer that does the rest of the indentation. The "current" line I refer to in the code is the new line (the "current" line is the one from which the native edit was called). -- Sébastien Miquel