From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markus Hauck Subject: [PATCH] Fix: allow org-refile in goto mode from everywhere Date: Mon, 07 Apr 2014 19:51:05 +0200 Message-ID: <878urhgh9y.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXDh4-0003rS-5V for emacs-orgmode@gnu.org; Mon, 07 Apr 2014 13:50:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXDgu-0007En-U6 for emacs-orgmode@gnu.org; Mon, 07 Apr 2014 13:50:50 -0400 Received: from mail-ee0-x22d.google.com ([2a00:1450:4013:c00::22d]:48999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXDgu-0007Df-Jb for emacs-orgmode@gnu.org; Mon, 07 Apr 2014 13:50:40 -0400 Received: by mail-ee0-f45.google.com with SMTP id d17so888895eek.18 for ; Mon, 07 Apr 2014 10:50:38 -0700 (PDT) Received: from ThinkPad-X220 (p4FDC2B31.dip0.t-ipconnect.de. [79.220.43.49]) by mx.google.com with ESMTPSA id o5sm43163953eeg.8.2014.04.07.10.50.36 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 07 Apr 2014 10:50:37 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable It seems like org-refile with the goto argument is no longer allowed From=20non 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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-org.el-org-refile-Allow-org-refile-goto-from-everywh.patch Content-Transfer-Encoding: quoted-printable Content-Description: allow org-refile from everywhere From=205a2fcef327ff463ed660dd594a6237df8d18d1a8 Mon Sep 17 00:00:00 2001 From: Markus Hauck 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 =2D-- 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 =2D-- 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 =2D (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 =2D (cond ((and arg (listp arg)) "Goto") + (cond ((or arg (listp arg)) "Goto") (regionp (concat actionmsg " region to")) (t (concat actionmsg " subtree \"" heading-text "\" to"))) =2D-=20 1.8.3 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJTQuWJAAoJEJY8eoendnVZM9sH/jKn6ecgSCPVV+4OP3d90FQ3 89cFs9kpWva/xzmKza43QOTDFRQZbxoi+VEVmh40tCGME9+BxQqzfn60td8TXS+/ QoGCDrK2lLlifxdKL3qo9YR8/57MOxQ0VGFFgP1ye/VhaW2s7VvvlTYg2Mc1sUiS /tgxpjm5s6sw8W/FuMT+ENgMSO3ixTM+IWaV9FAZrKTDtg/oW+dpjlpRI15Ak6Kh tRA7vKq2eX6lMjgDJYmwj1EIFl3rIAS7LiFuB1aQJc4v4B4gWKVKUVjRi3S9cvpf 30ND2BQTaYtDYgOEKVSiNdYtqTNrbLhI++PW8grzKoa5k0qF03TZdoZ5omordCo= =I7A9 -----END PGP SIGNATURE----- --==-=-=--