minad / consult

:mag: consult.el - Consulting completing-read
GNU General Public License v3.0
1.13k stars 99 forks source link

consult-keep-lines in scrach buffer - org-element--cache warning #840

Closed vondravl closed 8 months ago

vondravl commented 8 months ago

Hi, I', not sure if it is really error in consult or org-mode, but when trying to use consult-keep-lines in scratch buffer I'm getting this warning: Warning (org-element-cache): org-element--cache: Org parser error in *scratch*::143. Resetting. The error was: (wrong-type-argument integer-or-marker-p nil) Backtrace: nil Please report this to Org mode mailing list (M-x org-submit-bug-report).

It happens only in scrach, in regular buffers it is ok.

I'm using GNU Emacs 29.1 (build 2, x86_64-w64-mingw32) of 2023-07-31 Org mode version 9.6.6, consult-20230906.2047

oantolin commented 8 months ago

Is your scratch buffer in Org mode?

vondravl commented 8 months ago

Yes, it is. Shouldn't be? Proper buffers in orgmode mode work without warning.

oantolin commented 8 months ago

Shouldn't be?

It's fine to have the scratch buffer in Org mode. I just asked because if it wasn't in Org mode your issue would be even more mysterious.

minad commented 8 months ago

@vondravl I suggest to do this:

Please report this to Org mode mailing list (M-x org-submit-bug-report)

Maybe consult-keep-lines triggers a bug in Org due its modifications? As a workaround it may help to disable the cache, see org-element-use-cache and org-element-cache-persistent.

As an alternative, did you try consult-focus-lines? This command temporarily hides regions, which is probably preferrable in many scenarios.

vondravl commented 8 months ago

consult-focus-lines works and fits even better for my purpose. Thank you very much for help!