From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Martin Rubey Newsgroups: gmane.emacs.help Subject: Re: axiom mode Date: 11 Jun 2007 11:11:15 +0200 Message-ID: <9qmyz6n9e4.fsf@aquin.mat.univie.ac.at> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1181554830 2714 80.91.229.12 (11 Jun 2007 09:40:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 11 Jun 2007 09:40:30 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 11 11:40:29 2007 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.50) id 1HxgNw-0000XE-N7 for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Jun 2007 11:40:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HxgNw-0007M4-9V for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Jun 2007 05:40:28 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsserver.news.garr.it!newscore.univie.ac.at!aconews-feed.univie.ac.at!aconews.univie.ac.at!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 Original-Lines: 65 Original-NNTP-Posting-Host: aquin.mat.univie.ac.at Original-X-Trace: 1181553075 usenet.univie.ac.at 28520 131.130.16.163 Original-X-Complaints-To: abuse@univie.ac.at Original-Xref: shelby.stanford.edu gnu.emacs.help:149284 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:44874 Archived-At: martin rudalics writes: > You define `axiom-process' as a "global" variable, hence it may > reference one and only one "axiom process" at any instant of time. If > you want a couple of axiom processes to coexist simultaneously you have > to make `axiom-process' buffer-local. Then you can try to maintain a > one-to-one correspondence between axiom buffers and axiom processes. > > > What I would > > like to have is the behaviour of shell mode: usually M-x axiom should switch to > > the running axiom, but optionally, something like > > > > (add-hook 'shell-mode-hook (lambda () (rename-uniquely))) > > > > or renaming the current axiom buffer should give us a new axiom. > > I don't understand what "usually" and "optionally" refer to. I meant, desired behaviour should be: M-x axiom switches to the buffer *axiom*, if it exists and if it is an "axiom buffer". (I guess that should be a buffer in axiom-mode, with a running axiom process.) If there is no such buffer, it creates a new buffer and a new axiom process. (add-hook 'axiom-mode-hook (lambda () (rename-uniquely))) should rename the buffer. I do not know what else one could use shell-mode-hook (and therefore axiom-mode-hook) for. My trouble is, that (define-derived-mode shell-mode comint-mode "Shell" ... ) sets so many variables and (defun shell (&optional buffer) ... ) does not mention add-hook at all and shell-mode-hook is only defined as (defcustom shell-mode-hook '() "*Hook for customising Shell mode." :type 'hook :group 'shell) so I do not know when which function is called. Should I make all variables local? I guess, variables introduced with defvar are intended to be customizable by the user and are global to all buffers in axiom mode? Other variables, global to each individual buffer are introduced by make-local-variable? I guess I should invest another hour or so... Many thanks for your patience. Martin