From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id gBPlHUJ1kGSFkgAASxT56A (envelope-from ) for ; Mon, 19 Jun 2023 17:33:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id wAnXHUJ1kGSKBgEAauVa8A (envelope-from ) for ; Mon, 19 Jun 2023 17:33:22 +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 1022310FE8 for ; Mon, 19 Jun 2023 17:33:22 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qBGro-0007cz-DY; Mon, 19 Jun 2023 11:32:32 -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 1qBGrl-0007cl-9x for emacs-orgmode@gnu.org; Mon, 19 Jun 2023 11:32:30 -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 1qBGrj-0006bZ-8a for emacs-orgmode@gnu.org; Mon, 19 Jun 2023 11:32:28 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 73D02240028 for ; Mon, 19 Jun 2023 17:32:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.eu; s=2017; t=1687188744; bh=MDb3sJPNzg9TTFKht6qMdf7R2IBhCJagO7/aqiFcqrY=; h=Message-ID:Date:MIME-Version:Reply-To:Subject:To:Cc:From: Content-Transfer-Encoding:From; b=jTozvTk8DhZIEwCEQQS2UO4LquGU66kyohgaE0wj9uLILv73VNNU/00VUhw1BUnHq 4gHMhUCtRXH+8qtho+gIf+HMDDNlHk0JN7y12Be6pQL7wH9kCPjg99dMY63uDo/9EF DVo5DJHCFNTV2hR+XCyRlJuX5h6eVwH55c2AnB5qma8x8SlDsAq0Yj0iYkNXohz62P SYGtfQUBuJbom6dsM2HXJwiaC+6r8nY4CnSw7caFYXV3dnpY3YFN5YWt5pBPqxizfK qbuo3moldS9I2BNtGl1Quo1f6OVyYJNp1yTBrju55K8gOwGhuAcr7GDM4jq3o1QD2p FE9YsaA/9qAWg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QlDKM4SzFz6tn4; Mon, 19 Jun 2023 17:32:23 +0200 (CEST) Message-ID: <37d86bbf-c0e2-6337-efc2-cdf63dbf4580@posteo.eu> Date: Mon, 19 Jun 2023 15:32:23 +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> <87zg4vsof6.fsf@localhost> From: =?UTF-8?Q?S=c3=a9bastien_Miquel?= In-Reply-To: <87zg4vsof6.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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.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=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-Seal: i=1; s=key1; d=yhetil.org; t=1687188802; a=rsa-sha256; cv=none; b=Hh8YDqmXwO23kD4TSPrjHNgirFhAe4o8q0cv88sJn6jeSyoLXlK4g88CEec8a5Rsb3kjcG EjthvF+5A0jHXID8ojG0FgBB8SCBakQGpD7HzEZWOcrWCDB/2qsWzVaDtv1PqaZKjoVjj9 frxcKLXfRwF6ogVJPBf7cOTKqVTxBndiu5IHD/pKRPc6+LHn5LugwjV99WX+buxNcYQmBk wuUq7d1+Fccj/vmS80u2sMBdI93ku2k9+oVYSYr4ay7FDPks381zWuu8NUcHCAFio5aRr+ N0n8zBwgeDbZMtjH8ExUoL//NujmzbeC+V6qmsStSA5mykVX333Z6RTG+xIqtg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=jTozvTk8; 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1687188802; 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=uv9/n6sI9Hl/MBzyMGOwkf70xiummaYLpCNiLrjaW80=; b=RSOavCkMFS509UwzSXUGGUNBgqgXORgUnqECZtupimntT46dRDTglLiJ5EzoeHlSWKc5u2 BnXCOcQmHQ6oF7KzHkK0vV3asbZYptwUuWYXlnh/jTdthyJxKU4DnUhkgjCgkiSrb5V2s/ jEHnvMaF2OXGWyRwy11L2fSq3qNuscae/TOw4uRt0MWUU0QLD1SQjNRKWML6ha6aVXrOwO LRXi+Nw5B1FzVBpgSLBh92Z7VFxzRAW2H7aX2+wRJKhCX9U/vaXCV7DtwztK8Nju1BngIV 1hdOZSBHAJ1DucSsd7MP7rBda7c2dItkEUs3nH4IfFQjrxyHd9XHtEsx3fJsgA== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=jTozvTk8; 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-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -5.05 X-Spam-Score: -5.05 X-Migadu-Queue-Id: 1022310FE8 X-TUID: 3nVVXjw7RzAw Ihor Radchenko writes: > What about the following approach: > > When converting from org-src buffer back to Org, > > 1. We do not touch the original indentation, except minimal common > indentation of the whole src code, respecting the src mode value of > `indent-tabs-mode'. > 2. Minimal common indentation is treated according to > `org-src-preserve-indentation'. > 3. `org-src-preserve-indentation', when in effect, will add extra > indentation of #+begin indentation + `org-src-preserve-indentation', > now honouring `indent-tabs-mode' in Org buffer. > > When converting from Org to org-src buffer, > > 1. When `org-src-preserve-indentation' is in effect, remove the common > `org-src-preserve-indentation' + #+begin indentation from the body. You've mixed up =org-src-preserve-indentation= and =org-edit-src-content-indentation= so I may misunderstand. But I guess what you propose amounts to 1. When =org-src-preserve-indentation= is =t=, do not touch indentation one way or the other (same as now). 2. Otherwise, do what we do now, but for the common indentation in the org buffer, use the org value of =indent-tabs-mode=, and for the rest of the indentation, use the native value of =indent-tabs-mode=. In this case, instead of trying to read this value, we might as well just blindly add the common indentation, to every non empty 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. > > May you provide an example? > AFAIK, LaTeX usually treats newlines as whitespace, same with " ". When I say significant, I don't mean for compilation. When editing an array of equations for example, one might want to keep one equation per line in the buffer. -- Sébastien Miquel