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

Lines Matching +defs:generate +defs:new +defs:buffer

105 ;; If you add a new drawing mode, send it to me, and I would gladly
188 ;; if the buffer auto-scrolls.
248 will use the rectangle buffer when accessing the copied area. This means
254 artist package will use its own copy buffer."
419 (defvar artist-spray-new-char ?.
435 (make-variable-buffer-local 'artist-mode)
442 (make-variable-buffer-local 'artist-curr-go)
446 (make-variable-buffer-local 'artist-line-char-set)
450 (make-variable-buffer-local 'artist-line-char)
454 (make-variable-buffer-local 'artist-fill-char-set)
458 (make-variable-buffer-local 'artist-fill-char)
462 (make-variable-buffer-local 'artist-erase-char)
466 (make-variable-buffer-local 'artist-default-fill-char)
468 ; This variable is not buffer local
469 (defvar artist-copy-buffer nil
470 "Copy buffer.")
474 (make-variable-buffer-local 'artist-draw-region-min-y)
478 (make-variable-buffer-local 'artist-draw-region-max-y)
483 (make-variable-buffer-local 'artist-borderless-shapes)
1200 to new point
1237 * See thru for text means that text already in the buffer
1357 artist-spray-new-chars Initial spray-``color''
1803 (let ((tmp-buffer (get-buffer-create (concat "*artist-" file-name "*"))))
1804 (set-buffer tmp-buffer)
1807 (let ((str (copy-sequence (buffer-substring (point-min)
1809 (kill-buffer tmp-buffer)
1812 (defun artist-clear-buffer (buf)
1813 "Clear contents of buffer BUF."
1815 (set-buffer buf)
1831 (tmp-stdout-buffer (get-buffer-create
1843 ;; Clear the buffer
1844 (artist-clear-buffer tmp-stdout-buffer)
1852 (list tmp-stdout-buffer
1861 (list tmp-stdout-buffer
1868 (set-buffer tmp-stdout-buffer)
1869 (copy-sequence (buffer-substring (point-min)
1878 (if (memq tmp-stdout-buffer (buffer-list))
1879 (kill-buffer tmp-stdout-buffer))))))
1881 ;; Routines that deal with the buffer
1883 ;; artist-current-line get line number (top of buffer is 0)
1885 ;; artist-move-to-xy move to (x,y) (0,0) is beg-of-buffer
1898 "Return point's current line, buffer-relative. Top of buffer is 0."
1904 "Move to column X, at row Y from the top of buffer. Top line is 0."
1914 ;; of the buffer, and that last line happened to be longer than
1920 ;; character in the buffer ("a non-empty line at the
1924 ;; --------top of buffer--------
1927 ;; -------bottom of buffer------
1929 ;; But, if we are at the end of buffer when trying to move
1932 ;; buffer by the first forward-line. The second forward-line
1935 ;; If we are not moving past the end of the buffer, then the
1941 ;; moving past the beginning of the buffer.
1961 "Retrieve the character at X, Y, converting tabs and new-lines to spaces."
1966 (defun artist-replace-char (new-char)
1979 (insert (aref artist-replacement-table new-char)))
1984 (setq last-command-event (aref artist-replacement-table new-char))
1987 (defun artist-replace-chars (new-char count)
1996 (let* ((replaced-c (aref artist-replacement-table new-char))
2006 (setq last-command-event (aref artist-replacement-table new-char))
2011 With optional argument SEE-THRU, set to non-nil, text in the buffer
2085 (defun artist-intersection-char (new-c old-c)
2100 (cond ((and (= old-c ?- ) (= new-c ?| )) ?+ )
2101 ((and (= old-c ?| ) (= new-c ?- )) ?+ )
2102 ((and (= old-c ?+ ) (= new-c ?- )) ?+ )
2103 ((and (= old-c ?+ ) (= new-c ?| )) ?+ )
2104 ((and (= old-c ?\\ ) (= new-c ?/ )) ?X )
2105 ((and (= old-c ?/ ) (= new-c ?\\ )) ?X )
2106 ((and (= old-c ?X ) (= new-c ?/ )) ?X )
2107 ((and (= old-c ?X ) (= new-c ?\\ )) ?X )
2108 (t new-c)))
2114 (defun artist-unintersection-char (line-c buffer-c)
2125 (cond ((and (= line-c ?- ) (= buffer-c ?+ )) ?| )
2126 ((and (= line-c ?| ) (= buffer-c ?+ )) ?- )
2127 ((and (= line-c ?\\ ) (= buffer-c ?X )) ?/ )
2128 ((and (= line-c ?/ ) (= buffer-c ?X )) ?\\ )
2129 ((= line-c buffer-c) artist-erase-char)
2130 (t buffer-c)))
2246 ;; A line is here a list of (x y saved-char new-char)s.
2322 (defsubst artist-new-coord (x y &optional new-char)
2323 "Create a new coordinate at X,Y for use in a line.
2324 Optional argument NEW-CHAR can be used for setting the new-char component
2328 (aset coord 3 new-char)
2339 (defsubst artist-coord-set-x (coord new-x)
2341 (aset coord 0 new-x)
2344 (defsubst artist-coord-set-y (coord new-y)
2346 (aset coord 1 new-y)
2353 (defsubst artist-coord-get-new-char (coord)
2354 "Retrieve the new char component of a COORD."
2362 (defsubst artist-coord-add-new-char (coord new-char)
2363 "Set the new char component of a COORD to NEW-CHAR."
2364 (aset coord 3 new-char)
2367 (defsubst artist-coord-set-new-char (coord new-char)
2368 "Set the new char component of a COORD to NEW-CHAR."
2369 (aset coord 3 new-char)
2378 (list 'append point-list (list 'list (list 'artist-new-coord x y)))))
2430 ;; artist-calculate-new-char, artist-calculate-new-chars
2433 ;; Depending on new-coord's position relative to last-coord one of the
2440 ;; artist-calculate-new-char works on one coordinate, returns char.
2441 ;; artist-calculate-new-chars works on a point-list, returns point-list.
2443 (defun artist-calculate-new-char (last-coord new-coord)
2447 (new-x (artist-coord-get-x new-coord))
2448 (new-y (artist-coord-get-y new-coord)))
2449 (cond ((> new-x last-x) (cond ((< new-y last-y) ?/ )
2450 ((> new-y last-y) ?\\ )
2452 ((< new-x last-x) (cond ((< new-y last-y) ?\\ )
2453 ((> new-y last-y) ?/ )
2455 ((eq new-y last-y) ?o)
2458 (defun artist-calculate-new-chars (point-list)
2461 (list (artist-coord-add-new-char (car point-list) ?o ))
2463 (cons (artist-coord-add-new-char
2465 (artist-calculate-new-char (car (cdr point-list))
2470 (artist-coord-add-new-char
2472 (artist-calculate-new-char last-coord this-coord))
2476 ;; artist-modify-new-chars
2479 ;; artist-modify-new-chars works on a point-list, returns point-list.
2481 (defun artist-modify-new-chars (point-list)
2486 (let* ((new-c (artist-coord-get-new-char coord))
2488 (modified-c (artist-intersection-char new-c saved-c)))
2489 (artist-coord-set-new-char coord modified-c)))
2500 (let ((new-endpoint (make-vector 2 x)))
2501 (aset new-endpoint 1 y)
2502 new-endpoint))
2551 (artist-replace-char (artist-coord-get-new-char coord)))
2553 (artist-modify-new-chars
2554 (artist-calculate-new-chars
2668 (new-x2) ; set below
2669 (new-y2)) ; set below
2677 (setq new-x2 x2)
2678 (setq new-y2 (+ y1 (round (/ (* (abs delta-x) delta-y-sign)
2683 (setq new-x2 (round (+ x1 (* (* (abs delta-y) delta-x-sign)
2685 (setq new-y2 y2)))
2688 (list x1 y1 new-x2 new-y2)))
2702 (new-x1 (elt square-corners 0))
2703 (new-y1 (elt square-corners 1))
2704 (new-x2 (elt square-corners 2))
2705 (new-y2 (elt square-corners 3))
2706 (endpoint1 (artist-make-endpoint new-x1 new-y1))
2707 (endpoint2 (artist-make-endpoint new-x2 new-y2))
2708 (line1 (artist-draw-sline new-x1 new-y1 new-x2 new-y1))
2709 (line2 (artist-draw-sline new-x2 new-y1 new-x2 new-y2))
2710 (line3 (artist-draw-sline new-x2 new-y2 new-x1 new-y2))
2711 (line4 (artist-draw-sline new-x1 new-y2 new-x1 new-y1)))
2744 (new-x1 (elt square-corners 0))
2745 (new-y1 (elt square-corners 1))
2746 (new-x2 (elt square-corners 2))
2747 (new-y2 (elt square-corners 3))
2748 (x (1+ (min new-x1 new-x2)))
2749 (y (1+ (min new-y1 new-y2)))
2750 (x-max (max new-x1 new-x2))
2751 (y-max (max new-y1 new-y2))
2893 in the buffer."
2905 Let text already in buffer shine thru the TEXT inserted."
2910 Let blanks in TEXT overwrite any text already in the buffer."
2917 to be inserted in the buffer.
2919 Text already in the buffer ``shines thru'' blanks in the rendered text."
2929 to be inserted in the buffer.
2931 Blanks in the rendered text overwrites any text in the buffer."
2969 (next-c (cond ((null this-c) artist-spray-new-char)
3149 (let* ((buffer-c (artist-get-char-at-xy-conv x y))
3150 (new-c (artist-unintersection-char line-c buffer-c)))
3152 (artist-replace-char new-c))
3177 ;; Suppose the buffer looks like this and that we start vaporizing
3222 (new-endpoints (artist-vaporize-line (car vaporize-point)
3226 new-endpoints)))))
3232 (defun artist-ellipse-generate-quadrant (x-radius y-radius)
3271 (defsubst artist-new-fill-item (x y width)
3272 "Create a new item at X, Y, with WIDTH.
3274 (let ((new-item (make-vector 3 x)))
3275 (aset new-item 1 y)
3276 (aset new-item 2 width)
3277 new-item))
3283 (defsubst artist-fill-item-set-x (fill-item new-x)
3285 (aset fill-item 0 new-x)
3292 (defsubst artist-fill-item-set-y (fill-item new-y)
3294 (aset fill-item 1 new-y)
3301 (defsubst artist-fill-item-set-width (fill-item new-width)
3303 (aset fill-item 2 new-width)
3352 ;; or it was the first time on a new line
3356 (list (artist-new-fill-item left-edge y width)))))
3365 (artist-new-fill-item (artist-fill-item-get-x i)
3387 (if (= (artist-coord-get-new-char last-coord) ?/)
3388 (artist-coord-set-new-char last-coord artist-ellipse-right-char)))
3396 (let ((c (artist-coord-get-new-char coord)))
3397 (artist-new-coord (artist-coord-get-x coord)
3409 (let ((c (artist-coord-get-new-char coord)))
3410 (artist-new-coord (- (artist-coord-get-x coord))
3435 (let* ((point-list (artist-ellipse-generate-quadrant x-radius y-radius))
3439 (setq point-list (artist-calculate-new-chars point-list))
3452 (artist-replace-char (artist-coord-get-new-char coord)))
3454 (artist-modify-new-chars
3486 (new-coord (artist-new-coord line-x line-y)))
3487 (artist-coord-add-saved-char new-coord
3491 (setq point-list (append point-list (list new-coord)))
3614 (new-x1 (elt square-corners 0))
3615 (new-y1 (elt square-corners 1))
3616 (new-x2 (elt square-corners 2))
3617 (new-y2 (elt square-corners 3)))
3618 (artist-copy-generic new-x1 new-y1 new-x2 new-y2)
3619 (artist-erase-rect square new-x1 new-y1 new-x2 new-y2)))
3622 (defun artist-get-buffer-contents-at-xy (x y width)
3623 "Retrieve contents from the buffer at X, Y. WIDTH characters are returned."
3629 (buffer-substring here there)))
3634 Output is a copy buffer, a list of strings, representing the
3635 original contents of that area in the buffer."
3643 (setq l (cons (artist-get-buffer-contents-at-xy x y w) l))
3647 (setq artist-copy-buffer (reverse l)))))
3659 (new-x1 (elt square-corners 0))
3660 (new-y1 (elt square-corners 1))
3661 (new-x2 (elt square-corners 2))
3662 (new-y2 (elt square-corners 3)))
3663 (artist-copy-generic new-x1 new-y1 new-x2 new-y2)))
3666 "Pastes the contents of the copy-buffer at X,Y."
3669 artist-copy-buffer)))
3735 (push (artist-new-coord x1 y1) stack))
3770 (push (artist-new-coord x (- y 1)) stack))
3784 (push (artist-new-coord x (1+ y)) stack))
3836 (defsubst artist-arrow-point-set-state (arrow-point new-state)
3838 (aset arrow-point 3 new-state))
3942 ;; drawing mode, or even kills the buffer! In the mouse case, it is much
4042 ;; Otherwise re-draw the shape to the new position
4068 ;; Otherwise re-draw the shape to the new position
4212 ;; Start drawing a new 2-point-shape from last endpoint.
4424 (new-col (max 0 (+ curr-col (* distance step-x)))))
4426 (move-to-column new-col t)
4427 (move-to-column new-col t)
4512 (setq artist-spray-new-char initial-char)
4602 (new-state (not arrow-state)))
4606 (if new-state
4611 (artist-arrow-point-set-state artist-arrow-point-1 new-state)))))
4624 (new-state (not arrow-state)))
4628 (if new-state
4633 (artist-arrow-point-set-state artist-arrow-point-2 new-state)))))
4755 (defun artist-set-pointer-shape (new-pointer-shape)
4757 (setq x-pointer-shape new-pointer-shape)
4799 ;; 1. A routine which reads something from the mini-buffer (such
4805 ;; in the buffer where the user wants to place the text.
4807 ;; until he reaches the mini-buffer which is still prompting
4902 "Convert a window-relative coordinate COORD to a buffer-relative coordinate."
4974 ;; Draw the new shape
5005 (message "Mouse-1: set new point, mouse-2: set last point")
5085 ;; Check whether the (possibly new, that depends on if shift
5118 ;; Draw the new shape (if not rubber-banding, place both marks)
5126 ;; Show new operation in mode-line
5150 ;; Draw the new shape (if not rubberbanding, set 2nd mark)
5309 ;; Draw the new shape
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
5414 ;; 2. To make it easier and more flexible to program new drawing
5515 ;; to buffer relative before saved or handed over to
5557 ;; but someone else might base a new drawing mode upon your
5563 ;; e. Add your new mode to the master table, `artist-mt'.