From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iMuBFmZGpWAxCgAAgWs5BA (envelope-from ) for ; Wed, 19 May 2021 19:09:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 8B8aEmZGpWDvQAAAbx9fmQ (envelope-from ) for ; Wed, 19 May 2021 17:09:58 +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 90489C3A4 for ; Wed, 19 May 2021 19:09:57 +0200 (CEST) Received: from localhost ([::1]:42008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljPhj-0004sG-EE for larch@yhetil.org; Wed, 19 May 2021 13:09:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljPgC-0004oJ-R6 for emacs-orgmode@gnu.org; Wed, 19 May 2021 13:08:22 -0400 Received: from ciao.gmane.io ([116.202.254.214]:46566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljPgA-0002sW-1n for emacs-orgmode@gnu.org; Wed, 19 May 2021 13:08:20 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1ljPg5-0004PD-M1 for emacs-orgmode@gnu.org; Wed, 19 May 2021 19:08:13 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Maxim Nikulin Subject: [PATCH] org-faq.org: Expand "What is the best setup for indenting?" Date: Thu, 20 May 2021 00:08:06 +0700 Message-ID: References: <87zgwvg1qg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 In-Reply-To: <87zgwvg1qg.fsf@gnu.org> Content-Language: en-US Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 28 X-Spam_score: 2.8 X-Spam_bar: ++ X-Spam_report: (2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no 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-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621444197; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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; bh=kqy5B9cpgoUkdUbDpxDoGiFYFGDoxRb52D+y6gnc+BA=; b=EZX+VkDsZh1+XNa2IwnyyHle4SATHnq8uZtUlWKz3IeJ9ffskHTz07oAliuKvTdAHtGX0K BfybDUzHTc74dntVAqm2QrbcSK6if1Fofj49nz1xMgxNhipujS0kn/d1DYX+rv2M65/tcW CsHm14oFR1LcinKYppKVNsxDxs7byPU1IJBfmXr74S/gfSbDoiA4QxzcfYx5a+dEwnbBBS WJu0PgE1htT0AJyI3mthgQizCRkPX+4uZewSXPQ2ve4oRuzCS8jSGP9FfxIguWX2VuCfkJ G4DvS+9PIkfs9iCoPYX9gDk125L7qy/JGMPyZNjt/7TbdjQjmrzJHstfAlCzKg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621444197; a=rsa-sha256; cv=none; b=sdOxHYbLWl7pYIvQqXd735JMbT8kCqK1MPC59GIsQnx8Vz/VezvBfPk8q9+m0qn6Cevs/B 67be/ez7Q8UTYY3yJeRQgLIfTwNncQbenKHYiMOYJvFI17UqHMpaaeftOmz+8PwYdD9fXL jVM6etEK2/L5DiPw/Y8XH/5IHYkauiwcjlLxr1qmlb/SHFGunMFa7MTjXC/+0Dxy+GmzS1 ajV0oz0EYzK4dB9bjtrciOSE8pLVCrCPsG0XMLxBuOSK+JPV8akx/bGKaSgci1cfkmkKnR pWQQxRVhQ8ZBhYMJmIJaN2UvMZUqYjuW1NNTeNNskZSIyyBfQilzejHZ4/Nszg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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-Migadu-Spam-Score: -1.84 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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-Migadu-Queue-Id: 90489C3A4 X-Spam-Score: -1.84 X-Migadu-Scanner: scn1.migadu.com X-TUID: 97r0sYMde2KO --- org-faq.org | 61 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 17 deletions(-) diff --git a/org-faq.org b/org-faq.org index 9cc193c4..0f8934af 100644 --- a/org-faq.org +++ b/org-faq.org @@ -1029,21 +1029,33 @@ something like this: :CUSTOM_ID: indentation :END: -Indentation is a matter of personal preferences. General indentation -preferences are controlled in Emacs via ~electric-indent-mode~. Org -indentation behavior changes depending on ~org-adapt-indentation~, which -accepts three values: =nil= (no special indentation), =t= (always indent -relatively the the element above) and =headline-data= (only indent the -~PROPERTIES/LOGBOOK~ drawers relatively to the current level). On top -of these two configuration areas, there the difference between =RET= and -=C-j=. - -Here are two tables summarizing the behavior depending on whether -~electric-indent-mode~ is enable (the default) or not: - -With `electric-indent-mode' enabled: - -| org-adapt-indentation => | nil | t | headline-data | +Indentation, both appearance and behavior, is a matter of personal +preferences. You may try if the following adjustments suits better +for you than the defaults. Set ~org-adapt-indentation~ to have +content aligned to headline titles. Disable ~electric-indent-mode~ to +avoid automatic indentation in response to =RET= key. + +In more details, ~org-adapt-indentation~ controls indentation with +regards to previous element. Apparent effect is increased indentation +for content of deeper nested headings. The variable accepts three +values: =nil= (no special indentation), =t= (always indent relatively +the the element above) and =headline-data= (only indent the +~PROPERTIES/LOGBOOK~ drawers relatively to the current level). Value +=t= is suitable for short entries especially if you plan to share your +documents with someone who does not use Emacs. If you just want to +make heading level more prominent then consider adding visual left +margin using =#+STARTUP: indent= as described in the [[https://orgmode.org/manual/Clean-View.html#Clean-View][Clean View]] +section of the manual. The option works without adding extra spaces +to the document text. + +Configured indentation may be applied in response to =RET= or to +=C-j= depending on the state of ~electric-indent-mode~. The following +tables summarizes the difference. Version number is added to column +header if it describes default settings. + +With ~electric-indent-mode~ enabled: + +| org-adapt-indentation => | nil (Org >= 9.5) | t (Org 9.4) | headline-data | |---------------------------+------------------------+----------------------------+----------------------------| | RET after a headline | Do not indent | Indent | Do not indent | | C-j after a headline | Do not indent | Do not indent | Do not indent | @@ -1051,9 +1063,9 @@ With `electric-indent-mode' enabled: | C-j anywhere | Do not indent wrt prev | Do not indent wrt previous | Do not indent wrt previous | | Insert PROPERTIES/LOGBOOK | Do not indent | Indent wrt headline | Indent wrt headline | -With `electric-indent-mode' disabled: +With ~electric-indent-mode~ disabled: -| org-adapt-indentation => | nil | t | headline-data | +| org-adapt-indentation => | nil | t | headline-data (Org < 9.4) | |---------------------------+---------------------+----------------------------+----------------------------| | RET after a headline | Do not indent | Do not indent | Do not indent | | C-j after a headline | Do not indent | Indent | Do not indent | @@ -1061,6 +1073,21 @@ With `electric-indent-mode' disabled: | C-j | Indent wrt previous | Indent wrt previous | Indent wrt previous | | Insert PROPERTIES/LOGBOOK | Do not indent | Indent wrt headline | Indent wrt headline | +Do not try to avoid or to ignore indentation of heading body or +properties drawer determined by current state of +~org-adapt-indentation~ and ~electric-indent-mode~ by pressing =C-j= +instead of =RET= (or vice versa). The result is transient and you will +lost formatting when you refile heading or change its level (promote +or demote it). + +You may have noticed recommendation to disable ~electric-indent-mode~ +to restore behavior prior to Org 9.4. In Org 9.5 +~org-adapt-indentation~ default value changed to =nil= and, that is +more important, a number of bugs related to indentation were fixed. +Using =RET= with enabled ~electric-indent-mode~ should be convenient +now. Just customize ~org-adapt-indentation~ variable accordingly to +you preferences. + ** Can I migrate from Planner? Yes. This [[http://www.c0t0d0s0.de/plan2org/plan2org.pl][perl script]] or [[http://gitorious.org/bkuhn-small-hacks/org-mode/blobs/master/planner2org.plx -- 2.25.1