Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes in org-dblock-write:org-ql #184

Closed
wants to merge 5 commits into from

Conversation

balaramadurai
Copy link

Now org-agenda-files can be included as well as any other list of files that work for org-ql.

Useful if you are doing your weekly, quarterly or yearly reviews.

#151 is something that triggered my thoughts.

Unverified

No user is associated with the committer email.
Now org-agenda-files can be included as well as any other list of files that work for org-ql.

Useful if you are doing your weekly, quarterly or yearly reviews.
@timinou
Copy link

timinou commented Jan 25, 2021

Hey!

I made a similar change in my config file, and I found that the links generated don't work, because they do not include the full path. That's a limitation of the original code...

You can check that yourself by making a dynamic block that gathers headlines from other files and following the generated links.

I'm pretty new with ELisp so I wasn't able to fix it. Best!

@balaramadurai
Copy link
Author

@timinou,
Thank you for your input. Well, I barely know enough elisp myself, but I hacked something from various sources and this seems to work now.

I haven't done extensive tests, but seems to serve my purpose.

Thanks @alphapapa and others for developing such a lovely package!
Bala

@timinou
Copy link

timinou commented Jan 26, 2021

Thanks @balaramadurai !

I imported your code to my config.org and I had to make two changes:

  1. I added a "*" before the heading description (that's how I would see links generated with org-store-link be)
  2. I couldn't access headings in files that were not in the same directory as the file that had the dynamic block. In my case, the dynamic block is in journal/2021-01.org, and the headings in question are in actions.org.

I fixed (2) by changing your "format" string to include org-directory, but I don't know if that's the most idiomatic way of doing it, so I didn't push it. Let's see if @alphapapa has a better solution at hand!

Thank indeed to everyone involved for such a useful package! It opens up org-mode's customisation to yet another level.

- `:link t` option gives the user an option whether to make the headings a link or not
- an element with `:file` to be added via `org-ql.el`
- this `:file` will be used here for the file-name with its path
`:file` needed to add the path and file name to the org-link
@balaramadurai
Copy link
Author

Thanks @timinou for the feedback.

I made changes to two files - org-ql.el and org-ql-search.el and fixed the file name and * issue for the heading name.

Please let me know if this works for you. It seems to be working for me.

I tested my setup with my org-agenda-files and in a scratch buffer. Seems to be working.

Thanks and have a good day!
Bala

balaramadurai added a commit to balaramadurai/org-ql that referenced this pull request Mar 15, 2021
- `:link t` option gives the user an option whether to make the headings a link or not
- an element with `:file` to be added via `org-ql.el`
- this `:file` will be used here for the file-name with its path

Further to this reply - alphapapa#184 (comment), I used the buffer name from org-marker element.

Now org-agenda-files can be included as well as any other list of files that work for org-ql.

Useful if you are doing your weekly, quarterly or yearly reviews.
@alphapapa
Copy link
Owner

Thanks for your patience.

I think this PR isn't suitable for merging, because it seems to contain some changes unrelated to the matter at hand (controlling the scope of the block's search).

As well, this enhancement will have to be carefully considered to avoid security risks. e.g. what kind of argument does the :file argument accept? If it accepts arbitrary Lisp, that would probably be a code-execution vulnerability, allowing anyone who can modify the file to cause arbitrary code to be run next time the block is updated. I've tried to account for those issues in the other block arguments with extensive tests and argument checking, and that would have to be done for this feature as well.

Since this PR doesn't address those issues, I'm closing it. Thanks for sending it, though. Please feel free to continue the discussion on #151.

@alphapapa alphapapa closed this Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants