|From:||zhenjiang zech xu|
|Subject:||Re: [O] headlines without timestampes|
|Date:||Thu, 29 May 2014 17:38:24 -0600|
This function returns a CONS with the timestamp and the rest of the
zhenjiang zech xu <address@hidden> writes:
> For a simple example, assuming current entry is:
> * [2014-05-06 Thu] this is the heading
> I'd like to get the time string and the title "this is the heading"
> separately. Is there a canonical way to do that with org-mode APIs?
(defun get-timestamp-and-heading ()
(let* ((h (org-element-property :raw-value (org-element-at-point)))
(h-no-ts (replace-regexp-in-string org-ts-regexp-both "" h))
(ts (and (string-match org-ts-regexp-both h)
(match-string 0 h))))
(cons (org-trim h-no-ts) ts))))
|[Prev in Thread]||Current Thread||[Next in Thread]|