From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id CALVOYDcGmadBgAAqHPOHw:P1 (envelope-from ) for ; Sat, 13 Apr 2024 21:26:57 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id CALVOYDcGmadBgAAqHPOHw (envelope-from ) for ; Sat, 13 Apr 2024 21:26:57 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=ofTohujF; 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=1713036416; 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=y6v27LPcfaYTtsq7MorE2QoDuznJfecjCnyIH9nWJew=; b=GerqUvvn/AIIZkns1VwVg3zBszYAdl9kasZUVL2XeJdjmlOB0aXXpFoMFUXq9nCjrvJcFz H/gI8f+SZyMOsbg7cReP6hFz2h8jRDxe8SSqxVmUlTQz726NXdrmcGIESqcLqmZs2nCuBH Zr9TDjXbZoFSaiN+qft0XtzTgbi2VQaDcSVBx0soXq2zw80p8mluiM3qhM6rwQIUJVfBzr BBu3VYzGnVlxMCQTuG0y3qbjW8CXbNGpsG/mCvHO1LONkdNoz+vtM8ehDpUIG9cxxP9v/d 06tG9RqAoYvChXPE/t2VMvpDdKDpL0GGNFg5Wb0p5QsvBk2AyWKhpMWh4nYtuQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=ofTohujF; 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-Seal: i=1; s=key1; d=yhetil.org; t=1713036416; a=rsa-sha256; cv=none; b=n3OLC8MtAiNURkEK6H9Z1jGH7BcbHf29r8aAAYXBUuKD2w82mMMt//TXmFcpYorn+REfCv jxtpMl/4AdOXIcrIJT4NIqpRuTv2fDU/P1DelRXZupvDSXRgRVcT7rXpnWGkLPzmprHn/h o1HBq/FY0obnD6dgZCA5i/lAvqRTtKw0IDcwuJeSXJnpEADLRshHadIbTNTvEyjrD4l0s/ BO+cV5gF2GBv+spAfBav6xTaldGLkndpGVyuGf6W4cKYf57qQhL7gCG1NYRr0vIyehba+H 8Xues0zEm3CwzkVQcLYBOD2kMOZIedO/oE4ENsWxhFKF2dZ2Ds075qwwyYFWUQ== 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 79AF53C137 for ; Sat, 13 Apr 2024 21:26:56 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rvj0R-0002Pd-Ii; Sat, 13 Apr 2024 15:25:43 -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 1rvj0M-0002O8-TY for emacs-orgmode@gnu.org; Sat, 13 Apr 2024 15:25:38 -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 1rvj0K-00076T-Km for emacs-orgmode@gnu.org; Sat, 13 Apr 2024 15:25:38 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 4A541240101 for ; Sat, 13 Apr 2024 21:25:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1713036332; bh=CS7Vy37YYC03ag2IvzuZBNh35rBc4iBp7uQXCiHCWPA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=ofTohujFzjqhFcvqr4s2JXZMAYrZL1XFEMNaRs4ozRbFghVnNn9wu3XpTDFIby0GP gotik70hgByazqb+0dY3NVX/OCYY6XI+ljn2T1TsNugDvq4BR05Za5aKcek3z4ajLE isCcbYEysF8ICPvbQdvKNFETiPfFJYlukBhf5+h4gd9S2ZEOwhQU1CSbCjl/M0fpIL Un1gE/iilECIRUxFl229HvX2SA6OspG69HdX5UAGAnKoTONVl99cznkiiylLGe5z2j NQ7I4mZk+dHF7xn637gF4Dp5O63uk9WG8cf1UDM3Dw7UGQUhIEGoxLdmsnp0DfTQ2w f3sy1tXEZM91A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VH3LM0fgRz9rxM; Sat, 13 Apr 2024 21:25:31 +0200 (CEST) From: Ihor Radchenko To: Rohit Patnaik Cc: emacs-orgmode@gnu.org Subject: Re: How does =org-md-item= produce the correct indentation for nested lists? In-Reply-To: References: Date: Sat, 13 Apr 2024 19:26:00 +0000 Message-ID: <87a5lxyshj.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain 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_H4=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.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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -5.61 X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -5.61 X-Migadu-Queue-Id: 79AF53C137 X-TUID: H/DSGjVaoy2k "Rohit Patnaik" writes: > #+BEGIN_SRC elisp > (concat bullet > ... > (and contents > (org-trim (replace-regexp-in-string "^" " " contents)))) > #+END_SRC > > and I'm wondering why it's adding indentation in front of the bullet. Naively, I > would expect the result of this snippet, for an unordered list to be something > like: > > =- [item contents]= > > That is, it concatenate the bullet, then three spaces (4 - length of bullet), > then another four spaces, then the contents of the item. Instead, what I see is > a four-space indent, followed by the bullet and its padding, followed by the > item contents: > > = - [item contents]= > > This is the correct result, but I don't see how the code from ox-md.el produces > that result. The code makes use of the CONTENTS. If you have nested lists - item - sub-item - sub-sub-item "sub-sub-item" transcoder will receive CONTENTS="sub-sub-item" and return - sub-sub-item then, "sub-item" transcoder will receive CONTENTS="sub-item" + output of nested transcoder - CONTENTS= sub-item - sub-sub-item and add 4 spaces to each line, except first: - sub-item - sub-sub-item then, item transcoder will receive the result of the two nested transcoders: CONTENTS= item - sub-item - sub-sub-item yielding - item - sub-item - sub-sub-item Hope, it clarifies things. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at