Skip to content

org-ql-find snippet function error with vertico #419

Closed
@tpeacock19

Description

@tpeacock19

OS/platform

linux

Emacs version and provenance

Emacs 30.0.50 commit (20997aa20728a6fc2a3de736e9fc718b97dcef99).
GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.42, cairo version 1.18.0) of 2024-02-17

Emacs command

with-emacs.sh -i vertico -i org-ql

Org version and provenance

Org mode version 9.7-pre (release_N/A-N/A-57ec01 @ ~/.local/etc/emacs/elpa/org-9.7pre0.20240308.61420/)
Installed from elpa with package-install-upgrade-built-in = t

org-ql package version and provenance

Version: 20240222.200 Commit: e41fe90

Actions taken

Tried to run org-ql-find in an org buffer while using vertico

Observed results

I get this error (reformatted for legibility):

Error in post-command-hook (vertico--exhibit):
(wrong-number-of-arguments
 ((t) (regexp) "Return a snippet of the
current entry's matches for REGEXP."
  (if regexp
      (progn
	(save-excursion
	  (org-end-of-meta-data t)
	  (if
	      (org-at-heading-p) nil
	    (let* ((end (org-entry-end-position))
		   (snippets (let* ((--cl-var-- ""))
			       (while (re-search-forward
				       regexp end t) (setq
				       --cl-var--
				       (concat
					--cl-var--
					(match-string
					 0)))
				       (setq --cl-var--
					     (concat
					      --cl-var--
					      ""))
				       (goto-char
					(match-end 0)))
			       --cl-var--)))
	      (if (string-empty-p snippets)
		  nil
		(concat org-ql-completing-read-snippet-prefix
			(replace-regexp-in-string "
+" "  " snippets t t))))))))) 0)

Expected results

I expect the command to work with no error.

Backtrace

No response

Etc.

There seems to be a difference between the two built-in options org-ql-completing-read-snippet-function. The simple function does not require an argument whereas the regexp one does. Though the docstring for org-ql-completing-read--snippet-regexp states that the regexp parameter can be nil. This seems be solved by making this argument optional.

However, that may not be the root cause of the issue. I've tried to look through commit history for both org-ql and vertico to determine if there was a recent change, but I cannot find any. Happy to help debug however I can.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions