Function: artist-mode

artist-mode is an autoloaded, interactive and byte-compiled function defined in artist.el.gz.

Signature

(artist-mode &optional ARG)

Documentation

Toggle Artist mode.

Artist lets you draw lines, squares, rectangles and poly-lines, ellipses and circles with your mouse and/or keyboard.

How to quit Artist mode

 Type M-x artist-mode-off (artist-mode-off) to quit artist-mode.


How to submit a bug report

 Type M-x artist-submit-bug-report (artist-submit-bug-report) to submit a bug report.


Drawing with the mouse:

 mouse-2
 shift mouse-2 Pops up a menu where you can select what to draw with
mouse-1, and where you can do some settings (described
below).

 mouse-1
 shift mouse-1 Draws lines, rectangles or poly-lines, erases, cuts, copies
or pastes:

Operation Not shifted Shifted
--------------------------------------------------------------
                Pen fill-char at point line from last point
                                                          to new point
--------------------------------------------------------------
Line Line in any direction Straight line
--------------------------------------------------------------
Rectangle Rectangle Square
--------------------------------------------------------------
Poly-line Poly-line in any dir Straight poly-lines
--------------------------------------------------------------
Ellipses Ellipses Circles
--------------------------------------------------------------
Text Text (see thru) Text (overwrite)
--------------------------------------------------------------
Spray-can Spray-can Set size for spray
--------------------------------------------------------------
Erase Erase character Erase rectangle
--------------------------------------------------------------
Vaporize Erase single line Erase connected
lines
--------------------------------------------------------------
Cut Cut rectangle Cut square
--------------------------------------------------------------
Copy Copy rectangle Copy square
--------------------------------------------------------------
Paste Paste Paste
--------------------------------------------------------------
Flood-fill Flood-fill Flood-fill
--------------------------------------------------------------

* Straight lines can only go horizontally, vertically
or diagonally.

* Poly-lines are drawn while holding mouse-1 down. When you
release the button, the point is set. If you want a segment
to be straight, hold down shift before pressing the
mouse-1 button. Click mouse-2 or mouse-3 to stop drawing
poly-lines.

* See thru for text means that text already in the buffer
will be visible through blanks in the text rendered, while
overwrite means the opposite.

* Vaporizing connected lines only vaporizes lines whose
_endpoints_ are connected. See also the variable
artist-vaporize-fuzziness.

* Cut copies, then clears the rectangle/square.

* When drawing lines or poly-lines, you can set arrows.
See below under "Arrows" for more info.

* The mode line shows the currently selected drawing operation.
In addition, if it has an asterisk (*) at the end, you
are currently drawing something.

* Be patient when flood-filling -- large areas take quite
some time to fill.


 mouse-3 Erases character under pointer
 shift mouse-3 Erases rectangle


Settings

 Set fill Sets the character used when filling rectangles/squares

 Set line Sets the character used when drawing lines

 Erase char Sets the character used when erasing

 Rubber-banding Toggles rubber-banding

 Trimming Toggles trimming of line-endings (that is: when the shape
is drawn, extraneous white-space at end of lines is removed)

 Borders Toggles the drawing of line borders around filled shapes


Drawing with keys

 M-x artist-key-set-point (artist-key-set-point) Does one of the following:
For lines/rectangles/squares: sets the first/second endpoint
                For poly-lines: sets a point (use C-u (universal-argument) M-x artist-key-set-point (artist-key-set-point) to set last point)
When erase characters: toggles erasing
When cutting/copying: Sets first/last endpoint of rect/square
When pasting: Pastes

 M-x artist-select-operation (artist-select-operation) Selects what to draw

 Move around with M-x artist-next-line (artist-next-line), M-x artist-previous-line (artist-previous-line), M-x artist-forward-char (artist-forward-char) and M-x artist-backward-char (artist-backward-char).

 M-x artist-select-fill-char (artist-select-fill-char) Sets the character to use when filling
 M-x artist-select-line-char (artist-select-line-char) Sets the character to use when drawing
 M-x artist-select-erase-char (artist-select-erase-char) Sets the character to use when erasing
 M-x artist-toggle-rubber-banding (artist-toggle-rubber-banding) Toggles rubber-banding
 M-x artist-toggle-trim-line-endings (artist-toggle-trim-line-endings) Toggles trimming of line-endings
 M-x artist-toggle-borderless-shapes (artist-toggle-borderless-shapes) Toggles borders on drawn shapes


Arrows

 M-x artist-toggle-first-arrow (artist-toggle-first-arrow) Sets/unsets an arrow at the beginning
of the line/poly-line

 M-x artist-toggle-second-arrow (artist-toggle-second-arrow) Sets/unsets an arrow at the end
