From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id EAEMButVqWXtPwEAe85BDQ:P1 (envelope-from ) for ; Thu, 18 Jan 2024 17:46:35 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id EAEMButVqWXtPwEAe85BDQ (envelope-from ) for ; Thu, 18 Jan 2024 17:46:35 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=OKMAS7HS; 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"; dmarc=pass (policy=none) header.from=posteo.eu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705596395; 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=/i7Rdi3HB8+SJFx/QCsF6mOZTg8uFJ7nr8ADjs/Lwis=; b=ia7xQm9IbkMlOSBvVmKaHr0d71wecktO7TWIDBuxYZAnKcR2dlOJTT5sfg7BVTBm3xYm2G poFRKcewudlwpPjT/fSmvOxmGzjM25Zi43hzQAo33kts8Z+qkf+P3K9TzFsqGJ7j0xFdQj TfXcVzyOFsYQIYufNUZ97yHc2Lvu3dWWJHtPTNydvMT/qDCur33qm5oNVXHnVt1KNK84Ph pYWg0PBdj/l9Gd84Te4RBvLPr5r1xw4sJZncroPnQqRA5eNMlaknHe7ILpmfDAwJt5ZgGv epRvlKbI2KVHGCwvs70VPPDoQ1nQRG8e160C5DnC6b8kNu0vTtr4pQraxxBY3A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=OKMAS7HS; 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"; dmarc=pass (policy=none) header.from=posteo.eu ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705596395; a=rsa-sha256; cv=none; b=I6eugEyqJaycwFzrk3TiNdD57Qk2ZCySnCw6y71l2nsSycD/nztZMFJ2w3mJSNhAiGK02p ZJ9kRpZswFSSuW+Ixlu9/SpOYz+V+jRDYoJYQbpfuqBjXi/vYms/oveEKQjxG9jInV6GdR c2AL/BAqkh/E6dkWUYHUeT4gVk86pflpriN7tsCiBX3DMCMfCuj0YCxa038ggqZiIgHcXL IzR7kdIc24sIL66RHGiwLjECVZzwkK5kGzPRzkIXJsWtwSdyT3I7JNiTGLr/W9cIhncAdj jjFhkZnmJoEAlae2G8+t/HAJBnPp3HioA2RR8inUUslVwzHnXt/baNDAED05rQ== 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 8A301474FD for ; Thu, 18 Jan 2024 17:46:34 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQVWJ-0000uO-8U; Thu, 18 Jan 2024 11:45:35 -0500 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 1rQVWG-0000u2-H6 for emacs-orgmode@gnu.org; Thu, 18 Jan 2024 11:45:32 -0500 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 1rQVWE-0006hx-AJ for emacs-orgmode@gnu.org; Thu, 18 Jan 2024 11:45:32 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 5ED4A240028 for ; Thu, 18 Jan 2024 17:45:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.eu; s=2017; t=1705596327; bh=gud3sVcaRqEPltVKOKFy0YP6FrkqIyuHtTPQ+2bxV7Y=; h=Message-ID:Date:MIME-Version:Reply-To:Subject:To:Cc:From: Content-Type:Content-Transfer-Encoding:From; b=OKMAS7HSii9aT1ZekMayb7YPLladYEze7aELsWtMVtP2xoyMAfOl5byO24e2nSNhY pl7uqDWZgOzUiSa3WmorWvNKtpgOcQTiimumXxtPN74daxD4iMR/BfS2QSWLT18wal avLLnHzJBLdPjMDhsmuR9QPg6SSB5Aayq4V98TSf2kYHt6sfc6fHc7QzToqywsZ1td RpaafLFK9DXZUsASlHVhBdljzVEd3AmG7+Ssv/JnWeSTvP/VcngRR8rOUbjUymdHNX ksr4jrr1IuHszfKvxXTJ5iLIfdKQ4IRELYd5MfPJGPd6jfriLZnQ1onJIlHWV+E4PY 0sdSijpPSG+7w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TG7sL5k4cz6tm8; Thu, 18 Jan 2024 17:45:26 +0100 (CET) Message-ID: Date: Thu, 18 Jan 2024 16:45:25 +0000 MIME-Version: 1.0 Subject: Re: [BUG] defaults make it hard to edit Elisp blocks in org buffers Content-Language: fr To: Ihor Radchenko Cc: emacs-orgmode@gnu.org References: <878r4makff.fsf@localhost> From: =?UTF-8?Q?S=C3=A9bastien_Miquel?= In-Reply-To: <878r4makff.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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -5.12 X-Migadu-Queue-Id: 8A301474FD X-Spam-Score: -5.12 X-Migadu-Scanner: mx11.migadu.com X-TUID: mkBNSc3jjmUy Ihor Radchenko writes: >> If I recall correctly, in order to fix this, in =org-indent-line=, >> before calling =TAB= in the native buffer, one should check the >> current line indentation and if it is less than =block-content-ind=, >> start by adding this much indentation to the current line. >> >> This could be a bit fragile, and in particular it assumes that the >> rest of the block has this =block-content-ind=, which might not be the >> case. One could possibly at least check that the first line of the >> block does have this much indentation. If it doesn't, just do >> whatever. > What about a simpler approach - indent the line at point to block's > expected indentation (if it is not yet there) and then rely upon the > code block's major mode to do the right thing? I cannot think of any common use where the two approches differ, and it is indeed simpler. The possibility that the block does not have the common indentation still stands. -- Sébastien Miquel