Commit graph

78 commits

Author SHA1 Message Date
Adam Porter
7f8328a87c Change: (-view--link-follow) Ignore second argument
Hopefully this allows compatibility with Org 9.4, since Org's news
file doesn't say what the second argument is.
2020-11-22 17:25:59 -06:00
Adam Porter
c41cd4be82 Change: (-view--link-open, -view--link-follow) Rename function
For consistency with Org's naming scheme.
2020-11-22 17:25:04 -06:00
Adam Porter
71703def04 Change: Query safety checks
- Variable org-ql-ask-unsafe-queries replaces
  org-ql-view-ask-unsafe-links.
- New function: org-ql--ask-unsafe-query.
- Tests: Improve
2020-11-16 23:52:15 -06:00
Adam Porter
50ba441415 Fix: (org-ql-view-bookmark-handler) Bookmark destructuring
See #147.  Thanks to @tpeacock19 for reporting.
2020-11-16 21:16:09 -06:00
Adam Porter
673edaca11 Fix: (org-ql-view--link-open) Handle Org 9.3 links
Or try to, anyway...
2020-11-16 04:52:45 -06:00
Adam Porter
c07971cd57 Tidy: Use -let* instead of pcase-let* for plists
This actually only fixes a problem with running the tests, because I
don't have a way to force map-2.1 to be installed into the sandbox, so
the tests on CI always fail.  So for now we just use -let* for this.
2020-11-16 03:49:46 -06:00
Adam Porter
7770285002 Fix: (org-ql-view--contract-buffers-files) Non-existent org-directory
Fixes #138.  Fixes #139.  Thanks to Matt Huszagh (@matthuszagh) for
reporting.

This *actually* fixes those issues.  The 0.4.7 release is related to
those issues, but those issues actually arose in code added to
0.5-pre.
2020-11-16 02:41:32 -06:00
Adam Porter
9d86ee9e10 Change/Fix: Bookmark, link storing/loading/safety
This makes several changes and fixes and adds test cases for all the
combinations I'm aware of.

See #147.  Thanks to @tpeacock19 for patiently reporting these issues.

Squashed commit of the following:

commit d1b396c5654ae3fa8ad03d0d4b2cbde20000fa1a
Author: Adam Porter <adam@alphapapa.net>
Date:   Mon Nov 16 02:01:23 2020 -0600

    WIP: Fixes

commit 23215a723c4bf6e249c330863e01029166db56c3
Author: Adam Porter <adam@alphapapa.net>
Date:   Mon Nov 16 01:34:34 2020 -0600

    WIP: Fixes

commit 97b13d09d4d52bb168bfc19fb6f8daf2964f4b6c
Author: Adam Porter <adam@alphapapa.net>
Date:   Mon Nov 16 00:46:49 2020 -0600

    WIP: Test links too

    Everything passes now.

commit 1866a71dbbb6416f7e365c90cadd269765d52b70
Author: Adam Porter <adam@alphapapa.net>
Date:   Sun Nov 15 22:22:22 2020 -0600

    WIP: Test loading/saving bookmarks
2020-11-16 02:02:22 -06:00
Adam Porter
8a1fd14590 Fix: (org-ql-view--link-store) Indirect buffers
Probably the best thing to do, even if it's not "correct" in a sense.
2020-11-14 22:29:53 -06:00
Adam Porter
511edbfff8 Notes: Make ToC after sorting 2020-11-14 20:58:19 -06:00
Adam Porter
5b401cd8b7 Tidy: (org-ql-view-bookmark-make-record) 2020-11-14 20:36:28 -06:00
Adam Porter
0a2b751464 Fix: (org-ql-view-bookmark-make-record) List of filenames
Fixes #148.  Thanks to @tpeacock19 for reporting.
2020-11-14 20:35:52 -06:00
Adam Porter
1b12d4e9b0 Fix: (org-ql-view--link-store) Don't re-format formatted queries
org-ql-view--format-query already returns a string.
2020-11-14 05:43:50 -06:00
Adam Porter
4a8deb541e Comment: Add FIXME 2020-11-14 05:43:12 -06:00
Adam Porter
f63012dd5a Fix: (org-ql-view--link-store) Rejection of unlinkable buffers
Also, remove the Org <=9.1.4 compatibility code.  It's not worth it.
I'm probably the only person who needs it, anyway, and I can live with
the double-call until I upgrade my Org version.

