|
From: | Gustavo Barros |
Subject: | Re: org-refile-target-verify-function - use inherited tag & todo |
Date: | Sat, 02 Nov 2019 10:06:49 -0300 |
User-agent: | mu4e 1.2.0; emacs 26.3 |
Hi Nate, On Fri, Nov 01 2019, Nathan Neff wrote:
Indeed, I do use org-refile-use-outline-path 'file. However, I have a simpledirectory specified for my org-agenda-files. ("~/org-mode") ThereforeI'll need to do something a bit different.It appears that your solution creates "targets" which is the targets listof course, and then it creates "agenda-files" which goes through org-agenda-files and finds all the filenames in org-agenda files.It then mutates "targets", and removes any entry which is a filename fromorg-agenda-files.Since my org-agenda-files is simply ("~/org-mode/") none of the entriesmatch.Hmmm, let me ask: Why not simply go through targets and remove any entrywhose value isa simple filename? Why search org-agenda-files first? This function alsoassumes that the org-refile-targets always comes from org-agenda-files.I'll play with your function and see what I can get -- thank you for thehead-start! Thanks --Nate
I'm glad this might be useful to you. And you are correct in all of observations.
My main point is simply that, as things stand, you won't be able to trim the file level candidates with `org-refile-target-verify-function`, as they are hardcoded. But this simple function is the sketch of a (hackish) way.
`org-refile-get-targets`' main purpose is to return the list of targets. The advice function grabs this return value, filters the list and returns the filtered list. How it filters may depend, as you noted. I've chosen a simple criterion which meets my use case (`org-agenda-files`, as I specify the individual files directly there, and use only those as refile targets). Indeed, it does make some presumptions, as you noted. (The function does not "search org-agenda-files" though, it just gets the list of their names, which is contained in the variable). In your case, you will certainly have to devise another filtering criterion. I think the one you suggest is a good one too.
Best regards, Gustavo.
[Prev in Thread] | Current Thread | [Next in Thread] |