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

Lines Matching +defs:beginning +defs:of +defs:buffer

10 ;; This file is part of GNU Emacs.
13 ;; it under the terms of the GNU General Public License as published by
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;; You should have received a copy of the GNU General Public License
29 ;; Commands for editing a buffer interpreted as a rectangular array
30 ;; or matrix of whitespace-separated strings. You specify the array
39 ;; at end of buffer or parsing buffer using whitespace as delimiters.
46 (defvar array-max-column nil "Number of columns in the array.")
47 (defvar array-columns-per-line nil "Number of array columns per line.")
48 (defvar array-buffer-column nil "Current column number of point in the buffer.")
49 (defvar array-line-length nil "Length of a line in the array.")
50 (defvar array-buffer-line nil "Current line number of point in the buffer.")
51 (defvar array-lines-per-row nil "Number of lines per array row.")
52 (defvar array-max-row nil "Number of rows in the array.")
53 (defvar array-field-width nil "Width of a field in the array.")
54 (defvar array-row nil "Current array row location of point.")
55 (defvar array-column nil "Current array column location of point.")
56 (defvar array-rows-numbered nil "Are rows numbered in the buffer?")
66 ;; Requires array-buffer-line and array-buffer-column to be current.
69 (>= array-buffer-column array-line-length)
71 (>= array-buffer-line (* array-lines-per-row array-max-row))
72 ;; The cursor is on the last line of the row, the line is smaller
75 (and (zerop (% (1+ array-buffer-line) array-lines-per-row))
77 (>= array-buffer-column (* columns-last-line array-field-width)))))))
80 "Return the array row of the field in which the cursor is located."
81 ;; Requires array-buffer-line and array-buffer-column to be current.
83 (1+ (floor array-buffer-line array-lines-per-row))))
86 "Return the array column of the field in which the cursor is located."
87 ;; Requires array-buffer-line and array-buffer-column to be current.
91 (zerop (% array-buffer-line array-lines-per-row))))
96 (1- (% array-buffer-line array-lines-per-row))
97 (% array-buffer-line array-lines-per-row)))
99 (1+ (floor array-buffer-column array-field-width)))))
104 ;; Requires that array-buffer-line and array-buffer-column be current.
108 (defun array-update-buffer-position ()
109 "Set `array-buffer-line' and `array-buffer-column' to their current values."
110 (setq array-buffer-line (current-line)
111 array-buffer-column (current-column)))
121 (let ((array-buffer-line (current-line))
122 (array-buffer-column (current-column)))
128 "Display the current state of the local variables in the minibuffer."
130 (let ((buf (buffer-name (current-buffer))))
131 (with-output-to-temp-buffer "*Local Variables*"
132 (buffer-disable-undo standard-output)
155 (defun array-beginning-of-field (&optional go-there)
156 "Return the column of the beginning of the current field.
158 ;; Requires that array-buffer-column be current.
159 (let ((goal-column (- array-buffer-column (% array-buffer-column array-field-width))))
164 (defun array-end-of-field (&optional go-there)
165 "Return the column of the end of the current array field.
167 ;; Requires that array-buffer-column be current.
168 (let ((goal-column (+ (- array-buffer-column (% array-buffer-column array-field-width))
176 Leave point at the beginning of the field and return the new buffer column."
187 Leave point at the beginning of the field and return the new array row."
188 ;; Requires that array-buffer-line and array-buffer-column be current.
190 (% array-buffer-line array-lines-per-row)))
191 (goal-column (- array-buffer-column (% array-buffer-column array-field-width))))
192 (forward-line (- goal-line array-buffer-line))
198 Leave point at the beginning of the field and return the new array column."
199 ;; Requires that array-buffer-line and array-buffer-column be current.
200 (let ((goal-line (+ (- array-buffer-line (% array-buffer-line array-lines-per-row))
204 (forward-line (- goal-line array-buffer-line))
210 Leave point at the beginning of the field and return the new array row.
212 ;; Requires that array-buffer-line and array-buffer-column be current.
213 (let ((goal-column (array-beginning-of-field))
217 (error "End of array"))
219 (error "Beginning of array"))
228 Leave point at the beginning of the field and return the new array column.
230 ;; Requires that array-buffer-line and array-buffer-column be current.
234 (error "End of array"))
236 (error "Beginning of array"))
247 ;; Somewhere in the middle of the line.
249 (move-to-column-untabify (+ (array-beginning-of-field)
256 ;; Assumes point is at the beginning of the field.
257 (let ((array-buffer-column (current-column)))
259 (1- (save-excursion (array-end-of-field t) (point))))
265 ;; array-buffer-column will always be current.
269 ((and (>= array-buffer-column w-hscroll)
270 (<= array-buffer-column (+ w-hscroll w-width)))
273 ((> array-buffer-column (+ w-hscroll w-width))
275 (scroll-left (- (- array-buffer-column w-hscroll)
279 (scroll-right (+ (- w-hscroll array-buffer-column)
291 (let ((array-buffer-line (current-line))
292 (array-buffer-column (current-column)))
313 (let ((array-buffer-line (current-line))
314 (array-buffer-column (current-column)))
346 ;; Requires that array-buffer-column be current.
347 (buffer-substring
348 (save-excursion (array-beginning-of-field t) (point))
349 (save-excursion (array-end-of-field t) (point))))
353 Leave point at the beginning of the field and return the new array row.
355 ;; Requires that array-buffer-line, array-buffer-column, and array-copy-string be current.
358 (delete-region (point) (save-excursion (array-end-of-field t) (point)))
360 (move-to-column array-buffer-column)
365 Leave point at the beginning of the field and return the new array column.
367 ;; Requires that array-buffer-line, array-buffer-column, and array-copy-string be current.
369 (array-update-buffer-position)
371 (delete-region (point) (save-excursion (array-end-of-field t) (point)))
373 (move-to-column array-buffer-column)
378 Leave point at the beginning of the field."
379 ;; Requires that array-buffer-line, array-buffer-column, array-row, and
386 (array-update-buffer-position)
388 (delete-region (point) (save-excursion (array-end-of-field t) (point)))
390 (move-to-column array-buffer-column)
395 Leave point at the beginning of the field."
396 ;; Requires that array-buffer-line, array-buffer-column, array-column, and
403 (array-update-buffer-position)
405 (delete-region (point) (save-excursion (array-end-of-field t) (point)))
407 (move-to-column array-buffer-column)
412 Leave point at the beginning of the field."
415 (array-update-buffer-position)
416 (delete-region (point) (save-excursion (array-end-of-field t) (point)))
418 (move-to-column array-buffer-column))
429 (let* ((array-buffer-line (current-line))
430 (array-buffer-column (current-column))
450 (let* ((array-buffer-line (current-line))
451 (array-buffer-column (current-column))
471 (array-update-buffer-position)
480 (array-update-buffer-position)
500 (array-update-buffer-position)
506 (error "Beginning of array"))
508 (error "End of array"))
511 (buffer-substring
546 (array-update-buffer-position)
554 (array-update-buffer-position)
560 (array-update-buffer-position)
572 (array-update-buffer-position)
576 (array-update-buffer-position)
578 ;; Do the rest of the rows.
581 (buffer-substring
585 (setq array-buffer-column (current-column))
586 (array-end-of-field t)
597 (setq array-buffer-column (current-column))
598 (array-end-of-field t)
607 ;;; Reconfiguration of the array.
610 "Create the template of an array."
645 "Reconfigure the state of `array-rows-numbered' and `array-columns-per-line'.
646 NEW-COLUMNS-PER-LINE is the desired value of `array-columns-per-line' and
648 of `array-rows-numbered'."
670 (array-update-buffer-position)
671 (let* ((main-buffer (buffer-name (current-buffer)))
672 (temp-buffer (generate-new-buffer " *Array*"))
682 ;; Do the cutting in a temporary buffer.
683 (copy-to-buffer temp-buffer (point-min) (point-max))
684 (set-buffer temp-buffer)
717 (beginning-of-line)
725 (set-buffer main-buffer)
726 (erase-buffer)
727 (insert-buffer-substring temp-buffer)
736 (kill-buffer temp-buffer))
755 "Return the logical exclusive or of predicates PRED1 and PRED2."
760 "Return the current buffer line at point. The first line is 0."
762 (beginning-of-line)
823 considered to be a two-dimensional set of strings. The strings are
826 The array MUST reside at the top of the buffer.
832 Upon entering array mode, you will be prompted for the values of
834 supply. These variables are all local to the buffer. Other buffer
839 array-max-row: The number of rows in the array.
840 array-max-column: The number of columns in the array.
841 array-columns-per-line: The number of columns in the array per line of buffer.
842 array-field-width: The width of each field, in characters.
844 row numbers in the buffer.
847 array-line-length: The number of characters in a buffer line.
848 array-lines-per-row: The number of buffer lines used to display each row.
869 between that of point and mark.
879 \\[array-display-local-variables] Display the current values of local variables.
885 (make-local-variable 'array-buffer-line)
886 (make-local-variable 'array-buffer-column)
892 (read-number "Number of array rows: "))
894 (read-number "Number of array columns: "))