summaryrefslogtreecommitdiff
path: root/lisp/org/org-capture.el
diff options
context:
space:
mode:
authorRasmus <rasmus@gmx.us>2018-03-27 23:34:41 +0200
committerRasmus <rasmus@gmx.us>2018-03-27 23:34:41 +0200
commit613c9a5c1f3237fbdc3a3db2341c7c59353d2aa2 (patch)
tree7651699ebeb2a2a2d8d1081707d091fbc424e8fb /lisp/org/org-capture.el
parent1b075a9e38ca6812417f95ed2272e61d875d9e86 (diff)
downloademacs-613c9a5c1f3237fbdc3a3db2341c7c59353d2aa2.tar.gz
emacs-613c9a5c1f3237fbdc3a3db2341c7c59353d2aa2.tar.bz2
emacs-613c9a5c1f3237fbdc3a3db2341c7c59353d2aa2.zip
Update Org to v9.1.9
Please note this is a bugfix release. See etc/ORG-NEWS for details.
Diffstat (limited to 'lisp/org/org-capture.el')
-rw-r--r--lisp/org/org-capture.el43
1 files changed, 23 insertions, 20 deletions
diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el
index cb1741f2f91..3de386c69d6 100644
--- a/lisp/org/org-capture.el
+++ b/lisp/org/org-capture.el
@@ -4,7 +4,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;;
;; This file is part of GNU Emacs.
;;
@@ -51,8 +51,8 @@
(require 'org)
(declare-function org-at-encrypted-entry-p "org-crypt" ())
-(declare-function org-datetree-find-date-create "org-datetree"
- (date &optional keep-restriction))
+(declare-function org-clock-update-mode-line "org-clock" (&optional refresh))
+(declare-function org-datetree-find-date-create "org-datetree" (date &optional keep-restriction))
(declare-function org-decrypt-entry "org-crypt" ())
(declare-function org-encrypt-entry "org-crypt" ())
(declare-function org-table-analyze "org-table" ())
@@ -541,8 +541,8 @@ not-in-buffer: command not displayed in matching buffers
If you define several checks, the agenda command will be
accessible if there is at least one valid check.
-You can also bind a key to another agenda custom command
-depending on contextual rules.
+You can also bind a key to another capture template depending on
+contextual rules.
\\='((\"c\" \"d\" ((in-mode . \"message-mode\"))))
@@ -724,21 +724,24 @@ captured item after finalizing."
;; Did we start the clock in this capture buffer?
(when (and org-capture-clock-was-started
- org-clock-marker (marker-buffer org-clock-marker)
- (equal (marker-buffer org-clock-marker) (buffer-base-buffer))
- (> org-clock-marker (point-min))
+ org-clock-marker
+ (eq (marker-buffer org-clock-marker) (buffer-base-buffer))
+ (>= org-clock-marker (point-min))
(< org-clock-marker (point-max)))
- ;; Looks like the clock we started is still running. Clock out.
- (when (not org-capture-clock-keep) (let (org-log-note-clock-out) (org-clock-out)))
- (when (and (not org-capture-clock-keep)
- (org-capture-get :clock-resume 'local)
- (markerp (org-capture-get :interrupted-clock 'local))
- (buffer-live-p (marker-buffer
- (org-capture-get :interrupted-clock 'local))))
- (let ((clock-in-task (org-capture-get :interrupted-clock 'local)))
- (org-with-point-at clock-in-task
- (org-clock-in)))
- (message "Interrupted clock has been resumed")))
+ ;; Looks like the clock we started is still running.
+ (if org-capture-clock-keep
+ ;; User may have completed clocked heading from the template.
+ ;; Refresh clock mode line.
+ (org-clock-update-mode-line t)
+ ;; Clock out. Possibly resume interrupted clock.
+ (let (org-log-note-clock-out) (org-clock-out))
+ (when (and (org-capture-get :clock-resume 'local)
+ (markerp (org-capture-get :interrupted-clock 'local))
+ (buffer-live-p (marker-buffer
+ (org-capture-get :interrupted-clock 'local))))
+ (let ((clock-in-task (org-capture-get :interrupted-clock 'local)))
+ (org-with-point-at clock-in-task (org-clock-in)))
+ (message "Interrupted clock has been resumed"))))
(let ((beg (point-min))
(end (point-max))
@@ -1118,7 +1121,7 @@ may have been stored before."
(setq level (org-get-valid-level
(if (org-at-heading-p) (org-outline-level) 1)
1))
- (if reversed? (outline-next-heading) (org-end-of-subtree t)))
+ (if reversed? (outline-next-heading) (org-end-of-subtree t t)))
;; Insert as a top-level entry at the beginning of the file.
(reversed?
(goto-char (point-min))