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

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

8 ;; This file is part of GNU Emacs.
11 ;; it under the terms of the GNU General Public License as published by
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; You should have received a copy of the GNU General Public License
85 ;; given symbol foo, foo-p is the test function, foos is the set of
149 "The list of all commands in Vi-state.")
186 ;; chunk of text with reasonable accuracy.
244 ;; viper-replace-state-pre-command-sentinel: When you jump to another buffer
268 ;; Don't delete more than to the end of repl overlay
272 ;; So, this limits deletion to the end of line
279 ;; viper-replace-state-pre-command-sentinel: When one jumps to another buffer
376 (or (bolp) (viper-beginning-of-field) (backward-char 1))))
396 ;; use the keys `,',^ , as they will do accents instead of Vi actions.
457 ;; This ensures that Viper bindings are in effect, regardless of which minor
512 ;; because although the stack of minor modes can be the same for all buffers,
532 ;; Modifies mode-line-buffer-identification.
638 ;; This also takes care of the annoying incomplete lines in files.
707 ;; Change to replace state. When the end of replacement region is reached,
751 EVENTS is a list of events, which become the beginning of the command."
785 ;; In case of binding indirection--chase definitions.
793 ;; escaped to command, Viper's mode vars will remain those of
794 ;; `state'. When we return to the orig buffer, the bindings will be
819 ;; set state in the new buffer
823 ;; method. The character is read in emacs and inserted into the buffer.
826 ;; Also takes care of the iso-accents mode
927 "Execute FORM in Vi state, regardless of the Ccurrent Vi state."
928 (let ((buff (current-buffer))
938 (if (not (equal buff (current-buffer))) ; cmd switched buffer
940 (set-buffer buff)
948 (let ((buff (current-buffer))
952 (if (not (equal buff (current-buffer))) ; cmd switched buffer
954 (set-buffer buff)
972 This function is designed to make Viper aware of the packages that define
977 LOAD-FILE is a name of the file where the specific minor mode is defined.
980 (interactive "sEnter name of the load file: ")
1001 as a Meta key and any number of multiple escapes is allowed."
1045 ;; Some versions of Emacs (eg., 22.50.8 have a bug, which makes even
1058 ;; at the beginning, separate ESC from the rest of the seq.
1117 ;; If a sequence of keys starting with ESC is issued with very short delays,
1120 "Function that implements ESC key in Viper emulation of Vi."
1147 ;; represents the numeric value of the prefix argument and COM represents
1150 ;; Get value part of prefix-argument ARG.
1158 ;; Get raw value part of prefix-argument ARG.
1163 ;; Get com part of prefix-argument ARG.
1169 ;; Get com part of prefix-argument ARG and modify it.
1203 ;; If appears to be one of the vi commands,
1239 viper-buffer-search-char)))
1250 ;; ", we read the name of register and store it in viper-use-register.
1378 ;; START and END are buffer positions indicating what to append.
1382 (buffer-substring start end))))
1387 (setq viper-last-insertion (buffer-substring beg end))
1391 (setq viper-last-insertion (buffer-substring beg end))
1415 (set-marker viper-com-point (point) (current-buffer)))
1460 (set-marker viper-com-point (point) (current-buffer)))
1513 (set-marker viper-com-point (point) (current-buffer)))
1602 (defun viper-exec-buffer-search (m-com com)
1604 (regexp-quote (buffer-substring (point) viper-com-point)))
1607 (setq viper-intermediate-command 'viper-exec-buffer-search)
1612 ;; Using a dispatch array allows adding functions like buffer search
1659 if it exists, it is the name of the register for `com'.
1660 If the prefix argument, ARG, is non-nil, it is used instead of `val'."
1690 (viper-adjust-undo) ; take care of undo
1746 ;; execute the last emacs kbd macro on each line of the region
1774 ;; the buffer in response to 'undo'; so remove this hook to avoid
1783 (let ((modified (buffer-modified-p))
1824 (message "No further undo information in this buffer")))
1829 ;; In VI, unlike Emacs, if you open a line, say, and add a bunch of lines,
1836 (if (listp buffer-undo-list)
1837 (if (setq tmp (memq viper-buffer-undo-list-mark buffer-undo-list))
1841 ;; cut tail from buffer-undo-list temporarily by direct
1842 ;; manipulation with pointers in buffer-undo-list
1845 (setq buffer-undo-list (delq nil buffer-undo-list))
1846 (setq buffer-undo-list
1847 (delq viper-buffer-undo-list-mark buffer-undo-list))
1848 ;; restore tail of buffer-undo-list
1849 (setq buffer-undo-list (nconc buffer-undo-list tmp2)))
1850 (setq buffer-undo-list (delq nil buffer-undo-list)))))
1855 (if (listp buffer-undo-list)
1858 (setq buffer-undo-list
1859 (cons viper-buffer-undo-list-mark buffer-undo-list))
1903 "Find previous destructive command in the history of destructive commands.
1923 "Find next destructive command in the history of destructive commands."
1929 "Cycle through insertion ring in the direction of older insertions.
1931 With prefix argument, cycles in the direction of newer elements.
1933 to in the global map, instead of cycling through the insertion ring."
1949 (setq buffer-undo-list (cons nil buffer-undo-list))
1953 ;; this change of viper-intermediate-command must come after
1962 "Cycle through insertion ring in the direction of older insertions.
1972 ;; If at the last line of buffer, add \\n before eob, if newline is missing.
1975 (end-of-line)
1983 ;; add newline only if we actually edited buffer. otherwise it
1985 (buffer-modified-p)
1987 (not buffer-read-only))
2008 (beginning-of-line)
2011 (if (not (eobp)) (beginning-of-line))
2037 (beginning-of-line)
2041 (beginning-of-line)
2045 ;; If one of the args is nil, it'll return nil.
2055 (cond ((or (> beg (point-max)) (> end (point-max))) ; out of range
2059 ;; as part of the previous line.
2093 ;; making buffer-local variables so that normal buffers won't affect the
2121 (erase-buffer))
2151 "*List of suffixes that Viper tries to append to filenames ending with a `.'.
2153 prefix and many different suffixes. Usually, only one of the suffixes
2159 corresponding file exists is selected. If no file exists for any of the
2173 (file (buffer-substring-no-properties
2209 "Delete junk at the end of the first line of the minibuffer input.
2215 (end-of-line)
2230 ;; KEYMAP is used, if given, instead of minibuffer-local-map.
2327 "Append at end of line."
2334 (end-of-line)
2363 (end-of-line)
2367 (end-of-line)
2383 (beginning-of-line)
2387 (beginning-of-line)
2463 ;; if this command performs several separate buffer changes. Therefore, if
2464 ;; adds up the number of chars inserted and subtracts the number of chars
2469 ;; Take special care of text insertion from insertion ring inside
2490 ;; column-shift instead of the number of inserted chars
2493 ;; which occupy 2 columns instead of one. If we use
2494 ;; column-shift here, we may delete two chars instead of
2507 ;; the number of deleted chars
2520 ;; Delete stuff between viper-last-posn-in-replace-region and the end of
2522 ;; the overlay and current point is before the end of the overlay.
2523 ;; Don't delete anything if current point is past the end of the overlay.
2553 ;; Make STRING be the first element of the kill ring.
2607 ;; just have keymap attached to replace overlay. Then the "if part" of this
2622 ;; delete the rest of line
2625 (end-of-line)
2626 (if (eobp) (error "Last line in buffer")))
2665 ;; last line of buffer when this line has no \n.
2741 On reaching end of line, stop and signal error."
2750 ;; forward-char may be the parameter of a delete, and 'dl' works
2752 ;; the forward motion before the 'viper-execute-com', but, of
2764 On reaching beginning of line, stop and signal error."
2778 ;; Like forward-char, but doesn't move at end of buffer.
2792 ;; Like backward-char, but doesn't move at beg of buffer.
2819 ;; viper-syntax-preference is 'vi, then `_' is part of the word.
2830 ;; check for eob and white space before it. move off of eob
2871 ;; If we skipped to the next word and the prefix of this line doesn't
2872 ;; consist of separators preceded by a newline, then don't skip backwards
2935 ;; this is a bit different from Vi, but Vi's end of word
2937 (defun viper-end-of-word-kernel ()
2938 (if (viper-end-of-word-p) (forward-char))
2946 (defun viper-end-of-word-p ()
2957 (defun viper-end-of-word (arg &optional careful)
2958 "Move point to end of current word."
2964 (viper-loop val (viper-end-of-word-kernel))
2968 (viper-execute-com 'viper-end-of-word val com)))))
2970 (defun viper-end-of-Word (arg)
2971 "Forward to end of word delimited by white character."
2978 (viper-end-of-word-kernel)
2984 (viper-execute-com 'viper-end-of-Word val com)))))
2999 ((bobp)) ; could still be at separator, but at beg of buffer
3042 (defun viper-beginning-of-line (arg)
3043 "Go to beginning of line."
3049 (beginning-of-line val)
3050 (if com (viper-execute-com 'viper-beginning-of-line val com))))
3053 "Beginning of line at first non-white character."
3063 "Go to end of line."
3069 (end-of-line val)
3090 (beginning-of-line)
3096 (end-of-line)
3116 "Next line at beginning of line.
3134 (end-of-line)
3135 (if (eobp) (error "Last line in buffer")))
3159 "Previous line at beginning of line."
3163 (beginning-of-line)
3164 (if (bobp) (error "First line in buffer")))
3173 "Change to end of line."
3185 (viper-beginning-of-line (cons arg ?d)))
3192 "Go to ARG's line. Without ARG go to end of buffer."
3214 ;; Find ARG's occurrence of CHAR on the current line.
3231 (end-of-line))
3236 (beginning-of-line))
3248 (error "Command `%s': At %s of %s"
3250 (if (> arg 0) "end" "beginning")
3270 controlled by the sign of prefix numeric value."
3480 ;; If point is within viper-search-scroll-threshold of window top or bottom,
3481 ;; scroll up or down 1/7 of window height, depending on whether we are at the
3482 ;; bottom or at the top of the window. This function is called by viper-search
3483 ;; (which is called from viper-search-forward/backward/next). If the value of
3539 (beginning-of-line)
3541 (end-of-line)
3642 (goto-char (match-beginning 0))
3651 (goto-char (match-beginning 0))
3659 (end-of-line)
3661 (goto-char (match-beginning 0))
3682 (message "End of buffer")
3684 (message "Beginning of buffer")
3701 (message "Beginning of buffer")
3717 (message "End of buffer")
3743 "Toggle the value of viper-case-fold-search/viper-re-search.
3753 the Emacs binding of `/'."
3870 ARG is used to find the ARG's occurrence of the string.
3882 (not (marker-buffer viper-local-search-start-marker)))
3893 ARG is used to find the ARG's occurrence of the string.
3905 (not (marker-buffer viper-local-search-start-marker)))
3914 ;; Search for COUNT's occurrence of STRING.
3943 (message "Search wrapped around BOTTOM of buffer")
3972 (message "Search wrapped around TOP of buffer")
3990 ;; pull up or down if at top/bottom of window
3992 ;; highlight the result of search
4028 ;; Search contents of buffer defined by one of Viper's motion commands.
4030 (defun viper-buffer-search-enable (&optional c)
4031 (cond (c (setq viper-buffer-search-char c))
4032 ((null viper-buffer-search-char)
4033 ;; ?g acts as a default value for viper-buffer-search-char
4034 (setq viper-buffer-search-char ?g)))
4036 (cond ((viper-characterp viper-buffer-search-char)
4037 (char-to-string viper-buffer-search-char))
4038 (t (error "viper-buffer-search-char: wrong value type, %S"
4039 viper-buffer-search-char)))
4041 (aset viper-exec-array viper-buffer-search-char 'viper-exec-buffer-search)
4043 (cons viper-buffer-search-char viper-prefix-commands)))
4065 (defun viper-switch-to-buffer ()
4066 "Switch to buffer in the current window."
4068 (let ((other-buffer (other-buffer (current-buffer)))
4069 buffer)
4070 (setq buffer
4071 (funcall viper-read-buffer-function
4072 "Switch to buffer in this window: " other-buffer))
4073 (switch-to-buffer buffer)))
4075 (defun viper-switch-to-buffer-other-window ()
4076 "Switch to buffer in another window."
4078 (let ((other-buffer (other-buffer (current-buffer)))
4079 buffer)
4080 (setq buffer
4081 (funcall viper-read-buffer-function
4082 "Switch to buffer in another window: " other-buffer))
4083 (switch-to-buffer-other-window buffer)))
4085 (defun viper-kill-buffer ()
4086 "Kill a buffer."
4088 (let (buffer buffer-name)
4089 (setq buffer-name
4090 (funcall viper-read-buffer-function
4091 (format "Kill buffer \(%s\): "
4092 (buffer-name (current-buffer)))))
4093 (setq buffer
4094 (if (null buffer-name)
4095 (current-buffer)
4096 (get-buffer buffer-name)))
4097 (if (null buffer) (error "`%s': No such buffer" buffer-name))
4098 (if (or (not (buffer-modified-p buffer))
4102 buffer-name)))
4103 (kill-buffer buffer)
4138 (end-of-line)
4142 (beginning-of-line))
4144 (set-marker (viper-mark-marker) (point) (current-buffer))
4157 ;; newline; it leaves the cursor at the beginning when the text contains
4186 (if (viper-end-with-a-newline-p text) (beginning-of-line))
4189 (set-marker (viper-mark-marker) (point) (current-buffer))
4200 ;; newline; it leaves the cursor at the beginning when the text contains
4211 ;; If BEG and END do not belong to the same buffer, copy empty region.
4250 "Delete previous character. On reaching beginning of line, stop and beep."
4292 cursor move past the beginning of line."
4324 (end-of-line)
4356 (error "End of buffer"))
4359 (buffer-substring (viper-replace-start)
4379 ;; this move takes care of the last posn in the overlay, which
4380 ;; has to be shifted because of insert. We can't simply insert
4382 ;; beginning of the overlay in case we are replacing a single
4470 (defun viper-mark-beginning-of-buffer ()
4471 "Mark beginning of buffer."
4476 (message "Mark set at the beginning of buffer"))
4478 (defun viper-mark-end-of-buffer ()
4479 "Mark end of buffer."
4484 (message "Mark set at the end of buffer"))
4487 "Set mark at point of buffer."
4492 ((viper= char ?<) (viper-mark-beginning-of-buffer))
4493 ((viper= char ?>) (viper-mark-end-of-buffer))
4501 ;; Algorithm: If first invocation of this command save mark on ring, goto
4557 (error "Empty buffer")
4560 (let* ((buff (current-buffer))
4567 (or (find-buffer-visiting (nth 1 text-marker))
4589 (if (equal buff (current-buffer))
4594 (switch-to-buffer buff)
4603 (if (null (mark t)) (error "Mark is not set in this buffer"))
4658 (beginning-of-line)
4694 ;; use \n instead of newline, or else <Return> will move the insert point
4711 (with-output-to-temp-buffer " *viper-info*"
4732 (marker-buffer val)))
4735 (with-output-to-temp-buffer " *viper-info*"
4739 (set-buffer buf)
4742 (beginning-of-line)
4745 (beginning-of-line)
4751 (end-of-line)
4753 (setq text (buffer-substring s e))
4759 "Textmarker `%c' is in buffer `%s' at line %d.\n"
4760 reg (buffer-name buf) line-no))
4781 ;; Get viper standard value of SYMBOL. If symbol is customized, get its
4798 meaningless (i.e., not one of 1,2,3,4,5).
4800 User level determines the setting of Viper variables that are most
4856 ;; Ideally, if 5 is selected, a buffer should pop up to let the
4857 ;; user toggle the values of variables.
4889 (let ((ask-buffer " *viper-ask-level*")
4892 (switch-to-buffer ask-buffer)
4897 (erase-buffer)
4906 Please specify your level of familiarity with the venomous VI PERil
4944 (bury-buffer) ; remove ask-buffer from screen
4954 ;; if ENFORCE-BUFFER is not nil, error if CHAR is a marker in another buffer
4955 (defun viper-register-to-point (char &optional enforce-buffer)
4956 "Like jump-to-register, but switches to another buffer in another window."
4966 (if (and enforce-buffer
4967 (not (equal (current-buffer) (marker-buffer val))))
4968 (error (concat viper-EmptyTextmarker " in this buffer")
4970 (pop-to-buffer (marker-buffer val))
4978 (defun viper-save-kill-buffer ()
4979 "Save then kill current buffer."
4983 (save-buffer)
4984 (kill-buffer (current-buffer))))
5070 Please mail a concise, accurate summary of the problem to the address above.
5074 (with-output-to-temp-buffer " *viper-info*"
5075 (switch-to-buffer " *viper-info*")
5091 If you are reporting an error message received while executing one of the
5097 back trace of the execution that leads to the error. Please include this
5100 If you believe that one of Viper's commands goes into an infinite loop