From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id iJVgHWS4xmIo3AAAbAwnHQ (envelope-from ) for ; Thu, 07 Jul 2022 12:41:40 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id oFQCHWS4xmLQRQAAauVa8A (envelope-from ) for ; Thu, 07 Jul 2022 12:41:40 +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 EDBD837D1D for ; Thu, 7 Jul 2022 12:41:39 +0200 (CEST) Received: from localhost ([::1]:52712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9Ox1-0004o0-1e for larch@yhetil.org; Thu, 07 Jul 2022 06:41:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9Ow1-0004mS-SZ for emacs-orgmode@gnu.org; Thu, 07 Jul 2022 06:40:37 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:42616) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o9Ow0-00089O-2e for emacs-orgmode@gnu.org; Thu, 07 Jul 2022 06:40:37 -0400 Received: by mail-pf1-x430.google.com with SMTP id d10so4747662pfd.9 for ; Thu, 07 Jul 2022 03:40:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=BizTfTXg7rTn0bQqPoLOtpbTUjCqvQewA0jq6LiNFQI=; b=h1Z/PHXFb8wTbcWMp+dWKffcDgKbLKL7ku/PVesZeM5SL3bNR+cQobI16Etz/iYvm1 VM6L2+2F1MBplTu2kPrUS3gaeBaqAYxjU3TzfBOY0Pj3s1Jbgvfz9SKFCyjmpYwCxD9R HRz2i9Fg1ISE2y2DxYSjFE90VloFQprsO8MOh17cqOa3prTvqAPm5LTjjwtxKge4PBAa 9vxuSiuOZGy8v7j6cahS7Lla0JldiJwqh9Z9KC5f8KtZDk0/L56PogDC/0RHsu3PfUg4 IocGWOBZ9s9vyotaGj/oZ4FI+EBWEphVAif78W+c7QknivyFh9+1LXgQFkYy6G8ku6Xw Q7Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=BizTfTXg7rTn0bQqPoLOtpbTUjCqvQewA0jq6LiNFQI=; b=H73NddmmXZJykk0dIuDBusP0PCfpgAGHV0wS4n5frNhk02ey1j0Yohmem6B8nHFmWn 9vYWLEt65kfcOWPGsp6uGIv5dkh5z4YN7wPDkUWsd6pqnEg01FBrfrI/RpLpW7PS2j6V cHF2Drv5S84Pg6+szZR+/G/OP0vgrnZKoq8wc1VWG8IJgSUaHMHZOzwj5Ju+aD29JRWO 9PJEvv0l5TpbMv0egD0Z6XfQG+m7k9BK9R1U+zrHVJ3/6FrDJzfV2hBYjLOoObnwMDLY S6riii7zLFAeW8t3JgV6S20+uN6jkERtHAzjyq71NcVaU4FlnDiGQJswyEpRC7lYvHXE yPYw== X-Gm-Message-State: AJIora+xEGc8RZCdUqY2qNWuOy6QCqmHc6lAwomvIKyqe+adqrnwGAa8 SmfiX7a7qcrCz9MoXclSQdLGKOZNgOGhQw== X-Google-Smtp-Source: AGRyM1t1wIu5xu5HdNWl9laKHoAxHATE2FMzbi1od1beLJKLWc87Y/8SZzjC3dgeOnvcNy7b8p5Ybg== X-Received: by 2002:a05:6a00:1990:b0:525:565d:8ce7 with SMTP id d16-20020a056a00199000b00525565d8ce7mr52928387pfl.82.1657190433781; Thu, 07 Jul 2022 03:40:33 -0700 (PDT) Received: from localhost ([209.95.60.151]) by smtp.gmail.com with ESMTPSA id u27-20020a62d45b000000b0050dc7628148sm26709335pfl.34.2022.07.07.03.40.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 03:40:33 -0700 (PDT) From: Ihor Radchenko To: Valentin Lab Cc: emacs-orgmode@gnu.org Subject: Re: [feature] Consistent fixed indentation of headline data In-Reply-To: <2fcae365-97cf-ccc4-23f0-2fc5c110dd69@kalysto.org> References: <2fcae365-97cf-ccc4-23f0-2fc5c110dd69@kalysto.org> Date: Thu, 07 Jul 2022 18:41:39 +0800 Message-ID: <87v8s9urvg.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=yantar92@gmail.com; helo=mail-pf1-x430.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1657190500; 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=BizTfTXg7rTn0bQqPoLOtpbTUjCqvQewA0jq6LiNFQI=; b=nt7B7CRS3Uvzs9J3ECh5Y5fdscuYD6Tfu7pimPgA58SSIpKKlld0kjJwgYwD6ZtksXuOqy jkMCHI/hbEQ0l5HKoF7d18wJGS66pNzyMWJ1mVWgVkn3jhqIK3Kz+Q0MNBcFMLFVgDfMSH 09eWn4tI3r2vtyxnuHyFlmfyKqcrxFWi+ghDQDIOAeBs3CIX/vtxoieL8nMjlg8jYpAKyD Sz7hB9fnYaVUnnvnd2A4zkOMQQPCButNysALCTG343RzSVBk7bpuFC2S8qFzAq8L398Ios EtjMaIvoiKToqNNrnZQ+r23UeOYA91xwrC2eIfznne7efJVIBfX4xxDSe1Zx/Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657190500; a=rsa-sha256; cv=none; b=EZ8a4fxXQetgL7uhYaGaia8OWlayvjBRaba208+X5EYdn++y0e95xdBeK3La6lYiP56QHG 6cDWMQUMqpAQgy5M85yPcbGB0cr5x92wS+W5tRUxKQ/ZBl/m/MiFnXhGvkIJ1d+EJRyuJd 23G6p+KsKG1rFRSR0eaVTF7ZlV5offZC39Ay7gPfVGjDr6lK+sAOo39AwVOidIdijdBNaf 57Tu0qGppM2s4MMXfphoKbqLwgR5bN+7BmXOunxC1AH9ZR4ObAH259+kZAShfwYkkaYspC KikrR4Lo7olODnuZfvWdwCV8A3seAYYomxPL5/rYjFkBcEnJiD7x0gDT6Ka4wA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="h1Z/PHXF"; dmarc=pass (policy=none) header.from=gmail.com; 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-Spam-Score: -8.45 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="h1Z/PHXF"; dmarc=pass (policy=none) header.from=gmail.com; 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-Queue-Id: EDBD837D1D X-Spam-Score: -8.45 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3t1RwtnVNxef Valentin Lab writes: > I'm using org-mode for a long time, and I never understood quite well > how headline data were supposed to be indented, however I was happy with > what emerged to me as the default of 2 spaces (with my emacs and > org-mode version at the time). I recently updated my old emacs to > =9.5.3=, and what I thought was a default indentation was removed. > > Suddenly, I had no indentation at all for these headline-data and this > bugged me. First of all, thanks for the patch! New contributions are always welcome. Note that we rarely change the defaults. This particular change came after extensive discussion: https://orgmode.org/list/878s4x3bwh.fsf@gnu.org Also, it has been documented in https://orgmode.org/Changes.html I recommend reviewing the changes every time you update Org to new version. > I went through documentation, and code, and (re-)discovered > `org-adapt-indentation' that was nil in my case and is intended to stay > this way as far as I am concerned : I'm looking for a fixed indentation > whatever the depth of my outlines. > > I'm far from sure it was a default one day, but sure it was at least > suggested/enforced in my workflow with my emacs at some time. And even > if it didn't feel like it was clad in iron, it seems I'm not the only > one who was using that as I can find some examples remaining in the > current 'testing/examples' org files. > > This indentation concerns only what is called "headline data" in the > documentation of `org-adapt-indentation'. To be precise: schedules > ("SCHEDULE:", "DEADLINE:"...), clock drawer (":LOGBOOK:..."), property > drawer (":PROPERTY:..."). These are "data" appearing after the headline > as I understand them. This sounds like a reasonable addition. > If I'm a user of org-mode, I'm fairly new in the emacs lisp and hacking > community and I need to know: > - if my proposal is useful and has any chance to be accepted, It looks useful for me. > - if there are any pitfalls I delved into in matter of coding, > conventions, ... I will provide some comments on the patch below. In general, the patch looks nice. Providing tests is especially welcome. > Subject: [PATCH] org-el: Add fixed indentation of headline data > > * lisp/org.el (org-headline-data-fixed-indent-level): Definition of > new customizable variable and doc. > (org-add-planning-info): When creating planning line, force a > `org-indent-line' to indent it correctly. > (org--get-expected-indentation): If variable > `org-headline-data-fixed-indent-level' is set and line is header, > inform `org-indent-line' to indent from specified amount. > (org-adapt-indentation): Update documentation to mention new > `org-headline-data-fixed-indent-level'. Note that introducing a new customization should be documented in etc/ORG-NEWS file and probably also in the manual (17.4.2 Hard indentation). Also, I am not sure if we really need a new custom variable. We already have many. What about simply allowing an integer value of org-adapt-indentation? > TINYCHANGE > > Signed-off-by: Valentin Lab Note that your patch is _not_ a tiny change (not <15 LOC). See https://orgmode.org/worg/org-contribute.html#first-patch and https://orgmode.org/worg/org-contribute.html#copyright Would you consider signing the copyright assignment papers with FSF? > @@ -18371,6 +18386,9 @@ ELEMENT." > ;; a footnote definition. > (org--get-expected-indentation > (org-element-property :parent previous) t)))))))))) > + ((and (not (eq org-headline-data-fixed-indent-level nil)) > + (memq type '(drawer property-drawer planning node-property clock))) > + org-headline-data-fixed-indent-level) > ;; Otherwise, move to the first non-blank line above. Why clock? It does not belong to property drawers. > @@ -1216,6 +1259,13 @@ > (org-test-with-temp-text "* H\n:PROPERTIES:\n:key:\n:END:" > (org-indent-region (point-min) (point-max)) > (buffer-string))))) > + ;; ;; Indent property drawers according to `org-adapt-indentation'. > + ;; (let ((org-adapt-indentation 'headline-data)) > + ;; (should > + ;; (equal "* H\n :PROPERTIES:\n :key:\n :END:\n\ncontent2" > + ;; (org-test-with-temp-text "* H\n:PROPERTIES:\n:key:\n:END:\n\ncontent" > + ;; (org-indent-region (point-min) (point-max)) > + ;; (buffer-string))))) This test is commented. Is it intentional? Best, Ihor