emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* refile workflow -- move to same heading in different file?
@ 2017-08-02 15:11 Raymond Zeitler
  2017-08-03 10:07 ` Adam Porter
  0 siblings, 1 reply; 14+ messages in thread
From: Raymond Zeitler @ 2017-08-02 15:11 UTC (permalink / raw)
  To: 'org-mode mailing list'

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

How do I customize org to refile from one file to another?  I am baffled
that org-refile is not set up to do this out-of-the-box.

 

versions:

Org mode version 9.0.9 (9.0.9-30-g796a78-elpa @
c:/Users/rayz/AppData/Roaming/RZHOME/.emacs.d/elpa/org-20170703/)

GNU Emacs 25.2.1 (x86_64-w64-mingw32) of 2017-04-24

Windows 7 SP1

user is a member of the local administrator group

 

Details.

C-c C-w cannot seem to recognize any of my agenda files, even though
org-refile-targets is set to (in custom-set-variables):

(org-refile-targets (quote ((org-agenda-files :regexp . "Tasks"))))

 

Suppose org-agenda-files contains "~/proj1.org" "~/proj2.org" "~/proj3.org"
"~/todo.org".

 

My expectation is that when I press C-c C-w with point on a subheading of
Tasks in todo.org, I can specify, say proj1.org and get the subheading moved
to proj1.org under Tasks.  However, org-refile responds [No Match], even if
I provide the file as ~/proj1.org.  And Emacs is visiting proj1.org in
another buffer.

 

So I now do this manually:

 

Visit todo.org

For Each subheading of Tasks related to proj1.

    Place point at the start of subheading

    Invoke set-mark-command at end of subheading

    ; and BTW this is very tricky business, I guess due to narrowing

    kill

    switch buffer to proj1.org

    place point as close to column 1 under the Tasks line

    ; again very tricky business

    yank

    switch buffer back to todo.org

Next

 

(Sorry for posting pseudocode that resembles Vi$ual Ba$ic!  The org-babel
question for *that* is in queue.)

 

- Ray


[-- Attachment #2: Type: text/html, Size: 4399 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: refile workflow -- move to same heading in different file?
@ 2017-08-03 18:52 Raymond Zeitler
  2017-08-04  1:51 ` Adam Porter
  0 siblings, 1 reply; 14+ messages in thread
From: Raymond Zeitler @ 2017-08-03 18:52 UTC (permalink / raw)
  To: 'Adam Porter', emacs-orgmode

Thank you for responding.

1.  org-refile-targets ... value is ((org-agenda-files :regexp . "Tasks"))
Seems OK.  But then I see that org-refile-target-verify-function is nil,
which seems like a problem.  Mind you, this is the default configuration,
and I'm not sure what to change it to.

2.  I placed the let block below into a subheading of Tasks in my todo.org
and then evaluated it.  The error that Emacs returned follows that:
(let ((org-refile-targets (quote (((org-agenda-files) :regexp . "Tasks")))))
(org-refile))
org-find-base-buffer-visiting: Wrong type argument: stringp,
org-agenda-files

org-agenda-files evaluates to:
("~/HR.org" "~/1234.org" "~/2345.org" "~/3456.org" "~/4567.org"
"~/todo.org")
All those files exist, and they load when I invoke org-agenda.

