From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 4IWHMGM9uF4LLgAA0tVLHw (envelope-from ) for ; Sun, 10 May 2020 17:44:03 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id wL1kGXE9uF5LMgAAbx9fmQ (envelope-from ) for ; Sun, 10 May 2020 17:44:17 +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 E955F940C62 for ; Sun, 10 May 2020 17:44:14 +0000 (UTC) Received: from localhost ([::1]:47890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXpzr-0005Pn-Lu for larch@yhetil.org; Sun, 10 May 2020 13:44:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXpyI-0004HJ-71 for emacs-orgmode@gnu.org; Sun, 10 May 2020 13:42:38 -0400 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]:38288) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXpyF-0007Dm-VC for emacs-orgmode@gnu.org; Sun, 10 May 2020 13:42:37 -0400 Received: by mail-lj1-x243.google.com with SMTP id e25so6997475ljg.5 for ; Sun, 10 May 2020 10:42:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=7IXuTHDRGXO4LhCW4f259XrlkuDBB+thSZe+cWF42Mw=; b=GXTtrbS4tG3e4aWywtUQDyiIQiAkzIPyuDyEjRsSUIxlb8TNVb/2KIahDttl00SkYL mx03bVLrN8z1UCh982EMR0LQly6xNV5tCInWUBc0ImqU+j+MP1aKB/JJ3iasDuT/1/Io CB290iQK0gxVf9UcbAT/SE/B5AJTNpzT/QNiRXnOdIODHURZ2GpBrVSr60dLsaQskyIt uPenzFijxJ9KtDP6z4f7ulOsOhfdkaUiKV4QwNoDGw+sBfArC1XoYhohfm0q9B0LwrsZ E3Qwd8Xi4KXp5Cy2Q3abuRzEoDEyO+VNbpK1Nk0xO2N779BBdgDv0FwT2Ax8wDD0Kb7I 4Y1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=7IXuTHDRGXO4LhCW4f259XrlkuDBB+thSZe+cWF42Mw=; b=D8P1aWi6TB8dnpIMpZbvsgmo2ZZTXDwWzsDcRZgGhEIZQwFjOoaq8t1Bcow3AgCEbH bFyiIbJVEl3sFiJE5ccz7EyRtKya5oH07wj22EaG0dbR0w1ubSYfJ96iq6UKxyxB8O6g ARM/2wBOPu9w57/4X2FA3yukP2VqVt2GnSuP8cT8TtUGj9xVdeiP6s2b+n/enclvCZOX ICba6tuNCKS3KeOLSzzevw6OzBuVZChtnPzSEr/UTsrXrB9Xur8LrwQTtoIqW7OAx/W4 J3itS3sVQWi5a3rQFlTHQCPWWD5FGNUOuvLpD/+1qpbfYhTvNfpxmjnBoguro8bnJaAk Yu8A== X-Gm-Message-State: AOAM532w/GoOb+k3yqH1WHlMi76M7gJ7EnmBXE0MFXC6WbDHGGpXEVki UhvxkxLiuZML2UjJQ/q7OgZYeNgI X-Google-Smtp-Source: ABdhPJxoe1HWkE/IEvPTJ4j5qBw5urMlnxthYvB3Mb+2XIxq58Z4yKIbBKlkRVeo3/saECEfbCzSTg== X-Received: by 2002:a2e:87d0:: with SMTP id v16mr7403963ljj.137.1589132553401; Sun, 10 May 2020 10:42:33 -0700 (PDT) Received: from [192.168.2.37] ([62.74.88.104]) by smtp.gmail.com with ESMTPSA id d19sm7821863lfj.8.2020.05.10.10.42.32 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 May 2020 10:42:32 -0700 (PDT) To: emacs-orgmode@gnu.org From: Panagiotis Vlantis Subject: Customizable fixed indentation column Message-ID: <67935568-9ced-d320-5c68-01f6e8298e48@gmail.com> Date: Sun, 10 May 2020 20:42:30 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::243; envelope-from=panagiotis.vlantis.mc@gmail.com; helo=mail-lj1-x243.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 X-Spam-Score: -1.71 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=GXTtrbS4; dmarc=pass (policy=none) header.from=gmail.com; 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-Scan-Result: default: False [-1.71 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.53898292187374]; DWL_DNSWL_FAIL(0.00)[gmail.com:server fail,209.51.188.17:server fail]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.08), country: US(-0.00), ip: 209.51.188.17(-0.54)]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[62.74.88.104:received]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_COUNT_FIVE(0.00)[6]; FROM_HAS_DN(0.00)[]; FROM_NEQ_ENVFROM(0.00)[panagiotisvlantismc@gmail.com,emacs-orgmode-bounces@gnu.org]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[emacs-orgmode@gnu.org]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; DNSWL_BLOCKED(0.00)[209.51.188.17:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.51.188.17:from]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: hRdj2fMRksWW Hello to all, This is my first time using the mailing list so please point out if I am going about this the wrong way. After searching a bit, I didn't find a way to specify a custom fixed indentation column in org sections; the current implementation automatically aligns content at the beginning of the line when `org-adapt-indentation' is set to nil, which I find somewhat restrictive (e.g., in this case, one should be careful when using lists beginning with '*' characters). To that end, I modified the current implementation accordingly (and added some tests) in order to allow one to set the desired indentation column to something other than the 0th, where section contents will be aligned at if adaptive indentation is disabled. I don't know if others will find this feature useful but I'll go and include the patch here anyway. If you find this worth merging but should be modified somehow before that, I would be happy to do so. Best regards, Panagiotis From 9b24257aeb11fa6f1d00eae0ac48fe0f92ca2dad Mon Sep 17 00:00:00 2001 From: Panagiotis Vlantis Date: Sun, 10 May 2020 18:09:00 +0300 Subject: [PATCH] org: Enable selection of custom indentation column * lisp/org.el (org--get-expected-indentation): Return value of `org-fixed-indentation' when `org-adapt-indentation' is nil. (org-add-planning-info): Properly indent newly added planning info. (org-fixed-indentation): Introduce customizable variable for preferred fixed indentation column. * testing/lisp/test-org.el (test-org/get-property-block, test-org/insert-property-drawer, test-org/indent-line, test-org/indent-region, test-org/add-planning-info, test-org/deadline, test-org/schedule, test-org/set-property): Modify tests depending on indentation and add more tests. Introduce variable and modify indentation mechanism accordingly in order to allow the user to specify a custom indentation column (other than zero) to be used when adaptive indentation is disabled. TINYCHANGE ---  lisp/org.el              |  18 ++-  testing/lisp/test-org.el | 293 ++++++++++++++++++++++++++++++++++++---  2 files changed, 290 insertions(+), 21 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 9b9b4376b..d87d449f7 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10639,8 +10639,9 @@ WHAT entry will also be removed."      (what       (end-of-line)       (insert "\n") -     (when org-adapt-indentation -       (indent-to-column (1+ (org-outline-level))))) +     (indent-to-column (if org-adapt-indentation +                      (1+ (org-outline-level)) +                    (max org-fixed-indentation 0))))      (t nil)))       (when what         ;; Insert planning keyword. @@ -18720,6 +18721,16 @@ hierarchy of headlines by UP levels before marking the subtree."  ;;; Indentation +(defcustom org-fixed-indentation 0 +  "Preferred indentation column when adaptive indentation is disabled. + +When `org-adapt-indentation' is nil, the contents of sections +shall be indented to the column specified by this variable, +independently of the the corresponding section's level." +  :group 'org-edit-structure +  :type 'integer +  :safe #'integerp) +  (defvar org-element-greater-elements)  (defun org--get-expected-indentation (element contentsp)    "Expected indentation column for current line, according to ELEMENT. @@ -18735,7 +18746,8 @@ ELEMENT."         (cl-case type       ((diary-sexp footnote-definition) 0)       ((headline inlinetask nil) -      (if (not org-adapt-indentation) 0 +      (if (not org-adapt-indentation) +          (if (org-current-level) (max org-fixed-indentation 0) 0)          (let ((level (org-current-level)))            (if level (1+ level) 0))))       ((item plain-list) (org-list-item-body-column post-affiliated)) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index a0f505cbc..baaf6d800 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -452,7 +452,15 @@    (should     (equal "* H\n:PROPERTIES:\n:END:\n"        (org-test-with-temp-text "* H" -        (let ((org-adapt-indentation nil)) +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0)) +          (org-get-property-block nil 'force)) +        (buffer-string)))) +  (should +   (equal "* H\n     :PROPERTIES:\n     :END:\n" +      (org-test-with-temp-text "* H" +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 5))            (org-get-property-block nil 'force))          (buffer-string))))    (should @@ -473,7 +481,16 @@    (should     (equal ":PROPERTIES:\n:END:\n"        (org-test-with-temp-text "" -        (let ((org-adapt-indentation nil)) (org-insert-property-drawer)) +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0)) +          (org-insert-property-drawer)) +        (buffer-string)))) +  (should +   (equal ":PROPERTIES:\n:END:\n" +      (org-test-with-temp-text "" +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 5)) +          (org-insert-property-drawer))          (buffer-string))))    ;; Insert drawer in document header with existing comment and    ;; keyword. @@ -504,13 +521,24 @@    (should     (equal "* H\n:PROPERTIES:\n:END:\nParagraph"        (org-test-with-temp-text "* H\nParagraph" -        (let ((org-adapt-indentation nil)) (org-insert-property-drawer)) +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0)) +          (org-insert-property-drawer)) +        (buffer-string)))) +  (should +   (equal "* H\n     :PROPERTIES:\n     :END:\nParagraph" +      (org-test-with-temp-text "* H\nParagraph" +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 5)) +          (org-insert-property-drawer))          (buffer-string))))    (should     (equal "* H\nDEADLINE: <2014-03-04 tue.>\n:PROPERTIES:\n:END:\nParagraph"        (org-test-with-temp-text            "* H\nDEADLINE: <2014-03-04 tue.>\nParagraph" -        (let ((org-adapt-indentation nil)) (org-insert-property-drawer)) +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0)) +          (org-insert-property-drawer))          (buffer-string))))    ;; Indent inserted drawer.    (should @@ -522,7 +550,16 @@    (should     (equal "* H\n:PROPERTIES:\n:END:\n"        (org-test-with-temp-text "* H" -        (let ((org-adapt-indentation nil)) (org-insert-property-drawer)) +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0)) +          (org-insert-property-drawer)) +        (buffer-string)))) +  (should +   (equal "* H\n     :PROPERTIES:\n     :END:\n" +      (org-test-with-temp-text "* H" +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 5)) +          (org-insert-property-drawer))          (buffer-string))))    ;; Skip inlinetasks before point.    (when (featurep 'org-inlinetask) @@ -531,6 +568,7 @@          (org-test-with-temp-text          "* H\n*************** I\n*************** END\nP"            (let ((org-adapt-indentation nil) +            (org-fixed-indentation 0)              (org-inlinetask-min-level 15))          (org-insert-property-drawer))            (buffer-string))))) @@ -541,6 +579,7 @@          (org-test-with-temp-text          "* H\n*************** I\nP\n*************** END"            (let ((org-adapt-indentation nil) +            (org-fixed-indentation 0)              (org-inlinetask-min-level 15))          (org-insert-property-drawer))            (buffer-string)))))) @@ -850,7 +889,16 @@    (should     (zerop      (org-test-with-temp-text "* H\nA" -      (let ((org-adapt-indentation nil)) (org-indent-line)) +      (let ((org-adapt-indentation nil) +        (org-fixed-indentation 0)) +    (org-indent-line)) +      (org-get-indentation)))) +  (should +   (= 5 +    (org-test-with-temp-text "* H\nA" +      (let ((org-adapt-indentation nil) +        (org-fixed-indentation 5)) +    (org-indent-line))        (org-get-indentation))))    ;; Indenting preserves point position.    (should @@ -1083,14 +1131,32 @@     (equal "* H\n:PROPERTIES:\n:key:      value\n:END:"        (org-test-with-temp-text "* H\n:PROPERTIES:\n:key: value\n:END:"          (let ((org-property-format "%-10s %s") -          (org-adapt-indentation nil)) +          (org-adapt-indentation nil) +          (org-fixed-indentation 0)) +          (org-indent-region (point) (point-max))) +        (buffer-string)))) +  (should +   (equal "* H\n  :PROPERTIES:\n  :key:      value\n  :END:" +      (org-test-with-temp-text "* H\n:PROPERTIES:\n:key: value\n:END:" +        (let ((org-property-format "%-10s %s") +          (org-adapt-indentation nil) +          (org-fixed-indentation 2))            (org-indent-region (point) (point-max)))          (buffer-string))))    (should     (equal "* H\n:PROPERTIES:\n:key:\n:END:"        (org-test-with-temp-text "* H\n:PROPERTIES:\n:key:\n:END:"          (let ((org-property-format "%-10s %s") -          (org-adapt-indentation nil)) +          (org-adapt-indentation nil) +          (org-fixed-indentation 0)) +          (org-indent-region (point) (point-max))) +        (buffer-string)))) +  (should +   (equal "* H\n     :PROPERTIES:\n     :key:\n     :END:" +      (org-test-with-temp-text "* H\n:PROPERTIES:\n:key:\n:END:" +        (let ((org-property-format "%-10s %s") +          (org-adapt-indentation nil) +          (org-fixed-indentation 5))            (org-indent-region (point) (point-max)))          (buffer-string))))    ;; Indent plain lists. @@ -4647,11 +4713,24 @@ Text.          (replace-regexp-in-string           "\\( [.A-Za-z]+\\)>" "" (buffer-string)           nil nil 1)))) -  ;; Create deadline when `org-adapt-indentation' is nil. +  ;; Create deadline when `org-adapt-indentation' is nil and +  ;; `org-fixed-indentation' is 0.    (should     (equal "* H\nDEADLINE: <2015-06-25>\nParagraph"        (org-test-with-temp-text "* H\nParagraph" -        (let ((org-adapt-indentation nil)) +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0)) +          (org-add-planning-info 'deadline "<2015-06-25 Thu>")) +        (replace-regexp-in-string +         "\\( [.A-Za-z]+\\)>" "" (buffer-string) +         nil nil 1)))) +  ;; Create deadline when `org-adapt-indentation' is nil and +  ;; `org-fixed-indentation' is 5. +  (should +   (equal "* H\n     DEADLINE: <2015-06-25>\nParagraph" +      (org-test-with-temp-text "* H\nParagraph" +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 5))            (org-add-planning-info 'deadline "<2015-06-25 Thu>"))          (replace-regexp-in-string           "\\( [.A-Za-z]+\\)>" "" (buffer-string) @@ -4668,14 +4747,31 @@ Paragraph"          (replace-regexp-in-string           "\\( [.A-Za-z]+\\)>" "" (buffer-string)           nil nil 1)))) -  ;; Update deadline when `org-adapt-indentation' is nil. +  ;; Update deadline when `org-adapt-indentation' is nil and +  ;; `org-fixed-indentation' is 0. +  (should +   (equal "* H\nDEADLINE: <2015-06-25>\nParagraph" +      (org-test-with-temp-text "\ +* H +DEADLINE: <2015-06-24 Wed> +Paragraph" +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0)) +          (org-add-planning-info 'deadline "<2015-06-25 Thu>")) +        (replace-regexp-in-string +         "\\( [.A-Za-z]+\\)>" "" (buffer-string) +         nil nil 1)))) +  ;; Update deadline when `org-adapt-indentation' is nil and +  ;; `org-fixed-indentation' is 5. +  ;; (current mechanism respects existing indentation).    (should     (equal "* H\nDEADLINE: <2015-06-25>\nParagraph"        (org-test-with-temp-text "\  * H  DEADLINE: <2015-06-24 Wed>  Paragraph" -        (let ((org-adapt-indentation nil)) +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 5))            (org-add-planning-info 'deadline "<2015-06-25 Thu>"))          (replace-regexp-in-string           "\\( [.A-Za-z]+\\)>" "" (buffer-string) @@ -4689,11 +4785,24 @@ Paragraph"          (replace-regexp-in-string           "\\( [.A-Za-z]+\\)>" "" (buffer-string)           nil nil 1)))) -  ;; Schedule when `org-adapt-indentation' is nil. +  ;; Schedule when `org-adapt-indentation' is nil and +  ;; `org-fixed-indentation' is 0.    (should     (equal "* H\nSCHEDULED: <2015-06-25>\nParagraph"        (org-test-with-temp-text "* H\nParagraph" -        (let ((org-adapt-indentation nil)) +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0)) +          (org-add-planning-info 'scheduled "<2015-06-25 Thu>")) +        (replace-regexp-in-string +         "\\( [.A-Za-z]+\\)>" "" (buffer-string) +         nil nil 1)))) +  ;; Schedule when `org-adapt-indentation' is nil and +  ;; `org-fixed-indentation' is 5. +  (should +   (equal "* H\n     SCHEDULED: <2015-06-25>\nParagraph" +      (org-test-with-temp-text "* H\nParagraph" +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 5))            (org-add-planning-info 'scheduled "<2015-06-25 Thu>"))          (replace-regexp-in-string           "\\( [.A-Za-z]+\\)>" "" (buffer-string) @@ -4767,14 +4876,43 @@ Paragraph"          (replace-regexp-in-string           "\\( [.A-Za-z]+\\)>" "" (buffer-string)           nil nil 1)))) -  ;; Remove closed when `org-adapt-indentation' is nil. +  ;; Remove closed when `org-adapt-indentation' is nil and +  ;; `org-fixed-indentation' is 0. +  (should +   (equal "* H\nDEADLINE: <2015-06-25>\nParagraph" +      (org-test-with-temp-text "\ +* H +CLOSED: [2015-06-25 Thu] DEADLINE: <2015-06-25 Thu> +Paragraph" +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0)) +          (org-add-planning-info nil nil 'closed)) +        (replace-regexp-in-string +         "\\( [.A-Za-z]+\\)>" "" (buffer-string) +         nil nil 1)))) +  (should +   (equal "* H\nParagraph" +      (org-test-with-temp-text "\ +* H +  CLOSED: [2015-06-25 Thu] +Paragraph" +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0)) +          (org-add-planning-info nil nil 'closed)) +        (replace-regexp-in-string +         "\\( [.A-Za-z]+\\)>" "" (buffer-string) +         nil nil 1)))) +  ;; Remove closed when `org-adapt-indentation' is nil and +  ;; `org-fixed-indentation' is 5 +  ;; (current mechanism respects existing indentation).    (should     (equal "* H\nDEADLINE: <2015-06-25>\nParagraph"        (org-test-with-temp-text "\  * H  CLOSED: [2015-06-25 Thu] DEADLINE: <2015-06-25 Thu>  Paragraph" -        (let ((org-adapt-indentation nil)) +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 5))            (org-add-planning-info nil nil 'closed))          (replace-regexp-in-string           "\\( [.A-Za-z]+\\)>" "" (buffer-string) @@ -4785,7 +4923,8 @@ Paragraph"  * H    CLOSED: [2015-06-25 Thu]  Paragraph" -        (let ((org-adapt-indentation nil)) +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 5))            (org-add-planning-info nil nil 'closed))          (replace-regexp-in-string           "\\( [.A-Za-z]+\\)>" "" (buffer-string) @@ -4824,6 +4963,17 @@ Paragraph"     (equal "* H\nDEADLINE: <2012-03-29>"        (org-test-with-temp-text "* H"          (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0) +          (org-last-inserted-timestamp nil)) +          (org-deadline nil "<2012-03-29 Tue>")) +        (replace-regexp-in-string +         "\\( [.A-Za-z]+\\)>" "" (buffer-string) +         nil nil 1)))) +  (should +   (equal "* H\n     DEADLINE: <2012-03-29>" +      (org-test-with-temp-text "* H" +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 5)            (org-last-inserted-timestamp nil))            (org-deadline nil "<2012-03-29 Tue>"))          (replace-regexp-in-string @@ -4844,6 +4994,17 @@ Paragraph"        (org-test-at-time "2014-03-04"          (org-test-with-temp-text "* H"            (let ((org-adapt-indentation nil) +            (org-fixed-indentation 0) +            (org-last-inserted-timestamp nil)) +        (org-deadline nil "+1y")) +          (replace-regexp-in-string +           "\\( [.A-Za-z]+\\)>" "" (buffer-string) nil nil 1))))) +  (should +   (equal "* H\n     DEADLINE: <2015-03-04>" +      (org-test-at-time "2014-03-04" +        (org-test-with-temp-text "* H" +          (let ((org-adapt-indentation nil) +            (org-fixed-indentation 5)              (org-last-inserted-timestamp nil))          (org-deadline nil "+1y"))            (replace-regexp-in-string @@ -4853,6 +5014,16 @@ Paragraph"     (equal "* H\nDEADLINE: <2012-03-29 +2y>"        (org-test-with-temp-text "* H"          (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0) +          (org-last-inserted-timestamp nil)) +          (org-deadline nil "<2012-03-29 Tue +2y>")) +        (replace-regexp-in-string +         "\\( [.A-Za-z]+\\) " "" (buffer-string) nil nil 1)))) +  (should +   (equal "* H\n     DEADLINE: <2012-03-29 +2y>" +      (org-test-with-temp-text "* H" +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 5)            (org-last-inserted-timestamp nil))            (org-deadline nil "<2012-03-29 Tue +2y>"))          (replace-regexp-in-string @@ -4910,6 +5081,7 @@ Paragraph"     (equal "* H1\nDEADLINE: <2012-03-29>\n* H2\nDEADLINE: <2012-03-29>"        (org-test-with-temp-text "* H1\n* H2"          (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0)            (org-last-inserted-timestamp nil)            (org-loop-over-headlines-in-active-region t))            (transient-mark-mode 1) @@ -4922,6 +5094,7 @@ Paragraph"     (equal "* H1\nDEADLINE: <2012-03-29>\n* H2\nDEADLINE: <2012-03-29>"        (org-test-with-temp-text "* H1\n* H2"          (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0)            (org-last-inserted-timestamp nil)            (org-loop-over-headlines-in-active-region nil))            (transient-mark-mode 1) @@ -4938,15 +5111,37 @@ Paragraph"     (equal "* H\nSCHEDULED: <2012-03-29>"        (org-test-with-temp-text "* H"          (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0)            (org-last-inserted-timestamp nil))            (org-schedule nil "<2012-03-29 Tue>"))          (replace-regexp-in-string           "\\( [.A-Za-z]+\\)>" "" (buffer-string)           nil nil 1)))) +  (should +   (equal "* H\n     SCHEDULED: <2012-03-29>" +      (org-test-with-temp-text "* H" +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 5) +          (org-last-inserted-timestamp nil)) +          (org-schedule nil "<2012-03-29 Tue>")) +        (replace-regexp-in-string +         "\\( [.A-Za-z]+\\)>" "" (buffer-string) +         nil nil 1)))) +  (should +   (equal "* H\nSCHEDULED: <2014-03-04>" +      (org-test-with-temp-text "* H\nSCHEDULED: <2012-03-29>" +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0) +          (org-last-inserted-timestamp nil)) +          (org-schedule nil "<2014-03-04 Thu>")) +        (replace-regexp-in-string +         "\\( [.A-Za-z]+\\)>" "" (buffer-string) +         nil nil 1))))    (should     (equal "* H\nSCHEDULED: <2014-03-04>"        (org-test-with-temp-text "* H\nSCHEDULED: <2012-03-29>"          (let ((org-adapt-indentation nil) +          (org-fixed-indentation 5)            (org-last-inserted-timestamp nil))            (org-schedule nil "<2014-03-04 Thu>"))          (replace-regexp-in-string @@ -4958,6 +5153,7 @@ Paragraph"        (org-test-at-time "2014-03-04"          (org-test-with-temp-text "* H"            (let ((org-adapt-indentation nil) +            (org-fixed-indentation 0)              (org-last-inserted-timestamp nil))          (org-schedule nil "+1y"))            (replace-regexp-in-string @@ -4967,6 +5163,7 @@ Paragraph"     (equal "* H\nSCHEDULED: <2012-03-29 +2y>"        (org-test-with-temp-text "* H"          (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0)            (org-last-inserted-timestamp nil))            (org-schedule nil "<2012-03-29 Tue +2y>"))          (replace-regexp-in-string @@ -4976,6 +5173,16 @@ Paragraph"     (equal "* H\nSCHEDULED: <2012-03-29>"        (org-test-with-temp-text "* H\nCLOSED: [2017-01-25 Wed]"          (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0) +          (org-last-inserted-timestamp nil)) +          (org-schedule nil "<2012-03-29 Tue>")) +        (replace-regexp-in-string +         "\\( [.A-Za-z]+\\)>" "" (buffer-string) nil nil 1)))) +  (should +   (equal "* H\nSCHEDULED: <2012-03-29>" +      (org-test-with-temp-text "* H\nCLOSED: [2017-01-25 Wed]" +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 5)            (org-last-inserted-timestamp nil))            (org-schedule nil "<2012-03-29 Tue>"))          (replace-regexp-in-string @@ -4985,6 +5192,7 @@ Paragraph"     (equal "* H\n"        (org-test-with-temp-text "* H\nSCHEDULED: <2012-03-29>"          (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0)            (org-last-inserted-timestamp nil))            (org-schedule '(4)))          (buffer-string)))) @@ -4992,6 +5200,7 @@ Paragraph"     (equal "* H"        (org-test-with-temp-text "* H"          (let ((org-adapt-indentation nil) +          (org-fixed-indentation)            (org-last-inserted-timestamp nil))            (org-schedule '(4)))          (buffer-string)))) @@ -5004,6 +5213,7 @@ Paragraph"                    (org-parse-time-string "2014-03-04")))))          (org-test-with-temp-text "* H\nSCHEDULED: <2012-03-29>"            (let ((org-adapt-indentation nil) +            (org-fixed-indentation 0)              (org-last-inserted-timestamp nil))          (org-schedule '(16)))            (buffer-string))))) @@ -5014,6 +5224,7 @@ Paragraph"                 (org-parse-time-string "2014-03-04")))))       (org-test-with-temp-text "* H"         (let ((org-adapt-indentation nil) +         (org-fixed-indentation 0)           (org-last-inserted-timestamp nil))       (org-schedule '(16)))         (buffer-string)))) @@ -5024,6 +5235,20 @@ Paragraph"     (equal "* H1\nSCHEDULED: <2012-03-29>\n* H2\nSCHEDULED: <2012-03-29>"        (org-test-with-temp-text "* H1\n* H2"          (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0) +          (org-last-inserted-timestamp nil) +          (org-loop-over-headlines-in-active-region t)) +          (transient-mark-mode 1) +          (push-mark (point) t t) +          (goto-char (point-max)) +          (org-schedule nil "2012-03-29")) +        (replace-regexp-in-string +         "\\( [.A-Za-z]+\\)>" "" (buffer-string) nil nil 1)))) +  (should +   (equal "* H1\n     SCHEDULED: <2012-03-29>\n* H2\n SCHEDULED: <2012-03-29>" +      (org-test-with-temp-text "* H1\n* H2" +        (let ((org-adapt-indentation nil) +          (org-fixed-indentation 5)            (org-last-inserted-timestamp nil)            (org-loop-over-headlines-in-active-region t))            (transient-mark-mode 1) @@ -5036,6 +5261,7 @@ Paragraph"     (equal "* H1\nSCHEDULED: <2012-03-29>\n* H2\nSCHEDULED: <2012-03-29>"        (org-test-with-temp-text "* H1\n* H2"          (let ((org-adapt-indentation nil) +          (org-fixed-indentation 0)            (org-last-inserted-timestamp nil)            (org-loop-over-headlines-in-active-region nil))            (transient-mark-mode 1) @@ -5050,6 +5276,7 @@ Paragraph"      "\\* H\nSCHEDULED: <2017-02-01 [.A-Za-z]* \\+\\+7d>\n"      (org-test-with-temp-text "* H\nSCHEDULED: <2017-01-19 ++7d>\n"                   (let ((org-adapt-indentation nil) +                   (org-fixed-indentation 0)                     (org-last-inserted-timestamp nil))                     (org-schedule nil "2017-02-01"))                   (buffer-string))))) @@ -5144,7 +5371,27 @@ Paragraph"     (equal      ":PROPERTIES:\n:TEST: t\n:END:\n"      (org-test-with-temp-text "" -      (let ((org-property-format "%s %s")) +      (let ((org-property-format "%s %s") +        (org-adapt-indentation t) +        (org-fixed-indentation 5)) +    (org-set-property "TEST" "t")) +      (buffer-string)))) +  (should +   (equal +    ":PROPERTIES:\n:TEST: t\n:END:\n" +    (org-test-with-temp-text "" +      (let ((org-property-format "%s %s") +        (org-adapt-indentation nil) +        (org-fixed-indentation 0)) +    (org-set-property "TEST" "t")) +      (buffer-string)))) +  (should +   (equal +    ":PROPERTIES:\n:TEST: t\n:END:\n" +    (org-test-with-temp-text "" +      (let ((org-property-format "%s %s") +        (org-adapt-indentation nil) +        (org-fixed-indentation 5))      (org-set-property "TEST" "t"))        (buffer-string))))    (should @@ -5152,6 +5399,16 @@ Paragraph"      "* H\n:PROPERTIES:\n:TEST: t\n:END:\n"      (org-test-with-temp-text "* H"        (let ((org-adapt-indentation nil) +        (org-fixed-indentation 0) +        (org-property-format "%s %s")) +    (org-set-property "TEST" "t")) +      (buffer-string)))) +  (should +   (equal +    "* H\n     :PROPERTIES:\n     :TEST: t\n     :END:\n" +    (org-test-with-temp-text "* H" +      (let ((org-adapt-indentation nil) +        (org-fixed-indentation 5)          (org-property-format "%s %s"))      (org-set-property "TEST" "t"))        (buffer-string))))) -- 2.26.2