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

Lines Matching +defs:save +defs:point

235   "Character to set at first point when not rubber-banding."
240 "Character to set at second point when not rubber-banding."
511 (defvar artist-key-poly-point-list nil)
516 (defvar artist-rb-save-data nil)
517 (defvar artist-arrow-point-1 nil)
518 (defvar artist-arrow-point-2 nil)
532 (define-key map "\r" 'artist-key-set-point) ; return
879 point of the shape is set. Arguments and return values for
882 the last point is set, but before the filling is done.
1199 Pen fill-char at point line from last point
1200 to new point
1232 release the button, the point is set. If you want a segment
1280 \\[artist-key-set-point] Does one of the following:
1282 For poly-lines: sets a point (use C-u \\[artist-key-set-point] to set last point)
1340 artist-first-char What to set at first/second point...
1400 (make-local-variable 'artist-key-poly-point-list)
1406 (make-local-variable 'artist-rb-save-data)
1407 (make-local-variable 'artist-arrow-point-1)
1408 (make-local-variable 'artist-arrow-point-2)
1411 (setq artist-key-poly-point-list nil)
1417 (setq artist-rb-save-data (make-vector 7 0))
1418 (setq artist-arrow-point-1 nil)
1419 (setq artist-arrow-point-2 nil)
1802 (save-excursion
1805 (goto-char (point-min))
1807 (let ((str (copy-sequence (buffer-substring (point-min)
1808 (point-max)))))
1814 (save-excursion
1816 (goto-char (point-min))
1817 (delete-char (- (point-max) (point-min)) nil)))
1824 (save-excursion
1867 (save-excursion
1869 (copy-sequence (buffer-substring (point-min)
1870 (point-max))))
1889 ;; artist-replace-char overwrite (replace) char at point
1890 ;; artist-replace-chars overwrite (replace) chars at point
1894 "Return point's current column."
1898 "Return point's current line, buffer-relative. Top of buffer is 0."
1899 (+ (count-lines 1 (point))
1921 ;; end"). Suppose point is at at P. Then (forward-line 1)
1922 ;; returns 0 and puts point after the `X'.
1962 (save-excursion
1967 "Replace the character at point with NEW-CHAR."
1988 "Replace characters at point with NEW-CHAR. COUNT chars are replaced."
2010 "Replace contents at point with STRING.
2030 "Unsets point 1 when not rubber-banding."
2033 (x (aref artist-rb-save-data 0))
2034 (y (aref artist-rb-save-data 1)))
2036 (artist-replace-char (aref artist-rb-save-data 2))
2040 "Set point 1 at X, Y when not rubber-banding."
2043 (aset artist-rb-save-data 0 x)
2044 (aset artist-rb-save-data 1 y)
2045 (aset artist-rb-save-data 2 (artist-get-char-at-xy x y))
2049 (aset artist-rb-save-data 6 0)))
2052 "This function unsets point 2 when not rubber-banding."
2053 (if (= (aref artist-rb-save-data 6) 1)
2056 (x (aref artist-rb-save-data 3))
2057 (y (aref artist-rb-save-data 4)))
2059 (artist-replace-char (aref artist-rb-save-data 5))
2063 "Set point 2 at X, Y when not rubber-banding."
2066 (aset artist-rb-save-data 3 x)
2067 (aset artist-rb-save-data 4 y)
2068 (aset artist-rb-save-data 5 (artist-get-char-at-xy x y))
2072 (aset artist-rb-save-data 6 1)))
2075 "This function unsets point 1 and 2 when not rubber-banding."
2185 "Find the direction from point X1,Y1 to X2,Y2.
2227 (defun artist-save-chars-under-sline (line)
2244 ;; The line drawing engine is the eight-point alrogithm.
2261 "Table used by line drawing algorithm (eight point).")
2375 (defmacro artist-put-pixel (point-list x y)
2377 (list 'setq point-list
2378 (list 'append point-list (list 'list (list 'artist-new-coord x y)))))
2380 ;; Calculate list of points using eight point algorithm
2383 (defun artist-eight-point (x1 y1 x2 y2)
2384 "Run the eight-point algorithm to get a list of coords from X1,Y1 to X2,Y2."
2385 (let* ((point-list nil)
2401 (artist-put-pixel point-list x y)
2413 (artist-put-pixel point-list x y))
2414 point-list))
2416 ;; artist-save-chars-under-point-list
2418 ;; Returns point-list.
2420 (defun artist-save-chars-under-point-list (point-list)
2428 point-list))
2431 ;; Calculates which char to insert depending on direction of point-list.
2441 ;; artist-calculate-new-chars works on a point-list, returns point-list.
2458 (defun artist-calculate-new-chars (point-list)
2460 (if (null (cdr point-list))
2461 (list (artist-coord-add-new-char (car point-list) ?o ))
2462 (let ((last-coord (car point-list)))
2464 (car point-list)
2465 (artist-calculate-new-char (car (cdr point-list))
2466 (car point-list)))
2474 (cdr point-list))))))
2479 ;; artist-modify-new-chars works on a point-list, returns point-list.
2481 (defun artist-modify-new-chars (point-list)
2483 This function returns a point-list."
2490 point-list))
2512 (defun artist-make-2point-object (endpoint1 endpoint2 shapeinfo)
2513 "Create a 2-point object of ENDPOINT1, ENDPOINT2 and SHAPEINFO."
2516 (defun artist-2point-get-endpoint1 (obj)
2517 "Retrieve the first endpoint of a 2-point object OBJ."
2520 (defun artist-2point-get-endpoint2 (obj)
2521 "Retrieve the second endpoint of a 2-point object OBJ."
2524 (defun artist-2point-get-shapeinfo (obj)
2525 "Retrieve the shapeinfo component of a 2-point object OBJ."
2542 (artist-make-2point-object
2555 (artist-save-chars-under-point-list
2556 (artist-eight-point x1 y1 x2 y2))))))))
2566 (artist-2point-get-shapeinfo line)))
2584 (let* ((line (artist-save-chars-under-sline (artist-sline x1 y1 x2 y2)))
2606 (artist-make-2point-object endpoint1 endpoint2 line)))
2612 (let* ((shape-info (artist-2point-get-shapeinfo line))
2646 (artist-make-2point-object endpoint1
2653 (let ((shape-info (artist-2point-get-shapeinfo rectangle)))
2712 (artist-make-2point-object endpoint1
2719 (let ((shape-info (artist-2point-get-shapeinfo square)))
2777 This will store all points in `artist-key-poly-point-list' in reversed
2786 ;; Draw line from last point to this
2787 (let ((x-last (car (car artist-key-poly-point-list)))
2788 (y-last (cdr (car artist-key-poly-point-list))))
2793 ;; Update the point-list
2794 (setq artist-key-poly-point-list
2795 (cons (cons x1 y1) artist-key-poly-point-list))))
2800 (setq artist-key-poly-point-list (list (cons x1 y1))))
2805 Also, the `artist-key-poly-point-list' is reversed."
2807 (setq artist-key-poly-point-list
2808 (artist-uniq artist-key-poly-point-list))
2810 (if (>= (length artist-key-poly-point-list) 2)
2812 ;; Only set arrow-points if the point-list has two or more entries
2813 (let ((xn (car (car artist-key-poly-point-list)))
2814 (yn (cdr (car artist-key-poly-point-list)))
2815 (xn-1 (car (car (cdr artist-key-poly-point-list))))
2816 (yn-1 (cdr (car (cdr artist-key-poly-point-list))))
2817 (dirn)) ; direction for point n
2818 (setq artist-key-poly-point-list (reverse artist-key-poly-point-list))
2819 (let ((x0 (car (car artist-key-poly-point-list)))
2820 (y0 (cdr (car artist-key-poly-point-list)))
2821 (x1 (car (car (cdr artist-key-poly-point-list))))
2822 (y1 (cdr (car (cdr artist-key-poly-point-list))))
2823 (dir0)) ; direction for point 0
2826 (setq artist-arrow-point-1 (artist-make-arrow-point x0 y0 dir0))
2827 (setq artist-arrow-point-2 (artist-make-arrow-point xn yn dirn))))))
2946 Returns a list of points. Each point is on the form (X1 . Y1)."
2951 (point (cons (round (* dist (cos angle)))
2953 (setq points (cons point points)))
2963 ;; Replace one spray point
2964 (let* ((point (car spray-points))
2965 (x (+ x1 (car point)))
2966 (y (+ y1 (cdr point)))
2975 ;; Step to next spray point
3100 "Given a point X1, Y1, return a list of endpoints of lines through X, Y.
3215 "Vaporize lines reachable from point X1, Y1."
3221 (let* ((vaporize-point (pop ep-stack))
3222 (new-endpoints (artist-vaporize-line (car vaporize-point)
3223 (cdr vaporize-point))))
3233 "Create a point-list for first quadrant.
3245 (point-list nil))
3246 (artist-put-pixel point-list x y)
3256 (artist-put-pixel point-list x y))
3268 (artist-put-pixel point-list x y))
3269 point-list))
3307 (defun artist-ellipse-point-list-add-center (x-center y-center point-list)
3313 point-list))
3335 (defun artist-ellipse-compute-fill-info (point-list)
3358 point-list)
3374 (defun artist-ellipse-mirror-quadrant (point-list)
3386 (let ((last-coord (car (last point-list))))
3393 point-list
3403 (cdr (reverse point-list)))))
3435 (let* ((point-list (artist-ellipse-generate-quadrant x-radius y-radius))
3436 (fill-info (artist-ellipse-compute-fill-info point-list))
3439 (setq point-list (artist-calculate-new-chars point-list))
3440 (setq point-list (artist-ellipse-mirror-quadrant point-list))
3441 (setq point-list (artist-ellipse-point-list-add-center x1 y1 point-list))
3445 (setq point-list
3455 (artist-save-chars-under-point-list point-list))))
3457 (aset shape-info 0 point-list)
3459 (artist-make-2point-object (artist-make-endpoint x1 y1)
3475 (let ((point-list nil)
3480 (point-list nil)
3491 (setq point-list (append point-list (list new-coord)))
3493 (aset shape-info 0 point-list)
3495 (artist-make-2point-object (artist-make-endpoint x1 y1)
3500 "Draw an ellipse with center at X1, Y1 and point X2,Y2.
3537 (let ((point-list (aref (artist-2point-get-shapeinfo ellipse) 0)))
3544 point-list))))
3548 "Draw a circle with center at X1, Y1 and point X2,Y2.
3586 (let ((fill-info (aref (artist-2point-get-shapeinfo ellipse) 1)))
3625 (let ((here (point))
3626 (there (save-excursion (artist-move-to-xy (+ x width) y) (point))))
3628 (setq there (save-excursion (artist-move-to-xy (+ x width) y) (point)))
3694 (save-excursion
3710 (save-excursion
3711 (goto-char (point-max))
3714 (if (= (point) (point-max))
3806 (defun artist-make-arrow-point (x y direction &optional state)
3807 "Create an arrow point at X, Y for a line in direction DIRECTION.
3809 (save-excursion
3810 (let* ((arrow-point (make-vector 4 0))
3813 (set-marker arrow-marker (point))
3814 (aset arrow-point 0 arrow-marker)
3815 (aset arrow-point 1 (artist-get-char-at-xy x y))
3816 (aset arrow-point 2 direction)
3817 (aset arrow-point 3 state)
3818 arrow-point)))
3820 (defsubst artist-arrow-point-get-marker (arrow-point)
3822 (aref arrow-point 0))
3824 (defsubst artist-arrow-point-get-orig-char (arrow-point)
3826 (aref arrow-point 1))
3828 (defsubst artist-arrow-point-get-direction (arrow-point)
3830 (aref arrow-point 2))
3832 (defsubst artist-arrow-point-get-state (arrow-point)
3834 (aref arrow-point 3))
3836 (defsubst artist-arrow-point-set-state (arrow-point new-state)
3838 (aset arrow-point 3 new-state))
3843 (setq artist-arrow-point-1 nil)
3844 (setq artist-arrow-point-2 nil))
3846 (defun artist-set-arrow-points-for-poly (point-list)
3848 (let* ((ep1 (elt point-list 0))
3849 (ep2 (elt point-list 1))
3855 (epn (car (last point-list)))
3856 (epn-1 (car (last point-list 2)))
3862 (setq artist-arrow-point-1 (artist-make-arrow-point x1 y1 dir1))
3863 (setq artist-arrow-point-2 (artist-make-arrow-point xn yn dirn))))
3867 "Generic function for setting arrow-points for 2-point shapes.
3868 The 2-point shape SHAPE is drawn from X1, Y1 to X2, Y2."
3869 (let* ((endpoint1 (artist-2point-get-endpoint1 shape))
3870 (endpoint2 (artist-2point-get-endpoint2 shape))
3875 (setq artist-arrow-point-1
3876 (artist-make-arrow-point x1 y1
3878 (setq artist-arrow-point-2
3879 (artist-make-arrow-point x2 y2
3889 "Undraw current continous shape with point at X, Y."
3894 "Undraw current poly shape with point at X, Y."
3900 (defun artist-key-undraw-1point (x y)
3901 "Undraw current 1-point shape at X, Y."
3902 ;; No undraw-info for 1-point shapes
3906 "Undraw current 2-point shape at X, Y."
3926 (artist-key-undraw-1point col row))
3945 ;; at that point.
3952 "Draws current poly-point shape with nth point at X,Y."
3958 (defun artist-key-draw-1point (x y)
3959 "Draws current 1-point shape at X,Y."
3965 "Draws current 2-point shape at X,Y."
3985 (artist-key-draw-1point col row))
4015 (save-excursion
4034 "Update current poly-point shape with nth point at X,Y."
4053 (defun artist-key-do-continously-1point (x y)
4054 "Update current 1-point shape at X,Y."
4056 ;; where we have only one input point
4060 "Update current 2-point shape with 2nd point at X,Y."
4093 (artist-key-do-continously-1point col row))
4103 (defun artist-key-set-point-continously (x y)
4104 "Set point for current continous shape at X,Y."
4131 (defun artist-key-set-point-poly (x y &optional this-is-last-point)
4132 "Set point for current poly-point shape at X,Y.
4133 If optional argument THIS-IS-LAST-POINT is non-nil, this point is the last."
4145 ;; *** We were not drawing ==> set first point
4150 ;; If not rubber-banding, set first point.
4159 ;; Set point-list to contain start point
4160 (setq artist-key-poly-point-list (list (artist-make-endpoint x y)))
4170 (concat "First point set. "
4171 "Set next with \\[artist-key-set-point], "
4172 "set last with C-u \\[artist-key-set-point]"))))
4175 ;; *** We were drawing ==> we are about to set nth point
4176 ;; (last point if the argument this-is-last-point is non-nil)
4192 ;; Set x2 and y2 from shape's second point
4193 ;; (which might be different from the mouse's second point,
4197 (let ((endpoint2 (artist-2point-get-endpoint2 artist-key-shape)))
4202 (setq artist-key-poly-point-list
4203 (append artist-key-poly-point-list
4206 ;; Now do handle the case when this is the last point,
4207 ;; and the case when this point isn't the last
4209 (if (not this-is-last-point)
4210 ;; ** This is not the last point
4212 ;; Start drawing a new 2-point-shape from last endpoint.
4214 ;; First set the start-point
4228 ;; ** This is the last point
4231 (artist-funcall prep-fill-fn artist-key-poly-point-list)
4236 artist-key-poly-point-list))
4240 (artist-funcall arrow-set-fn artist-key-poly-point-list)
4243 (artist-funcall exit-fn artist-key-poly-point-list)
4251 (defun artist-key-set-point-1point (x y)
4252 "Set point for current 1-point shape at X,Y."
4271 (defun artist-key-set-point-2points (x y)
4272 "Set first or second point in current 2-point shape at X,Y."
4283 ;; *** We were not drawing ==> set first point
4288 ;; If not rubber-banding, set first point.
4303 ;; *** We were drawing ==> we are about to set 2nd point
4339 (defun artist-key-set-point-common (arg)
4340 "Common routine for setting point in current shape.
4341 With non-nil ARG, set the last point."
4355 (artist-key-set-point-continously col row)
4359 (artist-key-set-point-poly col row arg))
4361 (artist-key-set-point-1point col row))
4363 (artist-key-set-point-2points col row))
4431 (defun artist-key-set-point (&optional arg)
4432 "Set a point for the current shape. With optional ARG, set the last point."
4434 (artist-key-set-point-common arg))
4546 ;; is drawn by setting only one point)
4594 (save-excursion
4595 (if (not (null artist-arrow-point-1))
4596 (let* ((arrow-point artist-arrow-point-1)
4597 (arrow-state (artist-arrow-point-get-state arrow-point))
4598 (arrow-marker (artist-arrow-point-get-marker arrow-point))
4599 (direction (artist-arrow-point-get-direction arrow-point))
4600 (orig-char (artist-arrow-point-get-orig-char arrow-point))
4611 (artist-arrow-point-set-state artist-arrow-point-1 new-state)))))
4616 (save-excursion
4617 (if (not (null artist-arrow-point-2))
4618 (let* ((arrow-point artist-arrow-point-2)
4619 (arrow-state (artist-arrow-point-get-state arrow-point))
4620 (arrow-marker (artist-arrow-point-get-marker arrow-point))
4621 (direction (artist-arrow-point-get-direction arrow-point))
4622 (orig-char (artist-arrow-point-get-orig-char arrow-point))
4633 (artist-arrow-point-set-state artist-arrow-point-2 new-state)))))
4803 ;; button-up event is often mouse-set-point, so Emacs
4804 ;; sets the point to where the button was released, which is
4825 (artist-mouse-draw-1point ev))
4906 (window-start-y (save-excursion (goto-char (window-start))
4913 "Generic function for shapes that requires 1 point as input.
5005 (message "Mouse-1: set new point, mouse-2: set last point")
5029 (point-list nil)
5051 ;; Set the second point to the shape's second point
5052 ;; (which might be different from the mouse's second point,
5056 (let ((endpoint2 (artist-2point-get-endpoint2 shape)))
5059 (setq point-list (cons (artist-make-endpoint x1-last y1-last)
5060 point-list))
5146 ;; (unset last point if not rubberbanding)
5192 ;; Reverse point-list (last points are cond'ed first)
5193 (setq point-list (reverse point-list))
5195 (artist-funcall prep-fill-fn point-list)
5199 (artist-funcall fill-fn point-list))
5202 (if (and point-list (artist-funcall arrow-pred))
5203 (artist-funcall arrow-set-fn point-list)
5206 (artist-funcall exit-fn point-list)
5210 (defun artist-mouse-draw-1point (ev)
5211 "Generic function for shapes requiring only 1 point as input.
5284 ;; First undraw last shape (unset last point if not rubberbanding)
5359 artist-key-poly-point-list
5362 artist-arrow-point-1
5363 artist-arrow-point-2)))
5393 ;; categories, goto point 2, otherwise goto point 3.
5400 ;; arbitrary number of points (poly-point modes).
5403 ;; - Modes where the shape is made up of 2 points (2-point
5407 ;; - Modes where the shape is made up of 1 point (1-point
5426 ;; If your mode matches the continous mode or the 1-point mode:
5439 ;; If your mode matches the 2-point mode:
5472 ;; If your mode matches the poly-point mode:
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.
5488 ;; point is a vector, [x, y].
5493 ;; prep-fill-fn: point-list
5494 ;; arrow-set-fn: point-list
5495 ;; exit-fn: point-list
5497 ;; The arrow-set-fn must set the variables `artist-arrow-point-1'
5498 ;; and `artist-arrow-point-2'. If your mode does not take arrows,
5500 ;; artist-arrow-point-* to create and inspect arrow-points.
5535 ;; - artist-key-set-point-xxx for setting a point in the
5536 ;; mode, to be called from `artist-key-set-point-common'.