From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gEWWDZTFo2BEJAAAgWs5BA (envelope-from ) for ; Tue, 18 May 2021 15:48:04 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id MP1TCZTFo2BZGAAAB5/wlQ (envelope-from ) for ; Tue, 18 May 2021 13:48:04 +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 73E2212F86 for ; Tue, 18 May 2021 15:48:03 +0200 (CEST) Received: from localhost ([::1]:50714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lj04n-0005bC-Nf for larch@yhetil.org; Tue, 18 May 2021 09:48:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lj00J-0003Uq-JF for emacs-orgmode@gnu.org; Tue, 18 May 2021 09:43:23 -0400 Received: from mout01.posteo.de ([185.67.36.65]:50993) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lj00G-0007f6-48 for emacs-orgmode@gnu.org; Tue, 18 May 2021 09:43:23 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 49215240027 for ; Tue, 18 May 2021 15:43:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.eu; s=2017; t=1621345397; bh=PZqClnYamC7hrvz6X2DUDu3ksakKoW0X3hNNnT6sB40=; h=Subject:To:Cc:From:Date:From; b=hn4n6nrYKD2JKyMcxiRwpYC42mvExzR5Cx2H92Y3st6fE63Ntchm4h4vEwP8Mea6B llx1p+KzCHUuuwuuCdjshlzQIX9CEuiUrDqwryimsO70PcomySqyH8XteS6DhS/rRX Y1J6JwL7abiabo5ebuG/u4ISlodv/pnQtUYUw3EGFBWcl7GZenDoozmkhYsIzluDeB UPbGM6aKzF48qLfvbhkQA+ocMuTxntErwVvaXaWIPbHCyfcopEzRc6Nc4cgvwvHg3D 8sr8vA0Ah+PH4l/Pr8qWj02rK1Mbf9JRzEJFXE8FQYRCMRwlNlMw5iSmQIcbiG4+A5 Kz+Ahh641+6mA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Fkxz85Tzmz6tmR; Tue, 18 May 2021 15:43:16 +0200 (CEST) Subject: Re: begin_src Indentation in org 9.4.4, 9.4.5 To: Bastien References: <5DCBAF63-0E88-44AC-B892-1260F37E7E00@manicmind.earth> <36FAF062-87B9-4023-B354-6358E42F87CB@manicmind.earth> <7EFD6F4A-1BCF-4576-B115-3FE42D9C2552@manicmind.earth> <87fsyyars4.fsf@localhost> <87zgwwfc7f.fsf@gnu.org> <6da18e3f-08a1-1ab6-93c7-6243c685a55f@posteo.eu> <87lf8ca6p4.fsf@bzg.fr> From: =?UTF-8?Q?S=c3=a9bastien_Miquel?= Message-ID: Date: Tue, 18 May 2021 13:43:16 +0000 MIME-Version: 1.0 In-Reply-To: <87lf8ca6p4.fsf@bzg.fr> Content-Type: multipart/mixed; boundary="------------33DFCFBAA5F5F68C5D894BBB" Content-Language: fr 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no 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: , Reply-To: sebastien.miquel@posteo.eu Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621345683; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=15hHgbSXhg92nW1sWjhufRdcYunKPm84XU02H4T6JQ0=; b=BauVhaqW8dGuQEbd8ezjZUbETJPGy2HVQjMf0Bbq99WFdxcuqFiC8hwUNINnO7BpRdKztg TIXXP1XWWu+xiJsqyX0zHTHbA+p9PAgc81bc3BjllNifdBeiNSc2BgY8R7Ax9VlXknMnHn cQLVcglCADYTrvba5xMu0exC4B8l2TS/tlUp91I7IYoBaZyxd6UHcdU1zOZgpbbTpDMoTB V2HsLACB7RABxBPv4Wl1dyDWtRAMX6lbXHjrPbn+Rj7ZE0tiXaWnkjUBFMxQLO9Crr96p1 WDdfSXDWGT0JTYWAmf7BDe1NdcgHIbHMAJFT4itz/jjDBvPvq1ohh/o+PGk5+Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621345683; a=rsa-sha256; cv=none; b=CHAPjJNrjKdfuNzu87f7bVkOAW0mckC5vABq5nkirBaeZCJtw3sH1CQCL0xNAPJpREC5zJ vXDtST9HZxC+iIGvCCjvt2tt2X55UGh4DInuU7yhdLcRZp57k4w5rIpKF0x3aGIi9TXKMg ePoqCE4LN1zMQnWncoP4M5WXZykRxunN+TUJIrq/eDqgMXetGzS9BVRvt81RGmIhdmH45v dFam6N6MDKVQEc4rLERfvqxfpJKXUZgVLzzeQR61a2PUc9krN/nnFrTByt/4RunkQsR9I9 15kQ380DiR56YjJsvxAI7UL5NokawRXcWsY/oPMWLSUaKQX2dmGa9wrXYGwF7A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=hn4n6nrY; dmarc=pass (policy=none) header.from=posteo.eu; 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-Migadu-Spam-Score: -3.14 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=hn4n6nrY; dmarc=pass (policy=none) header.from=posteo.eu; 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-Migadu-Queue-Id: 73E2212F86 X-Spam-Score: -3.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: NxCuIDaDNUdy This is a multi-part message in MIME format. --------------33DFCFBAA5F5F68C5D894BBB Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi Bastien, Bastien writes: > Before I revert the commit and try your suggestion, can you share a > patch that add both changes (the revert and your fix) manually so I > can test it? If this fixes the original issue while preserving > electric indentation, I'm okay with it. Here's such a patch. > Also, do you want to become the maintainer for org-src.el? We need > more people taking charge of specific areas in Org's code. I do intend to keep monitoring this list and help around for the foreseeable future, and I would certainly agree to whatever sort of maintainer position eventually, but I hold no particular interest (or deep understanding) in this specific file. Regards, -- Sébastien Miquel --------------33DFCFBAA5F5F68C5D894BBB Content-Type: text/x-patch; charset=UTF-8; name="0001-org.el-org-src-contents-for-write-back-Indent-blank-.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-org.el-org-src-contents-for-write-back-Indent-blank-.pa"; filename*1="tch" >From 1be7fa790e68d1fc2d198eee81c0d3bb72156d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= Date: Tue, 18 May 2021 14:39:33 +0200 Subject: [PATCH] org.el (org-src--contents-for-write-back): Indent blank lines * lisp/org.el (org-src--contents-for-write-back): Indent blank lines. * lisp/org-src.el (org-return): Revert part of commit bfda3cc7df. --- lisp/org-src.el | 9 ++++----- lisp/org.el | 6 +----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lisp/org-src.el b/lisp/org-src.el index 5604e6568..79f002e56 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -453,15 +453,14 @@ Assume point is in the corresponding edit buffer." (insert (org-no-properties contents)) (goto-char (point-min)) (when (functionp write-back) (save-excursion (funcall write-back))) - ;; Add INDENTATION-OFFSET to every non-empty line in buffer, + ;; Add INDENTATION-OFFSET to every line in buffer, ;; unless indentation is meant to be preserved. (when (> indentation-offset 0) (while (not (eobp)) (skip-chars-forward " \t") - (unless (eolp) ;ignore blank lines - (let ((i (current-column))) - (delete-region (line-beginning-position) (point)) - (indent-to (+ i indentation-offset)))) + (let ((i (current-column))) + (delete-region (line-beginning-position) (point)) + (indent-to (+ i indentation-offset))) (forward-line)))))) (defun org-src--edit-element diff --git a/lisp/org.el b/lisp/org.el index ae09f3e99..0add9bc2e 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -18018,10 +18018,6 @@ object (e.g., within a comment). In these case, you need to use (delete-and-extract-region (point) (line-end-position)))) (org--newline indent arg interactive) (save-excursion (insert trailing-data)))) - ;; FIXME: In a source block, don't try to indent as it may result - ;; in weird results due to `electric-indent-mode' being `t'. - ((eq element-type 'src-block) - (org--newline nil nil nil)) (t ;; Do not auto-fill when point is in an Org property drawer. (let ((auto-fill-function (and (not (org-at-property-p)) @@ -19167,7 +19163,7 @@ Also align node properties according to `org-property-format'." (line-beginning-position 2)))) nil) ((and (eq type 'src-block) - org-src-tab-acts-natively + org-src-tab-acts-natively (> (line-beginning-position) (org-element-property :post-affiliated element)) (< (line-beginning-position) -- 2.31.1 --------------33DFCFBAA5F5F68C5D894BBB--