all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Newbie major-mode and elisp question
@ 2005-09-08  7:02 sj
  2005-09-08 16:21 ` rgb
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: sj @ 2005-09-08  7:02 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-09-09  5:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-08  7:02 Newbie major-mode and elisp question sj
2005-09-08 16:21 ` rgb
2005-09-08 17:12 ` Kevin Rodgers
2005-09-09  5:07 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.