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

Change to without-restriction in Emacs 30 requires recompiling org-ql-find library #465

Open
al3xandru opened this issue Sep 16, 2024 · 6 comments

Comments

@al3xandru
Copy link

al3xandru commented Sep 16, 2024

OS/platform

macOS

Emacs version and provenance

GNU Emacs 30.0.91 (build 1, aarch64-apple-darwin23.6.0, NS appkit-2487.70 Version 14.6.1 (Build 23G93)) of 2024-09-13

Installed using brew via d12frosted/emacs-plus/emacs-plus@30: stable 30.0.91

Emacs command

Launch Emacs.app

Org version and provenance

Org mode version 9.7.11 (release_9.7.11 @ /opt/homebrew/Cellar/emacs-plus@30/30.0.91/share/emacs/30.0.91/lisp/org/)

org-ql package version and provenance

org-ql-20240829.2138 via elpa using use-package

Actions taken

Using the following code:

  (defun alpo/org-goto-day ()
    "A shortcut function to jump to today entry"
    (interactive)
    (defun alpo/org-ql-find-query-filter (query)
      (message "Query: %s" query)
      (cond ((string-equal "" query)
             (message "heading:%s" (format-time-string "%Y-%m-%d %A")))
            ((string-equal "." query)
             (message "heading:%s" (format-time-string "%Y-%m-%d %A")))
            ((string-match "^-?[0-9]+" query)
             (let* ((days (string-to-number query))
                    (new-time (time-add (current-time) (* 3600 24 days)))
                    (result (format-time-string "%Y-%m-%d %A" new-time)))
               ;; (message "Days: %d, Current time: %s, New time: %s, Result: %s" days (current-time) new-time result)
               (message "heading:%s" result)))
            (t (message "heading:%s" query))
            ))
    (org-ql-find (current-buffer) :query-filter 'alpo/org-ql-find-query-filter :prompt "Enter date:"))

Observed results

org-ql-find: Symbol’s function definition is void: internal--without-restriction

Expected results

The above function works in Emacs 29.x

Backtrace

No response

Etc.

Let me know if additional details are needed. Thank you

@alphapapa
Copy link
Owner

alphapapa commented Sep 16, 2024

Thanks for the report, but I can't offer support for unreleased versions of Emacs. As well, the symbol internal--without-restriction is not found in this package's source code. If you think that an in-development version of Emacs has introduced a bug, you should consider asking on emacs-devel or filing an Emacs bug report (but you should be careful to reproduce the problem in an empty Emacs configuration first, using the latest-available versions of all packages; see with-emacs.sh to make it easier).

Note as well that the code you shared appears to be somewhat bogus: you are calling defun within another defun. If you want to define a closure and call it, you should use cl-labels or a lambda.

@al3xandru
Copy link
Author

Thanks for the suggestion to improve the code used above.

My understanding is that it is org-ql-find that ends up invoking internal--without-restriction, most probably indirectly. If that's true, that means orq-ql-find won't work in the next version of Emacs.

@alphapapa
Copy link
Owner

alphapapa commented Sep 16, 2024

My understanding is that it is org-ql-find that ends up invoking internal--without-restriction, most probably indirectly. If that's true, that means orq-ql-find won't work in the next version of Emacs.

Since that symbol is not included in org-ql's source code, it would seem likely that whatever change is relevant would be found in another library, not in any of org-ql's.

As well, since the docstring of that function in Emacs 29 says that it's a helper for without-restriction, which is a macro, it seems likely that this is a case of running incompatible bytecode across Emacs versions, i.e. you likely need to recompile org-ql-find within the newer Emacs version (that's why I said that it's important to reproduce the problem in a clean Emacs configuration with the latest versions of packages).

@alphapapa alphapapa changed the title org-ql-find: Symbol’s function definition is void: internal--without-restriction Change to without-restriction in Emacs 30 requires recompiling org-ql-find library Sep 16, 2024
@al3xandru
Copy link
Author

Thank you for looking into it.

How can I recompile org-ql-find? Is this a matter of removing .elc from the package so Emacs recompiles when visiting? thank you

@alphapapa
Copy link
Owner

See M-x package-recompile.

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

No branches or pull requests

2 participants