diff --git a/lisp/org-clock.el b/lisp/org-clock.el index e99eb5246..162ee07b6 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1264,10 +1264,12 @@ last clock-out time, if any." (let ((start-time (if (or org-clock-continuously (equal arg '(16))) (or org-clock-out-time (current-time)) (current-time)))) - (org-clock-clock-in (list (car org-clock-history)) nil start-time) - (message "Now clocking in: %s (in %s)" - org-clock-current-task - (buffer-name (marker-buffer org-clock-marker)))))) + (if (null org-clock-history) + (message "No last clock") + (org-clock-clock-in (list (car org-clock-history)) nil start-time) + (message "Clocking back: %s (in %s)" + org-clock-current-task + (buffer-name (marker-buffer org-clock-marker))))))) (defun org-clock-mark-default-task () "Mark current task as default task." @@ -1560,8 +1562,7 @@ UPDOWN tells whether to change 'up or 'down." (save-excursion ; Do not replace this with `with-current-buffer'. (org-no-warnings (set-buffer (org-clocking-buffer))) (goto-char org-clock-marker) - (if (save-excursion (move-beginning-of-line 1) - (looking-at (concat "^[ \t]*" org-clock-string))) + (if (looking-back (concat "^[ \t]*" org-clock-string ".*")) (progn (delete-region (1- (point-at-bol)) (point-at-eol)) (org-remove-empty-drawer-at "LOGBOOK" (point))) (message "Clock gone, cancel the timer anyway") diff --git a/lisp/org.el b/lisp/org.el index e72830382..ddc6285b5 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6703,6 +6703,8 @@ open and agenda-wise Org files." (org-flag-drawer t)))))) (defun org-flag-drawer (flag) + "When FLAG is non-nil, hide the drawer we are within. +Otherwise make it visible." (save-excursion (beginning-of-line 1) (when (looking-at "^[ \t]*:[a-zA-Z][a-zA-Z0-9]*:") @@ -17800,10 +17802,10 @@ BEG and END default to the buffer boundaries." (org-defkey org-mode-map "\C-c\C-x\C-t" 'org-toggle-time-stamp-overlays) (org-defkey org-mode-map "\C-c\C-x\C-i" 'org-clock-in) -(org-defkey org-mode-map "\C-c\C-x\C-I" 'org-clock-in-last) +(org-defkey org-mode-map "\C-c\C-x\C-x" 'org-clock-in-last) (org-defkey org-mode-map "\C-c\C-x\C-o" 'org-clock-out) (org-defkey org-mode-map "\C-c\C-x\C-j" 'org-clock-goto) -(org-defkey org-mode-map "\C-c\C-x\C-x" 'org-clock-cancel) +(org-defkey org-mode-map "\C-c\C-x\C-q" 'org-clock-cancel) (org-defkey org-mode-map "\C-c\C-x\C-d" 'org-clock-display) (org-defkey org-mode-map "\C-c\C-x\C-r" 'org-clock-report) (org-defkey org-mode-map "\C-c\C-x\C-u" 'org-dblock-update)