emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] capture: respect KEYS with GOTO arg [9.3.7 (release_9.3.7-661-g4aa4dd @ /home/n/.emacs.d/straight/build/org/)]
@ 2020-07-01 18:00 No Wayman
  2020-07-03  6:34 ` Kyle Meyer
  0 siblings, 1 reply; 3+ messages in thread
From: No Wayman @ 2020-07-01 18:00 UTC (permalink / raw)
  To: emacs-orgmode, No Wayman

[-- Attachment #1: Type: text/plain, Size: 308 bytes --]


`org-capture' does not pass its KEYS argument to 
`org-capture-goto-target'.
(Must not be a common use-case, as git blame points to 
org-capture's introduction 10 years ago!)

The attached patch does just that.
Wasn't sure if this was worthy of a NEWS entry. Will add if 
needed.

Thanks,
Nicholas Vollmer


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-capture-pass-keys-to-org-capture-goto-target --]
[-- Type: text/x-patch, Size: 970 bytes --]

From 4aa4dd120a74679afe33b7fe603035dd0379441a Mon Sep 17 00:00:00 2001
From: Nicholas Vollmer <iarchivedmywholelife@gmail.com>
Date: Wed, 1 Jul 2020 13:43:29 -0400
Subject: [PATCH] capture: org-capture pass KEYS with GOTO arg

* org-capture.el (org-capture): pass `keys' arg to `org-capture-goto-target'.

Allows programmatically visiting a specific template.
---
 lisp/org-capture.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index cc91251e0..2cc1ce394 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -628,7 +628,7 @@ of the day at point (if any) or the current HH:MM time."
     (setq org-overriding-default-time
 	  (org-get-cursor-date (equal goto 1))))
   (cond
-   ((equal goto '(4)) (org-capture-goto-target))
+   ((equal goto '(4))  (org-capture-goto-target keys))
    ((equal goto '(16)) (org-capture-goto-last-stored))
    (t
     (let* ((orig-buf (current-buffer))
-- 
2.27.0


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

* Re: [PATCH] capture: respect KEYS with GOTO arg [9.3.7 (release_9.3.7-661-g4aa4dd @ /home/n/.emacs.d/straight/build/org/)]
  2020-07-01 18:00 [PATCH] capture: respect KEYS with GOTO arg [9.3.7 (release_9.3.7-661-g4aa4dd @ /home/n/.emacs.d/straight/build/org/)] No Wayman
@ 2020-07-03  6:34 ` Kyle Meyer
  2020-07-05  6:14   ` No Wayman
  0 siblings, 1 reply; 3+ messages in thread
From: Kyle Meyer @ 2020-07-03  6:34 UTC (permalink / raw)
  To: No Wayman; +Cc: emacs-orgmode

No Wayman writes:

> `org-capture' does not pass its KEYS argument to 
> `org-capture-goto-target'.
> (Must not be a common use-case, as git blame points to 
> org-capture's introduction 10 years ago!)
>
> The attached patch does just that.

Thanks for the patch.  Indeed it looks like an oversight went unnoticed
for a long time.

> Wasn't sure if this was worthy of a NEWS entry. Will add if 
> needed.

In my view it doesn't require an entry.

> Subject: [PATCH] capture: org-capture pass KEYS with GOTO arg
>
> * org-capture.el (org-capture): pass `keys' arg to `org-capture-goto-target'.

After applying, I added "lisp/" in front of the file name and
capitalized "pass".

Pushed (99b8f36ab).


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

* Re: [PATCH] capture: respect KEYS with GOTO arg [9.3.7 (release_9.3.7-661-g4aa4dd @ /home/n/.emacs.d/straight/build/org/)]
  2020-07-03  6:34 ` Kyle Meyer
@ 2020-07-05  6:14   ` No Wayman
  0 siblings, 0 replies; 3+ messages in thread
From: No Wayman @ 2020-07-05  6:14 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: emacs-orgmode


Kyle Meyer <kyle@kyleam.com> writes:

> After applying, I added "lisp/" in front of the file name and
> capitalized "pass".
>
> Pushed (99b8f36ab).

Thanks, Kyle. Noted for future patches.


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

end of thread, other threads:[~2020-07-05  6:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-01 18:00 [PATCH] capture: respect KEYS with GOTO arg [9.3.7 (release_9.3.7-661-g4aa4dd @ /home/n/.emacs.d/straight/build/org/)] No Wayman
2020-07-03  6:34 ` Kyle Meyer
2020-07-05  6:14   ` No Wayman

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).