Giter Club home page Giter Club logo

Comments (14)

zeltak avatar zeltak commented on July 28, 2024

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.

alphapapa avatar alphapapa commented on July 28, 2024

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.

alphapapa avatar alphapapa commented on July 28, 2024

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.

zeltak avatar zeltak commented on July 28, 2024

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.

alphapapa avatar alphapapa commented on July 28, 2024

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.

zeltak avatar zeltak commented on July 28, 2024

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.

alphapapa avatar alphapapa commented on July 28, 2024

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.

zeltak avatar zeltak commented on July 28, 2024

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.

alphapapa avatar alphapapa commented on July 28, 2024

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.

zeltak avatar zeltak commented on July 28, 2024

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.

alphapapa avatar alphapapa commented on July 28, 2024

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.

alphapapa avatar alphapapa commented on July 28, 2024

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.

zeltak avatar zeltak commented on July 28, 2024

hi

ofc id be happy to test, anything you need

best

z

from org-rifle.

alphapapa avatar alphapapa commented on July 28, 2024

Thanks. :) I'll make a new issue for that and close this one...

from org-rifle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.