emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] Export without TODO keywords


From: Daniel Clemente
Subject: Re: [Orgmode] Export without TODO keywords
Date: Thu, 25 Dec 2008 23:34:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)


Hi,


> Carsten Dominik <address@hidden> writes:
>>
>> ....
>>  Then only „log notes“ exporting is not configurable.
>
> True, but this is not really metadata, but notes, which could
> easily be confused with normal plain text.
>
> I think I will stop here adding options for this purpose.
>
> You can try to write a small function which removes these
> as well, and call it from `org-export-preprocess-hook'.
>

  By the way, this is how I finally removed all tracking information under the 
headlines.
  I included it in my file and had to eval it so that it registers the hook.
  You can use the code as you like.

-- Daniel




(defun org-export-remove-notes-from-all-headings ()
  "Removes all the tracking information of headings, like log notes, keywords, 
and clocking.
Add this as a hook to `org-export-preprocess-hook'"
  (show-all)
  (org-map-entries 'org-export-remove-notes-from-heading nil nil)
  )

(defun org-export-remove-notes-from-heading ()
  "Removes all the tracking information which is under the current headline, if 
it contains.
This information includes log notes (see `org-log-done'), 
CLOSED/SCHEDULED/DEADLINE keywords, CLOCK entries and others."


  (unless (org-at-heading-p) (error "Not on a headline"))

  (beginning-of-line)
  (let* (
         (level (org-reduced-level (funcall outline-level)))
        ; Regexp of lines to delete. If it starts with TAB, it is indented and 
thus we delete it. If it has spaces, we delete if the number of spaces is equal 
to the heading level (number of *)
         (regexp-of-deletable (concat "^\\(\t+\\|" (make-string level ?  ) 
"\\)"))
         )

    (forward-line)

    (while (looking-at regexp-of-deletable)
    ;(message (concat "Deleting this text: " (buffer-substring 
(line-beginning-position) (line-end-position))))
      (kill-line t)
      )

    )
  )

(add-hook 'org-export-preprocess-hook 
'org-export-remove-notes-from-all-headings)





reply via email to

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