of the line/poly-line


Selecting operation

 There are some keys for quickly selecting drawing operations:

 M-x artist-select-op-line (artist-select-op-line) Selects drawing lines
 M-x artist-select-op-straight-line (artist-select-op-straight-line) Selects drawing straight lines
 M-x artist-select-op-rectangle (artist-select-op-rectangle) Selects drawing rectangles
 M-x artist-select-op-square (artist-select-op-square) Selects drawing squares
 M-x artist-select-op-poly-line (artist-select-op-poly-line) Selects drawing poly-lines
 M-x artist-select-op-straight-poly-line (artist-select-op-straight-poly-line) Selects drawing straight poly-lines
 M-x artist-select-op-ellipse (artist-select-op-ellipse) Selects drawing ellipses
 M-x artist-select-op-circle (artist-select-op-circle) Selects drawing circles
 M-x artist-select-op-text-see-thru (artist-select-op-text-see-thru) Selects rendering text (see thru)
 M-x artist-select-op-text-overwrite (artist-select-op-text-overwrite) Selects rendering text (overwrite)
 M-x artist-select-op-spray-can (artist-select-op-spray-can) Spray with spray-can
 M-x artist-select-op-spray-set-size (artist-select-op-spray-set-size) Set size for the spray-can
 M-x artist-select-op-erase-char (artist-select-op-erase-char) Selects erasing characters
 M-x artist-select-op-erase-rectangle (artist-select-op-erase-rectangle) Selects erasing rectangles
 M-x artist-select-op-vaporize-line (artist-select-op-vaporize-line) Selects vaporizing single lines
 M-x artist-select-op-vaporize-lines (artist-select-op-vaporize-lines) Selects vaporizing connected lines
 M-x artist-select-op-cut-rectangle (artist-select-op-cut-rectangle) Selects cutting rectangles
 M-x artist-select-op-copy-rectangle (artist-select-op-copy-rectangle) Selects copying rectangles
 M-x artist-select-op-paste (artist-select-op-paste) Selects pasting
 M-x artist-select-op-flood-fill (artist-select-op-flood-fill) Selects flood-filling


Variables

 This is a brief overview of the different variables. For more info,
 see the documentation for the variables (type C-h v (describe-variable) <variable> RET).

 artist-rubber-banding Interactively do rubber-banding or not
 artist-first-char What to set at first/second point...
 artist-second-char ...when not rubber-banding
 artist-interface-with-rect Should cut/copy/paste interface with rect
 artist-arrows(var)/artist-arrows(fun) The arrows to use when drawing arrows
 artist-aspect-ratio Character height-to-width for squares
 artist-trim-line-endings Trimming of line endings
 artist-flood-fill-right-border Right border when flood-filling
 artist-flood-fill-show-incrementally Update display while filling
 artist-pointer-shape Pointer shape to use while drawing
 artist-ellipse-left-char Character to use for narrow ellipses
 artist-ellipse-right-char Character to use for narrow ellipses
 artist-borderless-shapes If shapes should have borders
 artist-picture-compatibility Picture mode compatibility on or off
 artist-vaporize-fuzziness Tolerance when recognizing lines
 artist-spray-interval Seconds between repeated sprayings
 artist-spray-radius Size of the spray-area
 artist-spray-chars The spray-"color"
 artist-spray-new-char Initial spray-"color"

Hooks

 Turning the mode on or off runs artist-mode-hook.


Keymap summary

< artist-toggle-first-arrow
<down-mouse-1> artist-down-mouse-1
<down-mouse-2> artist-mouse-choose-operation
<down-mouse-3> artist-down-mouse-3
<down> artist-next-line
<left> artist-backward-char
<right> artist-forward-char
<up> artist-previous-line
> artist-toggle-second-arrow
C-<mouse-4> artist-select-prev-op-in-list
C-<mouse-5> artist-select-next-op-in-list
C-b artist-backward-char
C-c C-a C-b artist-submit-bug-report
C-c C-a C-d artist-select-op-erase-char
C-c C-a C-e artist-select-erase-char
C-c C-a C-f artist-select-fill-char
C-c C-a C-k artist-select-op-cut-rectangle
C-c C-a C-l artist-select-line-char
C-c C-a C-o artist-select-operation
C-c C-a C-r artist-toggle-rubber-banding
C-c C-a C-s artist-toggle-borderless-shapes
C-c C-a C-t artist-toggle-trim-line-endings
C-c C-a C-y artist-select-op-paste
C-c C-a E artist-select-op-erase-rectangle
C-c C-a L artist-select-op-straight-line
C-c C-a M-w artist-select-op-copy-rectangle
C-c C-a P artist-select-op-straight-poly-line
C-c C-a R artist-select-op-square
C-c C-a S artist-select-op-spray-can
C-c C-a T artist-select-op-text-overwrite
C-c C-a V artist-select-op-vaporize-lines
C-c C-a c artist-select-op-circle
C-c C-a e artist-select-op-ellipse
C-c C-a f artist-select-op-flood-fill
C-c C-a l artist-select-op-line
C-c C-a p artist-select-op-poly-line
C-c C-a r artist-select-op-rectangle
C-c C-a s artist-select-op-square
C-c C-a t artist-select-op-text-see-thru
C-c C-a v artist-select-op-vaporize-line
C-c C-a z artist-select-op-spray-set-size
C-c C-c artist-mode-off
C-f artist-forward-char
C-n artist-next-line
C-p artist-previous-line
RET artist-key-set-point
S-<down-mouse-1> artist-down-mouse-1
S-<down-mouse-2> artist-mouse-choose-operation
S-<down-mouse-3> artist-down-mouse-3

