From: Brady Trainor <algebrat@uw.edu>
To: emacs-orgmode@gnu.org
Subject: New headline after no content (empty headline)
Date: Sat, 15 Mar 2014 21:24:57 +0000 (UTC) [thread overview]
Message-ID: <loom.20140315T215440-545@post.gmane.org> (raw)
I am revisiting a workflow that I have a hard time letting go of, despite
it's unintended use in Org-mode.
That is, I like to visually separate groups of headlines by simply having a
couple of empty headlines. This allows more nimble and simple use-case of
manually sorting buildup of headlines by quick and flexible tagging (and
easy removal of such), and minimal visual aid of a couple empty headlines.
This way, I can so sorting and orienting of tasks without much commitment,
allowing me to start the process all over again quickly if I feel I
didn't "rotate my space" the right way.
My problem is that using the default new headline commands, it removes the
whitespace from previous lines, so "* " becomes "*\n* ", instead of my
desired "* \n* ".
So, I started trying to read the org.el file. I thought I had found
the "offending" line, (my L7614,) finding
;; If we insert after content, move there and clean up whitespace
(when respect-content
(org-end-of-subtree nil t)
(skip-chars-backward " \r\n")
(and (looking-at "[ \t]+") (replace-match ""))
(unless (eobp) (forward-char 1))
(when (looking-at "^\\*")
(unless (bobp) (backward-char 1))
(insert "\n")))
I thought to try substituting "[ \t]+" with "[\t]+", and byte compiled the
file. But this did not solve.
So, I never like to ask a question without having an answer myself, so I
learned a little more enough about keyboard macros to generate the
following somewhat simple and natural solution (natural in that it uses a
similar unused key chord):
(fset 'new-starred-line
[return ?* ? ])
(global-set-key (kbd "C-M-<return>") 'new-starred-line)
So, what is my question? What am I lacking in my .el package reading
skills? Why did my first fix not work? As a newb program hacker, am I
approaching this right? Maybe best case is to understand more of the entire
org.el file, but was trying to hack just enough. What would you have done?
Regards,
Brady
next reply other threads:[~2014-03-15 21:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-15 21:24 Brady Trainor [this message]
2014-03-17 0:49 ` New headline after no content (empty headline) Bastien
2014-03-23 2:08 ` Brady Trainor
2014-03-23 8:33 ` Bastien
2014-03-28 5:57 ` Brady Trainor
2014-03-31 5:55 ` Bastien
2014-03-31 6:26 ` Brady Trainor
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=loom.20140315T215440-545@post.gmane.org \
--to=algebrat@uw.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.