;;; artist.el --- draw ascii graphics with your mouse
;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
-;; 2005 Free Software Foundation, Inc.
+;; 2005, 2006 Free Software Foundation, Inc.
;; Author: Tomas Abrahamsson <tab@lysator.liu.se>
;; Maintainer: Tomas Abrahamsson <tab@lysator.liu.se>
(defconst artist-version "1.2.6")
(defconst artist-maintainer-address "tab@lysator.liu.se")
+(defvar x-pointer-crosshair)
(eval-and-compile
(condition-case ()
:type 'integer)
-(defvar artist-spray-chars '(?\ ?. ?- ?+ ?m ?% ?* ?#)
+(defvar artist-spray-chars '(?\s ?. ?- ?+ ?m ?% ?* ?#)
;; This is a defvar, not a defcustom, since the custom
;; package shows lists of characters as a lists of integers,
;; which is confusing
(while (< i 256)
(aset artist-replacement-table i i)
(setq i (1+ i))))
- (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)
(blink-matching-paren nil))
(while char-list
(let ((c (car char-list)))
- (if (and see-thru (= (aref artist-replacement-table c) ?\ ))
+ (if (and see-thru (= (aref artist-replacement-table c) ?\s))
(artist-move-to-xy (1+ (artist-current-column))
(artist-current-line))
(artist-replace-char c)))
"Read any extra arguments for figlet."
(interactive)
(let* ((avail-fonts (artist-figlet-get-font-list))
- (font (completing-read (concat "Select font: (default "
+ (font (completing-read (concat "Select font (default "
artist-figlet-default-font
- ") ")
+ "): ")
(mapcar
(lambda (font) (cons font font))
avail-fonts))))
(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)."
- (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)."
- (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)."
- (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 (x y)
;; that look like: \ / instead we get: ( )
;; \ / \ /
;; --------- ---------
- (let ((last-coord (last point-list)))
+ (let ((last-coord (car (last point-list))))
(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))
- (epn (last point-list))
- (epn-1 (last point-list 2))
+ (epn (car (last point-list)))
+ (epn-1 (car (last point-list 2)))
(xn (artist-endpoint-get-x epn))
(yn (artist-endpoint-get-y epn))
(xn-1 (artist-endpoint-get-x epn-1))
(setq artist-key-is-drawing t)
;; Feedback
- (message (substitute-command-keys
+ (message "%s" (substitute-command-keys
(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): ")
- (cond ((eq c ?\r) (setq artist-erase-char ?\ )
+ (cond ((eq c ?\r) (setq artist-erase-char ?\s)
(message "Normal erasing"))
(t (setq artist-erase-char c)
(message "Erasing with \"%c\"" c)))