clojure-emacs/sayid

Pressing g in the *sayid* windows results in wrong-type-argument

Opened this issue · 12 comments

Exactly where should I have the focus on when doing the 'g' command? Now I get an error.

This is the call stack:

Debugger entered--Lisp error: (wrong-type-argument stringp (now-as-str))

string-match("\`-+\'" (now-as-str))
menu-bar-update-yank-menu((now-as-str) nil)
kill-new((now-as-str))
sayid-gen-instance-expr()
funcall-interactively(sayid-gen-instance-expr)
call-interactively(sayid-gen-instance-expr nil nil)
command-execute(sayid-gen-instance-expr)

bpiel commented

@mattiasw2 Thanks for the bug report. I'm not sure exactly what's going on, but I don't believe the issue is cursor placement. Some questions:

Is now-as-str the name of the function you were attempting to generate an expression for?

Are you using emacs or spacemacs? Which version?

What versions are shown when you run sayid-version? (emacs command, not clojure)

Which version of CIDER?

thanks

GNU Emacs 25.1.1 (x86_64-w64-mingw32) of 2016-09-22

sayid-version says "wrong type argument: sequencep, 0\.0 \.15"

cider-version says "CIDER 0.15.0snapshot (package: 20170430.816)"

bpiel commented

@mattiasw2 Thanks for the details. I'll do some experimenting and try to pin it down.

bpiel commented

Oh.. seems like this is being caused by some kludgey code I wrote to try to deal with the fact that nrepl-send-sync-request can either return an object, or an object encoded as a string, depending on some (environmental?) factors that I never figured out.

I upgraded my setup from cider 0.14.0 to snapshot (like yours), but was unable to reproduce.

I really want to figure this out.

bpiel commented

@mattiasw2 if you feel like testing my theory and running some emacs code, you could run:

(defun sayid-read-if-string (v) v)

... anytime after the sayid.el package is loaded. That might be the quick fix. Still looking for the real fix.

Yes, defining sayid-read-if-string solves it. I think this is related to the Emacs version.

Now, also M-x sayid-version works and shows "clj=0.0.15 el=0.0.15"

However, after defining sayud-read-if-string, C-c s t b stops working. I get

sayid-setup-buf: Wrong type argument: listp, "("Traced namespaces:\n 3 / 3 quickshare2.basis.awss3cmds\n\n\nTraced functions:\n" (("color" ((("" "") ((76 (0)))))) ("start-col" ((0 ((56 (0)))) (19 ((20 (56)))))) ("ns" (("quickshare2.basis.awss3cmds" ((37 (19))))))))"

So, I need to decide which of them I want to use :-)

bpiel commented

Hmm.. this is trickier than I thought. Thanks for the update. I'll try the emacs version.

I testing with a new system ubuntu 16.04 + latest emacs (GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2018-01-23, and still have to define

(defun sayid-read-if-string (v) v)
bpiel commented

@mattiasw2 Thanks for the update. I get this error occasionally, but have never been able to nail it down.

Why not define sayid-read-if-string if it isn't defined?

I assume I can get it by removing the def of sayid-read-if-string, what do you want to know?

bpiel commented

@mattiasw2,

Guildsman is currently dominating my spare time. I plan on giving sayid (and especially this issue) some time once I have an alpha out for guildsman (soon?).

https://github.com/bpiel/guildsman

Quick answer to you question: sayid-read-if-string is defined in the code. But, you're re-defining it to an identity function, effectively disabling the problematic behavior. The problem is, sometimes that behavior is necessary, sometimes it's not.

Thanks for you interest and patience.