org: Add special edit on timestamps

* lisp/org.el (org-edit-special): Added a case to call a suitable
  function to edit the timestamp at hand.
This commit is contained in:
Marco Wahl 2018-09-18 17:59:52 +02:00
parent fa3dab48d0
commit 13090d114b
1 changed files with 6 additions and 1 deletions

View File

@ -20099,7 +20099,9 @@ When in a fixed-width region, call `org-edit-fixed-width-region'.
When in an export block, call `org-edit-export-block'. When in an export block, call `org-edit-export-block'.
When in a LaTeX environment, call `org-edit-latex-environment'. When in a LaTeX environment, call `org-edit-latex-environment'.
When at an #+INCLUDE keyword, visit the included file. When at an #+INCLUDE keyword, visit the included file.
When at a footnote reference, call `org-edit-footnote-reference' When at a footnote reference, call `org-edit-footnote-reference'.
When at an active timestamp, call `org-time-stamp'.
When at an inactive timestamp, call `org-time-stamp-inactive'.
On a link, call `ffap' to visit the link at point. On a link, call `ffap' to visit the link at point.
Otherwise, return a user error." Otherwise, return a user error."
(interactive "P") (interactive "P")
@ -20152,6 +20154,9 @@ Otherwise, return a user error."
(pcase (org-element-type context) (pcase (org-element-type context)
(`footnote-reference (org-edit-footnote-reference)) (`footnote-reference (org-edit-footnote-reference))
(`inline-src-block (org-edit-inline-src-code)) (`inline-src-block (org-edit-inline-src-code))
(`timestamp (if (eq 'inactive (org-element-property :type context))
(call-interactively #'org-time-stamp-inactive)
(call-interactively #'org-time-stamp)))
(`link (call-interactively #'ffap)) (`link (call-interactively #'ffap))
(_ (user-error "No special environment to edit here")))))))) (_ (user-error "No special environment to edit here"))))))))