emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jay Dixit <dixit@aya.yale.edu>
To: org-mode org <emacs-orgmode@gnu.org>
Subject: how to make org-blank-before-new-entry distinguish between a TODO list and a text outline?
Date: Mon, 22 Jun 2015 13:47:07 -0400	[thread overview]
Message-ID: <CAGE7GqCoQ0ryTDPY--MpZSCqnPqrsXh3=DdrNECedbnSc3e=9A@mail.gmail.com> (raw)

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

http://emacs.stackexchange.com/questions/13311/make-org-blank-before-new-entry-distinguish-between-a-todo-list-and-a-text-outli
I posted this question on stackexchange, but no response yet. Does anyone
here have any ideas?

Like many of us, I use org-mode for two different things:

1. As a TODO list manager
2. As a text outliner

I'd like org-blank-before-new-entry to work differently based on context.

1. TODO list: no blank lines
2. text outline: automatically insert 1 blank line when non-heading text
precedes a heading

In other words, when I'm doing a TODO list when I have many headings in a
row, I don't want stray line breaks between them.

For TODO list mode, no blank lines:

#+BEGIN_EXAMPLE
** Organize Party
** TODO Call people
*** TODO Peter
*** DONE Sarah
** TODO Buy food
** DONE Talk to neighbor
#+END_EXAMPLE

However, when I'm writing text, I want line breaks for the sake of visual
whitespace / ease of reading.

For outline mode, blank line before heading:

#+BEGIN_EXAMPLE
* Heading
This is a document that has a heading, and a body. The body will consist of
two paragraphs with sub-headings.

* Body
This is an introduction to the body. The body has two sub-headings, each of
which have their own paragraph.

** The First Paragraph
This is the first of two paragraphs.

** The Second Paragraph
This is the second of two paragraphs.
#+END_EXAMPLE

I've already set org-blank-before-new-entry to auto:

     ((heading . auto)
     (plain-list-item . auto))

But I think org-blank-before-new-entry works by detecting other blank lines
in the area. I want it to detect whether the preceding line of text is a
heading or a non-heading.

How can I modify org-blank-before-new-entry so that when I'm in a TODO list
consisting only of headings, org-meta-return doesn't add a line break? but
after a block of text, it does?

Any thoughts? Thanks!


---
Jay Dixit
jaydixit.com
(646) 355-8001
Jay Dixit

[-- Attachment #2: Type: text/html, Size: 6532 bytes --]

                 reply	other threads:[~2015-06-22 17:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CAGE7GqCoQ0ryTDPY--MpZSCqnPqrsXh3=DdrNECedbnSc3e=9A@mail.gmail.com' \
    --to=dixit@aya.yale.edu \
    --cc=emacs-orgmode@gnu.org \
    /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).