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

creating filter not working #23

Open
Tracked by #1
super-tomcat opened this issue Oct 2, 2020 · 9 comments
Open
Tracked by #1

creating filter not working #23

super-tomcat opened this issue Oct 2, 2020 · 9 comments

Comments

@super-tomcat
Copy link

super-tomcat commented Oct 2, 2020

Everytime i try to create a filter with.... Edit Filter (press / e)... in the Emacs Packages buffer i get this in the messages....

tablist-filter-eval: Invalid function: (feval (filter) (pcase filter ((` (not , (and operand (guard (not (cdr operand)))))) (not (feval (car operand)))) ((` (and , (and operands (guard (= 2 (length operands)))))) (and (feval (nth 0 operands)) (feval (nth 1 operands)))) ((` (or , (and operands (guard (= 2 (length operands)))))) (or (feval (nth 0 operands)) (feval (nth 1 operands)))) ((` ((, op) , (and operands (guard (= (length operands) 1))))) (let ((fn (assq op tablist-filter-unary-operator))) (unless fn (error "Undefined unary operator: %s" op)) (funcall fn id entry (car operands)))) ((` ((, op) , (and operands (guard (= (length operands) 2))))) (let ((fn (cdr (assq op tablist-filter-binary-operator)))) (unless fn (error "Undefined binary operator: %s" op)) (funcall fn id entry (car operands) (cadr operands)))) ((guard (stringp filter)) (let ((fn (cdr (assoc filter named-alist)))) (unless fn (error "Undefined named filter: %s" filter)) (if (functionp fn) (funcall fn id entry)) (feval (if (stringp fn) (tablist-filter-unparse fn) fn)))) ((` nil) t) (_ (error "Invalid filter: %s" filter))))

@super-tomcat
Copy link
Author

Update..... removing all the byte-compiled .elc files from the tablist folder and filtering works okay

@adbjesus
Copy link

I was also having this issue and removing the .elc files worked for me as well, thanks @super-tomcat

@czikus
Copy link

czikus commented Jan 12, 2021

I'm also affected by this. Removing .elc helps.

@brittAnderson
Copy link

brittAnderson commented Dec 1, 2021

I just started getting this error and I don't have any .elc files to delete. Any further suggestions?

Oh. I see. Just in case anyone finds there way here. Using straight.el so I looked in ... repos/tablist but there is also a build/tablist with symlinks for the el files, but nothing for the elc files. The elc files were in the build/tablist directory not in the repos/tablist directory.

@vancleve
Copy link

I started getting this error a few days ago as well.

Deleting the .elc files didn't help nor did recompiling them.

Any other suggestions?

@brittAnderson
Copy link

Are you using straight.el? If so, there are subdirectories that straight manages that are at the same level of the hierarchy. One is "repo" the other is "build". You should look inside both of those for the .elc files to delete, and make sure that you have your packages for pdf-tools up to date. If you are not using "straight" then I don't know that this will help, and since I never really understood the source of the error, but was just following the instructions I won't be able to help further. Sorry.

@vancleve
Copy link

@brittAnderson yup, using doom emacs, which uses straight.el. I'll look there, thanks!

@matzebond
Copy link

matzebond commented Jun 2, 2022

I also ran into this issue (maybe even multiple times on different machines).
I too use straight as a package manager and a random combination of straight-rebuild-package straight-pull-package-and-deps and revert-buffer helped me.

Edit: The above did not work. revert-buffer rather deleted the pdf annotations and with no annotations the pdf-annot-list-annotations does not ran into the tablist filter issue.

Worth mentioning that straight does shows two "is a malformed function" warnings during byte-compilation.

