From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Victor Kryukov Newsgroups: gmane.emacs.help Subject: Several questions on SLIME customizations Date: Sat, 18 Nov 2006 23:32:45 -0600 Organization: A noiseless patient Spider Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1163914842 24637 80.91.229.2 (19 Nov 2006 05:40:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 19 Nov 2006 05:40:42 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 19 06:40:40 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GlfQ0-0001ZD-C6 for geh-help-gnu-emacs@m.gmane.org; Sun, 19 Nov 2006 06:40:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GlfPz-0005cM-UQ for geh-help-gnu-emacs@m.gmane.org; Sun, 19 Nov 2006 00:40:39 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news.astraweb.com!newsrouter-eu.astraweb.com!border2.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.freenet.de!news.albasani.net!news.motzarella.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 84 Original-NNTP-Posting-Host: U2FsdGVkX19dfudoWPS9ZFYWJFZNF0i5KAKmdt3VwhqX7scVi5KCKreKp8KfVTXCbLySBgqPjBd/TUVN9H1ZEnenVagLmccmqo+y/ZYJtyts301XGgV2LmwSLDAkijgs4lRsL8zLTvGZZeS16Yq5vQ== Original-X-Trace: reader.motzarella.org U2FsdGVkX18zvDnu4DIx7lYZCV+7+ZRIFmvXCk5RG9eCR6aPB94YaXaH6yxZPqjpyNURV23rt5pb/+clYxz65WVxawADykOClu9XR8X+OZWBPvXdLKc6PsrpI0GqJleCzL7PIcYwjQqoeVn71tauT7dqB5eYrTnGvYUTQstdyrEniN9f2eX+5qPQ9Js2P91bP2moph+q5VSENpFA7WUpJcMeWSFWK7xj Original-X-Complaints-To: abuse@motzarella.org Original-NNTP-Posting-Date: Sun, 19 Nov 2006 05:38:38 +0000 (UTC) Cancel-Lock: sha1:RHQTU07i2sQUM3iTPeBc+UxQQp4= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Original-Xref: shelby.stanford.edu gnu.emacs.help:143195 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:38812 Archived-At: Hello list, I've a couple emacs customization/elisp questions, which are not very closely related, except that they have one unifying theme: making life under SLIME better (as I understand it). I would appreciate if you could answer at least some of them - and of course, feel free to share you strategies to customize SLIME! = Redefining TAB. = I tried TextMate recently (yes, luckily I live under Mac OS X; no, I don't want to start another flame war), and I especially like how it treats TAB key - ok, ok, I know that their behaviour is risky because it's context-dependent, but vim users somehow manage to accomodate to multiple contexts ;). Anyway, TAB is too valuable key to spare, as it's very easy to type, and in my use case, I never need to use it _alone_: most often during editing I need to wrap a bunch of lines into let statement, say, so I need to indent a whole region anyway. Hence my strategy was like this: (global-set-key "\r" 'newline-and-indent) makes Return indent next line automatically, and the following function indents the whole defun: (defun indent-defun () (interactive) (let (a b) (beginning-of-defun) (setq a (point)) (end-of-defun) (setq b (point)) (indent-region a b))) After that, we don't need TAB for any indenting purposes, and can redefine it to something more useful (we redefined default key binding for indent-region, as we don't need it that often): (add-hook 'slime-mode-hook (lambda () (local-set-key "\C-i" 'slime-complete-symbol) (local-set-key "\C-\M-\\" 'indent-defun))) So far so good - pressing TAB auto-completes all known symbols, and makes typing code much easier (at least for me). Here is the questions I have: 1. indent-defun looks terribly ugly for many reasons: a/ it is not LISPish - more like a BASIC program directly translated into Lisp; I would like to write something like (defun indent-defun () (interactive) (indent-region (beginning-of-defun) (end-of-defun))) but I don't know which elisp function(s) to use. b/ it will not work with defmacro, or with any other top-level form. I would like to have something like (beginning-of-top-level-form) - again, I don't know if such beast exists and my elisp skills are too weak yet to program it myself - any suggestions? = Renaming buffers = I am playing with several lisp implementations - clisp, Allegro CL Express and SBCL to be precise. I would like their slime buffers to have names like *clisp*, *allegro* and *sbcl* instead of *slime-repl sbcl* etc. I tried to rename these buffers: (defun sbcl () (interactive) (setq inferior-lisp-program "/usr/local/bin/sbcl") (slime) (rename-buffer "*sbcl*")) but what happens is that buffer is renamed _before_ slime finishes loading lisp, and after it finish, it renames the buffer back. Can I attach a function to the moment when slime finish it's load process - like defining hook for a major mode? Best, Victor.