Lawrence Bottorff <galaxybeinglam...@gmail.com> writes:

> I'm trying to give each header entry a timestamp.

This is from Bernt Hansen and automagically inserts a timestamp each
time you insert a new header - if you want so. 
If not, you can toggle the behaviour. Nice.

,------------------------------------------------------------------------
| (defvar bh/insert-inactive-timestamp t)
| 
| (defun bh/toggle-insert-inactive-timestamp ()
|   (interactive)
|   (setq bh/insert-inactive-timestamp (not bh/insert-inactive-timestamp))
|   (message "Heading timestamps are %s"
|            (if bh/insert-inactive-timestamp "ON" "OFF")))
| 
| (defun bh/insert-inactive-timestamp ()
|   (interactive)
|   (org-insert-time-stamp nil t t nil nil nil))
| 
| (defun bh/insert-heading-inactive-timestamp ()
|   (save-excursion
|     (when bh/insert-inactive-timestamp
|       (org-return)
|       (org-cycle)
|       (bh/insert-inactive-timestamp))))
| 
| (add-hook 'org-insert-heading-hook
| 'bh/insert-heading-inactive-timestamp 'append)
`-------------------------------------------------------------------------

,---------------------------------------------------------------------
| (global-set-key (kbd "<f9> T") 'bh/toggle-insert-inactive-timestamp)
| (global-set-key (kbd "<f9> t") 'bh/insert-inactive-timestamp)
`---------------------------------------------------------------------

-- 
cheers,
Thorsten


Reply via email to