• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/emulation/

Lines Matching +defs:previous +defs:search +defs:string

101   "*If t then do regexp replace, if nil then do string replace."
120 (defcustom vip-search-wrap-around t
121 "*If t, search wraps around."
125 (defcustom vip-re-search nil
126 "*If t, search is reg-exp search, otherwise vanilla search."
130 (defvar vip-s-string nil
131 "Last vip search string.")
134 "If t, search is forward.")
136 (defcustom vip-case-fold-search nil
137 "*If t, search ignores cases."
142 "*If t then do regexp replace, if nil then do string replace."
157 (defvar vip-quote-string "> "
202 (define-key vip-mode-map "-" 'vip-previous-line-at-bol)
204 (define-key vip-mode-map "/" 'vip-search-forward)
222 (define-key vip-mode-map "?" 'vip-search-backward)
238 (define-key vip-mode-map "N" 'vip-search-Next)
242 (define-key vip-mode-map "R" 'vip-replace-string)
269 (define-key vip-mode-map "k" 'vip-previous-line)
272 (define-key vip-mode-map "n" 'vip-search-next)
397 (defun vip-change-mode-line (string)
398 "Assuming that the mode line format contains the string \"Emacs:\", this
399 function replaces the string by \"Vi: \" etc."
401 (if (string= string "Emacs:")
403 (list (concat string " %17b")))))
482 (message "%s %s" case (prin1-to-string msg)))
783 (setq vip-last-shell-com (vip-read-string "!"))
827 (if (null m-com) (error "No previous command to repeat"))
852 "Undo previous change."
860 "Continue undoing previous changes."
869 (defun vip-string-tail (str)
870 (if (or (null str) (string= str "")) nil
900 "Quote region by inserting the user supplied string at the beginning of
902 (setq vip-quote-string
904 (vip-read-string (format "quote string (default %s): "
905 vip-quote-string))))
906 (if (string= str "") vip-quote-string str)))
909 (insert vip-quote-string)
913 (insert vip-quote-string)
917 (defun vip-end-with-a-newline-p (string)
918 "Check if the string ends with a newline."
919 (or (string= string "")
920 (= (aref string (1- (length string))) ?\n)))
924 (defun vip-read-string (prompt &optional init)
931 (setq str (read-string prompt init))
1105 (defun vip-replace-string ()
1106 "Replace string. If you supply null string as the string to be replaced,
1107 the query replace mode will toggle between string replace and regexp replace."
1110 (setq str (vip-read-string
1111 (if vip-re-replace "Replace regexp: " "Replace string: ")))
1112 (if (string= str "")
1117 "string replace")))
1121 ;; (vip-read-string (format "Replace regexp \"%s\" with: " str)))
1122 (while (re-search-forward str nil t)
1123 (replace-match (vip-read-string
1127 (replace-string
1129 (vip-read-string (format "Replace \"%s\" with: " str))))))))
1205 (re-search-forward "[^ \t\n]*[ \t\n]+" nil t val)
1224 (if (re-search-forward "[^ \t\n]+" nil t val) (backward-char))
1236 (if (re-search-backward "[ \t\n]+[^ \t\n]+" nil t val)
1283 (defun vip-previous-line (arg)
1284 "Go to previous line."
1289 (setq this-command 'previous-line)
1290 (if com (vip-execute-com 'vip-previous-line val com))))
1292 (defun vip-previous-line-at-bol (arg)
1299 (if com (vip-execute-com 'vip-previous-line val com))))
1330 search is forward, otherwise backward. OFFSET is used to adjust point
1331 after search."
1337 ;; forward search begins here
1339 ;; forward search ends here
1342 ;; backward search begins from here
1344 ;; backward search ends here
1346 ;; if arg > 0, point is forwarded before search.
1349 (let ((case-fold-search nil))
1350 (search-forward (char-to-string char) nil 0 arg))
1435 "Repeat previous find command."
1446 "Repeat previous find command in the opposite direction."
1465 (string= (buffer-name (current-buffer)) " *Minibuf-1*")
1595 "Scroll to previous screen."
1635 (defun vip-search-forward (arg)
1636 "Search a string forward. ARG is used to find the ARG's occurrence
1637 of the string. Default is vanilla search. Search mode can be toggled by
1638 giving null search string."
1642 vip-s-string (vip-read-string (if vip-re-search "RE-/" "/")))
1643 (if (string= vip-s-string "")
1645 (setq vip-re-search (not vip-re-search))
1646 (message "Search mode changed to %s search."
1647 (if vip-re-search "regular expression"
1649 (vip-search vip-s-string t val)
1653 (vip-execute-com 'vip-search-next val com))))))
1655 (defun vip-search-backward (arg)
1656 "Search a string backward. ARG is used to find the ARG's occurrence
1657 of the string. Default is vanilla search. Search mode can be toggled by
1658 giving null search string."
1662 vip-s-string (vip-read-string (if vip-re-search "RE-?" "?")))
1663 (if (string= vip-s-string "")
1665 (setq vip-re-search (not vip-re-search))
1666 (message "Search mode changed to %s search."
1667 (if vip-re-search "regular expression"
1669 (vip-search vip-s-string nil val)
1673 (vip-execute-com 'vip-search-next val com))))))
1675 (defun vip-search (string forward arg &optional no-offset init-point)
1680 (case-fold-search vip-case-fold-search)
1686 (if vip-re-search
1688 (re-search-forward string nil nil val)
1689 (re-search-backward string))
1690 (search-forward string nil nil val)
1691 (search-backward string))
1693 (search-failed
1694 (if (and null-arg vip-search-wrap-around)
1697 (vip-search string forward (cons 1 com) t start-point))
1699 (signal 'search-failed (cdr conditions)))))
1702 (if vip-re-search
1703 (re-search-backward string nil nil val)
1704 (search-backward string nil nil val))
1706 (search-failed
1707 (if (and null-arg vip-search-wrap-around)
1710 (vip-search string forward (cons 1 com) t start-point))
1712 (signal 'search-failed (cdr conditions))))))))
1714 (defun vip-search-next (arg)
1715 "Repeat previous search."
1718 (if (null vip-s-string) (error "No previous search string"))
1719 (vip-search vip-s-string vip-s-forward arg)
1720 (if com (vip-execute-com 'vip-search-next val com))))
1722 (defun vip-search-Next (arg)
1723 "Repeat previous search in the reverse direction."
1726 (if (null vip-s-string) (error "No previous search string"))
1727 (vip-search vip-s-string (not vip-s-forward) arg)
1728 (if com (vip-execute-com 'vip-search-Next val com))))
1869 "Delete previous character."
1904 (defvar vip-c-string)
1907 (setq vip-c-string
1908 (vip-read-string (format "%s => " (buffer-substring beg end))))
1918 (insert vip-c-string))
1925 "Query replace. If you supply null string as the string to be replaced,
1926 the query replace mode will toggle between string replace and regexp replace."
1929 (setq str (vip-read-string
1932 (if (string= str "")
1937 "string replace")))
1941 (vip-read-string (format "Query replace regexp \"%s\" with: " str)))
1944 (vip-read-string (format "Query replace \"%s\" with: " str)))))))
2046 "Delete previous word."
2111 (and (save-excursion (re-search-backward str nil t))
2118 (string= ex-token (substring str 0 length)))
2125 (re-search-forward "[a-z][a-z]*")
2196 (setq ex-token (char-to-string (following-char)))
2204 (re-search-forward "[0-9]*")
2206 (cond ((string= ex-token-type "plus") "add-number")
2207 ((string= ex-token-type "minus") "sub-number")
2209 (setq ex-token (string-to-number (buffer-substring (point) (mark)))))
2243 ;;(re-search-forward "[^/]*/")
2244 (re-search-forward "[^/]*\\(/\\|\n\\)")
2250 (setq ex-token-type "search-forward"))
2256 ;;(re-search-forward "[^\\?]*\\?")
2257 (re-search-forward "[^\\?]*\\(\\?\\|\n\\)")
2262 (setq ex-token-type "search-backward")
2272 (setq ex-token (char-to-string (following-char)))
2287 (defun vip-ex (&optional string)
2290 (or string
2293 (let ((com-str (or string (vip-read-string ":")))
2304 (cond ((or (string= ex-token-type "command")
2305 (string= ex-token-type "end-mark"))
2307 (cond ((string= ex-token "global")
2310 ((string= ex-token "v")
2323 ((string= ex-token-type "non-command")
2325 ((string= ex-token-type "whole")
2328 ((string= ex-token-type "comma")
2331 ((string= ex-token-type "semi-colon")
2355 (re-search-forward "[^/]*\\(/\\|\n\\)")
2356 ;;(re-search-forward "[^/]*/")
2373 (if (string= ex-token-type "non-command")
2376 (setq ex-token (char-to-string (following-char)))
2414 (cond ((string= ex-token-type "command")
2415 (if (or (string= ex-token "print") (string= ex-token "list")
2416 (string= ex-token "#"))
2421 ((string= ex-token-type "end-mark")
2423 ((string= ex-token-type "whole")
2425 ((string= ex-token-type "comma")
2435 (cond ((string= ex-token-type "dot")
2437 ((string= ex-token-type "add-number")
2442 ((string= ex-token-type "sub-number")
2447 ((string= ex-token-type "abs-number")
2453 ((string= ex-token-type "end")
2455 ((string= ex-token-type "plus") t);; do nothing
2456 ((string= ex-token-type "minus") t);; do nothing
2457 ((string= ex-token-type "search-forward")
2459 (ex-search-address t)
2461 ((string= ex-token-type "search-backward")
2463 (ex-search-address nil)
2465 ((string= ex-token-type "goto-mark")
2473 (defun ex-search-address (forward)
2474 "search pattern and set address"
2475 (if (string= ex-token "")
2476 (if (null vip-s-string) (error "No previous search string")
2477 (setq ex-token vip-s-string))
2478 (setq vip-s-string ex-token))
2482 (re-search-forward ex-token))
2484 (re-search-backward ex-token)))
2502 (re-search-forward "[0-9][0-9]*")
2503 (setq ex-count (string-to-number (buffer-substring (point) (mark))))
2527 (re-search-forward "[0-9][0-9]*")
2528 (setq ex-count (string-to-number (buffer-substring (point) (mark))))
2561 (re-search-forward "[ \t\n]")
2567 (re-search-forward "[ \t\n]")
2573 (cond ((string= ex-token "goto") (ex-goto))
2574 ((string= ex-token "copy") (ex-copy nil))
2575 ((string= ex-token "delete") (ex-delete))
2576 ((string= ex-token "edit") (ex-edit))
2577 ((string= ex-token "file") (vip-info-on-file))
2578 ;((string= ex-token "global") (ex-global nil))
2579 ((string= ex-token "join") (ex-line "join"))
2580 ((string= ex-token "k") (ex-mark))
2581 ((string= ex-token "mark") (ex-mark))
2582 ((string= ex-token "map") (ex-map))
2583 ((string= ex-token "move") (ex-copy t))
2584 ((string= ex-token "put") (ex-put))
2585 ((string= ex-token "quit") (ex-quit))
2586 ((string= ex-token "read") (ex-read))
2587 ((string= ex-token "set") (ex-set))
2588 ((string= ex-token "shell") (ex-shell))
2589 ((string= ex-token "substitute") (ex-substitute))
2590 ((string= ex-token "stop") (suspend-emacs))
2591 ((string= ex-token "t") (ex-copy nil))
2592 ((string= ex-token "tag") (ex-tag))
2593 ((string= ex-token "undo") (vip-undo))
2594 ((string= ex-token "unmap") (ex-unmap))
2595 ;((string= ex-token "v") (ex-global t))
2596 ((string= ex-token "version") (vip-version))
2597 ((string= ex-token "visual") (ex-edit))
2598 ((string= ex-token "write") (ex-write nil))
2599 ((string= ex-token "wq") (ex-write t))
2600 ((string= ex-token "yank") (ex-yank))
2601 ((string= ex-token "!") (ex-command))
2602 ((string= ex-token "=") (ex-line-no))
2603 ((string= ex-token ">") (ex-line "right"))
2604 ((string= ex-token "<") (ex-line "left"))
2605 ((string= ex-token "&") (ex-substitute t))
2606 ((string= ex-token "~") (ex-substitute t t))
2607 ((or (string= ex-token "append")
2608 (string= ex-token "args")
2609 (string= ex-token "change")
2610 (string= ex-token "insert")
2611 (string= ex-token "open")
2614 ((or (string= ex-token "abbreviate")
2615 (string= ex-token "list")
2616 (string= ex-token "next")
2617 (string= ex-token "print")
2618 (string= ex-token "preserve")
2619 (string= ex-token "recover")
2620 (string= ex-token "rewind")
2621 (string= ex-token "source")
2622 (string= ex-token "unabbreviate")
2623 (string= ex-token "xit")
2624 (string= ex-token "z")
2657 (vip-read-string "[Hit return to continue] ")
2689 (vip-read-string "[Hit return to continue] ")
2733 (if (string= ex-token "")
2734 (if (null vip-s-string) (error "No previous search string")
2735 (setq ex-g-pat vip-s-string))
2737 vip-s-string ex-token))
2755 (let ((found (re-search-backward ex-g-pat (mark) t)))
2800 (vip-read-string "[Hit return to continue] ")
2811 (cond ((string= com "join")
2820 ((or (string= com "right") (string= com "left"))
2823 (if (string= com "right") vip-shift-width (- vip-shift-width)))
2853 (let (char string)
2857 (setq char (char-to-string (following-char)))
2865 (setq string (buffer-substring (mark) (point))))
2875 (list 'execute-kbd-macro string 'count))))))))
2883 (setq char (char-to-string (following-char)))
2928 (re-search-forward "[ \t\n]")
2948 If REPEAT use previous reg-exp which is ex-reg-exp or
2949 vip-s-string"
2953 (setq pat (if r-flag vip-s-string ex-reg-exp)
2955 (setq pat (if (string= ex-token "") vip-s-string ex-token))
2956 (setq vip-s-string pat
2965 (if (string= ex-token "g") (setq opt-g t) (setq opt-c t)))
2993 (re-search-forward pat eol-mark t))
3000 (if (and (re-search-forward pat eol-mark t)
3020 (if (not (string= tag "")) (setq ex-tag tag))
3024 (if (string= tag "")
3036 (if (string= ex-file "")
3042 (if (and (not (string= ex-file (buffer-file-name)))