Hi,


> Carsten Dominik <domi...@science.uva.nl> 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)



_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to