Fixes #148.  Thanks to @tpeacock19 for reporting.
2020-11-12 02:44:16 -06:00
Adam Porter
284eda87e5 Fix: (org-ql-view--link-store) Test Org version
See #147.  Thanks to @tpeacock19 for reporting.
2020-11-12 02:10:57 -06:00
Adam Porter
a5d4886880 Fix: (org-ql-view--link-open) Safety check the sort parameter 2020-11-12 00:22:23 -06:00
Adam Porter
689cfd68e7 Fix: (-view--link-open) Set org-super-agenda-allow-unsafe-groups 2020-11-11 22:52:54 -06:00
Adam Porter
6ab74454d0 Fix: (org-ql-view--expand-buffers-files) Remove eval support
This prevents arbitrary code execution when opening "org-ql-search:"
links.  (The links feature was just pushed to master in the last day
or so, and no stable release with the feature has been tagged.)  This
fix also means that arbitrary expressions are no longer accepted when
interactively completing the buffers-files argument to
org-ql-search (a worthy trade, I think; users who need to do that can
call the function from Lisp).
2020-11-11 20:51:24 -06:00
Adam Porter
2bed84aa1e Fix: (org-ql-view--contract-buffers-files) Don't check file exists
If the buffer has no filename, this will signal an error.
2020-11-11 19:54:13 -06:00
Adam Porter
b0e8fa2734 Tidy: Indentation 2020-11-11 19:52:46 -06:00
Adam Porter
04c94bc141 Change: (org-ql-view.el) Rename bookmark functions
They shouldn't be private functions, especially since one is autoloaded.
2020-11-11 19:52:24 -06:00
Adam Porter
0101bbebde Comment: Remove useless package header
Not the main library file.
2020-11-11 19:52:24 -06:00
Adam Porter
87b952c7bf Fix: (org-ql-view--link-store) Don't store link to buffers 2020-11-11 19:52:24 -06:00
Adam Porter
ef40a25b05 Change: (org-ql-view--link-store) Convert queries to strings
See #147.
2020-11-11 19:52:24 -06:00
Adam Porter
07d21e57c0 Tidy 2020-11-11 19:52:24 -06:00
Adam Porter
bfd4d462a0 Add/Change/Fix: Storing links to containing buffer or files
This feels too complicated, but I don't see a way around it, short of
redesigning all of the argument expansion/contraction, which might end
up in the same place, anyway.

See #147.
2020-11-11 19:52:24 -06:00
Adam Porter
8102d7a8ee Fix: (org-ql-view--format-element)
Actually, really fix it this time.

Fixes #150.  Thanks to @tpeacock19 for reporting.
2020-11-11 18:11:24 -06:00
Adam Porter
168041f0df Comment: Add FIXME 2020-11-11 04:24:34 -06:00
Adam Porter
78fd672cc7 Fix: (org-ql-view--format-element) Get tags from marker buffer
Fixes bug introduced in 359a280d11.

Fixes #150.  Thanks to @tpeacock19 for reporting.
2020-11-11 00:23:17 -06:00
Adam Porter
23e73addcf Fix: (-view--link-store, -view--link-open) Types, current-buffer
This is regrettably complicated.  Maybe someday Elsa will help...

