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

Lines Matching +defs:delete +defs:char

76 (defun vi-switch-mode (arg mode-char)
77 "Switch the major mode of current buffer as specified by the following char \\{vi-tilde-map}"
79 (let ((mode-cmd (lookup-key vi-tilde-map (char-to-string mode-char))))
160 (define-key vi-com-map " " 'forward-char)
162 (define-key vi-com-map "\"" 'vi-char-argument)
172 (define-key vi-com-map "," 'vi-reverse-last-find-char)
189 (define-key vi-com-map ";" 'vi-repeat-last-find-char)
201 (define-key vi-com-map "F" 'vi-backward-find-char)
215 (define-key vi-com-map "T" 'vi-backward-upto-char)
229 (define-key vi-com-map "`" 'vi-goto-char-mark)
236 (define-key vi-com-map "f" 'vi-forward-find-char)
238 (define-key vi-com-map "h" 'backward-char)
242 (define-key vi-com-map "l" 'forward-char)
248 (define-key vi-com-map "r" 'vi-replace-1-char)
250 (define-key vi-com-map "t" 'vi-forward-upto-char)
254 (define-key vi-com-map "x" 'vi-kill-char)
262 (define-key vi-com-map "\177" 'delete-backward-char))
264 (put 'backward-char 'point-moving-unit 'char)
273 (put 'forward-char 'point-moving-unit 'char)
274 (put 'end-of-line 'point-moving-unit 'char)
281 (put 'vi-reverse-last-find-char 'point-moving-unit 'rev-find)
283 (put 'beginning-of-line 'point-moving-unit 'char)
284 (put 'vi-beginning-of-buffer 'point-moving-unit 'char)
285 (put 'vi-repeat-last-find-char 'point-moving-unit 'find)
289 (put 'vi-backward-find-char 'point-moving-unit 'find)
295 (put 'vi-backward-upto-char 'point-moving-unit 'find)
297 (put 'back-to-indentation 'point-moving-unit 'char)
298 (put 'vi-goto-char-mark 'point-moving-unit 'char)
301 (put 'vi-forward-find-char 'point-moving-unit 'find)
302 (put 'backward-char 'point-moving-unit 'char)
303 (put 'vi-forward-char 'point-moving-unit 'char)
305 (put 'vi-forward-upto-char 'point-moving-unit 'find)
346 (defvar vi-last-find-char nil ; cons cell
347 "Save last direction, char and upto-flag used for char finding.")
401 (make-local-variable 'vi-last-find-char)
511 (single-key-description last-command-char))
517 (single-key-description last-command-char))
558 (if overwrite-p (delete-region (point) (+ (point) (length str))))
566 (if overwrite-p (delete-region (point) (+ (point) (length str))))
630 (if (not (eolp)) (forward-char)))))
649 (goto-char (point-min)))
735 (delete-indentation t)
738 (delete-indentation t)
823 (defun vi-char-argument (arg)
827 (let ((char (read-char)))
828 (cond ((null arg) (setq prefix-arg (cons nil char)))
829 ((integerp arg) (setq prefix-arg (cons arg char)))
832 (t (setq prefix-arg (cons (car arg) char))))))
834 (defun vi-goto-mark (mark-char &optional line-flag)
837 (cond ((char-equal mark-char last-command-char) ; `` or ''
839 ((char-equal mark-char ?@) ; jump and pop mark
842 (let ((mark (vi-get-mark mark-char)))
846 (goto-char mark)
849 (defun vi-goto-line-mark (char)
850 "Go to the line (at first non-white) marked by next char."
852 (vi-goto-mark char t))
854 (defun vi-goto-char-mark (char)
855 "Go to the char position marked by next mark-char."
857 (vi-goto-mark char))
881 (defun vi-reverse-last-find-char (count &optional find-arg)
885 (if (null find-arg) (setq find-arg vi-last-find-char))
887 (progn (ding) (message "No last find char to repeat."))
888 (vi-find-char (cons (* (car find-arg) -1) (cdr find-arg)) count))) ;6/13/86
890 (defun vi-find-char (arg count)
892 If UPTO-FLAG is T, stop before the char. ARG = (DIRECTION.CHAR.UPTO-FLAG."
893 (let* ((direction (car arg)) (char (car (cdr arg)))
895 (if (catch 'exit-find-char
897 (cond ((null (char-after pos)) (throw 'exit-find-char nil))
898 ((char-equal (char-after pos) ?\n) (throw 'exit-find-char nil))
899 ((char-equal char (char-after pos)) (setq count (1- count))
901 (throw 'exit-find-char
906 (goto-char pos)
909 (defun vi-repeat-last-find-char (count &optional find-arg)
913 (if (null find-arg) (setq find-arg vi-last-find-char))
915 (progn (ding) (message "No last find char to repeat."))
916 (vi-find-char find-arg count)))
918 (defun vi-backward-find-char (count char)
921 (setq vi-last-find-char (cons -1 (cons char nil)))
922 (vi-repeat-last-find-char count))
924 (defun vi-forward-find-char (count char)
927 (setq vi-last-find-char (cons 1 (cons char nil)))
928 (vi-repeat-last-find-char count))
930 (defun vi-backward-upto-char (count char)
933 (setq vi-last-find-char (cons -1 (cons char t)))
934 (vi-repeat-last-find-char count))
936 (defun vi-forward-upto-char (count char)
939 (setq vi-last-find-char (cons 1 (cons char t)))
940 (vi-repeat-last-find-char count))
946 (if (not (eobp)) (forward-char))
948 (backward-char)))
950 (defun vi-replace-1-char (count char)
951 "Replace char after point by CHAR. Repeat COUNT times."
953 (delete-char count nil) ; don't save in kill ring
954 (setq last-command-char char)
956 (vi-set-last-change-command 'vi-replace-1-char count char))
968 (delete-region (point)
975 (vi-goto-insert-state 1 (list 'vi-delete-op 'next-line (1- count)) t))
977 (defun vi-prefix-char-value (arg)
978 "Get the char part of the current prefix argument."
989 (let ((this-op-char last-command-char))
990 (setq last-command-char (read-char))
991 (setq this-command (lookup-key vi-com-map (char-to-string last-command-char)))
995 (setq last-command-char (read-char))
996 (setq this-command (lookup-key vi-com-map (char-to-string last-command-char))))
997 (cond ((char-equal this-op-char last-command-char) ; line op
998 (vi-execute-op this-op-char 'next-line
1000 (vi-prefix-char-value prefix-arg))))
1004 (vi-execute-op this-op-char this-command prefix-arg))))))
1007 (defun vi-execute-op (op-char motion-command arg)
1010 (cond ((= op-char ?d)
1011 (if (vi-delete-op motion-command arg)
1012 (vi-set-last-change-command 'vi-delete-op (vi-repeat-command-of motion-command) arg)))
1013 ((= op-char ?c)
1014 (if (vi-delete-op motion-command arg)
1015 (vi-goto-insert-state 1 (list 'vi-delete-op
1017 ((= op-char ?y)
1020 ((= op-char ?!)
1023 ((= op-char ?<)
1026 ((= op-char ?>)
1029 ((= op-char ?=)
1032 ((= op-char ?\\)
1039 ((eq cmd-type 'find) 'vi-repeat-last-find-char)
1066 (goto-char begin) (beginning-of-line) (setq begin (point))
1067 (goto-char end) (next-line 1) (beginning-of-line) (setq end (point))))
1071 (defun vi-delete-op (motion-command arg)
1077 (setq reg (vi-prefix-char-value arg))
1091 (setq reg (vi-prefix-char-value arg))
1102 (setq arg (cons (1- (vi-prefix-numeric-value arg)) (vi-prefix-char-value arg)))
1107 "See if STRING ends with a newline char.
1116 (let ((reg (vi-prefix-char-value arg)) put-text)
1131 (if after-p (forward-char 1)))
1147 If char argument is given, it directs the output to a *temp* buffer."
1155 (shell-command-on-region begin end shell-command (not (vi-prefix-char-value arg)))
1161 SPECIAL FEATURE: char argument can be used to specify shift amount(1-9)."
1166 (if (vi-prefix-char-value arg)
1168 (- (vi-prefix-char-value arg) ?0)
1169 (- ?0 (vi-prefix-char-value arg)))))
1190 (defun vi-get-mark (char)
1192 (cdr (assq char vi-mark-alist)))
1194 (defun vi-set-mark (char)
1198 (if (char-equal char ?@)
1200 (let ((aelt (assq char vi-mark-alist)))
1203 (setq aelt (cons char (copy-marker (point))))
1209 (cond ((looking-at "[[({]") (forward-sexp 1) (backward-char 1))
1210 ((looking-at "[])}]") (forward-char 1) (backward-sexp 1))
1217 (if (not (bobp)) (forward-char 1))))
1223 (if (not (eobp)) (backward-char 1))))
1229 (if (not (eobp)) (backward-char 2))))
1272 (defun vi-kill-char (count)
1275 (delete-char count t) ; save in kill ring
1276 (vi-set-last-change-command 'delete-char count t))
1280 The following char specifies unit of objects to be
1285 (if (char-equal unit ??)
1288 (setq unit (read-char))))
1290 (cond ((char-equal unit ?c) (transpose-chars arg))
1291 ((char-equal unit ?l) (transpose-lines (vi-prefix-numeric-value arg)))
1292 ((char-equal unit ?p) (transpose-paragraphs (vi-prefix-numeric-value arg)))
1293 ((char-equal unit ?s) (transpose-sexps (vi-prefix-numeric-value arg)))
1294 ((char-equal unit ?w) (transpose-words (vi-prefix-numeric-value arg)))
1312 (cond ((char-equal position ?\r) (recenter 0))
1313 ((char-equal position ?-) (recenter -1))
1314 ((char-equal position ?.) (recenter (/ (window-height) 2)))
1316 (setq position (read-char))
1327 (forward-char 1)
1331 (goto-char opoint)
1334 (defun vi-name-last-change-or-macro (arg char)
1340 (name-last-kbd-macro (intern (char-to-string char)))
1348 (fset (intern (char-to-string char)) vi-last-change-command)))
1350 (defun vi-call-named-change-or-macro (count char)
1353 (if (stringp (symbol-function (intern (char-to-string char))))
1354 (execute-kbd-macro (intern (char-to-string char)) count)
1355 (vi-redo-last-change-command count (symbol-function (intern (char-to-string char))))))
1358 "Change the case of the char after point."
1368 (forward-char arg)))
1370 (defun vi-ask-for-info (char)
1373 (cond ((char-equal char ?l) (what-line))
1374 ((char-equal char ?c) (what-cursor-position))
1375 ((char-equal char ?p) (what-page))
1377 (setq char (read-char))
1378 (vi-ask-for-info char))))
1381 "Mark region appropriately. The next char REGION is d(efun),s(-exp),b(uffer),
1385 (cond ((char-equal region ?d) (mark-defun))
1386 ((char-equal region ?s) (mark-sexp arg))
1387 ((char-equal region ?b) (mark-whole-buffer))
1388 ((char-equal region ?p) (mark-paragraph))
1389 ((char-equal region ?P) (mark-page arg))
1390 ((char-equal region ?f) (c-mark-function))
1391 ((char-equal region ?w) (mark-word arg))
1392 ((char-equal region ?e) (mark-end-of-sentence arg))
1393 ((char-equal region ?l) (vi-mark-lines arg))
1395 (setq region (read-char))
1405 "Verify spelling for the objects specified by char UNIT : [b(uffer),
1409 (cond ((char-equal unit ?b) (call-interactively 'spell-buffer))
1410 ((char-equal unit ?r) (call-interactively 'spell-region))
1411 ((char-equal unit ?s) (call-interactively 'spell-string))
1412 ((char-equal unit ?w) (call-interactively 'spell-word))
1414 (setq unit (read-char))
1421 (concat "\C-c" (char-to-string (read-char))))))
1435 (defun vi-quote-words (arg char)
1439 (while (not (string-match "[[({<\"'`*]" (char-to-string char)))
1441 (setq char (read-char)))
1442 (vi-set-last-change-command 'vi-quote-words arg char)
1444 (insert char)
1445 (cond ((char-equal char ?[) (setq char ?]))
1446 ((char-equal char ?{) (setq char ?}))
1447 ((char-equal char ?<) (setq char ?>))
1448 ((char-equal char ?() (setq char ?)))
1449 ((char-equal char ?`) (setq char ?')))
1451 (forward-char 1)
1452 (insert char))
1464 (forward-char)
1468 (goto-char (point-min))
1482 (if flag (forward-char -1))
1488 (if flag (forward-char 1))))) arg)