From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: sj Newsgroups: gmane.emacs.help Subject: Newbie major-mode and elisp question Date: Thu, 08 Sep 2005 07:02:35 GMT Organization: SBC http://yahoo.sbc.com Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: sea.gmane.org 1126163348 26202 80.91.229.2 (8 Sep 2005 07:09:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Sep 2005 07:09:08 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 08 09:09:02 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EDGWK-0007zo-KL for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Sep 2005 09:08:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EDGWI-0002k7-7I for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Sep 2005 03:08:26 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!newscon06.news.prodigy.com!prodigy.net!newsmst01b.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr12.news.prodigy.com.POSTED!545d7442!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 46 User-Agent: KNode/0.7.7 Original-NNTP-Posting-Host: 66.137.210.78 Original-X-Complaints-To: abuse@prodigy.net Original-X-Trace: newssvr12.news.prodigy.com 1126162955 ST000 66.137.210.78 (Thu, 08 Sep 2005 03:02:35 EDT) Original-NNTP-Posting-Date: Thu, 08 Sep 2005 03:02:35 EDT X-UserInfo1: T[OGRY_DPZRYW]I]]ZN@_TDAYZOZ@GXOXR]ZMVMHQAVTUZ]CLNTCPFK[WDXDHV[K^FCGJCJLPF_D_NCC@FUG^Q\DINVAXSLIFXYJSSCCALP@PB@\OS@BITWAH\CQZKJMMD^SJA^NXA\GVLSRBD^M_NW_F[YLVTWIGAXAQBOATKBBQRXECDFDMQ\DZFUE@\JM Original-Xref: shelby.stanford.edu gnu.emacs.help:133765 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:29312 Archived-At: I'm writing my first major mode to run Nyquist in a buffer. Nyquist is an extension of XLISP for audio synthesis and composition. Nyquist-mode is a derivative of inferior-lisp mode, its working pretty well except for one annoying side effect. Whenever I issue (nyquist-mode) to start a new Nyquist process, whatever buffer I'm currently in gets switched to fundamental-mode. I have isolated the problem to the kill-all-local-variables statement. Is there some other way I should be doing this? (defun nyquist-mode () (interactive) (if (nyquist-has-process-p) ;; If we are already live just switch to the nyquist buffer (switch-to-buffer nyquist-buffer) ;; Else start a new Nyquist process. (progn ;; Clean up any old nyquist process buffers (if (get-buffer nyquist-buffer) (kill-buffer nyquist-buffer)) (kill-all-local-variables) (run-lisp nyquist-program) (switch-to-buffer "*inferior-lisp*") (rename-buffer nyquist-buffer) (setq major-mode 'nyquist-mode) (setq mode-name "Nyquist") (setq inferior-lisp-buffer nyquist-buffer) (lisp-load-file nyquist-start-file) (use-local-map nyquist-map) (run-hooks 'nyquist-hook) ))) Some background: There is only --one-- nyquist process at any time. The variable nyquist-buffer holds the buffer name for the nyquist process (needed because I ultimately need other non-nyquist lisp running) nyquist-program contains the local invocation to run nyquist. Hopefully the rest is self-explanatory. -- Remove underscores to reply _jones_57_@_swbell_._net