I want to pass the output I get from the emacs function (read-event) onto a clisp process running in emacs through slime. Any help much appreciated.

asked 08 Jul '10, 08:13

slothcheetah's gravatar image

accept rate: 50%

Well you could do something like

(insert (read-event))

in the slime repl buffer. I'm not sure how useful that is; could you elaborate more on what you are trying to do?


answered 09 Jul '10, 01:01

npostavs's gravatar image

accept rate: 42%


I want to do iterative searches, like emacs' C-x s, of a (natural language) dictionary, stored in an sqlite database.

So when the user presses a, everything with an a in it is displayed ac ==> everything with ac displayed. etc. All without pressing <enter> in between.

I can access sqlite through cl-sqlite.

There's no function insert.

(09 Jul '10, 04:25) slothcheetah

The insert function is in elisp. Do you want the user to do the iterative search from within emacs or from within the clisp process? That is, what triggers the search?

(09 Jul '10, 14:17) npostavs

From within the emacs minibuffer. After typing something like

M-x search-db

So search-db would have to be written in elisp? But would have to contain a command to pass the user input to inferior-lisp. I think it would have to bypass the slime-repl. Sounds like you'd have to know the innards of slime, swank etc.

I see what (insert ..) does. Might be able to think of something using it.


answered 10 Jul '10, 12:08

Andrew's gravatar image

accept rate: 0%

I think you are looking for slime-eval, something like this (assumes you have a get-words function on the clisp side in the common-lisp-user package):

(defun search-db ()
  (let ((prefix ""))
    (while t
      (setq prefix (concat prefix (string (read-event))))
      (message "%s" (slime-eval `(cl-user::get-words ,prefix))))))

Note: this doesn't deal with the user pressing <return> or <backspace> or other "special" keys like that.

P.S. don't put clarifications as new answers, edit the original question or add comments.


answered 10 Jul '10, 13:59

npostavs's gravatar image

accept rate: 42%

He may have struggled to edit it, as his rep is different between the two posts, maybe he's having trouble logging in?

(10 Jul '10, 21:16) Amos

That's exactly what I was looking for. Thanks.

I'll register and log on from now on.

(11 Jul '10, 22:41) slothcheetah

Oh, I didn't realize you could have different accounts with the same name.

(12 Jul '10, 02:33) npostavs
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 08 Jul '10, 08:13

Seen: 1,801 times

Last updated: 10 Jul '10, 13:59

powered by OSQA