I also tried the setting used by Sacha Chua(1), shown below.  The error that
Emacs returned follows that (but at least that's an error from the let
function and not an org function, so it might indicate a problem with how I
wrote it):
(let (org-refile-targets '((org-agenda-files . (:maxlevel . 3))))
(org-refile))
let: Invalid function: (org-agenda-files :maxlevel . 3)

Then on reddit there's naught-me's setting(2), upon which I based this:
(let ((org-refile-targets (quote ("~/HR.org" :maxlevel . 3) ("~/todo.org"
:regexp . "tasks"))) (org-refile))
This returns: funcall-interactively: End of file during parsing

I have no clue how to proceed.  And I spent far too much time on this.  Fun,
but very unproductive.

3. Helm is on my todo.org, actually, but I've put it off because of how
formidable it seems.

(1) http://pages.sachachua.com/.emacs.d/Sacha.html#org2789cb5
(2)
https://www.reddit.com/r/emacs/comments/4366f9/how_do_orgrefiletargets_work/

- Ray

-----Original Message-----
From: Emacs-orgmode [mailto:emacs-orgmode-bounces+zeitra=yahoo.com@gnu.org]
On Behalf Of Adam Porter
Sent: Thursday, August 03, 2017 6:08 AM
To: emacs-orgmode@gnu.org
Subject: Re: [O] refile workflow -- move to same heading in different file?

"Raymond Zeitler" <zeitra@yahoo.com> writes:

> C-c C-w cannot seem to recognize any of my agenda files, even though 
> org-refile-targets is set to (in custom-set-variables):
>
> (org-refile-targets (quote ((org-agenda-files :regexp . "Tasks"))))
>
> Suppose org-agenda-files contains "~/proj1.org" "~/proj2.org"
"~/proj3.org" "~/todo.org".
>
> My expectation is that when I press C-c C-w with point on a subheading 
> of Tasks in todo.org, I can specify, say proj1.org and get the 
> subheading moved to proj1.org under Tasks. However, org-refile 
> responds [No Match], even if I provide the file as ~/proj1.org. And 
> Emacs is visiting proj1.org in another buffer.

Hi Raymond,

Going on what you've provided, it sounds like it should work.  A few
suggestions:

1.  In case you haven't yet (but you probably have), check describe-variable
for org-refile-targets.

2.  If you have any doubt about org-refile-targets being set correctly,
experiment with setting it and calling org-refile inside a (let).

3.  I haven't used the default Emacs completion in years; I'm so used to
having Helm that when I have to run "emacs -q" now and then, completing
buffer names and such is painful!  :)  So I'd suggest temporarily, at least,
using Helm as the default completing-read method, which will make it much
easier to debug by showing you the full list of candidates.
That way, if it's empty to begin with, you know something's really wrong; or
if it's full, but it shows [No Match] after you type something in, that
should help you narrow down the cause.

Hope this helps.


----------------------------------------------------
This message has been processed by Firetrust Benign.

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: refile workflow -- move to same heading in different file?
@ 2017-08-04  4:14 Raymond Zeitler
  2017-08-04 10:21 ` Adam Porter
  0 siblings, 1 reply; 14+ messages in thread
From: Raymond Zeitler @ 2017-08-04  4:14 UTC (permalink / raw)
  To: 'Adam Porter', emacs-orgmode

Adam Porter wrote:
> Try this, it seems to work for me:
> 
> (let ((org-refile-targets '((org-agenda-files . (:regexp . "Tasks")))))
>   (org-refile))
> 
> This is one advantage of the customize system: it makes it harder to get
> these structures wrong.  :)

I get the same [No Match] result that I was getting originally.  I'm really
not happy about needing yet another package just to get some basic
functionality to work.  Besides, "package-install RET helm RET" results in
yet another [No Match].  Makes me think I should wipe out Emacs entirely and
do a fresh installation.

Meanwhile, if Helm is needed to make this work, maybe it should be
documented.  I wonder if it works for anyone who's not using Helm....

Gosh, I was really hoping to be doing export to ODT or PDF by now!

- Ray

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: refile workflow -- move to same heading in different file?
@ 2017-08-04 15:02 Raymond Zeitler
  2017-08-05  2:31 ` Adam Porter
  0 siblings, 1 reply; 14+ messages in thread
From: Raymond Zeitler @ 2017-08-04 15:02 UTC (permalink / raw)
  To: 'Adam Porter', emacs-orgmode

Adam Porter <adam@alphapapa.net> writes:

>"Raymond Zeitler" <zeitra@yahoo.com> writes:
-snip-
>> Makes me think I should wipe out Emacs entirely and do a fresh 
>> installation.

>I would try with "emacs -q" first.  Although since you're on Windows,
>it wouldn't surprise me if something isn't setup correctly.

With emacs -q I get the same [No Match] response.  But I was
pleasantly surprised that Org loaded automatically when I visited
~/todo.org, and the default layout was fairly pleasing.

>How did you install Emacs?

I unzipped emacs-25.2-x86_64.zip into c:\emacs-25.2_64 .  I installed
Org with package-list-packages and clicked on the link to install org.
Also, I started with a blank .emacs then added some old customizations
a little at a time.  Everything runs great, except for C-c C-w/.

I couldn't find installation instructions specifically for a Windows
non-administrator.  I know that C:\ is not accessible to non-admins,
so I considered putting it in %home%.  I might need to do that soon
due to new company policies.

>> Meanwhile, if Helm is needed to make this work, maybe it should be 
>> documented.  I wonder if it works for anyone who's not using Helm....

>It's not, and it does.

This is great info for me to have, so I'm motivated to keep trying.

Thanks for your help and patience.  Sorry I cluttered the list with
an Emacs config problem!

- Ray

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

end of thread, other threads:[~2017-08-06 19:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-02 15:11 refile workflow -- move to same heading in different file? Raymond Zeitler
2017-08-03 10:07 ` Adam Porter
  -- strict thread matches above, loose matches on Subject: below --
2017-08-03 18:52 Raymond Zeitler
2017-08-04  1:51 ` Adam Porter
2017-08-04  4:14 Raymond Zeitler
2017-08-04 10:21 ` Adam Porter
2017-08-04 10:53   ` Joost Kremers
2017-08-05  2:35     ` Adam Porter
2017-08-04 15:02 Raymond Zeitler
2017-08-05  2:31 ` Adam Porter
2017-08-05 12:41   ` Raymond Zeitler
2017-08-06  4:12     ` Raymond Zeitler
2017-08-06 10:23       ` Adam Porter
2017-08-06 19:52         ` Raymond Zeitler

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