emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] What is the best way to set #+DATE to today's date?


From: Rasmus
Subject: Re: [O] What is the best way to set #+DATE to today's date?
Date: Thu, 06 Aug 2015 19:41:33 +0200
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)

Kaushal <address@hidden> writes:

>> Why don't you just use a timestamp?
>
> But that would need me to insert the timestamp manually each time before
> exports

If you *always* want the current date you don't need to set date.

>> You can update whenever you want or using
>>    (org-insert-time-stamp (current-time))
>> at the right spot.
>
> Wouldn't that too need manual navigation to #+date: and then eval that
> elisp form?

Sure, but that's easy to find (untested): 

    (defun rasmus/update-date ()
      "update #+date keyword"
      (org-with-wide-buffer
       (let ((case-fold-search t))
         (goto-char (point-min))
         (search-forward-regexp "^#+date: ?")
         (delete-region (point) (line-end-position))
         (org-insert-time-stamp (current-time)))))

My point was that I don't understand the need for your today macro...

Rasmus

-- 
History is what should never happen again




reply via email to

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