With this change, and customizing org-ql-open-buffers to it's
non-default value will give HUGE performance improvements to org-ql
queries when files are queried that aren't already loaded into
buffers.
This change does not modify any defaults and org-ql will work just as
before (and as slow) until org-ql-open-buffers is modified by the
user. This is due to backwards compatability.
* org-ql.el (org-ql-select): Don't always read files into buffers,
depending on user customization.
(org-ql--prepair-work-buffer, org-ql--work-buffer)
(org-ql--init-work-buffer): Helper functions to work with new
hidden work-buffer.
(org-ql--work-buffer-name): New variable for name of work-buffer.
(org-ql-open-buffers): User customization to choose whether org-ql
should open all files in separate buffers or not.
Had to (and needed to, anyway) use peg-1.0. And while this does less
macro magic, and less magic with cl-eval-when, I couldn't get around
using eval. I wish peg had a function that takes a list of rules and
returns a predicate that matches a string or at point. (I tried to
work around the lack of that by using parts of peg macros, but it's
very complicated, and everything I tried had one problem or another.)
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
This seems to fix an occasional weird bug encountered when
byte-compiling and loading this file. I can't explain why it only
happens sometimes, but this seems to fix it, and it stands to reason
why it does, so it seems like the right thing to do.
peg.el doesn't use lexical binding, and org-ql.el does, so this caused
a byte-compile warning. It doesn't seem to change the behavior of the
expanded code, so it should be a safe change...
Unfortunately, the macro was moved from peg.el to peg-tests.el in
later versions of peg, so we copy it for our use here.
Fixes#75. Thanks to Karl Voit (@novoid) and @karlicoss for
reporting.
Released as 0.4.6.
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.
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.
Even when org-done-keywords-for-agenda is nil. I'm not sure when this
was broken, but the logic was wrong in this function, and this is the
intended behavior, so this is a bug fix.
Released as 0.4.2.