From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 KEanOpD3o2TkbwAASxT56A (envelope-from ) for ; Tue, 04 Jul 2023 12:42:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id OC5zOpD3o2TRaAAA9RJhRA (envelope-from ) for ; Tue, 04 Jul 2023 12:42:24 +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 59FD36C0E for ; Tue, 4 Jul 2023 12:42:24 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGdTN-00049N-6b; Tue, 04 Jul 2023 06:41:29 -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 1qGdTE-00048s-JY for emacs-orgmode@gnu.org; Tue, 04 Jul 2023 06:41:27 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGdTC-0006WL-7D for emacs-orgmode@gnu.org; Tue, 04 Jul 2023 06:41:20 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 5E7F7240103 for ; Tue, 4 Jul 2023 12:41:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1688467274; bh=w/7+k9qoBQQsEvQ14+tP6DKt5olYiBBM9v8Y8HMYIHs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=quYXI0uNC1SFdUrLNg63/nQn3Xjpgi+ko/hN67HBZuuFv0GG1ypQNzizyinmphFFR nV7aKvhblZbqdRBCXQWunyxZYGxpCjIMbCLDtu5AvvtTP9+MTA4u8jQwqu6nSJIJ+K H93ktmv2hR30BdZHrC68rizSDT12XMDWycmOjsuV4IjWGbLzgO8BZCk06K0CWMIOE+ QX3X/eaKGPh8o7aPxWxnR3pF96+9/7TIv0Uycm/MYZdZqyu8DlKB69pqO/BKq2lmqV LAV2F93voP4iEjZ2GBsxRTjgoMwml0QqaRkjXAb5+pVzuN2a2otwiCTQRg4UeDkpW4 JAqukCShJJ4nA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QwK8T6FLtz9rxR; Tue, 4 Jul 2023 12:41:13 +0200 (CEST) From: Ihor Radchenko To: sebastien.miquel@posteo.eu Cc: emacs-orgmode@gnu.org 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/)] In-Reply-To: <40b8bf4b-2c1c-ad5b-7109-e0684973bf81@posteo.eu> References: <87352p9g13.fsf@localhost> <87zg4vsof6.fsf@localhost> <37d86bbf-c0e2-6337-efc2-cdf63dbf4580@posteo.eu> <87sfamsb7m.fsf@localhost> <274bbd61-790d-8e19-d3a0-0793126c3bb0@posteo.eu> <87cz1itp8k.fsf@localhost> <1a97917c-bbab-4d7f-b629-0c84807448f2@posteo.eu> <87a5wmtmug.fsf@localhost> <87o7l0vt5z.fsf@localhost> <1d145455-2047-2b7a-8222-8eadc2529c8c@posteo.eu> <87edltqiox.fsf@localhost> <87sfa7opo9.fsf@localhost> <4eb9a5ad-2d91-15ae-ccd9-894c0303cca2@posteo.eu> <874jml8ggm.fsf@localhost> <8d6dd95e-5bce-44c3-638a-52351b69cc66@posteo.eu> <87cz19gn6i.fsf@localhost> <40b8bf4b-2c1c-ad5b-7109-e0684973bf81@posteo.eu> Date: Tue, 04 Jul 2023 10:41:09 +0000 Message-ID: <87a5wcez7e.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.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: , 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=1688467344; a=rsa-sha256; cv=none; b=EZtobFFlj20F9KyYjFHj1urb3xRnJqokyrWPDWnWt2xJHMbxuWP42I/KuT6nW40zfulh79 OSmXCADpuXWibEcx+nakXom41DT2V94oFr6x7gMDJ60tvpASoo1qp6Yn+k7BtHDwqkBDl4 au9O/CNkzEKhwe6r+XovFtvRcTa7RuDZqlEYamCqs1YgQ8qKXwS+VOWRhiHWB72FpGKE+E yT7sliS23xPyM2UAww/VBI1sWOo7QnWXh0HoUgF+zphJ3qeljsyg/+OJ+zGyJf/wFK9YTT uHhDX4KrgaNFC7jgiPr1MAxFjPSPwXbKbkuQJJxIQrhOs+ii9eacnvltuGwcAQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=quYXI0uN; dmarc=pass (policy=none) header.from=posteo.net; 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=1688467344; 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=jGiXmrMPke+wj6zLIVglb79KhoFEREhyyMvYDyNJQQc=; b=Mh62iPSgGEsza8fBWSPW0vFTfBtEnN47KbbVVbx+1TKtMmDr6oI0Ho7UuakJ9viB5qPUSr KvDtkIXFR9e8FD50YjUmpGu3bXt4RHCq6TPOtSZJjNoKlxvCgKeKM54MZdm13481POqhkm S+Yb0t9Q8OJ2RxRXesuSSjvv+SmWKlyzxopaXm7hWpugNzNS5sh6l23dzkZx8AL6/W/gBE I1wMwiSYc0H/Y0glrlbYljEspi+SqUCVKvq/tr+V2ExfLk/I6gofVCwoy1bV3sgE6BujWY vQyYkho34/iW4ny+Wvx24M3ZrnOvyQjkGEpZm1POwNuag+oam5CdQENYMz8h4g== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=quYXI0uN; dmarc=pass (policy=none) header.from=posteo.net; 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: -11.54 X-Spam-Score: -11.54 X-Migadu-Queue-Id: 59FD36C0E X-TUID: SnGOgW6Jli6M --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable S=C3=A9bastien Miquel writes: > From 9d31a71bc0ab7cfd466ecad60037d00c62bdd9f6 Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?S=3DC3=3DA9bastien=3D20Miquel?=3D > Date: Tue, 27 Jun 2023 09:23:01 +0200 > Subject: [PATCH] org-src.el: Use native value of `indent-tabs-mode' for > indentation Thanks! This looks good and also fixes the original issue raised in this thread. May you now rebase the patch onto the latest main, add a Link: to this discussion to the commit message, and apply the attached extra comments? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=comments.diff diff --git a/lisp/org-src.el b/lisp/org-src.el index 20e0b598c..e1f7d50dc 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -479,6 +479,8 @@ (defun org-src--contents-for-write-back (write-back-buf) (buffer-substring eol (point-max)))))) (write-back org-src--allow-write-back) marker indent-str) + ;; Compute the exact sequence of tabs and spaces used to indent up + ;; to `indentation-offset' in the Org buffer. (setq indent-str (with-temp-buffer ;; Reproduce indentation parameters from org buffer. @@ -500,6 +502,9 @@ (defun org-src--contents-for-write-back (write-back-buf) ;; first line. (when preserve-fl (forward-line)) (while (not (eobp)) + ;; Keep empty src lines empty, even when src block is + ;; indented on Org side. + ;; See https://list.orgmode.org/725763.1632663635@apollo2.minshall.org/T/ (when (not (eolp)) (insert indent-str)) ; not an empty line (forward-line))) (set-marker marker nil)))) --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--