Fixes #147 (again).  Thanks to @tpeacock19 for reporting.
2020-11-10 20:35:32 -06:00
Adam Porter
60b457eea4 Fix: (org-ql-view.el) Compiler warnings 2020-11-10 19:43:48 -06:00
Adam Porter
93f60ad478 Fix: (org-ql-view--link-store) Handle single filenames
Fixes #147.  Thanks to @tpeacock19 for reporting.
2020-11-10 19:42:12 -06:00
Adam Porter
364dfabca4 Add: (org-ql-view-ask-unsafe-links) 2020-11-10 19:42:12 -06:00
Adam Porter
5d563809e2 Change: (-view--link-open, -view--link-store) Links to views of files
Fixes #147.  Thanks to @tpeacock19 for reporting.
2020-11-10 18:27:33 -06:00
Adam Porter
1b43a88d32 Fix: (org-ql-view--link-store) Check buffers-files only when needed
See #147.  Thanks to @tpeacock19 for reporting.
2020-11-10 17:45:27 -06:00
Adam Porter
6d5ce97dc7 Fix: Byte-compile warnings 2020-11-10 04:14:01 -06:00
Adam Porter
992f3c2675 Add: Link support 2020-11-10 02:02:55 -06:00
Adam Porter
359a280d11 Change/Fix: (org-ql-view--format-element) Use org-ql--tags-at
Use org-ql--tags-at instead of org-get-tags/org-get-tags-at.  This
uses our cache, which should improve performance, and it obviates the
function alias for Org versions before 9.3 (which occasionally
misbehaves, e.g. if Org is reloaded).
2020-11-08 18:05:27 -06:00
Adam Porter
94be07244c Fix: (org-ql-view-refresh) Rename buffer uniquely
This is sort of a workaround or preventative measure as much as it is
a fix.  It seemed to be necessary when I was testing bookmark
loading in org-sidebar.
2020-11-05 11:21:33 -06:00
Adam Porter
028c25c106 Fix: (-view--bookmark-make-record) Replace buffers with filenames 2020-11-02 21:35:42 -06:00
Adam Porter
e5b4cd1065 Add: Bookmark support 2020-11-02 20:18:34 -06:00
Adam Porter
57708e6cc1 Change: (-view--plist, -view-save) Factor out plist code
In preparation for bookmark support.
2020-11-02 20:12:31 -06:00
Adam Porter
f4d7399e67 Fix: (org-ql-view--contract-buffers-files) Only compare to function
If the org-agenda-files variable points to a file pointing to a list
of agenda files, it shouldn't be compared to.  We should only compare
to the value returned by the org-agenda-files function.

Fixes #104.  Thanks to @gdindi for reporting.
2020-04-07 12:06:57 -05:00
Adam Porter
d55c01d2ae Merge: 0.4.4 2020-03-15 15:04:29 -05:00
Adam Porter
4fef5b089f Fix/Revert: Don't derive a new mode; check a variable in refresh
Using a different major mode in org-ql-view buffers causes some Org Agenda
remote commands to not work, because they test whether the major mode
is org-agenda-mode.  Even though these remote commands are not
guaranteed to work, it was not intended to break them now, so this
restores compatibility with them.

Fixes #102.  Thanks to Alois Janíček (@aloisjanicek) for reporting.

This reverts commit ba7d4a2e82.

Released as 0.4.4.
2020-03-15 15:02:52 -05:00
Adam Porter
5bc4a4a825 Merge: 0.4.3 2020-03-14 14:08:53 -05:00
Adam Porter
ba7d4a2e82 Add/Fix: org-ql-view-mode, and check when refreshing
Use a derived major mode for org-ql-view buffers, and ensure that mode
is active when calling org-ql-view-refresh, to avoid interfering with
buffers in other modes if the user calls the command by accident.

See
<b87156f2bb>.
Thanks to Alois Janíček (@AloisJanicek) for discovering the bug.

Released as 0.4.3.
2020-03-14 14:06:42 -05:00
Adam Porter
1688774ddd Change: (org-ql-view--header-line-format) Use keyword args 2020-03-09 17:40:41 -05:00
Adam Porter
f7d8b8c78c Fix: (org-ql-view-map) Bind q to bury-buffer
Because org-agenda-quit isn't useful in org-ql-view buffers.
2020-03-09 13:31:56 -05:00