147 |
;; |
;; |
148 |
;; 1.2.2 19-Nov-2000 |
;; 1.2.2 19-Nov-2000 |
149 |
;; Changed: More documentation fixes. |
;; Changed: More documentation fixes. |
150 |
;; Bugfix: The arrow characters (`artist-arrows'), which |
;; Bugfix: The arrow characters (`artist-arrows'), which |
151 |
;; got wrong in 1.1, are now corrected. |
;; got wrong in 1.1, are now corrected. |
152 |
;; |
;; |
153 |
;; 1.2.1 15-Nov-2000 |
;; 1.2.1 15-Nov-2000 |
202 |
nil) |
nil) |
203 |
(defmacro defface (var values doc &rest args) |
(defmacro defface (var values doc &rest args) |
204 |
`(make-face ,var)) |
`(make-face ,var)) |
205 |
(defmacro defcustom (var value doc &rest args) |
(defmacro defcustom (var value doc &rest args) |
206 |
`(defvar ,var ,value ,doc)))) |
`(defvar ,var ,value ,doc)))) |
207 |
|
|
208 |
;; User options |
;; User options |
446 |
"Char to use when filling.") |
"Char to use when filling.") |
447 |
(make-variable-buffer-local 'artist-fill-char) |
(make-variable-buffer-local 'artist-fill-char) |
448 |
|
|
449 |
(defvar artist-erase-char ?\ |
(defvar artist-erase-char ?\ |
450 |
"Char to use when erasing.") |
"Char to use when erasing.") |
451 |
(make-variable-buffer-local 'artist-erase-char) |
(make-variable-buffer-local 'artist-erase-char) |
452 |
|
|
1766 |
(goto-char (point-min)) |
(goto-char (point-min)) |
1767 |
(delete-char (- (point-max) (point-min)) nil))) |
(delete-char (- (point-max) (point-min)) nil))) |
1768 |
|
|
1769 |
|
|
1770 |
(defun artist-system (program stdin &optional program-args) |
(defun artist-system (program stdin &optional program-args) |
1771 |
"Run PROGRAM synchronously with the contents of string STDIN to stdin. |
"Run PROGRAM synchronously with the contents of string STDIN to stdin. |
1772 |
Optional args PROGRAM-ARGS are arguments to PROGRAM. |
Optional args PROGRAM-ARGS are arguments to PROGRAM. |
2849 |
(artist-replace-string (car string-list) see-thru) |
(artist-replace-string (car string-list) see-thru) |
2850 |
(setq string-list (cdr string-list)) |
(setq string-list (cdr string-list)) |
2851 |
(setq i (1+ i))))) |
(setq i (1+ i))))) |
2852 |
|
|
2853 |
(defun artist-text-insert-see-thru (x y text) |
(defun artist-text-insert-see-thru (x y text) |
2854 |
"At position X, Y, insert text TEXT. |
"At position X, Y, insert text TEXT. |
2855 |
Let text already in buffer shine thru the TEXT inserted." |
Let text already in buffer shine thru the TEXT inserted." |
2883 |
|
|
2884 |
;; |
;; |
2885 |
;; Spraying |
;; Spraying |
2886 |
;; |
;; |
2887 |
|
|
2888 |
(defun artist-spray-get-interval () |
(defun artist-spray-get-interval () |
2889 |
"Retrieves the interval for repeated spray." |
"Retrieves the interval for repeated spray." |
3145 |
;; the entire rectangle is vaporized. |
;; the entire rectangle is vaporized. |
3146 |
;; |
;; |
3147 |
;; Now, What if the `+' in the upper left and upper right corners, |
;; Now, What if the `+' in the upper left and upper right corners, |
3148 |
;; had not been changed to `|' but to spaces instead? We would |
;; had not been changed to `|' but to spaces instead? We would |
3149 |
;; have failed when popping (0,0) and vaporizing that line because |
;; have failed when popping (0,0) and vaporizing that line because |
3150 |
;; we wouldn't find any line at (0,0): |
;; we wouldn't find any line at (0,0): |
3151 |
;; |
;; |
3152 |
;; 0123456 |
;; 0123456 |
3153 |
;; 0 |
;; 0 |
3154 |
;; 1| | |
;; 1| | |
3155 |
;; 2| | |
;; 2| | |
3156 |
;; 3+-----+ |
;; 3+-----+ |
3663 |
|
|
3664 |
;; Last line is empty, don't paint on it, report previous line |
;; Last line is empty, don't paint on it, report previous line |
3665 |
;; as last line |
;; as last line |
3666 |
(>= y (- last-line 1))) |
(>= y (- last-line 1)) |
3667 |
(>= y last-line)))) |
(>= y last-line))))) |
|
|
|
3668 |
|
|
3669 |
(defun artist-flood-fill (x1 y1) |
(defun artist-flood-fill (x1 y1) |
3670 |
"Flood-fill starting at X1, Y1. Fill with the char in `artist-fill-char'." |
"Flood-fill starting at X1, Y1. Fill with the char in `artist-fill-char'." |
4740 |
(if (eq window-system 'x) |
(if (eq window-system 'x) |
4741 |
(artist-set-pointer-shape artist-pointer-shape)) |
(artist-set-pointer-shape artist-pointer-shape)) |
4742 |
|
|
4743 |
;; Redefine the button-up binding temporarily (the original |
;; Redefine the button-up binding temporarily (the original |
4744 |
;; binding is restored in the unwind-forms below). This is to |
;; binding is restored in the unwind-forms below). This is to |
4745 |
;; avoid the phenomenon outlined in this scenario: |
;; avoid the phenomenon outlined in this scenario: |
4746 |
;; |
;; |
4747 |
;; 1. A routine which reads something from the mini-buffer (such |
;; 1. A routine which reads something from the mini-buffer (such |
4748 |
;; as the text renderer) is called from below. |
;; as the text renderer) is called from below. |
4749 |
;; 2. Meanwhile, the users releases the mouse button. |
;; 2. Meanwhile, the users releases the mouse button. |
4750 |
;; 3. As a (funny :-) coincidence, the binding for the |
;; 3. As a (funny :-) coincidence, the binding for the |
4751 |
;; button-up event is often mouse-set-point, so Emacs |
;; button-up event is often mouse-set-point, so Emacs |
4752 |
;; sets the point to where the button was released, which is |
;; sets the point to where the button was released, which is |
4753 |
;; in the buffer where the user wants to place the text. |
;; in the buffer where the user wants to place the text. |