org-ql icon indicating copy to clipboard operation
org-ql copied to clipboard

`helm-org-ql-org-directory` stuck with warnings

Open lyndhurst opened this issue 10 months ago • 4 comments

OS/platform

Linux EndeavourOS

Emacs version and provenance

GNU Emacs v29.4 nil Doom core v3.0.0-pre HEAD -> master b55d98849 2025-02-21 18:35:36 -0500 Doom modules v25.03.0-pre HEAD -> master b55d98849 2025-02-21 18:35:36 -0500

Emacs command

helm-org-ql-org-directory

Org version and provenance

Package: org
 Source: Straight
 Pinned: 2f5add467c0c20c9f2427cc77597c9aa1b742a75
  Build: HEAD -> main, tag: release_9.7.22 2f5add467 2025-02-14 08:38:05 +0100
         Build location: ~/.emacs.d/.local/straight/build-29.4/org/
         Repo location: ~/.emacs.d/.local/straight/repos/org/
 Recipe: (:host github :repo "emacs-straight/org-mode" :files

org-ql package version and provenance

origin/master, origin/HEAD 98c62ab 2024-11-25 17:49:54 -0600 installed from straight

Actions taken

  1. M-x helm-org-ql-org-directory
  2. Start typing "emacs"

Observed results

Image

Expected results

Image

Backtrace

There is no error, the following warnings are printed every time I type a character, and nothing else happens until I hit RET or C-g (both dismiss the helm minibuffer):

⛔ Error (org-ql-select): Not an Org buffer: *helm*
⛔ Warning (org-element): ‘org-element-at-point’ cannot be used in non-Org buffer #<buffer *Warnings*> (special-mode)
⛔ Error (org-ql-select): Not an Org buffer: *helm*
⛔ Warning (org-element): ‘org-element-at-point’ cannot be used in non-Org buffer #<buffer *Warnings*> (special-mode)

Etc.

I tried a few different scenarios like with the target files open in buffers or not, calling helm-org-ql-org-directory after a successful call to helm-org-rifle-org-directory.

I see these warnings pop up a lot when googling around, and they are self explanatory big picture wise, an Org buffer is expected. I understood from my searches that packages parse Org files in non Org buffers so the data loads faster.

It is not the first time it happens on my Doom installation, and I had to suppress some org-element warnings to be be able to save my literate config, it would hang for ever sometimes (could not find out why or when).

At first I was not going to report it as a bug since I was convinced that it was coming from me, or Doom. I decided to report it anyway because all other hem-org-ql commands work fine, and I wrote a small function to retrieve (recursively) the Org files in my org-directory, passed the list as an argument to helm-org-ql and it works perfectly well. This is how I got the "Expected results" screenshot :)

Anyway I have a working binding to achieve the same result, so I am not really bothered, but I thought maybe it could be useful to you. I am migrating to a plain Orgmode note taking setup, and I am 80% relying on your great packages (apart from Orgmode itself of course), so the least I can do is make a quick report.

Thanks for your time and your contributions.

lyndhurst avatar Feb 24 '25 16:02 lyndhurst

Hello,

Thanks for taking the time to write this report.

Please try to reproduce the problem in a non-DOOM configuration. It is strange that non-Org buffers are being searched, since the command explicitly searches Org files in org-directory.

Also, in your DOOM configuration, please try the org-ql-find-in-org-directory command, both with and without helm-mode enabled.

alphapapa avatar Feb 25 '25 04:02 alphapapa

Thanks for taking the time to write this report.

The very least I can do ;)

Also, in your DOOM configuration, please try the org-ql-find-in-org-directory command, both with and without helm-mode enabled.

I tried the command with both helm-mode enabled, and disabled, and then again both with toggle-debug-on-error, in all four cases, I had the exact same behavior:

  • No warnings,
  • No errors,
  • No candidates listed.

I am not sure if I did it right for the helm-mode part; I did M-x org-ql-find-in-org-directory followed by M-x helm-mode, a "helm-mode" indicator appeared in the input prompt, so I deemed it successful.

I also tried org-ql-find-path with the same function to list my org-directory files, it is working fine.

Please try to reproduce the problem in a non-DOOM configuration. It is strange that non-Org buffers are being searched, since the command explicitly searches Org files in org-directory.

I have been on Emacs for under a year, and I never used it outside of Doom unfortunately, so I am not sure how to proceed. I am aware of --debug-init and -q options; I tried the latter, but as I figured nothing is loaded, so no helm related commands. I guess I need to write a minimal config and start Emacs pointing to it, but it is not something I can achieve quickly. I will try to get around to it sometimes soon.

Please let me know if there is anything else I can do.

lyndhurst avatar Feb 25 '25 13:02 lyndhurst

You can use this script to easily run Emacs in a clean or separate configuration: https://github.com/alphapapa/with-emacs.sh

I am not sure if I did it right for the helm-mode part; I did M-x org-ql-find-in-org-directory followed by M-x helm-mode, a "helm-mode" indicator appeared in the input prompt, so I deemed it successful.

helm-mode should be toggled before running the command in question.

alphapapa avatar Feb 26 '25 23:02 alphapapa

I had actually tried activating the helm-mode before running the command, but nothing happens so I did not think it was worth mentioning. There is no error with toggle-debug-on-error enabled, and only the "Quit" message is printed in the echo area.

Thank you so much for the with-emacs.sh pointer, this is going to be very helpful, I cannot count how many times I wanted to test something in a clean environment. I was able to reproduce the error following those steps:

  1. Run with-emacs.sh -i helm-org-ql
  2. Run (setq org-directory "~/path/to/dir") in the Eval prompt
  3. M-x helm-org-ql-org-directory

Image

lyndhurst avatar Feb 27 '25 08:02 lyndhurst