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

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

Open
mattiasw2 opened this issue May 6, 2017 · 12 comments
Open

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

mattiasw2 opened this issue May 6, 2017 · 12 comments
Labels
Emacs Emacs client related issue

Comments

@mattiasw2
Copy link

mattiasw2 commented May 6, 2017

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
Copy link
Collaborator

bpiel commented May 6, 2017

@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

@mattiasw2
Copy link
Author

mattiasw2 commented May 6, 2017

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
Copy link
Collaborator

bpiel commented May 6, 2017

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

@bpiel
Copy link
Collaborator

bpiel commented May 6, 2017

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
Copy link
Collaborator

bpiel commented May 6, 2017

@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.

@mattiasw2
Copy link
Author

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"

@mattiasw2
Copy link
Author

mattiasw2 commented May 7, 2017

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
Copy link
Collaborator

bpiel commented May 7, 2017

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

@mattiasw2
Copy link
Author

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
Copy link
Collaborator

bpiel commented Feb 1, 2018

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

@mattiasw2
Copy link
Author

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
Copy link
Collaborator

bpiel commented Feb 26, 2018

@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.

@bbatsov bbatsov added the Emacs Emacs client related issue label Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Emacs Emacs client related issue
Projects
None yet
Development

No branches or pull requests

3 participants