summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2012-07-06 13:16:13 +0200
committerBastien Guerry <bzg@altern.org>2012-07-06 13:16:13 +0200
commit2cf1ff345e934d09887bed944f62edbfda0eb42f (patch)
tree502ff02d6fed1ae84d439340ae8f668e52b263ca
parent9780de8b3018b3cd46e0d921fdcffd936fd6a53b (diff)
downloadorg-mode-2cf1ff345e934d09887bed944f62edbfda0eb42f.tar.gz
org.el (org-time-stamp): C-u C-u C-c . inserts a timestamp with no prompt.
* org.el (org-time-stamp): With two universal arguments, insert an active timestamp with the current time without prompting the user. This idea came up on the list, I can't recall who proposed this. Thanks to him anyway!
-rw-r--r--lisp/org.el23
1 files changed, 16 insertions, 7 deletions
diff --git a/lisp/org.el b/lisp/org.el
index c5a5f7e..46a08dd 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15007,13 +15007,20 @@ Return the position where this entry starts, or nil if there is no such entry."
(defun org-time-stamp (arg &optional inactive)
"Prompt for a date/time and insert a time stamp.
-If the user specifies a time like HH:MM, or if this command is called
-with a prefix argument, the time stamp will contain date and time.
-Otherwise, only the date will be included. All parts of a date not
-specified by the user will be filled in from the current date/time.
-So if you press just return without typing anything, the time stamp
-will represent the current date/time. If there is already a timestamp
-at the cursor, it will be modified."
+If the user specifies a time like HH:MM or if this command is
+called with at least one prefix argument, the time stamp contains
+the date and the time. Otherwise, only the date is be included.
+
+All parts of a date not specified by the user is filled in from
+the current date/time. So if you just press return without
+typing anything, the time stamp will represent the current
+date/time.
+
+If there is already a timestamp at the cursor, it will be
+modified.
+
+With two universal prefix arguments, insert an active timestamp
+with the current time without prompting the user."
(interactive "P")
(let* ((ts nil)
(default-time
@@ -15059,6 +15066,8 @@ at the cursor, it will be modified."
(concat (substring org-last-inserted-timestamp 0 -1)
" " repeater ">"))))
(message "Timestamp updated"))
+ ((equal arg '(16))
+ (org-insert-time-stamp (current-time) t))
(t
(setq time (let ((this-command this-command))
(org-read-date arg 'totime nil nil default-time default-input inactive)))