Comments (14)
Hi
thanks so much again i really love helm-org-refile. currently i see it only searches my agenda files. is there a way to have it search a specific directory holding other org files?
thx!
Z
from org-rifle.
Hi,
Thanks, glad you're enjoying it. Actually, the helm-org-rifle
command searches all currently open Org buffers, not agenda files. I'm planning to make a command to search specific files or directories of files soon. :)
from org-rifle.
Hi Z,
I just added two new commands which I hope will meet your needs. You may want to customize helm-org-rifle-close-unopened-file-buffers
, which defaults to nil
. If you set it to t
, it will leave open buffers that were not open before running a search, which will speed up subsequent searches. It will also clutter up the buffer list, so I defaulted it to nil
.
Please let me know how these new commands work for you. :)
from org-rifle.
Hi
thx for the update
i tried using the helm-org-rifle-directories
command
it asks for a directory which i choose via helm but then this is followed by asking for file after that?
what am i missing here?
best
Z
from org-rifle.
Hi Z,
Thanks for reporting that. It was happening if you selected directories that don't have Org files in them. I fixed it so that it will print an error instead. Do you think that's the best way to handle it?
from org-rifle.
Hi again
i see now. to me it would be ideal if it could recurse into the sub folders. for example i have a folder called uni
and in it sub folders named papers
lab
guides
which all contain org files.
ideally i would like to launch helm-org-rifle-directories
and point it to the uni
folder and it would search all the org files in the sub folders.
would that be possible?
thx!
Z
from org-rifle.
Actually it already does that if you call helm-org-rifle-directories
with a prefix:
(helm-org-rifle-directories PREFIX &optional DIRECTORIES)
Rifle through Org files in DIRECTORIES; with prefix, recurse into subdirectories.
If DIRECTORIES is nil, prompt with `helm-read-file-name'.
Does that work for you? I did some basic testing and it works for me, but I probably don't have as many org files as you do. I'd be glad to hear about its performance for larger sets of files.
I guess I could also add an option to recurse by default. What do you think? :)
Thanks for all your feedback!
from org-rifle.
Hi again
thank you for your amazing work, i LOVE helm-org-rifle :)
IMHO i think the recurs option should be default and not an added prefix. perhaps consider adding another command helm-org-rifle-directories-recursive
?
thx again, happy to test any other issues you may need.
PS i also have on my TODO list to try your other excellent org pacakges like org-protocol-capture-html and org-bookmark-heading :) will try to get to them tommorow
best and thanks again
Z
from org-rifle.
I decided to add an option for recursion and enabled it by default. Calling helm-org-rifle-directories
with a prefix inverts the option. Does this sound good? If you still want a separate function to call it recursively, you could do something like:
(defun helm-org-rifle-directories-recursive ()
(interactive)
(helm-org-rifle-directories nil t))
And if the option is disabled, this function would call it with recursion enabled. I think I'd rather avoid adding a separate command for it, though I might consider having something like a helm-org-rifle-extras.el
file with commands like that some people might want to add to their own configs.
thx again, happy to test any other issues you may need.
You're welcome. :) If you have time, I would like to hear about how fast it works for you when called recursively, like on your uni
directory. If the close-buffers
setting is enabled (as it is by default), it means that every time helm-org-rifle-directories
is called, every Org file found in that directory tree will be loaded into a buffer and have org-mode
enabled for it. Depending on one's particular config, that might be slow.
I have some ideas about ways to use grep
or git grep
to speed up searching unopened files, but I'm not sure if that will work out. And, of course, once the buffers are opened, the speed should probably be okay, depending on the number and size of the files.
PS i also have on my TODO list to try your other excellent org pacakges like org-protocol-capture-html and org-bookmark-heading :) will try to get to them tommorow
That would be great. I think they're working pretty well, but having sharp-eyed people like you and Jack give feedback helps immensely.
thank you for your amazing work, i LOVE helm-org-rifle :)
Thanks for your kind words. It's good to know that it's proving useful. :)
from org-rifle.
Hi again
thanks for the detailed response :)
i can confirm that with a prefix the helm-org-rifle-directories
does indeed recurs into other directories.
i can also report that the function you wrote
(defun helm-org-rifle-directories-recursive ()
(interactive)
(helm-org-rifle-directories nil t))
for some reason returns a error for me
`helm-org-rifle-directories-recursive: Wrong type argument: number-or-marker-p, nil``
also i can report that as you predicted running a recurs on my uni folder with org files >50 is SLOW ...very SLOW ;-)
planning to give org-boomarks and capture a go soon :)
Z
from org-rifle.
for some reason returns a error for me
helm-org-rifle-directories-recursive: Wrong type argument: number-or-marker-p, nil
I changed that function's arguments around the time I wrote that message, so you probably had the older version of it. I think if you install the latest version it should work.
also i can report that as you predicted running a recurs on my uni folder with org files >50 is SLOW ...very SLOW ;-)
Yeah, for Emacs to open 50 or more Org files and activate Org mode in each buffer is probably going to be slow most of the time. If a user leaves the buffers open, it should be faster after that, and the memory probably won't be an issue. The cluttered buffer list might be an issue, depending on how the user switches buffers. Using a "workspace" tool like perspectives or workspaces.el could help with the clutter.
Anyway, to search a whole directory tree of Org files, having Emacs open each one is just not very efficient. Maybe some minor optimizations could be done, like having it activate org-mode in a buffer only if a match is found, but that's not a very good solution.
What's probably needed is using something like grep or git grep to find matching lines in files and then process that further. I have some ideas about it but I don't know if they will work out very well. For results of matching lines, it's fine, but for matching org-mode entries, it practically requires loading the file into a buffer and using org-mode functions on it. I may have found a way to use git grep to parse org entries well enough to be useful, but that requires using git (which is a good idea anyway) and manually configuring a setting in the git repo.
Maybe some other tools like awk, ack, or ag could help. Or maybe even agrep. It would just be nice to be able to find matching Org entries without loading the buffer into Emacs first, and the multi-line nature of entries makes line-oriented tools difficult.
Well, sorry for the ramble, you don't need to read all that, just putting my thoughts together. :) But if you have any ideas, I'd be glad to hear them! :)
Thanks for your feedback.
from org-rifle.
Actually, BTW, I have an idea for a way to speed up the recursive searching in Emacs: if org-mode were not activated on each buffer, but only when a result is selected, that might help a lot.
If I were to put this together in a branch, would you be able to test it a little bit?
from org-rifle.
hi
ofc id be happy to test, anything you need
best
z
from org-rifle.
Thanks. :) I'll make a new issue for that and close this one...
from org-rifle.
Related Issues (20)
- Creating process pipe: Too many open files HOT 16
- tag inheritance and/or file matching HOT 1
- don't truncate headings HOT 3
- Changing value of helm-org-rifle-fontify-headings to nil causes helm-org-rifle-org-directory to stop working HOT 3
- org-narrow-to-subtree: prevents showing other parts of file, still shows from other files
- command-line client HOT 1
- Search gives up on small strings HOT 6
- Prioritising heading matches HOT 2
- Wrong number of arguments error with helm-org-rifle--refile HOT 1
- Req: Indication of status (progress, no results, which files have been searched?) HOT 1
- Req: Results in current file displayed first HOT 1
- helm-collect-matches error HOT 1
- Is there a way to do a exact match? HOT 1
- Disabling helm-org-rifle-fontify-headings breaks helm-org-rifle-agenda-files HOT 6
- helm-org-rifle-directories: how to add many directories? HOT 1
- Limit candidates to those with certain properties HOT 1
- Fix warning "Helm source <file>: after-init-hook Should be defined as a symbol HOT 1
- Docstring length warnings HOT 1
- Returned search results not always respecting sort order HOT 1
- Warning (emacs): ... after-init-hook Should be defined as a symbol HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from org-rifle.