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

Lines Matching +defs:replace +defs:regexp +defs:in +defs:string

16 ;; GNU Emacs is distributed in the hope that it will be useful,
33 ;; Use this, rather than defcustom, in subr.el and other files loaded
72 DOCSTRING is an optional documentation string.
74 But documentation strings are usually not useful in nameless functions.
85 "Add NEWELT to the list stored in the symbol LISTNAME.
121 "Temporary variable used in `dolist' expansion.")
125 Evaluate BODY with VAR bound to each car from LIST, in turn.
131 ;; but that uses a lot more space when many functions in many files
144 "Temporary variable used in `dotimes' expansion.")
155 ;; but that uses a lot more space when many functions in many files
169 Treated as a declaration when used at the right place in a
190 ;; We put this here instead of in frame.el so that it's defined even on
263 Store the result in LIST and return it. LIST must be a proper list.
264 Of several `equal' occurrences of an element in LIST, the first
274 INC is the increment used between numbers in the sequence and defaults to 1.
293 of course, also replace TO with a slightly larger value
336 "Find object KEY in a pseudo-alist ALIST.
353 (make-obsolete 'assoc-ignore-case 'assoc-string)
355 "Like `assoc', but ignores differences in case and text representation.
356 KEY must be a string. Upper-case and lower-case letters are treated as equal.
358 (assoc-string key alist t))
360 (make-obsolete 'assoc-ignore-representation 'assoc-string)
362 "Like `assoc', but ignores differences in text representation.
363 KEY must be a string.
365 (assoc-string key alist nil))
368 "Like `member', but ignores differences in case and text representation.
369 ELT must be a string. Upper-case and lower-case letters are treated as equal.
371 Non-strings in LIST are ignored."
410 SEQ must be a list, vector, or string. The comparison is done with `equal'."
430 KEYS should be a string constant in the format used for
453 (define-key map (char-to-string loop) 'digit-argument)
457 "Add binding in KEYMAP for KEY => DEFINITION, right after AFTER's binding.
468 The order of bindings in a keymap matters when it is used as a menu."
518 (string< a b))))))
528 and then modifies one entry in it."
541 KEY is a key sequence; noninteractively, it is a string or vector
545 Note that if KEY has a local binding in the current buffer,
557 KEY is a key sequence; noninteractively, it is a string or vector
561 The binding goes in the current buffer's local map,
562 which in most cases is shared with all other buffers in the same major mode."
573 KEY is a string or vector representing a sequence of keystrokes."
579 KEY is a string or vector representing a sequence of keystrokes."
588 (defvar key-substitution-in-progress nil
592 "Replace OLDDEF with NEWDEF for any keys in KEYMAP now defined as OLDDEF.
595 in KEYMAP as NEWDEF those keys which are defined as OLDDEF in OLDMAP.
598 in a cleaner way with command remapping, like this:
601 ;; Don't document PREFIX in the doc string because we don't want to
606 ;; prefix, a string. Redefined bindings will then be bound to the
611 (key-substitution-in-progress
612 (cons scan key-substitution-in-progress)))
655 (not (memq inner-def key-substitution-in-progress)))
663 ;;; global-map, esc-map, and ctl-x-map have their values set up in
722 "Return a list of symbols representing the modifier keys in event EVENT.
727 that has never been used in an event that has been read as input
728 in the current Emacs session, then this function can return nil,
758 that has never been used in an event that has been read as input
759 in the current Emacs session, then this function may return nil."
805 ;;;; Extracting fields of the positions in an event.
808 "Return the window in POSITION.
814 "Return the window area recorded in POSITION, or nil for the text area.
823 "Return the buffer location in POSITION.
835 (error "Position not in text area of window"))
841 "Return the x and y coordinates in POSITION.
847 "Return the nominal column and row in POSITION, measured in characters.
849 and y coordinates in POSITION and the frame's default character width
852 corresponds to the vertical position of the click in the scroll bar.
875 "Return the actual column and row in POSITION, measured in characters.
876 These are the actual row number in the window and character number in that row.
877 Return nil if POSITION does not contain the actual position; in that case
889 (defsubst posn-string (position)
890 "Return the string object of POSITION.
891 Value is a cons (STRING . STRING-POS), or nil if not a string.
904 "Return the object (image or string) of POSITION.
906 \(STRING . STRING-POS) for a string object, and nil for a buffer position.
909 (or (posn-image position) (posn-string position)))
929 (define-obsolete-function-alias 'read-input 'read-string "22.1")
932 (define-obsolete-function-alias 'string-to-int 'string-to-number "22.1")
936 (defun insert-string (&rest args)
939 is converted into a string by expressing it in decimal."
941 (insert (if (integerp el) (number-to-string el) el))))
942 (make-obsolete 'insert-string 'insert "22.1")
974 ;; Lisp manual only updated in 22.1.
990 (defalias 'send-string 'process-send-string)
992 (defalias 'string= 'string-equal)
993 (defalias 'string< 'string-lessp)
1000 (defalias 'search-forward-regexp (symbol-function 're-search-forward))
1001 (defalias 'search-backward-regexp (symbol-function 're-search-backward))
1002 (defalias 'int-to-string 'number-to-string)
1023 work in concert: running the hook actually runs all the hook
1024 functions listed in *either* the local value *or* the global value
1028 which acts as a flag to run the hook functions in the default value as
1034 This function does nothing if HOOK is already local in the current
1050 unless the optional argument APPEND is non-nil, in which case
1057 functions in the default value as well as in the local value.
1086 FUNCTION isn't the value of HOOK, or, if FUNCTION doesn't appear in the
1087 list of hooks to run in HOOK, then nothing is done. See `add-hook'.
1122 unless the optional argument APPEND is non-nil, in which case
1156 The resulting list is reordered so that the elements are in the
1166 The list order for each element is stored in LIST-VAR's
1187 "Add NEWELT to the history list stored in the variable HISTORY-VAR.
1252 Only affects hooks run in the current buffer."
1289 NAME specifies what will appear in the mode line when the minor mode
1290 is active. NAME should be either a string starting with a space, or a
1291 symbol whose value is such a string.
1297 in `minor-mode-alist'.
1303 included in the mode-line minor mode menu.
1336 (if (and (stringp mode-name) (string-match "[^ ]+" mode-name))
1337 (concat " (" (match-string 0 mode-name) ")"))))
1362 ;; "Non-nil means we have loaded the file `fns-VERSION.el' in `exec-directory'.
1367 ;; "Load the file `fns-VERSION.el' in `exec-directory' if not already done.
1382 "Return the input source in which SYMBOL was defined.
1414 This command searches the directories in `load-path' like `\\[load-library]'
1423 string. When run interactively, the argument INTERACTIVE-CALL is t,
1424 and the file name is displayed in the echo area."
1437 (message "No library %s in search path" library)))
1450 That function's doc string says which file created it."
1460 (defun load-history-regexp (file)
1461 "Form a regexp to find FILE in `load-history'.
1462 FILE, a string, is described in the function `eval-after-load'."
1466 (regexp-quote file)
1469 ;; Note: regexp-opt can't be used here, since we need to call
1471 (concat "\\(" (mapconcat 'regexp-quote load-suffixes "\\|") "\\)?"))
1472 "\\(" (mapconcat 'regexp-quote jka-compr-load-suffixes "\\|")
1475 (defun load-history-filename-element (file-regexp)
1483 (not (string-match file-regexp (car load-elt)))))
1494 If FILE is a string, it may be either an absolute or a relative file
1502 a file whose absolute true name ends in FILE will trigger evaluation.
1509 Alternatively, FILE can be a feature (i.e. a symbol), in which case FORM
1518 (let* ((regexp-or-feature
1519 (if (stringp file) (load-history-regexp file) file))
1520 (elt (assoc regexp-or-feature after-load-alist)))
1522 (setq elt (list regexp-or-feature))
1531 (load-history-filename-element regexp-or-feature)
1537 ABS-FILE, a string, should be the absolute true name of a file just loaded."
1544 (string-match (car a-l-element) abs-file))
1629 The optional argument PROMPT specifies a string to use to prompt the user.
1648 ;; bound to some prefix in function-key-map or key-translation-map.
1690 by doing (clear-string STRING)."
1699 (and (arrayp second) (clear-string second))
1701 (and (arrayp first) (clear-string first))
1702 (and (arrayp second) (clear-string second))
1708 ;; the object that was passed in by the caller.
1712 (cursor-in-echo-area t)
1718 (make-string (length pass) ?.))
1724 (and (arrayp pass) (clear-string pass))
1727 (let* ((new-char (char-to-string c))
1729 (and (arrayp pass) (clear-string pass))
1730 (clear-string new-char)
1735 (and (arrayp pass) (clear-string pass))
1742 "Read a numeric value in the minibuffer, prompting with PROMPT.
1748 (if (string-match "\\(\\):[ \t]*\\'" prompt)
1749 (replace-match (format " (default %s)" default) t t prompt 1)
1750 (replace-regexp-in-string "[ \t]*\\'"
1757 (number-to-string default)))))
1783 in milliseconds; this was useful when Emacs was built without
1818 This works regardless of whether undo is enabled in the buffer.
1821 if undo is enabled in the buffer and BODY succeeds, the
1851 `accept-change-group' to accept the changes in the group as final;
1929 (defun momentary-string-display (string pos &optional exit-char message)
1930 "Momentarily display STRING in the buffer at POS.
1937 Display MESSAGE (optional fourth arg) in the echo area.
1954 (insert-before-markers string)
2017 (dolist (o (overlays-in beg end))
2021 ;; or delete it entirely (if it is contained in beg...end).
2045 was displayed in is selected. This hook is normally set up with a
2047 variable names in it, provided the major mode is still Help mode.")
2052 This hook is normally set up with a function to put the buffer in Help
2060 On those systems, it is automatically local in every buffer.
2101 absolute file name, it is searched in `data-directory'.
2103 :data DATA - read sound data from string DATA.
2107 :volume VOL - set volume to VOL. VOL must an integer in the
2108 range 0..100 or a float in the range 0..1.0. If not specified,
2121 ;; Quote using double quotes, but escape any existing quotes in
2126 (if (or (null (string-match "[^\"]" argument))
2128 (while (string-match "[\"]" argument start)
2139 (while (string-match "[^-0-9a-zA-Z_./]" argument start)
2146 (defun string-or-null-p (object)
2147 "Return t if OBJECT is a string or nil.
2197 (defun insert-for-yank (string)
2202 (while (setq to (next-single-property-change 0 'yank-handler string))
2203 (insert-for-yank-1 (substring string 0 to))
2204 (setq string (substring string to))))
2205 (insert-for-yank-1 string))
2207 (defun insert-for-yank-1 (string)
2214 the normal insert behavior is modified in various ways. The value of
2218 to insert the string. FUNCTION takes one argument--the object to insert.
2231 (let* ((handler (and (stringp string)
2232 (get-text-property 0 'yank-handler string)))
2233 (param (or (nth 1 handler) string))
2282 They default to the values of (point-min) and (point-max) in BUFFER."
2292 They default to the values of (point-min) and (point-max) in BUFFER.
2306 "Start a program in a subprocess. Return the process object for it.
2317 Wildcards and redirection are handled as usual in the shell.
2323 ;; We used to use `exec' to replace the shell with the command,
2331 "Execute the shell command COMMAND synchronously in separate process.
2334 Insert output in BUFFER before point; t means current buffer;
2336 BUFFER can also have the form (REAL-BUFFER STDERR-FILE); in that case,
2338 while STDERR-FILE says what to do with standard error in the child.
2340 t (mix it with ordinary output), or a file name string.
2344 Wildcards and redirection are handled as usual in the shell.
2348 status or a signal description string.
2353 ;; We used to use `exec' to replace the shell with the command,
2365 "Execute the forms in BODY with BUFFER temporarily current.
2367 The value returned is the value of the last form in BODY.
2375 "Execute the forms in BODY with WINDOW as the selected window.
2376 The value returned is the value of the last form in BODY.
2383 the selected window in each frame. If the previously selected
2394 ;; frame that window is in.
2411 The value returned is the value of the last form in BODY.
2432 The value returned is the value of the last form in BODY.
2454 See also `with-temp-file' and `with-output-to-string'."
2464 (defmacro with-output-to-string (&rest body)
2465 "Execute BODY, return the text it sent to `standard-output', as a string."
2468 (get-buffer-create (generate-new-buffer-name " *string-output*"))))
2473 (buffer-string)
2487 ;; in case inhibit-quit is nil.
2508 If BODY makes changes in the buffer, they are recorded
2511 The return value is the value of the last form in BODY.
2514 functions can't be deferred, so in that case this macro has no effect.
2517 in BODY."
2525 "Execute the forms in BODY with TABLE as the current case table.
2526 The value returned is the value of the last form in BODY."
2543 FUN is called with one argument, the string for which completion is required,
2546 can ignore the value of its argument. If completion is performed in the
2547 minibuffer, FUN will be called in the buffer from which the minibuffer was
2555 (string (make-symbol "string"))
2558 `(lambda (,string ,predicate ,mode)
2563 ((eq ,mode t) (all-completions ,string (,fun ,string) ,predicate))
2564 ((not ,mode) (try-completion ,string (,fun ,string) ,predicate))
2565 (t (test-completion ,string (,fun ,string) ,predicate)))))))
2571 ;; not available in subr.el) or use `(lambda (,str) ...) which prevents the use
2572 ;; of lexical-let in the callers.
2584 arguments. FUN must return the completion table that will be stored in VAR.
2585 If completion is requested in the minibuffer, FUN will be called in the buffer
2591 (let ((str (make-symbol "string")))
2598 (defmacro complete-in-turn (a b)
2599 "Create a completion table that first tries completion in A and then in B.
2602 `(lambda (string predicate mode)
2605 (or (all-completions string ,a predicate)
2606 (all-completions string ,b predicate)))
2608 (or (try-completion string ,a predicate)
2609 (try-completion string ,b predicate)))
2611 (or (test-completion string ,a predicate)
2612 (test-completion string ,b predicate))))))
2620 ;; that works ok in practice (people should not use that variable elsewhere).
2625 The value returned is the value of the last form in BODY."
2638 (defun match-string (num &optional string)
2639 "Return string of text matched by last search.
2640 NUM specifies which parenthesized expression in the last regexp.
2642 Zero means the entire text matched by the whole regexp or whole string.
2643 STRING should be given if the last search was by `string-match' on STRING."
2645 (if string
2646 (substring string (match-beginning num) (match-end num))
2649 (defun match-string-no-properties (num &optional string)
2650 "Return string of text matched by last search, without text properties.
2651 NUM specifies which parenthesized expression in the last regexp.
2653 Zero means the entire text matched by the whole regexp or whole string.
2654 STRING should be given if the last search was by `string-match' on STRING."
2656 (if string
2657 (substring-no-properties string (match-beginning num)
2662 (defun looking-back (regexp &optional limit greedy)
2675 (and (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)
2684 (looking-at (concat "\\(?:" regexp "\\)\\'"))))
2688 (looking-at (concat "\\(?:" regexp "\\)\\'")))))
2691 (defun subregexp-context-p (regexp pos &optional start)
2692 "Return non-nil if POS is in a normal subregexp context in REGEXP.
2693 A subregexp context is one where a sub-regexp can appear.
2696 If START is non-nil, it should be a position in REGEXP, smaller
2697 than POS, and known to be in a subregexp context."
2699 ;; reuses the regexp-matcher's own parser, so it understands all the
2701 ;; error string.
2704 (string-match (substring regexp (or start 0) pos) "")
2706 (invalid-regexp
2728 ;; (string-match re-context-re (substring regexp (or start 0) pos))
2732 ;;;; split-string
2734 (defconst split-string-default-separators "[ \f\t\n\r\v]+"
2735 "The default value of separators for `split-string'.
2737 A regexp matching strings of whitespace. May be locale-dependent
2747 (defun split-string (string &optional separators omit-nulls)
2757 `split-string-default-separators', normally \"[ \\f\\t\\n\\r\\v]+\", and
2765 Note that the effect of `(split-string STRING)' is the same as
2766 `(split-string STRING split-string-default-separators t)'. In the rare
2768 whitespace, use `(split-string STRING split-string-default-separators)'.
2772 (rexp (or separators split-string-default-separators))
2776 (while (and (string-match rexp string
2779 (< start (length string)))
2781 (< start (length string)))
2785 (cons (substring string start (match-beginning 0))
2788 (if (or keep-nulls (< start (length string)))
2790 (cons (substring string start)
2795 ;;;; Replacement in strings.
2797 (defun subst-char-in-string (fromchar tochar string &optional inplace)
2798 "Replace FROMCHAR with TOCHAR in STRING each time it occurs.
2799 Unless optional argument INPLACE is non-nil, return a new string."
2800 (let ((i (length string))
2801 (newstr (if inplace string (copy-sequence string))))
2808 (defun replace-regexp-in-string (regexp rep string &optional
2810 "Replace all matches for REGEXP with REP in STRING.
2812 Return a new string containing the replacements.
2815 arguments with the same names of function `replace-match'. If START
2816 is non-nil, start replacements at that index in STRING.
2818 REP is either a string used as the NEWTEXT arg of `replace-match' or a
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)
2830 ;; To avoid excessive consing from multiple matches in long strings,
2831 ;; don't just call `replace-match' continually. Walk down the
2832 ;; string looking for matches of REGEXP and building up a (reversed)
2836 ;; operate in a temporary buffer; we can't tell from the function's
2839 (let ((l (length string))
2843 (while (and (< start l) (string-match regexp string start))
2846 ;; If we matched the empty string, make sure we advance by one char
2849 ;; Operate only on the substring to minimize string consing.
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)))
2859 (cons (substring string start mb) ; unmatched prefix
2862 ;; Reconstruct a string from the pieces.
2863 (setq matches (cons (substring string start l) matches)) ; leftover
2890 saved table is restored, even in case of an abnormal exit.
2933 (when (and after (not undo-in-progress) (overlay-start ol1))
2986 If SYNTAX is provided it's a regexp that describes the possible text of
2988 its text matches the regexp.
2990 clone should be incorporated in the clone."
2992 ;; with insert-(behind|in-front-of)-hooks or use a slightly larger overlay
2994 ;; We opted for a larger overlay because it behaves better in the case
2995 ;; where the clone is reduced to the empty string (we want the overlay to
2996 ;; stay when the clone's content is the empty string and we want to use
3085 "Report progress of an operation in the echo area.
3105 MESSAGE is shown in the echo area. When at least 1% of operation
3115 call this function. You should omit it or set it to nil in most
3118 Optional MIN-CHANGE determines the minimal change in percents to
3141 "Report progress of an operation in the echo area unconditionally.
3191 "Print reporter's message followed by word \"done\" in echo area."
3195 "Loop a certain number of times and report progress in the echo area.
3201 printed in the echo area. After the loop is finished, MESSAGE
3226 "*Specify the string used to separate the version elements.
3228 Usually the separator is \".\", but it can be any other string.")
3231 (defvar version-regexp-alist
3239 This association is used to handle version string like \"1.0pre2\",
3258 REGEXP regexp used to match non-numeric part of a version string.
3267 "Convert version string VER into an integer list.
3276 | `version-regexp-alist' (which see).
3279 in `version-regexp-alist'.
3301 See documentation for `version-separator' and `version-regexp-alist'."
3303 (error "Invalid version string: '%s'" ver))
3306 (string-equal (substring ver 0 (length version-separator))
3311 (case-fold-search t) ; ignore case in matching
3313 (while (and (setq s (string-match "[0-9]+" ver i))
3316 (setq lst (cons (string-to-number (substring ver i (match-end 0)))
3320 (when (and (setq s (string-match "[^0-9]+" ver i))
3325 (unless (string= s version-separator)
3326 (setq al version-regexp-alist)
3327 (while (and al (not (string-match (caar al) s)))
3413 Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\",
3414 etc. That is, the trailing \".0\"s are irrelevant. Also, version string \"1\"
3423 Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\",
3424 etc. That is, the trailing \".0\"s are irrelevant. Also, version string \"1\"
3432 Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\",
3433 etc. That is, the trailing \".0\"s are irrelevant. Also, version string \"1\"