Make org-(in)active-current-time-stamp work without loading org
This commit is contained in:
parent
9d08d908ae
commit
a044949c7d
28
README.org
28
README.org
@ -1965,17 +1965,25 @@ backward compatibility. See table [[tab:org-latex-class-tag-placeholder]] and ty
|
|||||||
(insert "\\(\\)")
|
(insert "\\(\\)")
|
||||||
(backward-char 2)))
|
(backward-char 2)))
|
||||||
|
|
||||||
|
(defun org-active-current-time-stamp ()
|
||||||
|
"Insert an active date-time stamp of the current time."
|
||||||
|
(interactive)
|
||||||
|
(if (fboundp 'org-insert-time-stamp)
|
||||||
|
(org-insert-time-stamp (current-time) 'with-hm)
|
||||||
|
(let ((stamp (format-time-string "<%Y-%m-%d %a %H:%M>" (current-time))))
|
||||||
|
(insert stamp)
|
||||||
|
stamp)))
|
||||||
|
|
||||||
|
(defun org-inactive-current-time-stamp ()
|
||||||
|
"Insert an inactive date-time stamp of the current time."
|
||||||
|
(interactive)
|
||||||
|
(if (fboundp 'org-insert-time-stamp)
|
||||||
|
(org-insert-time-stamp (current-time) 'with-hm 'inactive)
|
||||||
|
(let ((stamp (format-time-string "[%Y-%m-%d %a %H:%M]" (current-time))))
|
||||||
|
(insert stamp)
|
||||||
|
stamp)))
|
||||||
|
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(defun org-active-current-time-stamp ()
|
|
||||||
"Insert an active date-time stamp of the current time."
|
|
||||||
(interactive)
|
|
||||||
(org-insert-time-stamp (current-time) 'with-hm))
|
|
||||||
|
|
||||||
(defun org-inactive-current-time-stamp ()
|
|
||||||
"Insert an inactive date-time stamp of the current time."
|
|
||||||
(interactive)
|
|
||||||
(org-insert-time-stamp (current-time) 'with-hm 'inactive))
|
|
||||||
|
|
||||||
(define-key org-mode-map
|
(define-key org-mode-map
|
||||||
(kbd "C-c <SPC>") #'org-inactive-current-time-stamp)
|
(kbd "C-c <SPC>") #'org-inactive-current-time-stamp)
|
||||||
(define-key org-mode-map
|
(define-key org-mode-map
|
||||||
|
Loading…
x
Reference in New Issue
Block a user