emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org.el (org-todo): Respect state argument when called from elisp
@ 2019-08-16 14:44 Renato Ferreira
  2019-08-16 22:41 ` Kyle Meyer
  0 siblings, 1 reply; 2+ messages in thread
From: Renato Ferreira @ 2019-08-16 14:44 UTC (permalink / raw)
  To: emacs-orgmode


(org-todo): Fast selection should only be shown if a state argument was not used
* list/org.el (org-todo): Respect argument when called from elisp
when calling from elisp (such as in `org-clock-in').

TINYCHANGE
---
 lisp/org.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 2451273e0..1b91adc18 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10100,9 +10100,6 @@ When called through ELisp, arg is also interpreted in the following way:
 					    (length tail) 2)
 					 org-todo-keywords-1)
 				  (org-last org-todo-keywords-1))))
-			     ((and org-todo-key-trigger org-use-fast-todo-selection)
-			      ;; Use fast selection.
-			      (org-fast-todo-selection this))
 			     (arg
 			      ;; User or caller requests a specific state.
 			      (cond
@@ -10121,7 +10118,9 @@ When called through ELisp, arg is also interpreted in the following way:
 				(user-error "State `%s' not valid in this file" arg))
 			       ((nth (1- (prefix-numeric-value arg))
 				     org-todo-keywords-1))))
+			     ((and org-todo-key-trigger org-use-fast-todo-selection)
+			      ;; Use fast selection.
+			      (org-fast-todo-selection this))
 			     ((null member) (or head (car org-todo-keywords-1)))
 			     ((equal this final-done-word) nil) ;-> make empty
 			     ((null tail) nil) ;-> first entry
--
2.22.1

Message-ID: <87lfvtywo4.fsf@gmail.com>

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] org.el (org-todo): Respect state argument when called from elisp
  2019-08-16 14:44 [PATCH] org.el (org-todo): Respect state argument when called from elisp Renato Ferreira
@ 2019-08-16 22:41 ` Kyle Meyer
  0 siblings, 0 replies; 2+ messages in thread
From: Kyle Meyer @ 2019-08-16 22:41 UTC (permalink / raw)
  To: Renato Ferreira, emacs-orgmode

Renato Ferreira <renatofdds@gmail.com> writes:

> (org-todo): Fast selection should only be shown if a state argument was not used
> * list/org.el (org-todo): Respect argument when called from elisp
> when calling from elisp (such as in `org-clock-in').

Thanks for the patch!  I hit this earlier today but hadn't yet looked
into it.  Testing this out, it fixes the issue introduced by f1c030bed
(Prefix argument to `org-todo' forces stage change logging, 2019-08-14),
while keeping the intended C-u behavior change from that patch.

> @@ -10121,7 +10118,9 @@ When called through ELisp, arg is also interpreted in the following way:
>  				(user-error "State `%s' not valid in this file" arg))
>  			       ((nth (1- (prefix-numeric-value arg))
>  				     org-todo-keywords-1))))
> +			     ((and org-todo-key-trigger org-use-fast-todo-selection)
> +			      ;; Use fast selection.
> +			      (org-fast-todo-selection this))
>  			     ((null member) (or head (car org-todo-keywords-1)))
>  			     ((equal this final-done-word) nil) ;-> make empty
>  			     ((null tail) nil) ;-> first entry

This patch didn't apply for me, and the hunk counts look off.  It should
be -10121,6, no?  Anyway, I've adjusted it so that it applies and pushed
it to master.  (I made a typo fix and a few small tweaks to your commit
message.)

-- 
Kyle

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-16 22:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-16 14:44 [PATCH] org.el (org-todo): Respect state argument when called from elisp Renato Ferreira
2019-08-16 22:41 ` Kyle Meyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).