axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] Re: axiom-mode


From: Martin Rubey
Subject: Re: [Axiom-developer] Re: axiom-mode
Date: 22 May 2007 20:51:38 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Martin Rubey <address@hidden> writes:

> C Y <address@hidden> writes:
> 
> > > Just another idea: M-up could get you into output "mode", and in that
> > > "mode", some ordinary keys have a different meaning: b for blue 
> > > foreground, B for blue background, g for green, r for red, space for
> > > black, etc.  That would really be a killer app!  None of the current
> > > interfaces for maple, mathematica, mupad, etc. is able to do that! 
> > > I beg you to look at it!
> > 
> > I'll check - Jay, does Emacs allow that kind of dynamic, context
> > sensitive key binding?  I MIGHT be able to put together some sort of
> > hack but an Emacs supplied mechanism would be better.
> 
> Maybe mmm-mode + picture mode is the right thing for that?  I just added the
> following to my axiom.el:
> 
> (defface axiom-blue-output '((t (:background "red")))
>   :group 'axiom)
> 
> (defun make-blue ()
>   (interactive)
>   (let ((over (make-overlay (point) (+ (point) 1) nil nil t)))
>     (overlay-put over 'face 'axiom-blue-output)))

Another, maybe simpler idea: have a command axiom-set-face which allows the
user to specify a face and make within the output region the up, down, right
and left paint.  Or maybe M-up, M-down, M-right and M-left. Or the same with
C-prefix.  This would render the implementation trivial, probably, and may even
be more useable.

We need cursor combinations for:

* move to previous input line       
* get previous input                C-up / C-down
* move within the input region      left / right
* move within the output region     
* paint within the output region

Thus, maybe:

left/right/up/down:        move ordinarily (i.e., one line)
Shift-left/right/up/down:  paint within output region
Ctrl-up/down               fetch previous/next input
M-up/down                  move to previous / next input.

What do you think?

-------------------------------------------------------------------------------

Apart from this, I seem to have a problem with overlays:

(defface axiom-blue-output '((t (:background "blue")))
  ""
  :group 'axiom)
(defface axiom-red-output '((t (:background "red")))
  ""
  :group 'axiom)


(defun make-blue ()
  (interactive)
  (let ((over (make-overlay (point) (+ (point) 1) nil nil t)))
    (overlay-put over 'face 'axiom-blue-output)))

(defun make-red ()
  (interactive)
  (let ((over (make-overlay (point) (+ (point) 1) nil nil t)))
    (overlay-put over 'face 'axiom-red-output)))

It seems that I cannot color something blue that was previously red?

Martin





reply via email to

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