• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/textmodes/

Lines Matching +defs:mode +defs:function

94 ;; * Picture mode compatibility: Artist is picture mode compatible (this
97 ;; See the documentation for the function artist-mode for a detailed
105 ;; If you add a new drawing mode, send it to me, and I would gladly
113 ;; (autoload 'artist-mode "artist" "Enter artist-mode" t)
124 ;; Artist also requires the Picture mode (which also comes with Emacs)
134 ;; while drawing with the mouse. (See the comment in the function
164 ;; Bugfix: Sets next-line-add-newlines to t while in artist-mode.
184 ;; New: Picture mode compatibility.
186 ;; with Picture mode.
222 "Customization of the Artist mode."
333 "Whether or not picture mode compatibility is on."
368 (defcustom artist-text-renderer-function 'artist-figlet
372 (defvaralias 'artist-text-renderer 'artist-text-renderer-function)
433 (defvar artist-mode nil
434 "Non-nil to enable `artist-mode' and nil to disable.")
435 (make-variable-buffer-local 'artist-mode)
437 (defvar artist-mode-name " Artist"
438 "Name of artist mode beginning with a space (appears in the mode-line).")
492 This variable is initialized by the artist-make-prev-next-op-alist function.")
498 (require 'picture)) ; picture mode compatibility
508 ;; Variables that are made local in artist-mode-init
521 (defvar artist-mode-map
523 (setq artist-mode-map (make-sparse-keymap))
550 (define-key map "\C-c\C-c" 'artist-mode-off)
574 "Keymap for `artist-minor-mode'.")
590 ((function-call
794 ((function-call
797 (function-call
800 (function-call
803 (function-call
806 (function-call
809 (function-call
812 (function-call
817 "Master Table for `artist-mode'.
819 available in artist mode, but it also holds layout information for the
831 `function-call' -- call a function
845 This is the layout of the INFO-PART for `function-call':
851 FN is the function performing the operation. This function
871 MODE-LINE is a string that appears in the mode-line when drawing
873 ARROW-PRED is a function that is called to find out if the shape
874 can have arrows. The function is called with no arguments and
876 ARROW-SET-FN is a function that is called to set arrow end-points.
878 INIT-FN is, if non-nil, a function that is called when the first
881 PREP-FILL-FN is, if non-nil, a function that is called after
884 EXIT-FN is, if non-nil, a function that is called after filling
893 DRAW-FN is the function to call for drawing. Arguments and
900 INTERVAL-FN is, if non-nil, a function to call for getting
902 This function is called with no arguments and must
911 UNDRAW-FN is a function to call for undrawing the shape.
914 FILL-PRED is a function that is called to find out if the shape
915 can have arrows. The function must take no arguments and
917 FILL-FN is a function to call for filling the shape.
928 The following table describe function arguments and return value
1007 (defsubst artist-go-get-mode-line (info-variant-part)
1008 "Retrieve the mode line component from an INFO-VARIANT-PART.
1023 "Retrieve the init function component from an INFO-VARIANT-PART.
1028 "Retrieve the fill preparation function component from an INFO-VARIANT-PART.
1043 "Retrieve the draw function component from an INFO-VARIANT-PART.
1048 "Retrieve the undraw function component from an INFO-VARIANT-PART.
1050 This interval function component is available only if the `draw-how'
1055 "Retrieve the interval function component from an INFO-VARIANT-PART.
1057 This interval function component is available only if the `draw-how'
1064 This interval function component is available only if the `draw-how'
1069 "Retrieve the fill function component from an INFO-VARIANT-PART.
1071 This interval function component is available only if the `draw-how'
1075 ;; For the 'function-call info-parts
1086 "Retrieve the function component from a graphics operation INFO-PART."
1151 "Cyclically select next drawing mode operation."
1158 "Cyclically select previous drawing mode operation."
1167 ;;; The artist-mode
1171 (defun artist-mode (&optional state)
1172 "Toggle artist mode. With arg, turn artist mode on if arg is positive.
1176 How to quit artist mode
1178 Type \\[artist-mode-off] to quit artist-mode.
1250 * The mode line shows the currently selected drawing operation.
1352 artist-picture-compatibility Whether or not to be picture mode compatible
1361 When entering artist-mode, the hook `artist-mode-init-hook' is called.
1362 When quitting artist-mode, the hook `artist-mode-exit-hook' is called.
1367 \\{artist-mode-map}"
1369 (if (setq artist-mode
1370 (if (null state) (not artist-mode)
1372 (artist-mode-init)
1373 (artist-mode-exit)))
1375 ;; insert our minor mode string
1376 (or (assq 'artist-mode minor-mode-alist)
1377 (setq minor-mode-alist
1378 (cons '(artist-mode artist-mode-name)
1379 minor-mode-alist)))
1381 ;; insert our minor mode keymap
1382 (or (assq 'artist-mode minor-mode-map-alist)
1383 (setq minor-mode-map-alist
1384 (cons (cons 'artist-mode artist-mode-map)
1385 minor-mode-map-alist)))
1389 (defun artist-mode-init ()
1390 "Init Artist mode. This will call the hook `artist-mode-init-hook'."
1424 (if (and artist-picture-compatibility (not (eq major-mode 'picture-mode)))
1426 (picture-mode)
1428 (run-hooks 'artist-mode-init-hook)
1429 (artist-mode-line-show-curr-operation artist-key-is-drawing))
1431 (defun artist-mode-exit ()
1432 "Exit Artist mode. This will call the hook `artist-mode-exit-hook'."
1433 (if (and artist-picture-compatibility (eq major-mode 'picture-mode))
1434 (picture-mode-exit))
1436 (run-hooks 'artist-mode-exit-hook))
1438 (defun artist-mode-off ()
1439 "Turn Artist mode off."
1441 (artist-mode -1)
1442 (force-mode-line-update))
1452 (defun artist-mode-line-show-curr-operation (is-drawing)
1453 "Show current operation in mode-line. If IS-DRAWING, show that."
1454 (let ((mtext (concat artist-mode-name "/"
1455 (artist-go-get-mode-line-from-symbol artist-curr-go)
1457 (setcdr (assq 'artist-mode minor-mode-alist) (list mtext)))
1458 (force-mode-line-update))
1491 The returned value is suitable for the `x-popup-menu' function."
1507 ((eq element-tag 'function-call)
1556 ; Retrieving a symbol (graphics operation or function-call) from a keyword
1582 ((eq element-tag 'function-call)
1645 (defun artist-go-get-mode-line-from-symbol (symbol)
1646 "Search the master table, get mode-line from a graphics operation SYMBOL."
1647 (artist-go-retrieve-from-symbol symbol 'artist-go-get-mode-line))
1727 ; Retrieving info from a function-call symbol
1731 "Search the master table for a function call SYMBOL.
1737 "Search TABLE for a function-call SYMBOL.
1744 (cond ((eq element-tag 'function-call)
1761 "Search the master table to get function from a function call SYMBOL."
1769 ;; Macro that won't funcall the function if it is nil.
1772 "Call function FN with ARGS iff FN is not nil."
1972 ;; The self-insert-command doesn't care about the overwrite-mode,
1973 ;; so the insertion is done in the same way as in picture mode.
1981 (let ((overwrite-mode 'overwrite-mode-textual)
1993 ;; The self-insert-command doesn't care about the overwrite-mode,
1994 ;; so the insertion is done in the same way as in picture mode.
2003 (let ((overwrite-mode 'overwrite-mode-textual)
2014 (overwrite-mode 'overwrite-mode-textual)
2052 "This function unsets point 2 when not rubber-banding."
2075 "This function unsets point 1 and 2 when not rubber-banding."
2483 This function returns a point-list."
2915 This is done by calling the function specified by
2916 `artist-text-renderer-function', which must return a list of strings,
2921 (rendered-text (artist-funcall artist-text-renderer-function input-text)))
2927 This is done by calling the function specified by
2928 `artist-text-renderer-function', which must return a list of strings,
2933 (rendered-text (artist-funcall artist-text-renderer-function input-text)))
3847 "Generic function for setting arrow-points for poly-shapes from POINT-LIST."
3867 "Generic function for setting arrow-points for 2-point shapes.
3942 ;; drawing mode, or even kills the buffer! In the mouse case, it is much
4376 (artist-mode-line-show-curr-operation artist-key-is-drawing)))
4531 ;; otherwise this function cannot get called).
4553 (artist-mode-line-show-curr-operation artist-key-is-drawing))
4810 ;; To do this foolproof, all local and minor-mode maps should
4818 (artist-mode-line-show-curr-operation t)
4844 (artist-mode-line-show-curr-operation artist-key-is-drawing))))
4859 ;; *** It was a draw-function
4868 ;; *** It was a set/unset function
4878 ;; Restore mode-line
4879 (artist-mode-line-show-curr-operation artist-key-is-drawing))
4913 "Generic function for shapes that requires 1 point as input.
5002 "Generic function for shapes requiring several points as input.
5126 ;; Show new operation in mode-line
5128 (artist-mode-line-show-curr-operation t))))
5211 "Generic function for shapes requiring only 1 point as input.
5241 "Generic function for shapes requiring 2 points as input.
5366 (function
5380 ;; Now provide this minor mode
5389 ;; If you are going to add a new drawing mode, read the following
5392 ;; 1. If your new drawing mode falls into one of the following
5397 ;; Example: the erase-char mode, the pen and pen-line modes.
5401 ;; Example: the poly-line mode
5408 ;; modes). This mode differs from the continous modes in
5416 ;; init-fn: a function to be called at the very beginning
5418 ;; prep-fill-fn: a function to be called before filling,
5419 ;; arrow-set-fn: a function for setting arrows, to be called
5421 ;; exit-fn: a function to be called at the very end of
5426 ;; If your mode matches the continous mode or the 1-point mode:
5428 ;; a. Create a draw-function that draws your shape. Your function
5432 ;; b. Add your mode to the master table, `artist-mt'.
5439 ;; If your mode matches the 2-point mode:
5441 ;; a. Create one draw-function that draws your shape and one
5442 ;; undraw-function that undraws it.
5444 ;; The draw-function must take x1, y1, x2 and y2 as
5448 ;; Shapeinfo: all info necessary for your undraw-function to
5457 ;; The undraw-function must take one argument: the list created
5458 ;; by your draw-function. The return value is not used.
5460 ;; b. If you want to provide a fill-function, then create a
5461 ;; function that takes 5 arguments: the list created by your
5462 ;; draw-function, x1, y1, x2 and y2. The return value is not
5465 ;; c. Add your mode to the master table, `artist-mt'.
5472 ;; If your mode matches the poly-point mode:
5474 ;; a. Create one draw-function that draws your shape and one
5475 ;; undraw-function that undraws it. The draw- and
5477 ;; your poly-point mode between 2 points. The draw- and
5478 ;; undraw-functions are then really 2-point mode functions.
5480 ;; values as those of the 2-point mode.
5486 ;; b. If you want to provide a fill-function, then create a
5487 ;; function that takes 1 argument: a list of points where each
5490 ;; c. Add your mode to the master table, `artist-mt'.
5498 ;; and `artist-arrow-point-2'. If your mode does not take arrows,
5503 ;; 3. If your mode doesn't match any of the categories, you are facing
5507 ;; a. Decide on a name for your type of mode. Let's assume that
5511 ;; b. Create a function artist-mouse-draw-xxx for drawing with
5516 ;; any other function. Converting is done with
5517 ;; the function `artist-coord-win-to-buf'.
5530 ;; When artist-mouse-draw-xxx ends, the shape for your mode
5536 ;; mode, to be called from `artist-key-set-point-common'.
5552 ;; of drawing mode.
5555 ;; only you is using your type of mode, so noone will be able
5556 ;; to switch to another operation of the same type of mode,
5557 ;; but someone else might base a new drawing mode upon your
5563 ;; e. Add your new mode to the master table, `artist-mt'.