;;; artist.el --- draw ascii graphics with your mouse
;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
;;; artist.el --- draw ascii graphics with your mouse
;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
;; Author: Tomas Abrahamsson <tab@lysator.liu.se>
;; Maintainer: Tomas Abrahamsson <tab@lysator.liu.se>
;; Author: Tomas Abrahamsson <tab@lysator.liu.se>
;; Maintainer: Tomas Abrahamsson <tab@lysator.liu.se>
;; This is a defvar, not a defcustom, since the custom
;; package shows lists of characters as a lists of integers,
;; which is confusing
;; This is a defvar, not a defcustom, since the custom
;; package shows lists of characters as a lists of integers,
;; which is confusing
- (aset artist-replacement-table ?\n ?\ )
- (aset artist-replacement-table ?\t ?\ )
- (aset artist-replacement-table 0 ?\ )
+ (aset artist-replacement-table ?\n ?\s)
+ (aset artist-replacement-table ?\t ?\s)
+ (aset artist-replacement-table 0 ?\s)
(make-local-variable 'artist-key-is-drawing)
(make-local-variable 'artist-key-endpoint1)
(make-local-variable 'artist-key-poly-point-list)
(make-local-variable 'artist-key-is-drawing)
(make-local-variable 'artist-key-endpoint1)
(make-local-variable 'artist-key-poly-point-list)
(defun artist-text-see-thru (x y)
"Prompt for text to render, render it at X,Y.
(defun artist-text-see-thru (x y)
"Prompt for text to render, render it at X,Y.
-This is done by calling the function specified by `artist-text-renderer',
-which must return a list of strings, to be inserted in the buffer.
+This is done by calling the function specified by
+`artist-text-renderer-function', which must return a list of strings,
+to be inserted in the buffer.
Text already in the buffer ``shines thru'' blanks in the rendered text."
(let* ((input-text (read-string "Type text to render: "))
Text already in the buffer ``shines thru'' blanks in the rendered text."
(let* ((input-text (read-string "Type text to render: "))
(artist-text-insert-see-thru x y rendered-text)))
(defun artist-text-overwrite (x y)
"Prompt for text to render, render it at X,Y.
(artist-text-insert-see-thru x y rendered-text)))
(defun artist-text-overwrite (x y)
"Prompt for text to render, render it at X,Y.
-This is done by calling the function specified by `artist-text-renderer',
-which must return a list of strings, to be inserted in the buffer.
+This is done by calling the function specified by
+`artist-text-renderer-function', which must return a list of strings,
+to be inserted in the buffer.
Blanks in the rendered text overwrites any text in the buffer."
(let* ((input-text (read-string "Type text to render: "))
Blanks in the rendered text overwrites any text in the buffer."
(let* ((input-text (read-string "Type text to render: "))
(defun artist-vap-find-endpoints-horiz (x y)
"Find endpoints for a horizontal line through X, Y.
An endpoint is a cons pair, (ENDPOINT-X . ENDPOINT-Y)."
(defun artist-vap-find-endpoints-horiz (x y)
"Find endpoints for a horizontal line through X, Y.
An endpoint is a cons pair, (ENDPOINT-X . ENDPOINT-Y)."
- (list (artist-vap-find-endpoint x y 1 0 '(?- ?+) '(? ))
- (artist-vap-find-endpoint x y -1 0 '(?- ?+) '(? ))))
+ (list (artist-vap-find-endpoint x y 1 0 '(?- ?+) '(?\s))
+ (artist-vap-find-endpoint x y -1 0 '(?- ?+) '(?\s))))
(defun artist-vap-find-endpoints-vert (x y)
"Find endpoints for a vertical line through X, Y.
An endpoint is a cons pair, (ENDPOINT-X . ENDPOINT-Y)."
(defun artist-vap-find-endpoints-vert (x y)
"Find endpoints for a vertical line through X, Y.
An endpoint is a cons pair, (ENDPOINT-X . ENDPOINT-Y)."
- (list (artist-vap-find-endpoint x y 0 1 '(?| ?+) '(? ))
- (artist-vap-find-endpoint x y 0 -1 '(?| ?+) '(? ))))
+ (list (artist-vap-find-endpoint x y 0 1 '(?| ?+) '(?\s))
+ (artist-vap-find-endpoint x y 0 -1 '(?| ?+) '(?\s))))
(defun artist-vap-find-endpoints-swne (x y)
"Find endpoints for a diagonal line (made by /'s) through X, Y.
An endpoint is a cons pair, (ENDPOINT-X . ENDPOINT-Y)."
(defun artist-vap-find-endpoints-swne (x y)
"Find endpoints for a diagonal line (made by /'s) through X, Y.
An endpoint is a cons pair, (ENDPOINT-X . ENDPOINT-Y)."
- (list (artist-vap-find-endpoint x y 1 -1 '(?/ ?X) '(? ))
- (artist-vap-find-endpoint x y -1 1 '(?/ ?X) '(? ))))
+ (list (artist-vap-find-endpoint x y 1 -1 '(?/ ?X) '(?\s))
+ (artist-vap-find-endpoint x y -1 1 '(?/ ?X) '(?\s))))
(defun artist-vap-find-endpoints-nwse (x y)
"Find endpoints for a diagonal line (made by \\'s) through X, Y.
An endpoint is a cons pair, (ENDPOINT-X . ENDPOINT-Y)."
(defun artist-vap-find-endpoints-nwse (x y)
"Find endpoints for a diagonal line (made by \\'s) through X, Y.
An endpoint is a cons pair, (ENDPOINT-X . ENDPOINT-Y)."
- (list (artist-vap-find-endpoint x y 1 1 '(?\\ ?X) '(? ))
- (artist-vap-find-endpoint x y -1 -1 '(?\\ ?X) '(? ))))
+ (list (artist-vap-find-endpoint x y 1 1 '(?\\ ?X) '(?\s))
+ (artist-vap-find-endpoint x y -1 -1 '(?\\ ?X) '(?\s))))
(if (= (artist-coord-get-new-char last-coord) ?/)
(artist-coord-set-new-char last-coord artist-ellipse-right-char)))
(if (= (artist-coord-get-new-char last-coord) ?/)
(artist-coord-set-new-char last-coord artist-ellipse-right-char)))
(x2 (artist-endpoint-get-x ep2))
(y2 (artist-endpoint-get-y ep2))
(dir1 (artist-find-direction x2 y2 x1 y1))
(x2 (artist-endpoint-get-x ep2))
(y2 (artist-endpoint-get-y ep2))
(dir1 (artist-find-direction x2 y2 x1 y1))
(xn (artist-endpoint-get-x epn))
(yn (artist-endpoint-get-y epn))
(xn-1 (artist-endpoint-get-x epn-1))
(xn (artist-endpoint-get-x epn))
(yn (artist-endpoint-get-y epn))
(xn-1 (artist-endpoint-get-x epn-1))
(concat "First point set. "
"Set next with \\[artist-key-set-point], "
"set last with C-u \\[artist-key-set-point]"))))
(concat "First point set. "
"Set next with \\[artist-key-set-point], "
"set last with C-u \\[artist-key-set-point]"))))
(defun artist-select-erase-char (c)
"Set current erase character to be C."
(interactive "cType char to use when erasing (type RET for normal): ")
(defun artist-select-erase-char (c)
"Set current erase character to be C."
(interactive "cType char to use when erasing (type RET for normal): ")
(message "Normal erasing"))
(t (setq artist-erase-char c)
(message "Erasing with \"%c\"" c)))
(message "Normal erasing"))
(t (setq artist-erase-char c)
(message "Erasing with \"%c\"" c)))