[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/textmodes/artist.el
From: |
Juanma Barranquero |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/textmodes/artist.el |
Date: |
Fri, 28 May 2004 22:59:58 -0400 |
Index: emacs/lisp/textmodes/artist.el
diff -c emacs/lisp/textmodes/artist.el:1.15 emacs/lisp/textmodes/artist.el:1.16
*** emacs/lisp/textmodes/artist.el:1.15 Mon Sep 1 15:45:36 2003
--- emacs/lisp/textmodes/artist.el Fri May 28 19:55:04 2004
***************
*** 1,6 ****
;;; artist.el --- draw ascii graphics with your mouse
! ;; Copyright (C) 2000, 2001 Free Software Foundation, Inc.
;; Author: Tomas Abrahamsson <address@hidden>
;; Maintainer: Tomas Abrahamsson <address@hidden>
--- 1,6 ----
;;; artist.el --- draw ascii graphics with your mouse
! ;; Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc.
;; Author: Tomas Abrahamsson <address@hidden>
;; Maintainer: Tomas Abrahamsson <address@hidden>
***************
*** 1698,1716 ****
(t (cons (car l) (artist-butlast (cdr l))))))
! (defun artist-last (seq &optional n)
! "Return the last link in the list SEQ.
With optional argument N, returns Nth-to-last link (default 1)."
! (if (not n)
! (setq n 1))
! (let ((len (length seq)))
! (elt seq (- len n))))
(defun artist-remove-nulls (l)
"Remove nils in list L."
! (cond ((null l) nil)
! ((null (car l)) (artist-remove-nulls (cdr l)))
! (t (cons (car l) (artist-remove-nulls (cdr l))))))
(defun artist-uniq (l)
"Remove consecutive duplicates in list L. Comparison is done with `equal'."
--- 1698,1711 ----
(t (cons (car l) (artist-butlast (cdr l))))))
! (defun artist-last (l &optional n)
! "Return the last link in the list L.
With optional argument N, returns Nth-to-last link (default 1)."
! (nth (- (length l) (or n 1)) l))
(defun artist-remove-nulls (l)
"Remove nils in list L."
! (remq nil l))
(defun artist-uniq (l)
"Remove consecutive duplicates in list L. Comparison is done with `equal'."
***************
*** 3368,3375 ****
(append right-half left-half)))
! (defun artist-draw-ellipse-general (x y x-radius y-radius)
! "Draw an ellipse with center at X, Y and X-RADIUS and Y-RADIUS.
Output is an ellipse, which is a list (END-POINT-1 END-POINT-2 SHAPE-INFO).
--- 3363,3370 ----
(append right-half left-half)))
! (defun artist-draw-ellipse-general (x1 y1 x-radius y-radius)
! "Draw an ellipse with center at X1, Y1 and X-RADIUS and Y-RADIUS.
Output is an ellipse, which is a list (END-POINT-1 END-POINT-2 SHAPE-INFO).
***************
*** 3379,3393 ****
POINT-LIST is a list of vectors on the form [X Y SAVED-CHAR NEW-CHAR].
FILL-INFO is a list of vectors on the form [X Y ELLIPSE-WIDTH-ON-THIS-LINE].
! Ellipses with zero y-radius are not drawn correctly."
(let* ((point-list (artist-ellipse-generate-quadrant x-radius y-radius))
(fill-info (artist-ellipse-compute-fill-info point-list))
(shape-info (make-vector 2 0)))
(setq point-list (artist-calculate-new-chars point-list))
(setq point-list (artist-ellipse-mirror-quadrant point-list))
! (setq point-list (artist-ellipse-point-list-add-center x y point-list))
! (setq fill-info (artist-ellipse-fill-info-add-center x y fill-info))
;; Draw the ellipse
(setq point-list
--- 3374,3388 ----
POINT-LIST is a list of vectors on the form [X Y SAVED-CHAR NEW-CHAR].
FILL-INFO is a list of vectors on the form [X Y ELLIPSE-WIDTH-ON-THIS-LINE].
! Ellipses with zero Y-RADIUS are not drawn correctly."
(let* ((point-list (artist-ellipse-generate-quadrant x-radius y-radius))
(fill-info (artist-ellipse-compute-fill-info point-list))
(shape-info (make-vector 2 0)))
(setq point-list (artist-calculate-new-chars point-list))
(setq point-list (artist-ellipse-mirror-quadrant point-list))
! (setq point-list (artist-ellipse-point-list-add-center x1 y1 point-list))
! (setq fill-info (artist-ellipse-fill-info-add-center x1 y1 fill-info))
;; Draw the ellipse
(setq point-list
***************
*** 3404,3415 ****
(aset shape-info 0 point-list)
(aset shape-info 1 fill-info)
! (artist-make-2point-object (artist-make-endpoint x y)
(artist-make-endpoint x-radius y-radius)
shape-info)))
! (defun artist-draw-ellipse-with-0-height (x y x-radius y-radius)
! "Draw an ellipse with center at X, Y and X-RADIUS and Y-RADIUS.
Output is an ellipse, which is a list (END-POINT-1 END-POINT-2 SHAPE-INFO).
--- 3399,3410 ----
(aset shape-info 0 point-list)
(aset shape-info 1 fill-info)
! (artist-make-2point-object (artist-make-endpoint x1 y1)
(artist-make-endpoint x-radius y-radius)
shape-info)))
! (defun artist-draw-ellipse-with-0-height (x1 y1 x-radius y-radius)
! "Draw an ellipse with center at X1, Y1 and X-RADIUS and Y-RADIUS.
Output is an ellipse, which is a list (END-POINT-1 END-POINT-2 SHAPE-INFO).
***************
*** 3419,3428 ****
POINT-LIST is a list of vectors on the form [X Y SAVED-CHAR NEW-CHAR].
FILL-INFO is a list of vectors on the form [X Y ELLIPSE-WIDTH-ON-THIS-LINE].
! The Y-RADIUS must be 0, but the X-RADUIS must not be 0."
(let ((point-list nil)
(width (max (- (abs (* 2 x-radius)) 1)))
! (left-edge (1+ (- x (abs x-radius))))
(line-char (if artist-line-char-set artist-line-char ?-))
(i 0)
(point-list nil)
--- 3414,3423 ----
POINT-LIST is a list of vectors on the form [X Y SAVED-CHAR NEW-CHAR].
FILL-INFO is a list of vectors on the form [X Y ELLIPSE-WIDTH-ON-THIS-LINE].
! The Y-RADIUS must be 0, but the X-RADIUS must not be 0."
(let ((point-list nil)
(width (max (- (abs (* 2 x-radius)) 1)))
! (left-edge (1+ (- x1 (abs x-radius))))
(line-char (if artist-line-char-set artist-line-char ?-))
(i 0)
(point-list nil)
***************
*** 3430,3436 ****
(shape-info (make-vector 2 0)))
(while (< i width)
(let* ((line-x (+ left-edge i))
! (line-y y)
(new-coord (artist-new-coord line-x line-y)))
(artist-coord-add-saved-char new-coord
(artist-get-char-at-xy line-x line-y))
--- 3425,3431 ----
(shape-info (make-vector 2 0)))
(while (< i width)
(let* ((line-x (+ left-edge i))
! (line-y y1)
(new-coord (artist-new-coord line-x line-y)))
(artist-coord-add-saved-char new-coord
(artist-get-char-at-xy line-x line-y))
***************
*** 3440,3446 ****
(setq i (1+ i))))
(aset shape-info 0 point-list)
(aset shape-info 1 fill-info)
! (artist-make-2point-object (artist-make-endpoint x y)
(artist-make-endpoint x-radius y-radius)
shape-info)))
--- 3435,3441 ----
(setq i (1+ i))))
(aset shape-info 0 point-list)
(aset shape-info 1 fill-info)
! (artist-make-2point-object (artist-make-endpoint x1 y1)
(artist-make-endpoint x-radius y-radius)
shape-info)))
***************
*** 3954,3960 ****
(defun artist-draw-region-trim-line-endings (min-y max-y)
"Trim lines in current draw-region from MIN-Y to MAX-Y.
! Trimming here means removing white space at end of a line"
;; Safetyc check: switch min-y and max-y if if max-y is smaller
(if (< max-y min-y)
(let ((tmp min-y))
--- 3949,3955 ----
(defun artist-draw-region-trim-line-endings (min-y max-y)
"Trim lines in current draw-region from MIN-Y to MAX-Y.
! Trimming here means removing white space at end of a line."
;; Safetyc check: switch min-y and max-y if if max-y is smaller
(if (< max-y min-y)
(let ((tmp min-y))
***************
*** 4286,4292 ****
(defun artist-key-set-point-common (arg)
"Common routine for setting point in current shape.
! With ARG set to t, set the last point."
(let ((draw-how (artist-go-get-draw-how-from-symbol artist-curr-go))
(col (artist-current-column))
(row (artist-current-line))
--- 4281,4287 ----
(defun artist-key-set-point-common (arg)
"Common routine for setting point in current shape.
! With non-nil ARG, set the last point."
(let ((draw-how (artist-go-get-draw-how-from-symbol artist-curr-go))
(col (artist-current-column))
(row (artist-current-line))
***************
*** 4793,4799 ****
(defun artist-mouse-choose-operation (ev op)
! "Choose operation for evenvt EV and operation OP."
(interactive
(progn
(select-window (posn-window (event-start last-input-event)))
--- 4788,4794 ----
(defun artist-mouse-choose-operation (ev op)
! "Choose operation for event EV and operation OP."
(interactive
(progn
(select-window (posn-window (event-start last-input-event)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/textmodes/artist.el,
Juanma Barranquero <=