emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@gnu.org>
To: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [POLL] Setting `org-adapt-indentation' to nil by default?
Date: Mon, 03 May 2021 15:40:29 +0200	[thread overview]
Message-ID: <87fsz4ue9e.fsf@bzg.fr> (raw)
In-Reply-To: <871rao7zcq.fsf@gmail.com> ("Kévin Le Gouguec"'s message of "Mon, 03 May 2021 14:53:25 +0200")

[-- Attachment #1: Type: text/plain, Size: 414 bytes --]

Hi Kevin,

Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:

> Great!  One last snag that I can see: when inserting properties or
> clocking in, the :LOGBOOK:, :PROPERTIES: and :END: lines are indented,
> but the /first/ :property: or CLOCK: line remains at column 0.

Er.  Can you try this (hopefully last) patch and report any problem?

Thanks for your patience in testing this!

-- 
 Bastien

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix-indent.patch --]
[-- Type: text/x-diff, Size: 1655 bytes --]

diff --git a/lisp/org.el b/lisp/org.el
index c0b5ee5ec..c20539a8a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -18846,17 +18846,6 @@ ELEMENT."
 	 (t
 	  (goto-char start)
 	  (current-indentation))))
-      ((and
-	(eq org-adapt-indentation 'headline-data)
-        (or (memq type '(planning clock node-property property-drawer drawer))
-            ;; When storing a note in a LOGBOOK drawer,
-            ;; `org-store-log-note' needs to insert a new line before
-            ;; the newly inserted note, thus the `type' at point will
-            ;; return `paragraph' instead of the expected `drawer', so
-            ;; we need to manually detect the drawer.
-            (eq (org-element-type (car (org-element-lineage element))) 'drawer)))
-       (org--get-expected-indentation
-	(org-element-property :parent element) t))
       ((memq type '(headline inlinetask nil))
        (if (org-match-line "[ \t]*$")
 	   (org--get-expected-indentation element t)
@@ -19000,11 +18989,12 @@ Also align node properties according to `org-property-format'."
   (interactive)
   (unless (or (org-at-heading-p)
               (and (eq org-adapt-indentation 'headline-data)
+                   (not (org-at-clock-log-p))
                    (save-excursion
                      (beginning-of-line 1)
                      (skip-chars-backward "\n")
                      (or (org-at-heading-p)
-                         (org-at-drawer-p)
+                         (looking-back ":END:.*")
                          (org-at-planning-p)))))
     (let* ((element (save-excursion (beginning-of-line) (org-element-at-point)))
 	   (type (org-element-type element)))

  reply	other threads:[~2021-05-03 13:41 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-02  6:09 [POLL] Setting `org-adapt-indentation' to nil by default? Bastien
2021-05-02  7:13 ` Tim Cross
2021-05-02  8:06 ` Jean Louis
2021-05-02  8:47   ` Tim Cross
2021-05-02 20:18     ` Jean Louis
2021-05-02 22:25       ` Tim Cross
2021-05-03  7:41         ` Kévin Le Gouguec
2021-05-03 10:15         ` Jean Louis
2021-05-02  8:56   ` Bastien
2021-05-02  8:59     ` Bastien
2021-05-02 20:24       ` Jean Louis
2021-05-02 20:21     ` Jean Louis
2021-05-02 20:22     ` Jean Louis
2021-05-02 10:07 ` Eric S Fraga
2021-05-02 15:01 ` Detlef Steuer
2021-05-02 15:44   ` Colin Baxter
2021-05-02 15:46 ` Amin Bandali
2021-05-02 18:11   ` Tom Gillespie
2021-05-02 18:19     ` Nicolas Goaziou
2021-05-02 18:48       ` Tom Gillespie
2021-05-02 19:20         ` Nicolas Goaziou
2021-05-03 10:11   ` Dr. Arne Babenhauserheide
2021-05-02 18:31 ` Jim Porter
2021-05-02 20:44 ` Kévin Le Gouguec
2021-05-03  7:33   ` Kévin Le Gouguec
2021-05-03  8:06     ` Bastien
2021-05-03 12:53       ` Kévin Le Gouguec
2021-05-03 13:40         ` Bastien [this message]
2021-05-03 14:57           ` Kévin Le Gouguec
2021-05-06 14:50       ` Maxim Nikulin
2021-05-15 20:51         ` Bastien
2021-05-19 17:02           ` [PATCH] etc/ORG-NEWS: Suggest against disabling `electric-indent-mode' Maxim Nikulin
2021-05-20 12:25             ` Bastien
2021-05-19 17:08           ` [PATCH] org-faq.org: Expand "What is the best setup for indenting?" Maxim Nikulin
2021-05-19 18:06             ` Greg Minshall
2021-05-20 15:57               ` Maxim Nikulin
2021-05-21  2:45                 ` Greg Minshall
2021-05-27 16:11                   ` Maxim Nikulin
2021-05-21  9:38                 ` Bastien
2021-05-20 12:28             ` Bastien
2021-05-19 17:08           ` [POLL] Setting `org-adapt-indentation' to nil by default? Maxim Nikulin
2021-05-02 21:07 ` Jack Kamm
2021-05-05  7:54 ` Bastien
2021-05-06 14:13   ` Bastien
2021-05-09 16:42     ` Kévin Le Gouguec
2021-05-15 12:46       ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fsz4ue9e.fsf@bzg.fr \
    --to=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=kevin.legouguec@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).