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

Lines Matching +defs:backward +defs:delete +defs:char

95        (consp (viper-memq-char com ,nms)
115 delete backspace
225 viper-del-backward-char-in-insert
226 viper-del-backward-char-in-replace
227 viper-delete-backward-char
229 viper-delete-char))
262 ;; Make sure we don't delete more than needed.
264 (defsubst viper-trim-replace-chars-to-delete-if-necessary ()
265 (setq viper-replace-chars-to-delete
267 (min viper-replace-chars-to-delete
268 ;; Don't delete more than to the end of repl overlay
286 ;; viper-delete-backward-char, etc., since they either don't change
293 ;; delete characters to compensate for inserted chars.
296 (goto-char viper-last-posn-in-replace-region)
297 (viper-trim-replace-chars-to-delete-if-necessary)
298 (delete-char viper-replace-chars-to-delete)
299 (setq viper-replace-chars-to-delete 0)
376 (or (bolp) (viper-beginning-of-field) (backward-char 1))))
437 "\C-h" 'viper-del-backward-char-in-insert)
439 "\C-h" 'viper-del-backward-char-in-replace))
442 [backspace] 'viper-del-backward-char-in-insert)
444 [backspace] 'viper-del-backward-char-in-replace)
450 (define-key viper-vi-basic-map "\C-h" 'viper-backward-char))
452 (define-key viper-vi-basic-map [backspace] 'viper-backward-char))
753 (if (viper= last-command-char ?\\)
798 ;; this-command, last-command-char, last-command-event
804 last-command-char (event-to-character last-command-event))
808 last-command-char last-command-event)
827 (defun viper-special-read-and-insert-char ()
850 (setq ch (read-char-exclusive))
855 (setq ch (read-char-exclusive)))
872 (setq ch (read-char-exclusive))
877 (setq ch (read-char-exclusive)))
897 ;;(setq ch (read-char-exclusive))
906 ;;(setq ch (read-char-exclusive))
1003 (let (char)
1005 (setq char (viper-read-char-exclusive))
1006 (viper-escape-to-emacs arg (list ?\e char) ))
1009 (setq char (viper-read-char-exclusive))
1010 (if (= char (string-to-char viper-ESC-key))
1012 (viper-escape-to-emacs arg (list ?\e char) )))
1183 (defun viper-prefix-arg-value (event-char com)
1187 (while (and (viper-characterp event-char)
1188 (>= event-char ?0) (<= event-char ?9))
1189 (setq value (+ (* (if (integerp value) value 0) 10) (- event-char ?0)))
1190 (setq event-char (viper-read-event-convert-to-char)))
1194 (while (eq event-char ?U)
1196 (setq event-char (viper-read-event-convert-to-char)))
1200 (viper-characterp event-char)
1201 (viper-vi-command-p event-char)
1207 ;; last-command-char is the char we want emacs to think was typed
1213 ;; current state is not vi-state), then `event-char' represents the
1215 ;; last-command-char must make emacs believe that this is the command
1217 (cond ((eq event-char 'return) (setq event-char ?\C-m))
1218 ((eq event-char 'delete) (setq event-char ?\C-?))
1219 ((eq event-char 'backspace) (setq event-char ?\C-h))
1220 ((eq event-char 'space) (setq event-char ?\ )))
1221 (setq last-command-char (or com event-char))
1223 `(key-binding (char-to-string ,event-char))))
1227 (viper-set-unread-command-events event-char))
1232 (defun viper-prefix-arg-com (char value com)
1237 (viper-memq-char char
1239 viper-buffer-search-char)))
1242 ;; construct a com list and exit while. however, if char is "
1246 (if (viper-memq-char char '(?# ?\")) (error ""))
1247 (setq com (cons char com))
1249 ;; If com is nil we set com as char, and read more. Again, if char is
1251 ;; if char is !, =, or #, a complete com is formed so we exit the while
1253 (cond ((viper-memq-char char '(?! ?=))
1254 (setq com char)
1255 (setq char (read-char))
1257 ((viper= char ?#)
1258 ;; read a char and encode it as com
1259 (setq com (+ 128 (read-char)))
1260 (setq char (read-char)))
1261 ((viper= char ?\")
1262 (let ((reg (read-char)))
1266 (setq char (read-char))))
1268 (setq com char)
1269 (setq char (read-char))))))
1272 ;; `com' is a single char, so we construct the command argument
1273 ;; and if `char' is `?', we describe the arg; otherwise
1277 (while (viper= char ?U)
1279 (setq char (read-char)))
1280 ;; `char' is a movement cmd, a digit arg cmd, or a register cmd---so
1282 (or (viper-movement-command-p char)
1283 (viper-digit-command-p char)
1284 (viper-regsuffix-command-p char)
1285 (viper= char ?!) ; bang command
1286 (viper= char ?g) ; the gg command (like G0)
1290 `(key-binding (char-to-string ,char)))))
1293 (if (viper-memq-char (car com) '(?r ?R))
1295 (let ((char (car com)) (com (cdr com)))
1297 (if (viper= char ?r)
1325 (setq last-command-char char)
1328 (if viper-xemacs-p (character-to-event char) char)))
1352 last-command-char (if (consp arg) (cdr arg) nil)))
1360 last-command-char
1420 (insert " ")(backward-char 1)))
1422 (viper-forward-char-carefully))
1428 (if (eq (preceding-char) ?\n)
1429 (viper-backward-char-carefully)) ; give back the newline
1451 (delete-region (mark t) (point)))
1458 (defun viper-exec-delete (m-com com)
1482 (if (and (eolp) (not (bolp))) (backward-char 1)))))
1532 (goto-char viper-com-point)))
1558 (goto-char viper-com-point))
1595 (goto-char viper-com-point))
1618 (aset viper-exec-array ?d 'viper-exec-delete)
1681 viper-d-char (nth 4 viper-d-com)))
1684 (goto-char save-point)) ; go back to before repeat.
1686 (or (bolp) (backward-char 1))))
1688 (backward-char 1))
1708 history command to execute. `<char>0' is equivalent to `.', `<char>1'
1735 ;; The hash-command. It is invoked interactively by the key sequence #<char>.
1737 (defun viper-special-prefix-com (char)
1738 (cond ((viper= char ?c)
1741 ((viper= char ?C)
1744 ((viper= char ?g)
1748 ((viper= char ?q)
1751 ((viper= char ?s)
1753 (t (error "#%c: %s" char viper-InvalidViCommand))))
1799 (goto-char undo-beg-posn)
1806 (goto-char undo-end-posn)
1809 (goto-char before-undo-pt)
1810 (goto-char undo-beg-posn)))
1814 (if (and (eolp) (not (bolp))) (backward-char 1))
1825 (if (and (eolp) (not (bolp))) (backward-char 1))
1877 (cond ((characterp text) (char-to-string text))
1942 (backward-delete-char
2005 (progn (goto-char beg) (set-mark end))
2006 (goto-char end)
2073 (goto-char savemax)
2076 (goto-char savemax) (delete-region (point) (point-max))
2120 (delete-region (minibuffer-prompt-end) (point-max))
2132 (goto-char (viper-minibuffer-real-start)))))
2141 (setq command (local-key-binding (char-to-string last-command-char)))
2176 (goto-char (point-max))
2214 (goto-char (viper-minibuffer-real-start))
2216 (delete-region (point) (point-max)))))
2293 (char (nth 2 viper-d-com)))
2298 (setq viper-d-com (list i-com val char nil nil nil))
2321 (if (not (eolp)) (forward-char))
2416 (forward-char val)
2435 viper-replace-chars-to-delete 0)
2472 (setq viper-replace-chars-to-delete 0)
2477 (column-shift (- (save-excursion (goto-char real-end)
2479 (save-excursion (goto-char beg)
2486 (setq viper-replace-chars-to-delete
2487 (+ viper-replace-chars-to-delete
2494 ;; column-shift here, we may delete two chars instead of
2523 ;; Don't delete anything if current point is past the end of the overlay.
2541 (delete-region
2591 (viper-set-unread-command-events last-input-char)
2612 (viper-set-unread-command-events last-input-char)
2622 ;; delete the rest of line
2623 (delete-region (point) (viper-line-pos 'end))
2646 (delete-char (min len (- (point-max) (point) 1)))
2699 (defun viper-replace-char (arg)
2705 (viper-replace-char-subr com val)
2706 (if (and (eolp) (not (bolp))) (forward-char 1))
2710 (list 'viper-replace-char val ?r nil viper-d-char nil))
2713 (defun viper-replace-char-subr (com arg)
2715 char)
2718 (viper-special-read-and-insert-char))
2720 (delete-char 1 t)
2721 (setq char (if com viper-d-char (viper-char-at-pos 'backward)))
2723 (if com (insert char))
2725 (setq viper-d-char char)
2728 (delete-char 1 t)
2729 (insert char))
2732 (backward-char arg)
2739 (defun viper-forward-char (arg)
2750 ;; forward-char may be the parameter of a delete, and 'dl' works
2751 ;; just like 'x' for the last char on a line, so we have to allow
2755 (if (and (eolp) (bolp)) (error "") (forward-char val))
2756 (if com (viper-execute-com 'viper-forward-char val com))
2757 (if (eolp) (progn (backward-char 1) (error ""))))
2758 (forward-char val)
2759 (if com (viper-execute-com 'viper-forward-char val com)))))
2762 (defun viper-backward-char (arg)
2772 (if (bolp) (error "") (backward-char val))
2773 (if com (viper-execute-com 'viper-backward-char val com)))
2774 (backward-char val)
2775 (if com (viper-execute-com 'viper-backward-char val com)))))
2778 ;; Like forward-char, but doesn't move at end of buffer.
2781 (defun viper-forward-char-carefully (&optional arg)
2785 (forward-char arg)
2792 ;; Like backward-char, but doesn't move at beg of buffer.
2795 (defun viper-backward-char-carefully (&optional arg)
2799 (backward-char arg)
2828 (forward-char)
2832 (viper-backward-char-carefully)
2834 (viper-backward-char-carefully))
2835 (viper-skip-all-separators-backward 'within-line)
2836 (viper-backward-char-carefully)
2838 (viper-skip-all-separators-backward 'within-line)
2839 (or (viper-looking-at-separator) (forward-char)))))
2854 ;; first skip non-newline separators backward, then skip \n. Then, if TWICE is
2857 (let ((prev-char (viper-char-at-pos 'backward))
2859 ;; skip non-newline separators backward
2860 (while (and (not (viper-memq-char prev-char '(nil \n)))
2864 (viper-memq-char prev-char '(?\ ?\t))
2865 (viper-memq-char (char-syntax prev-char) '(?\ ?-))))
2866 (viper-backward-char-carefully)
2867 (setq prev-char (viper-char-at-pos 'backward)))
2869 (if (and (< lim (point)) (eq prev-char ?\n))
2870 (backward-char)
2874 (goto-char saved-point))
2875 (setq prev-char (viper-char-at-pos 'backward))
2879 (while (and (not (viper-memq-char prev-char '(nil \n)))
2883 (viper-memq-char prev-char '(?\ ?\t))
2884 (viper-memq-char (char-syntax prev-char) '(?\ ?-))))
2885 (viper-backward-char-carefully)
2886 (setq prev-char (viper-char-at-pos 'backward))))
2889 (viper-forward-char-carefully))
2903 (cond ((viper-char-equal com ?c)
2906 ((viper-char-equal com ?y)
2925 (cond ((viper-char-equal com ?c)
2928 ((viper-char-equal com ?y)
2938 (if (viper-end-of-word-p) (forward-char))
2944 (viper-backward-char-carefully))
2950 (forward-char)
2953 (forward-char)
2967 (forward-char)
2980 (backward-char))
2983 (forward-char)
2986 (defun viper-backward-word-kernel (val)
2988 (viper-backward-char-carefully)
2990 (viper-skip-alpha-backward "_"))
2992 (forward-char)
2994 (viper-backward-char-carefully)
2996 (viper-skip-alpha-backward "_"))
2998 (viper-skip-nonalphasep-backward))
3000 (t (forward-char))))
3002 (viper-skip-nonalphasep-backward)))
3005 (defun viper-backward-word (arg)
3013 (if (setq i (save-excursion (backward-char) (looking-at "\n")))
3014 (backward-char))
3016 (if i (forward-char))))
3017 (viper-backward-word-kernel val)
3018 (if com (viper-execute-com 'viper-backward-word val com))))
3020 (defun viper-backward-Word (arg)
3028 (if (setq i (save-excursion (backward-char) (looking-at "\n")))
3029 (backward-char))
3031 (if i (forward-char))))
3033 (viper-skip-separators nil) ; nil means backward here
3034 (viper-skip-nonseparators 'backward))
3035 (if com (viper-execute-com 'viper-backward-Word val com))))
3075 (backward-char 1)
3091 (forward-char (1- (min line-len val)))
3093 (backward-char 1))
3110 (if (and (eolp) (not (bolp))) (backward-char 1)))
3119 (let* ((field (get-char-property (point) 'field))
3120 (button (get-char-property (point) 'button))
3121 (doc (get-char-property (point) 'widget-doc))
3153 (if (and (eolp) (not (bolp))) (backward-char 1)))
3200 (goto-char (point-max))
3201 (goto-char (point-min))
3215 ;; If FORWARD then search is forward, otherwise backward. OFFSET is used to
3217 (defun viper-find-char (arg char forward offset)
3218 (or (char-or-string-p char) (error ""))
3235 (viper-backward-paragraph 1)
3255 (if (> arg 0) (goto-char (1+ (point-min)))
3256 (goto-char (point-max)))
3258 (search-forward (char-to-string char) nil 0 arg))
3260 (error "Command `%s': `%c' not found" cmd char))))
3261 (goto-char point)
3263 (backward-char (if offset 2 1))
3264 (forward-char (if offset 1 0)))))
3266 (defun viper-find-char-forward (arg)
3267 "Find char on the line.
3268 If called interactively read the char to find from the terminal, and if
3269 called from viper-repeat, the char last used is used. This behavior is
3277 (setq viper-f-char (read-char)
3280 ;; viper-repeat --- set viper-F-char from command-keys
3281 (setq viper-F-char (if (stringp cmd-representation)
3283 viper-F-char)
3284 viper-f-char viper-F-char)
3287 (viper-find-char
3288 val (if (> (viper-p-val arg) 0) viper-f-char viper-F-char) t nil)
3292 (setq viper-F-char viper-f-char) ; set new viper-F-char
3293 (forward-char)
3294 (viper-execute-com 'viper-find-char-forward val com)))))
3296 (defun viper-goto-char-forward (arg)
3297 "Go up to char ARG forward on line."
3304 (setq viper-f-char (read-char)
3307 ;; viper-repeat --- set viper-F-char from command-keys
3308 (setq viper-F-char (if (stringp cmd-representation)
3310 viper-F-char)
3311 viper-f-char viper-F-char)
3314 (viper-find-char
3315 val (if (> (viper-p-val arg) 0) viper-f-char viper-F-char) t t)
3319 (setq viper-F-char viper-f-char) ; set new viper-F-char
3320 (forward-char)
3321 (viper-execute-com 'viper-goto-char-forward val com)))))
3323 (defun viper-find-char-backward (arg)
3324 "Find char ARG on line backward."
3331 (setq viper-f-char (read-char)
3334 ;; viper-repeat --- set viper-F-char from command-keys
3335 (setq viper-F-char (if (stringp cmd-representation)
3337 viper-F-char)
3338 viper-f-char viper-F-char)
3341 (viper-find-char
3342 val (if (> (viper-p-val arg) 0) viper-f-char viper-F-char) nil nil)
3346 (setq viper-F-char viper-f-char) ; set new viper-F-char
3347 (viper-execute-com 'viper-find-char-backward val com)))))
3349 (defun viper-goto-char-backward (arg)
3350 "Go up to char ARG backward on line."
3357 (setq viper-f-char (read-char)
3360 ;; viper-repeat --- set viper-F-char from command-keys
3361 (setq viper-F-char (if (stringp cmd-representation)
3363 viper-F-char)
3364 viper-f-char viper-F-char)
3367 (viper-find-char
3368 val (if (> (viper-p-val arg) 0) viper-f-char viper-F-char) nil t)
3372 (setq viper-F-char viper-f-char) ; set new viper-F-char
3373 (viper-execute-com 'viper-goto-char-backward val com)))))
3382 (viper-find-char val viper-f-char viper-f-forward viper-f-offset)
3385 (if viper-f-forward (forward-char))
3395 (viper-find-char val viper-f-char (not viper-f-forward) viper-f-offset)
3398 (if viper-f-forward (forward-char))
3483 ;; (which is called from viper-search-forward/backward/next). If the value of
3529 (goto-char
3535 (if (and (eolp) (not (bolp))) (forward-char -1))
3544 (backward-char) )
3545 ((re-search-backward "[][(){}]" beg-lim t))
3553 (backward-char)))
3558 (forward-char 1)
3562 (forward-char)
3564 (backward-sexp 1)
3591 (defun viper-backward-sentence (arg)
3599 (backward-sentence val)
3600 (if com (viper-execute-com 'viper-backward-sentence nil com))))
3615 (backward-char 1)
3618 (defun viper-backward-paragraph (arg)
3628 (backward-paragraph val)
3631 (forward-char 1)
3632 (viper-execute-com 'viper-backward-paragraph nil com)
3633 (backward-char 1)))))
3641 (re-search-backward viper-heading-start nil t val)
3642 (goto-char (match-beginning 0))
3651 (goto-char (match-beginning 0))
3661 (goto-char (match-beginning 0))
3683 (goto-char (point-max)))
3685 (goto-char (point-min))))
3702 (goto-char (point-min)))))
3718 (goto-char (point-max)))))
3891 (defun viper-search-backward (arg)
3892 "Search a string backward.
3915 ;; Search is forward if FORWARD is non-nil, otherwise backward.
3931 (if offset (viper-forward-char-carefully))
3935 (re-search-backward string))
3937 (search-backward string))
3944 (goto-char (point-min))
3953 ;; delete the wrap-around message
3956 (goto-char start-point)
3961 ;; backward
3965 (re-search-backward string nil nil val)
3966 (search-backward string nil nil val))
3973 (goto-char (point-max))
3982 ;; delete the wrap-around message
3985 (goto-char start-point)
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)))
4053 ;; This is a Viper wraper for isearch-backward."
4054 (defun viper-isearch-backward (arg)
4055 "Do incremental search backward."
4059 (viper-exec-form-in-emacs (list 'isearch-backward arg)))
4143 (if (not (eolp)) (viper-forward-char-carefully)))
4156 ;; Vi puts cursor on the last char when the yanked text doesn't contain a
4160 (or (= (point) (mark)) (viper-backward-char-carefully))
4199 ;; Vi puts cursor on the last char when the yanked text doesn't contain a
4203 (or (= (point) (mark)) (viper-backward-char-carefully))
4218 (defun viper-delete-char (arg)
4224 (list 'viper-delete-char val nil nil nil nil))
4231 (viper-forward-char-carefully val)
4244 (delete-char val t)
4246 (if (and (eolp) (not (bolp))) (backward-char 1)))
4249 (defun viper-delete-backward-char (arg)
4255 (list 'viper-delete-backward-char val nil nil nil nil))
4261 (viper-backward-char-carefully val)
4275 (delete-backward-char val t)))
4278 (defun viper-del-backward-char-in-insert ()
4279 "Delete 1 char backwards while in insert mode."
4284 (delete-backward-char 1 nil)))
4287 (defun viper-del-backward-char-in-replace ()
4289 If `viper-delete-backwards-in-replace' is t, then DEL key actually deletes
4294 (cond (viper-delete-backwards-in-replace
4297 (delete-backward-char 1 nil))
4304 (delete-backward-char 1 nil))))
4308 (backward-char 1)))
4310 (backward-char 1))))
4328 (delete-region (point) (1- (point)))
4334 (backward-char 1))
4370 (goto-char (viper-replace-end))
4374 (delete-backward-char 1)
4385 (goto-char (viper-replace-start))
4393 (goto-char (viper-replace-start))
4416 (setq c (following-char))
4417 (delete-char 1 nil)
4419 (insert-char (downcase c) 1)
4420 (insert-char (upcase c) 1))
4421 (if (eolp) (backward-char 1))
4474 (goto-char (point-min))
4482 (goto-char (point-max))
4489 (let ((char (read-char)))
4490 (cond ((and (<= ?a char) (<= char ?z))
4491 (point-to-register (viper-int-to-char (1+ (- char ?a)))))
4492 ((viper= char ?<) (viper-mark-beginning-of-buffer))
4493 ((viper= char ?>) (viper-mark-end-of-buffer))
4494 ((viper= char ?.) (viper-set-mark-if-necessary))
4495 ((viper= char ?,) (viper-cycle-through-mark-ring))
4496 ((viper= char ?^) (push-mark viper-saved-mark t t))
4497 ((viper= char ?D) (mark-defun))
4527 (setq mark-ring (delete (viper-mark-marker) mark-ring))
4533 (setq mark-ring (delete (viper-mark-marker) mark-ring))
4543 (let ((char (read-char))
4545 (viper-goto-mark-subr char com nil)))
4550 (let ((char (read-char))
4552 (viper-goto-mark-subr char com t)))
4554 (defun viper-goto-mark-subr (char com skip-white)
4558 (backward-char 1)))
4559 (cond ((viper-valid-register char '(letter))
4561 (reg (viper-int-to-char (1+ (- char ?a))))
4578 (error viper-EmptyTextmarker char))
4595 (goto-char viper-com-point)
4598 ((and (not skip-white) (viper= char ?`))
4602 (goto-char viper-last-jump))
4609 ((and skip-white (viper= char ?'))
4613 (goto-char viper-last-jump))
4620 (t (error viper-InvalidTextmarker char))))
4635 (and (save-excursion (re-search-backward str nil t))
4645 (defun viper-backward-indent ()
4652 (if (eq ?^ (preceding-char))
4654 (delete-backward-char 1)
4660 (if (re-search-backward "[^ \t]" bol 1) (forward-char))
4661 (delete-region (point) p)
4706 (let ((reg (read-char)))
4723 (let ((reg (read-char)))
4729 (let* ((val (get-register (viper-int-to-char (1+ (- reg ?a)))))
4741 (goto-char pos)
4743 (if (re-search-backward "[^ \t]" nil t)
4747 (goto-char pos)
4769 (defun viper-delete-backward-word (arg)
4774 (backward-word arg)
4775 (delete-region (point) (mark t))
4808 (delete-other-windows)
4928 (setq viper-expert-level (- (viper-read-char-exclusive) ?0))
4955 (defun viper-register-to-point (char &optional enforce-buffer)
4958 (let ((val (get-register char)))
4969 (viper-int-to-char (1- (+ char ?a)))))
4971 (goto-char val))
4975 (error viper-EmptyTextmarker (viper-int-to-char (1- (+ char ?a))))))))
5051 'viper-delete-backwards-in-replace
5076 (delete-other-windows)
5120 nil 'delete-other-windows