summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2013-04-09 17:36:14 (GMT)
committer Bastien Guerry <bzg@altern.org>2013-04-09 17:36:14 (GMT)
commit749829d591d9da342abe1430a468120562a6ad4b (patch)
tree12a71baf564993744c613a2bd9eacd1c44e9b2ca
parent5625a6ed799147c02ce43c7481b794eab8cdfd32 (diff)
downloadorg-mode-749829d591d9da342abe1430a468120562a6ad4b.zip
org-mode-749829d591d9da342abe1430a468120562a6ad4b.tar.gz
org-clock.el (org-clock-select-task): Fix window to buffer
* org-clock.el (org-clock-select-task): Fix window to buffer. Hide the cursor. (org-clock-insert-selection-line): Add the clock-out time. Thanks to Bernt Hansen for reporting the issue about the window.
-rw-r--r--lisp/org-clock.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 6274afb..ba02d37 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -546,9 +546,10 @@ of a different task.")
(push s sel-list)))
org-clock-history)
(run-hooks 'org-clock-before-select-task-hook)
- (org-fit-window-to-buffer)
+ (goto-char (point-min))
+ (org-fit-window-to-buffer nil nil (+ 6 (length org-clock-history)))
(message (or prompt "Select task for clocking:"))
- (setq rpl (read-char-exclusive))
+ (setq cursor-type nil rpl (read-char-exclusive))
(cond
((eq rpl ?q) nil)
((eq rpl ?x) nil)
@@ -560,7 +561,7 @@ of a different task.")
And return a cons cell with the selection character integer and the marker
pointing to it."
(when (marker-buffer marker)
- (let (file cat task heading prefix)
+ (let (file cat clockout task heading prefix)
(with-current-buffer (org-base-buffer (marker-buffer marker))
(save-excursion
(save-restriction
@@ -569,6 +570,11 @@ pointing to it."
(goto-char marker)
(setq file (buffer-file-name (marker-buffer marker))
cat (org-get-category)
+ clockout (replace-regexp-in-string
+ "^<\\(.+\\)>$" "\\1"
+ (format-time-string
+ (cdr org-time-stamp-formats)
+ (org-clock-get-last-clock-out-time)))
heading (org-get-heading 'notags)
prefix (save-excursion
(org-back-to-heading t)
@@ -579,8 +585,8 @@ pointing to it."
(concat prefix heading)
org-odd-levels-only)
(length prefix)))))))
- (when (and cat task)
- (insert (format "[%c] %-15s %s\n" i cat task))
+ (when (and cat task clockout)
+ (insert (format "[%c] %-12s %-12s %s\n" i cat clockout task))
(cons i marker)))))
(defvar org-clock-task-overrun nil