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: Jay Belanger
Subject: Re: [Axiom-developer] Re: axiom-mode
Date: Tue, 22 May 2007 16:11:20 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

Martin Rubey <address@hidden> writes:
...
> 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.  

Is there any reason the paint would be disabled outside the output
region?

> 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

Why are "move within the input region" and "move within the output
region" separate?

> 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?

It looks pretty slick.  You might want different paint commands,
though, since I think "shift-arrow" is the same as "arrow" in a
terminal. 

> -------------------------------------------------------------------------------
>
> 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?

I guess the older overlays have higher precedence than newer ones, but
the manual doesn't seem to mention that.  I suppose you could give the
overlays a special property to test for, and then remove older
overlays with that property before putting on a new one; something like:

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

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

I noticed that overlays can be used to give different regions of text
different keymaps, by the way.

Jay




reply via email to

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