mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-23 07:18:53 +00:00
Fix name of dynamically bound variable in org-clock.el.
This commit is contained in:
parent
ccd84a9f63
commit
3658686f59
@ -1691,7 +1691,7 @@ from the `before-change-functions' in the current buffer."
|
|||||||
(remove-hook 'before-change-functions
|
(remove-hook 'before-change-functions
|
||||||
'org-clock-remove-overlays 'local))))
|
'org-clock-remove-overlays 'local))))
|
||||||
|
|
||||||
(defvar org-clock-state) ;; dynamically scoped into this function
|
(defvar org-state) ;; dynamically scoped into this function
|
||||||
(defun org-clock-out-if-current ()
|
(defun org-clock-out-if-current ()
|
||||||
"Clock out if the current entry contains the running clock.
|
"Clock out if the current entry contains the running clock.
|
||||||
This is used to stop the clock after a TODO entry is marked DONE,
|
This is used to stop the clock after a TODO entry is marked DONE,
|
||||||
@ -1700,9 +1700,9 @@ and is only done if the variable `org-clock-out-when-done' is not nil."
|
|||||||
org-clock-out-when-done
|
org-clock-out-when-done
|
||||||
(marker-buffer org-clock-marker)
|
(marker-buffer org-clock-marker)
|
||||||
(or (and (eq t org-clock-out-when-done)
|
(or (and (eq t org-clock-out-when-done)
|
||||||
(member org-clock-state org-done-keywords))
|
(member org-state org-done-keywords))
|
||||||
(and (listp org-clock-out-when-done)
|
(and (listp org-clock-out-when-done)
|
||||||
(member org-clock-state org-clock-out-when-done)))
|
(member org-state org-clock-out-when-done)))
|
||||||
(equal (or (buffer-base-buffer (org-clocking-buffer))
|
(equal (or (buffer-base-buffer (org-clocking-buffer))
|
||||||
(org-clocking-buffer))
|
(org-clocking-buffer))
|
||||||
(or (buffer-base-buffer (current-buffer))
|
(or (buffer-base-buffer (current-buffer))
|
||||||
|
68
lisp/org.el
68
lisp/org.el
@ -11260,18 +11260,18 @@ For calling through lisp, arg is also interpreted in the following way:
|
|||||||
(completion-ignore-case t)
|
(completion-ignore-case t)
|
||||||
(member (member this org-todo-keywords-1))
|
(member (member this org-todo-keywords-1))
|
||||||
(tail (cdr member))
|
(tail (cdr member))
|
||||||
(state (cond
|
(org-state (cond
|
||||||
((and org-todo-key-trigger
|
((and org-todo-key-trigger
|
||||||
(or (and (equal arg '(4))
|
(or (and (equal arg '(4))
|
||||||
(eq org-use-fast-todo-selection 'prefix))
|
(eq org-use-fast-todo-selection 'prefix))
|
||||||
(and (not arg) org-use-fast-todo-selection
|
(and (not arg) org-use-fast-todo-selection
|
||||||
(not (eq org-use-fast-todo-selection
|
(not (eq org-use-fast-todo-selection
|
||||||
'prefix)))))
|
'prefix)))))
|
||||||
;; Use fast selection
|
;; Use fast selection
|
||||||
(org-fast-todo-selection))
|
(org-fast-todo-selection))
|
||||||
((and (equal arg '(4))
|
((and (equal arg '(4))
|
||||||
(or (not org-use-fast-todo-selection)
|
(or (not org-use-fast-todo-selection)
|
||||||
(not org-todo-key-trigger)))
|
(not org-todo-key-trigger)))
|
||||||
;; Read a state with completion
|
;; Read a state with completion
|
||||||
(org-icompleting-read
|
(org-icompleting-read
|
||||||
"State: " (mapcar (lambda(x) (list x))
|
"State: " (mapcar (lambda(x) (list x))
|
||||||
@ -11320,12 +11320,12 @@ For calling through lisp, arg is also interpreted in the following way:
|
|||||||
nil)))
|
nil)))
|
||||||
(t
|
(t
|
||||||
(car tail))))
|
(car tail))))
|
||||||
(state (or
|
(org-state (or
|
||||||
(run-hook-with-args-until-success
|
(run-hook-with-args-until-success
|
||||||
'org-todo-get-default-hook state org-last-state)
|
'org-todo-get-default-hook state org-last-state)
|
||||||
state))
|
org-state))
|
||||||
(next (if state (concat " " state " ") " "))
|
(next (if org-state (concat " " org-state " ") " "))
|
||||||
(change-plist (list :type 'todo-state-change :from this :to state
|
(change-plist (list :type 'todo-state-change :from this :to org-state
|
||||||
:position startpos))
|
:position startpos))
|
||||||
dolog now-done-p)
|
dolog now-done-p)
|
||||||
(when org-blocker-hook
|
(when org-blocker-hook
|
||||||
@ -11337,16 +11337,16 @@ For calling through lisp, arg is also interpreted in the following way:
|
|||||||
(run-hook-with-args-until-failure
|
(run-hook-with-args-until-failure
|
||||||
'org-blocker-hook change-plist))))
|
'org-blocker-hook change-plist))))
|
||||||
(if (org-called-interactively-p 'interactive)
|
(if (org-called-interactively-p 'interactive)
|
||||||
(error "TODO state change from %s to %s blocked" this state)
|
(error "TODO state change from %s to %s blocked" this org-state)
|
||||||
;; fail silently
|
;; fail silently
|
||||||
(message "TODO state change from %s to %s blocked" this state)
|
(message "TODO state change from %s to %s blocked" this org-state)
|
||||||
(throw 'exit nil))))
|
(throw 'exit nil))))
|
||||||
(store-match-data match-data)
|
(store-match-data match-data)
|
||||||
(replace-match next t t)
|
(replace-match next t t)
|
||||||
(unless (pos-visible-in-window-p hl-pos)
|
(unless (pos-visible-in-window-p hl-pos)
|
||||||
(message "TODO state changed to %s" (org-trim next)))
|
(message "TODO state changed to %s" (org-trim next)))
|
||||||
(unless head
|
(unless head
|
||||||
(setq head (org-get-todo-sequence-head state)
|
(setq head (org-get-todo-sequence-head org-state)
|
||||||
ass (assoc head org-todo-kwd-alist)
|
ass (assoc head org-todo-kwd-alist)
|
||||||
interpret (nth 1 ass)
|
interpret (nth 1 ass)
|
||||||
done-word (nth 3 ass)
|
done-word (nth 3 ass)
|
||||||
@ -11354,24 +11354,24 @@ For calling through lisp, arg is also interpreted in the following way:
|
|||||||
(when (memq arg '(nextset previousset))
|
(when (memq arg '(nextset previousset))
|
||||||
(message "Keyword-Set %d/%d: %s"
|
(message "Keyword-Set %d/%d: %s"
|
||||||
(- (length org-todo-sets) -1
|
(- (length org-todo-sets) -1
|
||||||
(length (memq (assoc state org-todo-sets) org-todo-sets)))
|
(length (memq (assoc org-state org-todo-sets) org-todo-sets)))
|
||||||
(length org-todo-sets)
|
(length org-todo-sets)
|
||||||
(mapconcat 'identity (assoc state org-todo-sets) " ")))
|
(mapconcat 'identity (assoc org-state org-todo-sets) " ")))
|
||||||
(setq org-last-todo-state-is-todo
|
(setq org-last-todo-state-is-todo
|
||||||
(not (member state org-done-keywords)))
|
(not (member org-state org-done-keywords)))
|
||||||
(setq now-done-p (and (member state org-done-keywords)
|
(setq now-done-p (and (member org-state org-done-keywords)
|
||||||
(not (member this org-done-keywords))))
|
(not (member this org-done-keywords))))
|
||||||
(and logging (org-local-logging logging))
|
(and logging (org-local-logging logging))
|
||||||
(when (and (or org-todo-log-states org-log-done)
|
(when (and (or org-todo-log-states org-log-done)
|
||||||
(not (eq org-inhibit-logging t))
|
(not (eq org-inhibit-logging t))
|
||||||
(not (memq arg '(nextset previousset))))
|
(not (memq arg '(nextset previousset))))
|
||||||
;; we need to look at recording a time and note
|
;; we need to look at recording a time and note
|
||||||
(setq dolog (or (nth 1 (assoc state org-todo-log-states))
|
(setq dolog (or (nth 1 (assoc org-state org-todo-log-states))
|
||||||
(nth 2 (assoc this org-todo-log-states))))
|
(nth 2 (assoc this org-todo-log-states))))
|
||||||
(if (and (eq dolog 'note) (eq org-inhibit-logging 'note))
|
(if (and (eq dolog 'note) (eq org-inhibit-logging 'note))
|
||||||
(setq dolog 'time))
|
(setq dolog 'time))
|
||||||
(when (and state
|
(when (and org-state
|
||||||
(member state org-not-done-keywords)
|
(member org-state org-not-done-keywords)
|
||||||
(not (member this org-not-done-keywords)))
|
(not (member this org-not-done-keywords)))
|
||||||
;; This is now a todo state and was not one before
|
;; This is now a todo state and was not one before
|
||||||
;; If there was a CLOSED time stamp, get rid of it.
|
;; If there was a CLOSED time stamp, get rid of it.
|
||||||
@ -11381,17 +11381,17 @@ For calling through lisp, arg is also interpreted in the following way:
|
|||||||
(org-add-planning-info 'closed (org-current-effective-time))
|
(org-add-planning-info 'closed (org-current-effective-time))
|
||||||
(if (and (not dolog) (eq 'note org-log-done))
|
(if (and (not dolog) (eq 'note org-log-done))
|
||||||
(org-add-log-setup 'done state this 'findpos 'note)))
|
(org-add-log-setup 'done state this 'findpos 'note)))
|
||||||
(when (and state dolog)
|
(when (and org-state dolog)
|
||||||
;; This is a non-nil state, and we need to log it
|
;; This is a non-nil state, and we need to log it
|
||||||
(org-add-log-setup 'state state this 'findpos dolog)))
|
(org-add-log-setup 'state org-state this 'findpos dolog)))
|
||||||
;; Fixup tag positioning
|
;; Fixup tag positioning
|
||||||
(org-todo-trigger-tag-changes state)
|
(org-todo-trigger-tag-changes org-state)
|
||||||
(and org-auto-align-tags (not org-setting-tags) (org-set-tags nil t))
|
(and org-auto-align-tags (not org-setting-tags) (org-set-tags nil t))
|
||||||
(when org-provide-todo-statistics
|
(when org-provide-todo-statistics
|
||||||
(org-update-parent-todo-statistics))
|
(org-update-parent-todo-statistics))
|
||||||
(run-hooks 'org-after-todo-state-change-hook)
|
(run-hooks 'org-after-todo-state-change-hook)
|
||||||
(if (and arg (not (member state org-done-keywords)))
|
(if (and arg (not (member org-state org-done-keywords)))
|
||||||
(setq head (org-get-todo-sequence-head state)))
|
(setq head (org-get-todo-sequence-head org-state)))
|
||||||
(put-text-property (point-at-bol) (point-at-eol) 'org-todo-head head)
|
(put-text-property (point-at-bol) (point-at-eol) 'org-todo-head head)
|
||||||
;; Do we need to trigger a repeat?
|
;; Do we need to trigger a repeat?
|
||||||
(when now-done-p
|
(when now-done-p
|
||||||
@ -11400,7 +11400,7 @@ For calling through lisp, arg is also interpreted in the following way:
|
|||||||
(save-match-data
|
(save-match-data
|
||||||
(setq org-agenda-headline-snapshot-before-repeat
|
(setq org-agenda-headline-snapshot-before-repeat
|
||||||
(org-get-heading))))
|
(org-get-heading))))
|
||||||
(org-auto-repeat-maybe state))
|
(org-auto-repeat-maybe org-state))
|
||||||
;; Fixup cursor location if close to the keyword
|
;; Fixup cursor location if close to the keyword
|
||||||
(if (and (outline-on-heading-p)
|
(if (and (outline-on-heading-p)
|
||||||
(not (bolp))
|
(not (bolp))
|
||||||
|
Loading…
Reference in New Issue
Block a user