$ /usr/bin/emacs -Q -L /home/maschm/.emacs.d/straight/build/tablist/ --batch --eval \
 "(let ((default-directory \"/home/maschm/.emacs.d/straight/build/\"))
  (normal-top-level-add-subdirs-to-load-path)
  (byte-recompile-directory \"/home/maschm/.emacs.d/straight/build/tablist/\" 0 'force))"
Checking /home/maschm/.emacs.d/straight/build/tablist/...
Compiling /home/maschm/.emacs.d/straight/build/tablist/tablist-autoloads.el...
Compiling /home/maschm/.emacs.d/straight/build/tablist/tablist-filter.el...

In tablist-filter-wisent-lexer:
tablist-filter.el:134:19: Warning: reference to free variable ‘binary-op’
tablist-filter.el:154:34: Warning: reference to free variable ‘keywords’
tablist-filter.el:134:8: Warning: reference to free variable ‘unary-op’

In tablist-filter-unparse:
tablist-filter.el:180:49: Warning: ‘(unparse (filter &optional noerror) (cond
    ((stringp filter) (if (or (string-match (nth 2
    tablist-filter-lexer-regexps) filter) (= 0 (length filter))) (format "%S"
    filter) filter)) ((and (eq (car-safe filter) 'not) (= (length filter) 2))
    (let ((paren (memq (car-safe (nth 1 filter)) '(or and)))) (format
    "!%s%s%s" (if paren "(" "") (unparse (cadr filter) noerror) (if paren ")"
    "")))) ((and (memq (car-safe filter) '(and or)) (= (length filter) 3))
    (let ((lparen (and (eq (car filter) 'and) (eq 'or (car-safe (car-safe (cdr
    filter)))))) (rparen (and (eq (car filter) 'and) (eq 'or (car-safe
    (car-safe (cddr filter))))))) (format "%s%s%s %s %s%s%s" (if lparen "("
    "") (unparse (cadr filter) noerror) (if lparen ")" "") (cl-case (car
    filter) (and "&&") (or "||")) (if rparen "(" "") (unparse (car (cddr
    filter)) noerror) (if rparen ")" "")))) ((and (assq (car-safe filter)
    tablist-filter-binary-operator) (= (length filter) 3)) (format "%s %s %s"
    (unparse (cadr filter) noerror) (car filter) (unparse (car (cddr filter))
    noerror))) ((and (assq (car-safe filter) tablist-filter-unary-operator) (=
    (length filter) 2)) (format "%s %s" (car filter) (unparse (cadr filter)
    noerror))) ((not filter) "") (t (funcall (if noerror 'format 'error)
    "Invalid filter: %s" filter))))’ is a malformed function

In tablist-filter-eval:
tablist-filter.el:229:55: Warning: ‘(feval (filter) (pcase filter (`(not \,
    (and operand (guard (not (cdr operand))))) (not (feval (car operand))))
    (`(and \, (and operands (guard (= 2 (length operands))))) (and (feval (nth
    0 operands)) (feval (nth 1 operands)))) (`(or \, (and operands (guard (= 2
    (length operands))))) (or (feval (nth 0 operands)) (feval (nth 1
    operands)))) (`(,op \, (and operands (guard (= (length operands) 1))))
    (let ((fn (assq op tablist-filter-unary-operator))) (unless fn (error
    "Undefined unary operator: %s" op)) (funcall fn id entry (car operands))))
    (`(,op \, (and operands (guard (= (length operands) 2)))) (let ((fn (cdr
    (assq op tablist-filter-binary-operator)))) (unless fn (error "Undefined
    binary operator: %s" op)) (funcall fn id entry (car operands) (cadr
    operands)))) ((guard (stringp filter)) (let ((fn (cdr (assoc filter
    named-alist)))) (unless fn (error "Undefined named filter: %s" filter))
    (if (functionp fn) (funcall fn id entry)) (feval (if (stringp fn)
    (tablist-filter-unparse fn) fn)))) (`nil t) (_ (error "Invalid filter: %s"
    filter))))’ is a malformed function
tablist-filter.el:229:55: Warning: Unused lexical argument `id'
tablist-filter.el:229:55: Warning: Unused lexical argument `entry'
tablist-filter.el:229:55: Warning: Unused lexical argument `named-alist'

In tablist-filter-help:
tablist-filter.el:320:4: Warning: ‘(princ-op (op) (princ (car op)) (princ (concat (make-string (max 0 (- 4 (length (symbol-name (car op))))) 32) "- " (car (split-string (or (documentation (cdr op)) (format "FIXME: Not documented: %s" (cdr op))) "
" t)) "
")))’ is a malformed function

In end of data:
tablist-filter.el:348:9: Warning: the function ‘princ-op’ is not known to be
    defined.
tablist-filter.el:271:16: Warning: the function ‘cl-position’ is not known to
    be defined.
tablist-filter.el:231:7: Warning: the function ‘feval’ is not known to be
    defined.
tablist-filter.el:227:6: Warning: the function ‘unparse’ is not known to be
    defined.
tablist-filter.el:181:4: Warning: the function ‘cl-labels’ is not known to be
    defined.
tablist-filter.el:120:27: Warning: the function ‘unary-op’ is not known to be
    defined.
tablist-filter.el:120:4: Warning: the function ‘cl-destructuring-bind’ is not
    known to be defined.
Compiling /home/maschm/.emacs.d/straight/build/tablist/tablist.el...

In toplevel form:
tablist.el:304:22: Warning: Use keywords rather than deprecated positional
    arguments to `define-minor-mode'
tablist.el:997:5: Warning: Use keywords rather than deprecated positional
    arguments to `define-minor-mode'
Done (Total of 2 files compiled, 1 skipped)

@jakobwuhrer
Copy link

jakobwuhrer commented Oct 17, 2022

I've repeatedly encountered this issue too (using guix + use-package)

in my case, running

(unload-feature 'tablist-filter t)
(load-file (find-library-name "tablist-filter"))

did the trick (though it's clearly a workaround, I think the guix package definition needs to be fixed)

I've set up an interactive function to do this since I frequently run into this issue:

(defun my-fix-tablist ()
  (interactive)
  (unload-feature 'tablist-filter t)
  (load-file (find-library-name "tablist-filter")))

KPCCoiL added a commit to KPCCoiL/tablist that referenced this issue Jan 1, 2023
`(require 'cl-lib)` was missing even though this file uses macros in cl-lib, such as `cl-labels`.
This caused problems when it is byte-compiled (ref. politza#23).
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

7 participants