From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: PJ Weisberg Newsgroups: gmane.emacs.help Subject: Re: slime-connect paredit conflict Date: Fri, 29 Oct 2010 05:14:16 +0000 Message-ID: References: <271606.73720.qm@web63102.mail.re1.yahoo.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1288329302 11458 80.91.229.12 (29 Oct 2010 05:15:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 29 Oct 2010 05:15:02 +0000 (UTC) To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 29 07:15:01 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PBhIo-0007ox-5y for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Oct 2010 07:14:58 +0200 Original-Received: from localhost ([127.0.0.1]:52722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PBhIn-0005iW-D6 for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Oct 2010 01:14:57 -0400 Original-Received: from [140.186.70.92] (port=36310 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PBhIF-0005iR-Qp for Help-gnu-emacs@gnu.org; Fri, 29 Oct 2010 01:14:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PBhIE-0005kx-HP for Help-gnu-emacs@gnu.org; Fri, 29 Oct 2010 01:14:23 -0400 Original-Received: from smtpauth13.prod.mesa1.secureserver.net ([64.202.165.37]:58002) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PBhIE-0005kf-5g for Help-gnu-emacs@gnu.org; Fri, 29 Oct 2010 01:14:22 -0400 Original-Received: (qmail 9245 invoked from network); 29 Oct 2010 05:14:18 -0000 Original-Received: from unknown (74.125.82.169) by smtpauth13.prod.mesa1.secureserver.net (64.202.165.37) with ESMTP; 29 Oct 2010 05:14:18 -0000 Original-Received: by wyf23 with SMTP id 23so2937162wyf.0 for ; Thu, 28 Oct 2010 22:14:16 -0700 (PDT) Original-Received: by 10.227.207.132 with SMTP id fy4mr11692723wbb.0.1288329256347; Thu, 28 Oct 2010 22:14:16 -0700 (PDT) Original-Received: by 10.216.233.163 with HTTP; Thu, 28 Oct 2010 22:14:16 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 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:75270 Archived-At: On Thu, Oct 28, 2010 at 3:14 AM, PJ Weisberg wrote: > On Thu, Oct 28, 2010 at 12:20 AM, Glen Rubin wrote: >> >> I am using emacs, slime, swank combo. When I try to slime-connect, I >> initially get the following error: >> >> error in process filter: Symbol's value as variable is void: paredit- >> backward-delete-key >> >> If I then try again it works. So, it's really annoying having to >> connect twice all the time! I was able to resolve this by removing a >> code fragment in my .emacs file, but then end up having problems with >> undeletable brackets as described in paredit wiki. >> >> Here is my .emacs file: >> >> ;;; This was installed by package-install.el. >> ;;; This provides support for the package system and >> ;;; interfacing with ELPA, the package archive. >> ;;; Move this code earlier if you want to reference >> ;;; packages in your .emacs. >> (when >> (load >> (expand-file-name "~/.emacs.d/elpa/package.el")) >> (package-initialize)) >> >> (add-hook 'slime-repl-mode-hook (lambda () (paredit-mode +1))) >> ;; Stop SLIME's REPL from grabbing DEL, >> ;; which is annoying when backspacing over a '(' >> (defun override-slime-repl-bindings-with-paredit () >> (define-key slime-repl-mode-map >> (read-kbd-macro paredit-backward-delete-key) nil)) >> (add-hook 'slime-repl-mode-hook 'override-slime-repl- >> bindings-with-paredit) > > Try changing that last line to "(add-hook 'slime-repl-mode-hook > 'override-slime-repl-bindings-with-paredit t)" On Thu, Oct 28, 2010 at 5:55 AM, Glen Rubin wrote: > worked! THX!!! To take some of the black magic out of this, the problem was that the file where paredit-backward-delete-key is defined isn't loaded until the first time you call paredit-mode. "add-hook" is used to add to a list of functions that are called when you enter slime-repl-mode, but by default it adds to the *beginning* of the list. The extra 't' tells it to add to the end of the list, so the function that uses the variable gets called *after* the one that causes it to be loaded.