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

Weird error in opening org-noter with Emacs 29.0.50 internal-macroexpand-for-load: Eager macro-expansion failure: (error "Misplaced t or ‘otherwise’ clause") #169

Open
Mark-Sol111 opened this issue Oct 10, 2022 · 5 comments

Comments

@Mark-Sol111
Copy link

GNU Emacs 29.0.50 (build 2, x86_64-apple-darwin19.6.0, NS appkit-1894.70 Version 10.15.7 (Build 19H2026)) of 2022-09-24
Run M-x org-noter in doc (pdf-tools buffer)
org-noter create doc and open it with error:
internal-macroexpand-for-load: Eager macro-expansion failure: (error "Misplaced t or ‘otherwise’ clause")
after that org-noter doesn't response

@wilya7
Copy link

wilya7 commented Dec 5, 2022

I had the same problem, however, after I deleted the whole content of .emacs.d/ and rebuild from scratch with only my init.el remaining, the error went away.

@jrgant
Copy link

jrgant commented Dec 14, 2022

Rebuilding didn't work for me, unfortunately. For anyone else looking for clues, I don't believe this issue is related to org-noter but to pdf-tools, more specifically pdf-annot-minor-mode.

Minimal steps to trigger the macro-expansion failure error:

  1. Open a PDF and activate pdf-view-mode
  2. Activate pdf-annot-minor-mode

I'm going to post an issue with the pdf-tools folks.

@lucasvreis
Copy link

This fixes the error (feel free to PR to pdf-tools, I could not find the issue there):

diff --git a/lisp/pdf-annot.el b/lisp/pdf-annot.el
index 81cb639..01465ea 100644
--- a/lisp/pdf-annot.el
+++ b/lisp/pdf-annot.el
@@ -524,12 +524,11 @@ the variable is nil and this function is called again."
            (union (cl-union (cl-union changed inserted :test 'pdf-annot-equal)
                             deleted :test 'pdf-annot-equal))
            (closure (lambda (arg)
-                      (cl-ecase arg
+                      (cl-case arg
                         (:inserted (copy-sequence inserted))
                         (:changed (copy-sequence changed))
                         (:deleted (copy-sequence deleted))
-                        (t (copy-sequence union))
-                        (nil nil))))
+                        (t (copy-sequence union)))))
            (pages (mapcar (lambda (a) (pdf-annot-get a 'page)) union)))
       (when union
         (unwind-protect

@jrgant
Copy link

jrgant commented Apr 2, 2023

Sorry, I completely dropped the ball on this. I just applied your fix and can confirm that it resolves the issue. Thank you.

@jrgant
Copy link

jrgant commented Apr 2, 2023

FYI, someone applied this fix already: vedang/pdf-tools@49078c7. Should be reflected in the most recent pdf-tools release (v1.0.0).

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

4 participants