[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: axiom mode
From: |
martin rudalics |
Subject: |
Re: axiom mode |
Date: |
Mon, 11 Jun 2007 14:45:15 +0200 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
> 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.
... and puts it in `axiom-mode'. FWIW that's what your code does at the
moment.
> (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.
Why do you want to rename the buffer?
> Should I make all variables local?
The only variable I can think of at the moment is `axiom-process'.
> I guess, variables introduced with defvar
> are intended to be customizable by the user
... `defcustom' serves that purpose ...
> and are global to all buffers in
> axiom mode?
A priori a symbol defined as a variable doesn't relate to buffers hence
it "is global".
> Other variables, global to each individual buffer are introduced
> by make-local-variable?
You should defvar them first and make them buffer-local either by using
`make-variable-buffer-local' or, better, `make-local-variable'. A
typical idiom in this context is
(set (make-local-variable 'foo) value)
which makes foo buffer-local and assigns it value.
If you really need multiple axiom processes - so far you didn't tell me
_why_ you need them - you would make `axiom-process' local in the buffer
where you create the process and set it to the process object returned
by comint. Otherwise, I see no need to change anything here.
- axiom mode, Martin Rubey, 2007/06/09
- Re: axiom mode, Tom Tromey, 2007/06/09
- Re: axiom mode, Martin Rubey, 2007/06/10
- Re: axiom mode, martin rudalics, 2007/06/10
- Re: axiom mode, Martin Rubey, 2007/06/10
- Re: axiom mode, martin rudalics, 2007/06/11
- Re: axiom mode,
martin rudalics <=
- Re: axiom mode, Martin Rubey, 2007/06/11