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

Lines Matching +defs:replace +defs:match

293 of course, also replace TO with a slightly larger value
1003 (defalias 'store-match-data 'set-match-data)
1336 (if (and (stringp mode-name) (string-match "[^ ]+" mode-name))
1337 (concat " (" (match-string 0 mode-name) ")"))))
1480 (save-match-data
1483 (not (string-match file-regexp (car load-elt)))))
1505 evaluation. Otherwise, its extension must match FILE's. A further
1544 (string-match (car a-l-element) abs-file))
1748 (if (string-match "\\(\\):[ \t]*\\'" prompt)
1749 (replace-match (format " (default %s)" default) t t prompt 1)
1750 (replace-regexp-in-string "[ \t]*\\'"
2085 (goto-char (match-end 0))
2126 (if (or (null (string-match "[^\"]" argument))
2127 (< (match-end 0) (length argument)))
2128 (while (string-match "[\"]" argument start)
2129 (setq end (match-beginning 0)
2139 (while (string-match "[^-0-9a-zA-Z_./]" argument start)
2140 (setq end (match-beginning 0)
2323 ;; We used to use `exec' to replace the shell with the command,
2353 ;; We used to use `exec' to replace the shell with the command,
2615 ;;; Matching and match data.
2617 (defvar save-match-data-internal)
2619 ;; We use save-match-data-internal as the local variable because
2623 (defmacro save-match-data (&rest body)
2624 "Execute the BODY forms, restoring the global value of the match data.
2631 '((save-match-data-internal (match-data)))
2635 ;; as Lisp programs should not copy from save-match-data-internal.
2636 '(set-match-data save-match-data-internal 'evaporate))))
2638 (defun match-string (num &optional string)
2641 Value is nil if NUMth pair didn't match, or there were less than NUM pairs.
2643 STRING should be given if the last search was by `string-match' on STRING."
2644 (if (match-beginning num)
2646 (substring string (match-beginning num) (match-end num))
2647 (buffer-substring (match-beginning num) (match-end num)))))
2649 (defun match-string-no-properties (num &optional string)
2652 Value is nil if NUMth pair didn't match, or there were less than NUM pairs.
2654 STRING should be given if the last search was by `string-match' on STRING."
2655 (if (match-beginning num)
2657 (substring-no-properties string (match-beginning num)
2658 (match-end num))
2659 (buffer-substring-no-properties (match-beginning num)
2660 (match-end num)))))
2669 If GREEDY is non-nil, extend the match backwards as far as possible,
2671 of a match for REGEXP."
2700 ;; details of the syntax. A disadvantage is that it needs to match the
2704 (string-match (substring regexp (or start 0) pos) "")
2728 ;; (string-match re-context-re (substring regexp (or start 0) pos))
2738 \(as yet unimplemented). Should not match non-breaking spaces.
2750 The beginning and end of STRING, and each match for SEPARATORS, are
2770 Modifies the match data; use `save-match-data' if necessary."
2776 (while (and (string-match rexp string
2778 (= start (match-beginning 0))
2783 (if (or keep-nulls (< start (match-beginning 0)))
2785 (cons (substring string start (match-beginning 0))
2787 (setq start (match-end 0)))
2808 (defun replace-regexp-in-string (regexp rep string &optional
2815 arguments with the same names of function `replace-match'. If START
2818 REP is either a string used as the NEWTEXT arg of `replace-match' or a
2820 match, and its value is used as the replacement text. When REP is called,
2821 the match-data are the result of matching REGEXP against a substring
2824 To replace only the first match (if any), make REGEXP match up to \\'
2825 and replace a sub-expression, e.g.
2826 (replace-regexp-in-string \"\\\\(foo\\\\).*\\\\'\" \"bar\" \" foo foo\" nil nil 1)
2831 ;; don't just call `replace-match' continually. Walk down the
2842 (save-match-data
2843 (while (and (< start l) (string-match regexp string start))
2844 (setq mb (match-beginning 0)
2845 me (match-end 0))
2850 ;; Set up match data for the substring for replacement;
2852 ;; match data directly in Lisp.
2853 (string-match regexp (setq str (substring string mb me)))
2855 (cons (replace-match (if (stringp rep)
2857 (funcall rep (match-string 0 str)))
2944 (save-match-data
2949 (when (< (match-end 0) cend)
2951 (setq end (min end (match-end 0)))
2953 (+ (match-end 0) margin)))
2954 (when (> (match-beginning 0) cbeg)
2956 (setq beg (max (match-beginning 0) beg))
2957 (move-overlay ol1 (- (match-beginning 0) margin)
3258 REGEXP regexp used to match non-numeric part of a version string.
3278 The NUMBER part is optional if SEPARATOR is a match for an element
3309 (save-match-data
3313 (while (and (setq s (string-match "[0-9]+" ver i))
3316 (setq lst (cons (string-to-number (substring ver i (match-end 0)))
3318 i (match-end 0))
3320 (when (and (setq s (string-match "[^0-9]+" ver i))
3322 (setq s (substring ver i (match-end 0))
3323 i (match-end 0))
3327 (while (and al (not (string-match (caar al) s)))