* [PATCH] Fix: allow org-refile in goto mode from everywhere
@ 2014-04-07 17:51 Markus Hauck
2014-04-11 10:00 ` Bastien
2014-04-20 6:04 ` Bastien
0 siblings, 2 replies; 4+ messages in thread
From: Markus Hauck @ 2014-04-07 17:51 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 570 bytes --]
It seems like org-refile with the goto argument is no longer allowed
From non org-mode buffers. In commit 49da67d the condition was changed
from:
(unless goto ...)
to:
(unless (and goto (listp goto)) ...)
where the condition of unless is only true for non-empty lists. IMO the
condition has to be:
(unless (or goto (listp goto)) ...)
(replace and with or) due to the `unless`, so that either t or '(.....)
is checked.
This patch allows org-refile with the goto flag from outside org-buffers
(again).
Patch is attached.
Best,
Markus
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: allow org-refile from everywhere --]
[-- Type: text/x-diff, Size: 1683 bytes --]
From 5a2fcef327ff463ed660dd594a6237df8d18d1a8 Mon Sep 17 00:00:00 2001
From: Markus Hauck <markus1189@gmail.com>
Date: Mon, 7 Apr 2014 19:21:43 +0200
Subject: [PATCH] org.el (org-refile): Allow org-refile goto from everywhere
* lisp/org-agenda.el (org-refile): Flip logic to allow instead of
prohibit the use of `org-refile' with the goto flat from non
org-mode buffers.
In commit 49da67d the condition was changed from only
`(unless goto ...)` to `(unless (and goto (listp arg)) ...)`
where the `and` condition is only true for non-empty lists, so that
calling `(org-refile t)` complains about not being inside an org-mode
buffer.
With this patch org-refile can be used (again) from anywhere when
passed the goto flag to jump to the chosen task.
TINYCHANGE
---
lisp/org.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index f8615a2..1705c5e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11675,7 +11675,7 @@ prefix argument (`C-u C-u C-u C-c C-w')."
(setq it (or rfloc
(let (heading-text)
(save-excursion
- (unless (and arg (listp arg))
+ (unless (or arg (listp arg))
(org-back-to-heading t)
(setq heading-text
(replace-regexp-in-string
@@ -11683,7 +11683,7 @@ prefix argument (`C-u C-u C-u C-c C-w')."
"\\3"
(nth 4 (org-heading-components)))))
(org-refile-get-location
- (cond ((and arg (listp arg)) "Goto")
+ (cond ((or arg (listp arg)) "Goto")
(regionp (concat actionmsg " region to"))
(t (concat actionmsg " subtree \""
heading-text "\" to")))
--
1.8.3
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 489 bytes --]
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix: allow org-refile in goto mode from everywhere
2014-04-07 17:51 [PATCH] Fix: allow org-refile in goto mode from everywhere Markus Hauck
@ 2014-04-11 10:00 ` Bastien
2014-04-20 6:04 ` Bastien
1 sibling, 0 replies; 4+ messages in thread
From: Bastien @ 2014-04-11 10:00 UTC (permalink / raw)
To: Markus Hauck; +Cc: emacs-orgmode
Hi Markus,
I applied your patch on maint, thanks for the clear explanations
and the perfectly formatted patch.
Best,
--
Bastien
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix: allow org-refile in goto mode from everywhere
2014-04-07 17:51 [PATCH] Fix: allow org-refile in goto mode from everywhere Markus Hauck
2014-04-11 10:00 ` Bastien
@ 2014-04-20 6:04 ` Bastien
2014-04-21 17:59 ` Markus Hauck
1 sibling, 1 reply; 4+ messages in thread
From: Bastien @ 2014-04-20 6:04 UTC (permalink / raw)
To: Markus Hauck; +Cc: emacs-orgmode
Hi Markus,
Markus Hauck <markus1189@gmail.com> writes:
> It seems like org-refile with the goto argument is no longer allowed
> From non org-mode buffers.
I reverted your patch.
> In commit 49da67d the condition was changed from:
>
> (unless goto ...)
>
> to:
>
> (unless (and goto (listp goto)) ...)
>
> where the condition of unless is only true for non-empty lists.
That's in fact on purpose. If you want to use org-refile to go to
a location, use (org-refile '(4)), the '(4) emulates the universal
prefix argument. Note that
With your patch, the prompt for org-refile (as (org-refile nil))
was asking "Goto: " because (listp nil) is `t'.
Let me know if I missed something.
--
Bastien
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix: allow org-refile in goto mode from everywhere
2014-04-20 6:04 ` Bastien
@ 2014-04-21 17:59 ` Markus Hauck
0 siblings, 0 replies; 4+ messages in thread
From: Markus Hauck @ 2014-04-21 17:59 UTC (permalink / raw)
To: Bastien; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 822 bytes --]
Hi Bastien,
I think you're right, sorry for any inconveniences ;)
Bastien <bzg@gnu.org> writes:
> Hi Markus,
>
> Markus Hauck <markus1189@gmail.com> writes:
>
>> It seems like org-refile with the goto argument is no longer allowed
>> From non org-mode buffers.
>
> I reverted your patch.
>
>> In commit 49da67d the condition was changed from:
>>
>> (unless goto ...)
>>
>> to:
>>
>> (unless (and goto (listp goto)) ...)
>>
>> where the condition of unless is only true for non-empty lists.
>
> That's in fact on purpose. If you want to use org-refile to go to
> a location, use (org-refile '(4)), the '(4) emulates the universal
> prefix argument. Note that
>
> With your patch, the prompt for org-refile (as (org-refile nil))
> was asking "Goto: " because (listp nil) is `t'.
>
> Let me know if I missed something.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 489 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-04-21 17:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-07 17:51 [PATCH] Fix: allow org-refile in goto mode from everywhere Markus Hauck
2014-04-11 10:00 ` Bastien
2014-04-20 6:04 ` Bastien
2014-04-21 17:59 ` Markus Hauck
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).