This is a minor mode. If called interactively, toggle the Artist mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate the variable artist-mode(var)/artist-mode(fun).

The mode's hook is called both when the mode is enabled and when it is disabled.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/artist.el.gz
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; ---------------------------------
;;; The artist-mode
;;; ---------------------------------

;;;###autoload
(define-minor-mode artist-mode
  "Toggle Artist mode.

Artist lets you draw lines, squares, rectangles and poly-lines,
ellipses and circles with your mouse and/or keyboard.

How to quit Artist mode

 Type \\[artist-mode-off] to quit artist-mode.


How to submit a bug report

 Type \\[artist-submit-bug-report] to submit a bug report.


Drawing with the mouse:

 mouse-2
 shift mouse-2	Pops up a menu where you can select what to draw with
		mouse-1, and where you can do some settings (described
		below).

 mouse-1
 shift mouse-1	Draws lines, rectangles or poly-lines, erases, cuts, copies
		or pastes:

		Operation	Not shifted		  Shifted
		--------------------------------------------------------------
                Pen             fill-char at point        line from last point
                                                          to new point
		--------------------------------------------------------------
		Line		Line in any direction	  Straight line
		--------------------------------------------------------------
		Rectangle	Rectangle		  Square
		--------------------------------------------------------------
		Poly-line	Poly-line in any dir	  Straight poly-lines
		--------------------------------------------------------------
		Ellipses	Ellipses		  Circles
		--------------------------------------------------------------
		Text		Text (see thru)		  Text (overwrite)
		--------------------------------------------------------------
		Spray-can	Spray-can		  Set size for spray
		--------------------------------------------------------------
		Erase		Erase character		  Erase rectangle
		--------------------------------------------------------------
		Vaporize	Erase single line	  Erase connected
							  lines
		--------------------------------------------------------------
		Cut		Cut rectangle		  Cut square
		--------------------------------------------------------------
		Copy		Copy rectangle		  Copy square
		--------------------------------------------------------------
		Paste		Paste			  Paste
		--------------------------------------------------------------
		Flood-fill	Flood-fill		  Flood-fill
		--------------------------------------------------------------

		* Straight lines can only go horizontally, vertically
		  or diagonally.

		* Poly-lines are drawn while holding mouse-1 down.  When you
		  release the button, the point is set.  If you want a segment
		  to be straight, hold down shift before pressing the
		  mouse-1 button.  Click mouse-2 or mouse-3 to stop drawing
		  poly-lines.

		* See thru for text means that text already in the buffer
		  will be visible through blanks in the text rendered, while
		  overwrite means the opposite.

		* Vaporizing connected lines only vaporizes lines whose
		  _endpoints_ are connected.  See also the variable
		  `artist-vaporize-fuzziness'.

		* Cut copies, then clears the rectangle/square.

		* When drawing lines or poly-lines, you can set arrows.
		  See below under \"Arrows\" for more info.

		* The mode line shows the currently selected drawing operation.
		  In addition, if it has an asterisk (*) at the end, you
		  are currently drawing something.

		* Be patient when flood-filling -- large areas take quite
		  some time to fill.


 mouse-3	Erases character under pointer
 shift mouse-3	Erases rectangle


Settings

 Set fill	Sets the character used when filling rectangles/squares

 Set line	Sets the character used when drawing lines

 Erase char	Sets the character used when erasing

 Rubber-banding	Toggles rubber-banding

 Trimming	Toggles trimming of line-endings (that is: when the shape
		is drawn, extraneous white-space at end of lines is removed)

 Borders        Toggles the drawing of line borders around filled shapes


Drawing with keys

 \\[artist-key-set-point]		Does one of the following:
		For lines/rectangles/squares: sets the first/second endpoint
                For poly-lines: sets a point (use \\[universal-argument] \\[artist-key-set-point] to set last point)
		When erase characters: toggles erasing
		When cutting/copying: Sets first/last endpoint of rect/square
		When pasting: Pastes

 \\[artist-select-operation]	Selects what to draw

 Move around with \\[artist-next-line], \\[artist-previous-line], \\[artist-forward-char] and \\[artist-backward-char].

 \\[artist-select-fill-char]	Sets the character to use when filling
 \\[artist-select-line-char]	Sets the character to use when drawing
 \\[artist-select-erase-char]	Sets the character to use when erasing
 \\[artist-toggle-rubber-banding]	Toggles rubber-banding
 \\[artist-toggle-trim-line-endings]	Toggles trimming of line-endings
 \\[artist-toggle-borderless-shapes]	Toggles borders on drawn shapes


Arrows

 \\[artist-toggle-first-arrow]		Sets/unsets an arrow at the beginning
		of the line/poly-line

 \\[artist-toggle-second-arrow]		Sets/unsets an arrow at the end
		of the line/poly-line


Selecting operation

 There are some keys for quickly selecting drawing operations:

 \\[artist-select-op-line]	Selects drawing lines
 \\[artist-select-op-straight-line]	Selects drawing straight lines
 \\[artist-select-op-rectangle]	Selects drawing rectangles
 \\[artist-select-op-square]	Selects drawing squares
 \\[artist-select-op-poly-line]	Selects drawing poly-lines
 \\[artist-select-op-straight-poly-line]	Selects drawing straight poly-lines
 \\[artist-select-op-ellipse]	Selects drawing ellipses
 \\[artist-select-op-circle]	Selects drawing circles
 \\[artist-select-op-text-see-thru]	Selects rendering text (see thru)
 \\[artist-select-op-text-overwrite]	Selects rendering text (overwrite)
 \\[artist-select-op-spray-can]	Spray with spray-can
 \\[artist-select-op-spray-set-size]	Set size for the spray-can
 \\[artist-select-op-erase-char]	Selects erasing characters
 \\[artist-select-op-erase-rectangle]	Selects erasing rectangles
 \\[artist-select-op-vaporize-line]	Selects vaporizing single lines
 \\[artist-select-op-vaporize-lines]	Selects vaporizing connected lines
 \\[artist-select-op-cut-rectangle]	Selects cutting rectangles
 \\[artist-select-op-copy-rectangle]	Selects copying rectangles
 \\[artist-select-op-paste]	Selects pasting
 \\[artist-select-op-flood-fill]	Selects flood-filling


Variables

 This is a brief overview of the different variables.  For more info,
 see the documentation for the variables (type \\[describe-variable] <variable> RET).

 `artist-rubber-banding'              Interactively do rubber-banding or not
 `artist-first-char'                  What to set at first/second point...
 `artist-second-char'                 ...when not rubber-banding
 `artist-interface-with-rect'         Should cut/copy/paste interface with rect
 `artist-arrows'                      The arrows to use when drawing arrows
 `artist-aspect-ratio'                Character height-to-width for squares
 `artist-trim-line-endings'           Trimming of line endings
 `artist-flood-fill-right-border'     Right border when flood-filling
 `artist-flood-fill-show-incrementally'  Update display while filling
 `artist-pointer-shape'               Pointer shape to use while drawing
 `artist-ellipse-left-char'           Character to use for narrow ellipses
 `artist-ellipse-right-char'          Character to use for narrow ellipses
 `artist-borderless-shapes'           If shapes should have borders
 `artist-picture-compatibility'       Picture mode compatibility on or off
 `artist-vaporize-fuzziness'          Tolerance when recognizing lines
 `artist-spray-interval'              Seconds between repeated sprayings
 `artist-spray-radius'                Size of the spray-area
 `artist-spray-chars'                 The spray-\"color\"
 `artist-spray-new-char'              Initial spray-\"color\"

Hooks

 Turning the mode on or off runs `artist-mode-hook'.


Keymap summary

\\{artist-mode-map}"
  :init-value nil :group 'artist :lighter artist-mode-name
  :keymap artist-mode-map
  (cond ((null artist-mode)
	 ;; Turn mode off
	 (artist-mode-exit))
	(t
	 ;; Turn mode on
	 (artist-mode-init)
         (let* ((font (face-attribute 'default :font))
                (spacing-prop (if (fontp font)
                                  (font-get font :spacing)
                                t)))
           (when (or (null spacing-prop) (eq spacing-prop 0))
             (message "The default font isn't monospaced, so the drawings in this buffer may look odd"))))))