ankurdave / color-identifiers-mode

Emacs minor mode to highlight each source code identifier uniquely based on its name
308 stars 23 forks source link

emacs 24.4 on cygwin - (wrong-type-argument listp :pcase--succeed) #23

Closed joefromct closed 1 year ago

joefromct commented 10 years ago

Hi,

For some reason i'm getting an error when trying to activate (color-identifiers-mode) in an emacs lisp file with emacs 24.4 compiled over cygwin (shouldn't be an issue i don't think?). The error reported is pcase--app-subst-match(:pcase--succeed sexp car x).

I'm not really sure where to start debugging something such as this so let me know what additional information i can provide. The Backtrace buffer in emacs shows something along these lines... i had trouble pasting everything into the issue as it had non-printable chars/etc.

Debugger entered--Lisp error: (wrong-type-argument listp :pcase--succeed)
pcase--app-subst-match(:pcase--succeed sexp car x)
#[257 "\303@\300\301\302$AB\207" [sexp car x pcase--app-subst-match] 6 "\n\n(fn BRANCH)"]    
((:pcase--succeed #[257 "\302\301\242>\204
 pcase--app-subst-rest((((and (match sexp app car (quote let*)) (match sexp app cdr rest)) #[257 "\302\301\242>\204
 pcase--app-subst-rest((((and (match sexp app car (quote let*)) (match sexp app cdr rest)) #[257 "\302\301\242>\204
pcase--u1(((match sexp app car (quote let)) (match sexp app cdr rest)) #[257 "\302\301\242>\204
joefromct commented 10 years ago

FYI, I've discovered that it has to do with using color-identifiers-mode with smart-parens-mode also on... the issue for me arises only when modifying a lisp file and not python, sql, etc.

Maybe something in emacs 24.4 changed around pcase?

(pcase sexp ((or (\` (let \, rest)) (\` (let* \, rest))) (append (when (listp (car rest)) (mapcar (lambda (var) (if (symbolp var) var (car var))) (car rest))) (color-identifiers:elisp-declarations-in-sexp rest))) ((or (\` (defun (\, -) (\, args) \, rest)) (\` (lambda (\, args) \, rest))) (append (when (listp args) args)         
(color-identifiers:elisp-declarations-in-sexp rest))) ((\` nil) nil) ((pred consp) (let ((cons sexp) (result nil)) (while (consp cons) (let ((ids (color-identifiers:elisp-declarations-in-sexp ...))) (when ids (setq result (append ids result)))) (setq cons (cdr cons))) (when cons (let ((ids (color-identifiers:elisp-declarations-in-sexp cons))) (when ids (setq result (append ids result))))) result)) (other-object nil))
  color-identifiers:elisp-declarations-in-sexp((show-paren-mode))
  (let* ((sexp (read (current-buffer))) (ids (color-identifiers:elisp-declarations-in-sexp sexp)) (strs (-filter (quote identity) (mapcar (function (lambda (id) (if ... ...))) ids)))) (setq result (append strs result)))
  (while t (let* ((sexp (read (current-buffer))) (ids (color-identifiers:elisp-declarations-in-sexp sexp))     (strs (-filter (quote identity) (mapcar (function (lambda ... ...)) ids)))) (setq result (append strs result))))
  (condition-case nil (while t (let* ((sexp (read (current-buffer))) (ids (color-identifiers:elisp-declarations-in-sexp sexp)) (strs (-filter (quote identity) (mapcar (function ...) ids)))) (setq result     (append strs result)))) (end-of-file nil))
  (save-excursion (goto-char (point-min)) (condition-case nil (while t (let* ((sexp (read (current-buffer))) (ids (color-identifiers:elisp-declarations-in-sexp sexp)) (strs (-filter (quote identity)     
(mapcar     ... ids)))) (setq result (append strs result)))) (end-of-file nil)))
  (let ((result nil)) (save-excursion (goto-char (point-min))
ankurdave commented 8 years ago

This bug probably still exists. If someone has an example of code that triggers it, that would be helpful in fixing it.

Hi-Angel commented 1 year ago

Can you please retest it with latest color-identifiers? I wonder if it's still a problem.

As a side note, I'm also using both color-identifiers and smartparens, but not in Cygwin though.

Hi-Angel commented 1 year ago

Actually, I just realized I did some fixes to this code in response to byte-compiler warnings in 2020. Since we never were given a reproducer and the author doesn't answer whether they still see it, I think we can assume it's fixed.

Please feel free to reopen if you see that again.