emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Timestamp practices?


From: Thorsten Jolitz
Subject: Re: [O] Timestamp practices?
Date: Wed, 20 Mar 2013 16:13:42 +0100
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.2 (gnu/linux)

Lawrence Bottorff <address@hidden> 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

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