Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbol's function definition is void: org-ql-block #53

Closed
gcantieni opened this issue Nov 8, 2019 · 2 comments
Closed

Symbol's function definition is void: org-ql-block #53

gcantieni opened this issue Nov 8, 2019 · 2 comments
Assignees
Milestone

Comments

@gcantieni
Copy link

Hi there, for me it looks like org-ql-block is pointing to a non-existent function. When I run the example usage:

(setq org-agenda-custom-commands
      '(("t" "Custom: Agenda and Emacs SOMEDAY [#A] items"
         ((org-ql-block '(and (todo "SOMEDAY")
                              (tags "Emacs")
                              (priority "A"))
                        ((org-ql-block-header "SOMEDAY :Emacs: High-priority")))
          (agenda)))))

When I try to run this I get Symbol's function definition is void: org-ql-block. Additionally, when I call describe-function on org-ql-block I get:

org-ql-block is an alias for ‘org-ql-search-block’, which is not
defined.  Please make a bug report.


Not documented.
@alphapapa
Copy link
Owner

Hi,

That alias is autoloaded, so if it isn't working, I guess the package isn't installed correctly.

@alphapapa alphapapa reopened this Dec 25, 2019
@alphapapa alphapapa self-assigned this Dec 25, 2019
@alphapapa alphapapa added the bug label Dec 25, 2019
@alphapapa
Copy link
Owner

@gcantieni Thanks for your report. Comments on #75 have shown that there is a bug here. Steps to reproduce from my comments there:

  1. Start a clean Emacs config in a sandbox using https://github.com/alphapapa/alpha-org/blob/master/emacs-sandbox.sh.
  2. M-x package-install RET org-ql RET.
  3. Make and save test file:
* [#A] Heading                                                        :Emacs:
blah
  1. Add to agenda files with C-c [.
  2. Evaluate this Elisp:
(let ((org-agenda-custom-commands
       '(("a" ""
	  ((org-ql-block '(and 
                              (tags "Emacs")
                              (priority "A"))
			 ((org-ql-block-header ":Emacs: High-priority"))))))))
  (org-agenda nil "a"))

Output:

:Emacs: High-priority
  [#A] Heading                                                                                  :Emacs:
  1. Kill Emacs.
  2. Restart Emacs with the same config.
  3. Re-open the Org file.
  4. Repeat steps 4 and 5.

Result: A backtrace saying that org-ql-block is a void function.

However, then:

  1. C-h f org-ql-block RET to show the help buffer:
org-ql-block is an alias for ‘org-ql-search-block’ in
‘org-ql-search.el’.

Then:

  1. Repeat step 5.

Result: the agenda block is displayed properly, without error.

Also, these steps seem to indicate that the alias is loaded into Emacs, but the function is still void:

  1. Exit Emacs.
  2. Restart Emacs with the same config.
  3. C-h f org-ql-block RET.

Result:

org-ql-block is an alias for ‘org-ql-search-block’ in
‘org-ql-search.el’.

(org-ql-block QUERY)

Insert items for QUERY into current buffer.
...

Unlike the error message reported by @gcantieni, this shows that org-ql-search-block is loaded and defined, but when the example agenda code is run, the alias function is void. Loading org-ql-search fixes the problem, but it shouldn't be necessary, because the autoload should take care of it.

org-ql-search.el defines the alias like this:

;;;###autoload
(defalias 'org-ql-block 'org-ql-search-block)

For some reason that's not causing the alias to work, even though describe-function shows that it is loaded. More investigation will be required.

In the meantime, users can (require 'org-ql-search) in their Emacs configs to force the file to load and define the function and alias.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants