From the CL side the function you are looking for is swank::eval-in-emacs to which you pass a the code you want to evaluate in emacs. You can see an example here, to make emacs run the graphivz command and open the resulting png in a buffer. From the emacs side the function you are looking for is slime-eval (found in slime.el)
You can use indentation provided by a SLIME contribution:
You may want to add that to the list slime-contribs- see Loading Contribs in the SLIME manual.
One can add it to the list of SLIME contributions:
(add-to-list 'slime-contribs 'slime-cl-indent)
It is simple as:
Open your lisp file with fibonachi function
Issue M-x slime
Place you cursor over fibonachi function and press C-c C-c to evaluate/compile it in Slime.
switch to slime window and call (fibonachi 10)
Screenshot example with hello-world function:
I also considered binding M-. to a wrapper function [...] but I want the "else" clause to do whatever M-. would have done if evil wasn't enabled.
You could bind it to a conditional binding, the manual explains it for menu items, but it works for key bindings as well, (elisp) Extended Menu Items:
the extended format binding looks like this:
I think geiser-mode may provide what you are looking for at least for guile and racket, but apparently not MIT Scheme. I know that provides M-. to jump to symbol definition in environment, completion, and inline documentation help. Take a look at the introduction, and cheat sheet for a quick overveiw of features.
Alternative, it does appear mit-scheme has ...
I think the following should mostly do what you want
(defvar w3m-dedicated-window nil)
(defun w3m-browse-url-dedicated-window (url &optional new-session)
(let ((w3m-pop-up-windows t))
(if (and w3m-dedicated-window
(w3m-browse-url url ...
I found, it is more appropriate to add into contribs 'slime-indentation. it will load slime-cl-indent.
And after that, you can use this code to choose required indentation style:
(setq lisp-indent-function 'common-lisp-indent-function)
(setq common-lisp-style-default "sbcl")
Available styles are: basic, classic, modern and sbcl. All of them are defined in ...
For what it may be worth, the solution suggested above did not work in its original form but it works with evil-normal-state-map:
(define-key evil-normal-state-map (kbd "M-.")
`(menu-item "" evil-repeat-pop :filter
,(lambda (cmd) (if (eq last-command 'evil-repeat-pop) cmd))))
The examples I'm aware of use either XEmacs or SXEmacs (a fork of XEmacs) and their module/FFI support to extend them with C or existing C functions.
wand-mode: Combines FFI and the imagemagick library for simple image manipulation, such as red-eyes removal.
xwem: Emacs as window manager. Nuff said.
I recall Steve Youngs (the SXEmacs maintainer) speaking ...
(add-to-list 'auto-mode-alist '("\\.cl\\'" . slime-mode))
(add-to-list 'auto-mode-alist '("\\.asd\\'" . slime-mode))
to your init/config file. Then files with those extensions will use slime-mode by default. This pattern of (add-to-list 'auto-mode-alist '("\\.EXTENSION\\'" . MODE)) is a good way to have files with the extension EXTENSION open ...
According to commit 2e5538a the long deprecated function slime-face-inheritance-possible-p has been removed from slime in May 2015.
You probably installed the package slime-repl via marmalade, where it is currently listed as version 20100404, e.g. being from 2010 and thus very old.
As of now (October 2015) the package slime also contains the slime-repl.el ...
You should be able to permanently change the face via the customization facility. Try:
M-x customize-face slime-repl-inputed-output-face
Then you can change the foreground color directly, and if you save the changes (Apply and Save), the changes will be stored for future use.
Note that this requires that slime is already started before you can make the ...
The easiest way is to parametrize the call slime-eval, using funcall and a defvar/defcustom and take advantage use of sly's retro contrib, which allows the user to refer to the slynk pacage by the name of swank. Besides the replacing (slime-eval ...) with (funcall org-babel-lisp-eval-fn ...) the other thing we must do is to require slime or sly when ...
You can achieve this by adjusting the value of display-buffer-alist:
(quote (("\\*inferior-lisp\\*" display-buffer-pop-up-frame
This setting tells Emacs that a buffer with the name matching the regular expression "\*inferior-lisp\*" should be displayed in a new (pop-up) frame.
(You can also customize ...
Slime isn't part of the base Emacs install. You need to add it to your config. Usually this is done via package-install-packages, but you may have downloaded the code yourself.
Regardless of how you installed slime, using it requires you load the appropriate configuration code. When you start emacs with emacs -Q, you are explicitly telling Emacs to ignore ...
backward-sexp, bound to C-M-b by default`, would do it. Of course, if you’re nested inside several s–expressions then you would need to press it multiple times.
So perhaps you want beginning-of-defun, bound to C-M-a, instead.
The slime REPL buffer is is REPL mode. You can get information about the mode with C-h m. That is useful in that it shows you the keymap for the mode, and among other things, you will see that C-c C-p is bound to slime-repl-previous-prompt. Here is an excerpt from the description:
REPL mode defined in ‘slime-repl.el’:
Major mode for interacting with a ...
C-j runs slime-repl-newline-and-indent which I think will work. Whenever I'm faced with an unfamiliar mode, I do C-h m which shows me mode information, including the keymaps: I can then zero in on the relevant function(s). That's how I found this.
The doc string of slime-repl-newline-and-indent says:
Insert a newline, then indent the next line.
Restrict the ...
You want slime-switch-to-output-buffer, bound to C-c C-z by default.
The SLIME User Manual has the documentation for this and many other interesting commands. You can read it inside of Emacs (use C-h i to open the Info viewer, you’ll find the manuals there), or online. See specifically chapter 8.2 REPL: the “top level”.
I did not mention it in my post, but after installing Paredit I also installed Sly, a fork from the Slime project. This was the root of the problem.
I learned how to uninstall packages with this post.
In addition, @nega connected the dots between this problem and this other post.
After removing Sly, Slime is perfectly functioning! And the keybindings such as ...
Since no one answered, I've done a naive implementation. This is a community wiki answer in hope, the implementation evolves over time.
(defun my-sly-copy-call-to-repl ()
"Copy name/symbol of toplevel sexp to sly-mREPL and select sly-mREPL."
slime-repl-mode overrides in slime-repl-mode-map the key-binding for electric-pair-delete-pair. The override is not very surprising. It is just backward-delete-char-untabify. The binding in global-map is delete-backward-char. If you do not really need the untabify part in the repl removing the override shouldn't do any harm.
Just put the following Elisp ...
Thanks to @Dan for suggesting to use autoload.
Instead of detecting the file type, I binded the load to the slime function, like this:
(autoload 'slime "path/to/slime-helper.el "Launch SLIME" t nil)
Evaluating this expression tells Emacs to automatically load the
library slime-helper.el from load-path, when slime is called for the
first time—either ...
It still works. You need to have the file in the contrib directory under .emacs.d/elpa/slime-20170319.1601, then do something like
(push 'slime-repl-ansi-color slime-contribs)
to enable it.
It interfaces with slime through the slime-repl-emit function.
Not sure if that's applicable here, but there is a chance to do that on the CLOS level, if the CLOS implementation supports the meta-object protocol (MOP).
Using Clozure CL - a Common Lisp implementation - here. This maybe a little bit different depending on the implementation.
; we need to define a new meta-class, which is a subclass from
According to the doc-string of the variable split-window-preferred-function, the value should be a "[f]unction called by 'display-buffer' routines to split a window." The default value is split-window-sensibly, which has a semi-lengthy doc-string that talks about (in part) the variables split-height-threshold and split-width-threshold; and, those variables ...
You are using the wrong kind of quotes. I just tried:
(setq foo “bar”)
and got the same error. This command worked for me:
(setq foo "bar")
So you need to change all instances of “ to " (and probably also ‘ to ').