From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Loury Subject: Re: Timestamp practices? Date: Thu, 21 Mar 2013 11:15:37 +0100 Message-ID: <87obed2h4m.fsf@konixwork.incubateur.ens-lyon.fr> References: <87obeep0ih.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:49917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIcZ3-0004w0-5H for emacs-orgmode@gnu.org; Thu, 21 Mar 2013 06:17:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIcYy-0004xF-QN for emacs-orgmode@gnu.org; Thu, 21 Mar 2013 06:17:41 -0400 Received: from mail-we0-x22a.google.com ([2a00:1450:400c:c03::22a]:56000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIcYy-0004wx-KH for emacs-orgmode@gnu.org; Thu, 21 Mar 2013 06:17:36 -0400 Received: by mail-we0-f170.google.com with SMTP id z2so665973wey.1 for ; Thu, 21 Mar 2013 03:17:35 -0700 (PDT) In-Reply-To: <87obeep0ih.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Thorsten Jolitz , emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thorsten Jolitz writes: > Lawrence Bottorff 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.=20 > If not, you can toggle the behaviour. Nice. > > ,------------------------------------------------------------------------ > | (defvar bh/insert-inactive-timestamp t) > |=20 > | (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"))) > |=20 > | (defun bh/insert-inactive-timestamp () > | (interactive) > | (org-insert-time-stamp nil t t nil nil nil)) > |=20 > | (defun bh/insert-heading-inactive-timestamp () > | (save-excursion > | (when bh/insert-inactive-timestamp > | (org-return) > | (org-cycle) > | (bh/insert-inactive-timestamp)))) > |=20 > | (add-hook 'org-insert-heading-hook > | 'bh/insert-heading-inactive-timestamp 'append) > `------------------------------------------------------------------------- > > ,--------------------------------------------------------------------- > | (global-set-key (kbd " T") 'bh/toggle-insert-inactive-timestamp) > | (global-set-key (kbd " t") 'bh/insert-inactive-timestamp) > `--------------------------------------------------------------------- > > --=20 > 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. =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=94=82 (add-to-list 'org-capture-templates =E2=94=82 '("t" "Todo Item" entry (file+headline (expand-file-name "to= do.org" org-directory) "Refile") "* TODO %? =E2=94=82 :LOGBOOK: =E2=94=82 - Captured %U =E2=94=82 :END: =E2=94=82 " =E2=94=82 :kill-buffer =E2=94=82 ) =E2=94=82 ) =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80 The useful part here is the %U. (see info:org#Template expansion). This is of course to adjust according to your needs. =2D-=20 Konubinix GPG Key : 7439106A Fingerprint: 5993 BE7A DA65 E2D9 06CE 5C36 75D2 3CED 7439 106A --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQEcBAEBAgAGBQJRSt3JAAoJEHXSPO10ORBqcGEIALeAYDVnzO60BR3xroIsCzy5 aVxm4wPZybKtGaf31XnM9GNj7uVw86fVRukWVFG7eIC5UdMq5GHnTepzdOmpAWhi 2AHifdgdWavfijRADAt79zRIkqBc4Qh7ihUikd8fg/KWX9pMHF3TnjC1i1GN/Qtl yJohnKeGWC/dzA4UTjb5UmdAsL6FTGLIJYbO1sha2xKX3SpQHr0iEF6xkbfBcWik OvOYbLcB2EJ7KhaAOuq1qwOIYsUv7vQjKw4DyWh714EGQQ0OOLv8bPEpm1qSwCuv XqJvi+zTEYvKnFCK6jRY7QwW+pr+915k8b2bjpiI5xMxXV9VHtchpRkLu/dqT1k= =Ur3L -----END PGP SIGNATURE----- --=-=-=--