emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] New headline after no content (empty headline)


From: Brady Trainor
Subject: [O] New headline after no content (empty headline)
Date: Sat, 15 Mar 2014 21:24:57 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)


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








reply via email to

[Prev in Thread] Current Thread [Next in Thread]