axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] Re: [Axiom-mail] [ANN] new version of axiom mode for e


From: Alasdair McAndrew
Subject: [Axiom-developer] Re: [Axiom-mail] [ANN] new version of axiom mode for emacs.
Date: Thu, 24 May 2007 10:11:19 +1000

Lovely stuff!  Well done, Martin!

I found the green output a bit garish for my tastes, so I changed the output foreground to blue, and the background to white.  I have discovered one problem, though:

)read newton )quiet

The axiom mode interprets the initial )q from )quiet as a signal to quit!  So your idea of not trapping )quit, I think, is a good one.  Though from a brief look through the code, it seems that )quit is supposed to be abbreviated as )q only at the beginning of a line - which is well and good.

But at the moment, my line above doesn't cause axiom to ask me whether I want to quit - it just kills the axiom process.

-Alasdair

On 23 May 2007 15:35:26 +0200, Martin Rubey <address@hidden> wrote:
Dear all,

after a day of hacking and with some help from Cliff and Jay (many thanks!) I
have a new version of axiom.el, which you find attached.  I'd be extremely
grateful for feedback!  Alasdair, is this usable for you?

To use it, put it into a directory where emacs can find it, gunzip it, say

  document axiom.el.pamphlet

to obtain documentation and source or

  notangle axiom.el.pamphlet > axiom.el

to obtain source only.  Then start (gnu) emacs and type

  M-x load-file

press return and type

  axiom.el

possibly including the complete path.  To start a fresh axiom session type

  M-x axiom

Most things should come natural, here is a very short description of it's
functionality:

-------------------------------------------------------------------------------
M-x axiom
  starts an axiom session or returns to an already started one.  We really
  should provide functionality to have several sessions in parallel, but I
  don't know how to do this.

M-up, M-down
  moves the cursor to the previous or next input.

C-up/M-p, C-down/M-n
  fetches the previous or next input.

M-k
  copies the current input-output combination into the kill-ring.

S-up, S-down, S-left, S-right
  turns the cursor into a paint-brush.

M-x axiom-paint-face
  changes the face of the paint-brush.

return
  evaluates input.  If point is on a previous input, it overwrites old output
  ``nicely''.
-------------------------------------------------------------------------------

Changes:

  * I modified some keybindings and instead of axiom-mode one calls axiom now.

  * I provided support for painting.

  * by default, HyperDoc is started now.

  * I fixed bugs that positioned point incorrectly and screwed up overwriting
    old output.  Cliff: you said you fixed that already once.  Could you see
    whether you had a different axiom.el.pamphlet than provided on MathAction?

-------------------------------------------------------------------------------
ToDo:

* Testing: does it work with xemacs? does it work under MSwindows?

* the way we deal with system commands like )quit is unsatisfactory for two
  reasons:

  - we do not allow user interaction: )quit will quit without asking, but
    worse, )di op 1 will make emacs appear to hang. C-g get's everything back
    to normal.  Reason: )di op 1 will make axiom ask whether we really want a
    long list of operations.

  - (1+x)q will be parsed as )quit.  We do not check yet whether the first
    non-white space character is the open parenthesis.

* the underscore character does not work.  It should...

* the way we wait for output looks extremely dangerous to me:

(defun axiom-wait-for-output ()
  "Wait for output from the Axiom process.  Point is set at the end of the
  line."
  (while (and
          axiom-waiting-for-output
          (not (search-backward ") -> " (- (point) 5) t)))
    (accept-process-output axiom-process))
  (sit-for 0 axiom-after-output-wait)
  (end-of-line))

  what if output contains ") -> " and we are unlucky?  Not sure whether this is
  a problem though.  In all other places, instead of ") -> " the regular
  _expression_ axiom-prompt is used.  Shouldn't we do this here, too?  Isn't
  there a simpler way to look for output?

  In fact, it might make sense to keep the current output number in a variable
  -- that way we could also detect errors.

* It would be nice to give the output a different face, as in mmm-mode, but I'm
  a bit lazy.  Maybe today evening.

* S-return should overwrite old output while return should copy the input line
  at point and evaluate it at the bottom of the buffer.

* it would be important to have the possibility of deleting part or all of the
  buffer.  (Personally, I often have a buffer with a 100000 lines, which is a
  burden for emacs, it seems). By contrast, it is not necessary to provide
  functionality as stated in the section "Restarting and Re-evaluating - Kill
  and Restart Axiom without Erasing the Document" since such functionality is
  provided by axiom itself.

* it would be extremely nice to have command tab-completion, as when starting
  axiom in a shell.  (The polymake team would like to have this, for example.)
  Anybody knows how to go about this?

* undo should have sane behaviour, whatever that is.  Possibly, it should be
  restricted to the current input, but that might be too restrictive. (For
  example, if one has overwritten some important output by accident.)

* sending definitions from input files is still not possible.

* cleanup is certainly necessary.  I don't know elisp well enough.  I have no
  idea, for example, why

   (end-of-line))

  in axiom-wait-for-output is necessary.  Really, every function should state
  in the docstring where point is supposed to be before and after execution.

  It is extremely important that this mode works reliably, and as it is
  currently, I wouldn't be surprised if it would screw up in weird
  circumstances.

Martin


_______________________________________________
Axiom-mail mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/axiom-mail




reply via email to

[Prev in Thread] Current Thread [Next in Thread]