-
Notifications
You must be signed in to change notification settings - Fork 109
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
Allow multiple values in `org-ql-view-buffers-files' #311
base: master
Are you sure you want to change the base?
Allow multiple values in `org-ql-view-buffers-files' #311
Conversation
commit d8f2922 Author: Ahmed Shariff <[email protected]> Date: Fri Sep 24 15:47:38 2021 -0500 Abstract buffers-files being flattened to a list of strings commit 2d49745 Author: Ahmed Shariff <[email protected]> Date: Fri Sep 17 17:53:21 2021 -0500 Fix: \w duplicates & func's with buffers/names with expand/contract commit 576f9d3 Author: Ahmed Shariff <[email protected]> Date: Thu Sep 16 18:42:32 2021 -0500 Handling support for functions \w functions using completing-read-multiple commit cea1651 Author: Ahmed Shariff <[email protected]> Date: Thu Sep 16 16:49:19 2021 -0500 Cleaning up functions and improvements for clarity. commit aa9c6cc Author: Ahmed Shariff <[email protected]> Date: Wed Sep 15 17:56:19 2021 -0500 Adding `comma separated` instruction to readme commit 564d491 Author: Ahmed Shariff <[email protected]> Date: Mon Sep 13 17:05:14 2021 -0500 Fixes for using mulitiple values and related test suite improvements commit ffaebcb Merge: 788951a 94f9e6f Author: Ahmed Shariff <[email protected]> Date: Mon Sep 13 13:15:57 2021 -0500 Merge branch 'master' of https://github.com/alphapapa/org-ql commit 788951a Author: Ahmed Shariff <[email protected]> Date: Mon Sep 13 11:01:55 2021 -0500 Replacing org-ql-view--expand-buffers-files commit cabf88e Author: Ahmed Shariff <[email protected]> Date: Mon Jul 19 00:19:52 2021 -0500 removing duplcates when expanding buffers-files commit b68d836 Author: Ahmed Shariff <[email protected]> Date: Sun Jul 18 23:49:54 2021 -0500 Using completing-read-multiple for org-ql-view--complete-buffers-files commit 06bdfc7 Author: Ahmed Shariff <[email protected]> Date: Sun Jul 4 23:32:08 2021 -0500 Fn always promts for buffer/files; handle buffer obj and list Fn: org-ql-view--complete-buffers-files With buffers, org-ql-view--contract-buffers-files return the buffer name. When org-ql-view-buffers-files is a list, just dumpt it as a string and check if completion-read returns the same value, if so return the original value of org-ql-view-buffers-files commit cc6e22d Author: Ahmed Shariff <[email protected]> Date: Sun Jul 4 23:31:31 2021 -0500 Allow reading buffer names for buffers-or-names commit 89b8476 Author: Ahmed Shariff <[email protected]> Date: Sat Jul 3 21:25:10 2021 -0500 Test cases for all org-ql-view--*-buffers-files functions commit 7120b63 Author: Ahmed Shariff <[email protected]> Date: Sat Jul 3 02:17:33 2021 -0500 Refactor of org-ql-view--complete-buffers-files Handles the different values `org-ql-view-buffers-files` can hold. Use completing-read only if `org-ql-view-buffers-files` is nil or the contracted form of `org-ql-view-buffers-files` is a string. commit 7b990e5 Author: Ahmed Shariff <[email protected]> Date: Wed Jun 30 18:01:49 2021 -0500 Fix for issue with initial-input in org-ql-view--complete-buffers-files
Hi again, After skimming through #228 again, I feel like quoting my last comment:
In other words, this still feels like too much to review, and we still lack carefully written problem statements which can be clearly and simply addressed. I do appreciate your work on this PR, and I especially noticed how much you put into the test cases. But, again, with this kind of issue--especially one that could present a security vulnerability--we need to be methodical. In the end, this may be an issue that I need to solve myself, when I have time, because I have to take responsibility for the solution, so I need to thoroughly understand its implementation. So I can't promise to use any code you submit. If you want to keep working on this, I don't object, but please proceed without any expectations. |
I completely understand your concerns. I couldn't think of a better way to break this down to smaller chunks; as the contraction and expansion functions are very much related. For now, I'll leave this here for now. I myself am using this for my daily tasks. If you need any help with the issues, please feel free to ping me. I'm more than happy to help, I enjoy hacking stuff anywho :) |
Thank you, that's very kind. You're right that it's not easy to atomize these concerns. It may be a while before I have time to visit this issue seriously. When I do, I'll study your code more carefully. The tests especially may be a good model. |
059b10c
to
77b4c2b
Compare
This is a revisit to the #228, apologize for not being able to get back to this sooner.
That PR had started trying to fix the init-value of the
completing-read
(#227) and wound up doing alot of other things.The goal of the PR is as follows:
org-ql-view-buffers-files
usingcompleting-read-multiple
This entails the following fixes:
completing-read-multiple
are correct and don't have duplicatesorg-ql-view-buffers-files
are handled correctlyorg-ql-view--complete-buffers-files
uses the correct contracted form, also respect any functions set it's instead.What I have here also had an interesting side-effect on the link-safety tests:
buffers-or-files
would cause theorg-ql-view--expand-buffers-files
signal an error atorg-ql/org-ql-view.el
Line 634 in 5f70636
org-ql/org-ql-view.el
Line 639 in 5f70636
I could have caught the error in the former and let the latter signal the error, but that didn't feel right to me