How do I enable the syntax highlighting mode for SLIME in emacs?
I guess that by SLIME you mean the SLIME REPL. It uses repl major mode and you cannot just enable font-locking for it, since there is one enabled already and it's simply different from that in lisp-mode and clojure-mode for instance. Your best bet might be to play around with the font-lock faces for repl-mode. This article might prove helpful.
Related
I'd really like to get up and running with a great Lisp REPL, but unfortunately I'm a vim person, not an emacs person. Is there a way to configure Emacs so that I can use slime while in Evil mode?
Yes, if you have Evil-mode always enabled (evil-mode 1), you can still use it in slime.
I am currently using emacs24 with clojure-mode as my clojure IDE. I use the zenburn theme.
As far as I can tell, clojure-mode only provides syntax-highlighting for macros. Is there a way to add syntax highlighting for all clojure native functions?
I've googled a bit and it seems like I'm either the only one who wants this, or the only one that doesn't have it for some strange reason. I don't think my .emacs file is a necessary addition to this question but I'll add it if someone wants to take a look.
Thank you.
You need to explicitly enable font locking for these functions with clojure-mode-extra-font-locking. Install this package from MELPA, and add the following to your init.el:
(eval-after-load 'clojure-mode '(require 'clojure-mode-extra-font-locking))
I'm trying to figure out if there's a way to reset the keymap so that I can manually enable features with an appropriate keybinding. I'm trying to do a customized Emacs build and would like full control over the keybindings and features enabled.
Edit: Thanks for the answers, this answered what I was looking for perfectly. I was trying to Google it and I couldn't find much but now I'm starting to understand Emacs more.
Basically I'm trying to learn it and customize the keybindings to my preferences. Though I have had trouble overriding some keybindings but the suggestions of disabling major mode was what I was looking for.
Well, Emacs will give you full control, there are a couple different ways to accomplish what it sounds like you're trying to do. To be successful though, I recommend you read and understand the Keymaps section of the manual. If your customized Emacs build uses any major or minor modes, you'll have to do special work to disable/override any keymaps they set.
Of particular interest are the sections Creating Keymaps, Active Keymaps, Controlling Active Maps, and ... pretty much the whole chapter.
I recommend starting with creating a basic keymap and overriding the global keymap with yours. That'd be a good start. Probably the easiest way would be to do something like:
(setq global-map (make-keymap))
(global-set-key ...)
Though, you're also going to have to disable the major modes from setting up their keys, the easiest way would be to disable automatic choosing of major modes by doing this:
(setq auto-mode-alist nil)
Read the section on How Emacs Chooses a Major Mode.
The question needs more detail to enable writing a more detailed answer...
You may bundle the features into a minor-mode with its own keymap. When the minor-mode is enabled, its keymap will be consulted before the global-map, overriding the latter in effect. When disabled, the default key bindings in the global-map will be visible again.
According to this answer, Emacs + Slime already has much advanced functionality. So how can I get syntax coloring, auto-completion, and perhaps even version control management, set up and running in my copy of Lispbox?
If it's of any help, I have installed Lispbox on Mac OS Lion.
Syntax highlighting should already be working as soon as you load a lisp file in Emacs, regardless of whether you've got SLIME installed or not. If it's not, try doing M-x font-lock-mode and see if that turns it on.
Version control isn't provided by Emacs or SLIME, but Emacs can integrate with pretty much any version control system you care to use. I recommend Mercurial or Git. Emacs should start vc-mode automatically when you open a file that is in one of the supported version control systems. The manual includes extensive documentation, do M-: (info "(emacs)Version Control") to jump right to it.
Auto-completion is more complicated. There is more than one way to skin this cat, but for Lisp SLIME's default method should be good enough. Use M-TAB to complete the symbol at point.
Is there a way to expand the current command at the Clojure repl like I'd be able to do in Common Lisp?
For example say I have typed:
Math/
I would like the tab key to expand to all the available variables and functions in that namespace.
I'm using Clojure as inferior-lisp would like to know how to do this from the plain vanilla repl in Clojure, and through swank slime.
Another vote in favour of clojure-mode and slime under Emacs. In particular, if you set up auto-complete, then you can use my ac-slime package to get context-aware tab completion in a dropdown list. Here's a screencast showing it in action.
And, further to technomancy's comment about hippie-expand, here's how to tie slime completion into hippie-expand.
Update: as of 2012, nrepl, nrepl.el and ac-nrepl are replacing slime and ac-slime; same functionality, smaller and cleaner codebase.
Update2: as of Oct 2013 nrepl.el is renamed to cider and it and ac-nrepl have moved to the clojure-emacs organisation on github. nrepl remains as the server component
Have you tried Clojure mode for Emacs? It has autocomplete (suggestions are shown in new window, and if there's only one possible option, it is used to expand name), highlighting and many other nice features (not more then for CL, but not less too).
It is available via ELPA. After installing ELPA type M-x package-list-packages, set cursor near needed package and press i (already installed packages are in red). You'll need packages clojure-mode, slime, slime-repl and swank-clojure. When you're done with i-marks, press x to complete installation. Finally, press M-x slime - Emacs will tell, that Clojure is not installed and propose to download and use latest version. Just agree.
You can also integrate Emacs with Leiningen.
The vanilla repl in Clojure is pretty crippled; it doesn't even have history. Avoid it for anything but the most primitive of tasks. I don't think you can get this in inferior-lisp, but in the slime repl you can just use TAB to complete things like this. In clojure-mode buffers with slime activated it's M-TAB, or you can tie it into your hippie-expand functions.