emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* New headline after no content (empty headline)
@ 2014-03-15 21:24 Brady Trainor
  2014-03-17  0:49 ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: Brady Trainor @ 2014-03-15 21:24 UTC (permalink / raw)
  To: emacs-orgmode



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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-03-31  6:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-15 21:24 New headline after no content (empty headline) Brady Trainor
2014-03-17  0:49 ` 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

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).