emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Timestamp practices?


From: Samuel Loury
Subject: Re: [O] Timestamp practices?
Date: Thu, 21 Mar 2013 11:15:37 +0100
User-agent: Notmuch/0.15 (http://notmuchmail.org) Emacs/24.3.50.2 (x86_64-unknown-linux-gnu)

Thorsten Jolitz <address@hidden> writes:

> 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
>
>

Moreover, if you also use org-capture. You may precise a timestamp to be
put in the captured template. IIRC, This is also inspired from Bernt's
configuration.

╭────
│ (add-to-list 'org-capture-templates
│                         '("t" "Todo Item" entry (file+headline 
(expand-file-name "todo.org" org-directory) "Refile") "* TODO %?
│   :LOGBOOK:
│   - Captured       %U
│   :END:
│ "
│                                :kill-buffer
│                        )
│   )
╰────
The useful part here is the %U. (see info:org#Template expansion).

This is of course to adjust according to your needs.

-- 
Konubinix
GPG Key    : 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A

Attachment: pgpYlYCEK9x5R.pgp
Description: PGP signature


reply via email to

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