alphapapa / alphapapa/org-ql

Handle multiple buffers-or-files with `org-ql-view--complete-buffers-files`

Aperta
#260 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Emacs Lisp
Stelle
1.6k
Fork
120
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Original issue: #227
Extending conversation from #228

From the original issue, there was an problem with the `initial-input` for `completing-read`. After testing a few things, an issue with the `org-ql-view--complete-buffers-files` not supporting multiple files when trying to refresh `org-ql-view` was found. Consequently the use of `completing-read-multiple` was proposed in #228.

The refactor of the `org-ql-view--complete-buffers-files` entails the following:
- [ ] Use `completing-read-multiple` in `org-ql-view--complete-buffers-files`
- [ ] Refactor `org-ql-view--contract-buffers-files` to allow displaying `buffers-or-files` in the view buffer
- All file names and buffers/buffer-names are normalized to allow identifying duplicates.
- When a list is passed, if it's not one of the special cases (eg: "org-directory"), make sure it's a list of strings.
- Remove duplicate entries if there are any (in theory this should never happen?)
- If the value being contracted is a function and it resolves to the `org-agenda-files` function, contract to "org-agenda-files" instead of a function.
- Expect the output of this function to be a list of strings, a string value, or a function.
- [ ] Refactor `org-ql-view--expand-buffers-files` to always return a list of string to allow displaying them in the view buffer
- Resolve all values to a list of strings and ensure no unique values are present in them.
- Refactoring `org-ql-view--expand-buffers-files` will impact `org-ql-view--link-follow` in the following ways:
- There is no need to test if the values returned by `org-ql-view--expand-buffers-files` is a buffer or string at https://github.com/alphapapa/org-ql/blob/31aeb0a2505acf8044c07824888ddec7f3e529c1/org-ql-view.el#L636
This will reflect in the test cases as well

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.