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

Lines Matching +defs:string +defs:char

41 ;; for bindings active during `isearch-edit-string'.
48 ;; the minibuffer to edit the string. This gives you a chance to
49 ;; modify the search string before executing the search. There are
54 ;; Exiting immediately from isearch uses isearch-edit-string instead
108 Actually, `isearch-edit-string' is called to let you enter the search
109 string, and RET terminates editing and does a nonincremental search."
180 "List of search string sequences.")
182 "List of regular expression search string sequences.")
194 "Index in `search-ring' of last string reused.
197 "Index in `regexp-search-ring' of last string reused.
202 Default value, nil, means edit the string instead."
233 string is highlighted lazily (see `lazy-highlight-initial-delay'
312 (char-table-p (nth 1 map))
318 (set-char-table-default table (car l) 'isearch-printing-char)
322 (define-key map [t] 'isearch-other-control-char)
328 (define-key map (make-string 1 i) 'isearch-other-control-char)
331 ;; Single-byte printing chars extend the search string by default.
334 (define-key map (vector i) 'isearch-printing-char)
337 ;; To handle local bindings with meta char prefix keys, define
339 ;; keys as well, one full keymap per char of the prefix key. It
343 (define-key map (char-to-string meta-prefix-char) meta-map)
345 (define-key map (vector meta-prefix-char t) 'isearch-other-meta-char)
355 (define-key map "\177" 'isearch-delete-char)
358 ;; This assumes \e is the meta-prefix-char.
359 (or (= ?\e meta-prefix-char)
364 (define-key map "\C-q" 'isearch-quote-char)
367 (define-key map "\C-j" 'isearch-printing-char)
368 (define-key map "\t" 'isearch-printing-char)
369 (define-key map [?\S-\ ] 'isearch-printing-char)
371 (define-key map "\C-w" 'isearch-yank-word-or-char)
372 (define-key map "\M-\C-w" 'isearch-del-char)
373 (define-key map "\M-\C-y" 'isearch-yank-char)
408 (define-key map "\M-e" 'isearch-edit-string)
423 (define-key map "\C-f" 'isearch-yank-char-in-minibuffer)
424 (define-key map [right] 'isearch-yank-char-in-minibuffer)
430 ;; and bound locally while editing the search string.
435 (defvar isearch-hidden nil) ; Non-nil if the string exists but is invisible.
443 (defvar isearch-string "") ; The current search string.
444 (defvar isearch-message "") ; text-char-description version of isearch-string
456 ; case in the search string is ignored.
486 ;; New value of isearch-forward after isearch-edit-string.
521 As you type characters, they add to the search string and are found.
524 Type \\[isearch-delete-char] to cancel last input item from end of search string.
529 Type \\[isearch-yank-word-or-char] to yank next word or character in buffer
530 onto the end of the search string, and search for it.
531 Type \\[isearch-del-char] to delete character from end of search string.
532 Type \\[isearch-yank-char] to yank char from buffer onto end of search\
533 string and search for it.
534 Type \\[isearch-yank-line] to yank rest of line onto end of search string\
536 Type \\[isearch-yank-kill] to yank the last string of killed text.
537 Type \\[isearch-quote-char] to quote control character to search for it.
544 If you try to exit with the search string still empty, it invokes
547 Type \\[isearch-query-replace] to start `query-replace' with string to\
548 replace from last search string.
550 with string to replace from last search string.
554 Type \\[isearch-edit-string] to edit the search string in the minibuffer.
560 Type \\[isearch-complete] to complete the search string using the search ring.
586 With a prefix argument, do a regular string search instead.
608 With a prefix argument, do a regular string search instead.
643 isearch-string ""
740 (goto-char found-point))
765 For going to the minibuffer to edit the search string,
769 (let ((command `(isearch-resume ,isearch-string ,isearch-regexp
781 ;; If NOPUSH is non-nil, we don't push the string on the search ring.
792 (goto-char found-point)
814 (goto-char (next-single-property-change (point) 'intangible))
815 (goto-char (previous-single-property-change (point) 'intangible)))))
817 (if (and (> (length isearch-string) 0) (not nopush))
819 (isearch-update-ring isearch-string isearch-regexp))
835 (defun isearch-update-ring (string &optional regexp)
840 string
850 ;; (handle-switch-frame (car (cdr last-command-char))))
856 (defsubst isearch-string-state (frame)
857 "Return the search string in FRAME."
860 "Return the search string to display to the user in FRAME."
895 (setq isearch-string (isearch-string-state cmd)
907 (goto-char (isearch-point-state cmd))))
915 (cons (vector isearch-string isearch-message (point)
932 nonincremental search instead via `isearch-edit-string'."
935 (= 0 (length isearch-string)))
937 (isearch-edit-string)))
942 (defun isearch-edit-string ()
943 "Edit the search string in the minibuffer.
946 \\[exit-minibuffer] to resume incremental searching with the edited string.
950 \\[isearch-complete-edit] to complete the search string using the search ring.
952 If first char entered is \\[isearch-yank-word-or-char], then do word search instead."
966 ;; isearch-string -message and -forward are not bound
968 (isearch-new-string isearch-string)
1009 (isearch-message) ;; for read-char
1011 (let* (;; Why does following read-char echo?
1020 ;; for a string is the yank-word character, then go into
1028 isearch-yank-word-or-char))
1034 (setq isearch-new-string
1037 isearch-string
1042 (mapconcat 'isearch-text-char-description
1043 isearch-new-string "")))
1052 (setq isearch-string isearch-new-string
1057 ;; Empty isearch-string means use default.
1058 (if (= 0 (length isearch-string))
1059 (setq isearch-string (or (car (if isearch-regexp
1065 (mapconcat 'isearch-text-char-description
1066 isearch-string ""))
1067 ;; This used to set the last search string,
1069 ;; Only the string actually used should be saved.
1082 ;; The search done message is confusing when the string
1084 (if (equal isearch-string "")
1112 (goto-char isearch-opoint)
1140 (if (equal isearch-string "")
1141 ;; If search string is empty, use last one.
1143 (setq isearch-error "No previous search string")
1144 (setq isearch-string
1149 (mapconcat 'isearch-text-char-description
1150 isearch-string "")
1159 (goto-char (if isearch-forward (point-min) (point-max)))))))
1166 (if (equal isearch-string "")
1172 ;; an empty string, ensure we advance.
1178 (forward-char (if isearch-forward 1 -1))
1219 "Start query-replace with string to replace from last search string."
1230 (goto-char isearch-other-end))
1232 (cons isearch-string
1235 isearch-string
1237 isearch-string
1245 "Start query-replace-regexp with string to replace from last search string."
1251 (defun isearch-delete-char ()
1260 (defun isearch-del-char (&optional arg)
1261 "Delete character from end of search string and search again.
1262 If search string is empty, just beep."
1264 (if (= 0 (length isearch-string))
1266 (setq isearch-string (substring isearch-string 0 (- (or arg 1)))
1267 isearch-message (mapconcat 'isearch-text-char-description
1268 isearch-string "")
1273 (defun isearch-yank-string (string)
1274 "Pull STRING into search string."
1275 ;; Downcase the string if not supposed to case-fold yanked strings.
1278 (setq string (downcase string)))
1279 (if isearch-regexp (setq string (regexp-quote string)))
1280 (setq isearch-string (concat isearch-string string)
1283 (mapconcat 'isearch-text-char-description
1284 string ""))
1290 "Pull string from kill ring into search string."
1292 (isearch-yank-string (current-kill 0)))
1295 "Pull current X selection into search string."
1297 (isearch-yank-string (x-get-selection)))
1321 (isearch-yank-string
1324 (goto-char isearch-other-end))
1327 (defun isearch-yank-char-in-minibuffer (&optional arg)
1328 "Pull next character from buffer into end of search string in minibuffer."
1335 (point) (progn (forward-char arg) (point)))))
1336 (forward-char arg)))
1338 (defun isearch-yank-char (&optional arg)
1339 "Pull next character from buffer into search string."
1341 (isearch-yank-internal (lambda () (forward-char arg) (point))))
1343 (defun isearch-yank-word-or-char ()
1344 "Pull next character or word from buffer into search string."
1348 (if (or (= (char-syntax (or (char-after) 0)) ?w)
1349 (= (char-syntax (or (char-after (1+ (point))) 0)) ?w))
1351 (forward-char 1)) (point))))
1354 "Pull next word from buffer into search string."
1359 "Pull rest of line from buffer into search string."
1369 ;; addition of characters which make isearch-string valid
1371 ;; If the string was found but was completely invisible,
1376 ;; matched, in the string following point.
1384 (isearch-no-upper-case-p isearch-string isearch-regexp)))
1385 (looking-at (if isearch-regexp isearch-string
1386 (regexp-quote isearch-string))))
1397 (isearch-no-upper-case-p isearch-string isearch-regexp))))
1400 (goto-char (if isearch-forward isearch-other-end
1415 ;; + needs no special handling because the string must match at least once.
1419 (= (mod (- (length str) (string-match "\\\\*\\'" str)) 2) 1))
1436 (when (and isearch-regexp (eq (not (isearch-backslash isearch-string))
1444 (progn (goto-char isearch-barrier)
1457 (let* ((string (isearch-string-state frame))
1458 (lchar (aref string (1- (length string)))))
1465 (isearch-string-state (car previous)))
1477 (goto-char (if isearch-forward
1492 ;; (Old comment from isearch-other-meta-char: "Note that we don't have to
1509 ;; search string to be scrolled out of the current window. If a command
1564 (defun isearch-string-out-of-window (isearch-point)
1565 "Test whether the search string is currently outside of the window.
1567 together with as much of the search string as will fit; the symbol
1574 start end) ; start and end of search string in buffer
1589 "Scroll the window to bring the search string back into view.
1591 search string is above the top of the window, nil when it is beneath
1599 (goto-char start)
1602 (goto-char isearch-point)
1604 (goto-char end)
1607 (goto-char isearch-point)
1609 (goto-char isearch-point))
1613 Return the key sequence as a string/vector."
1627 (defalias 'isearch-other-control-char 'isearch-other-meta-char)
1629 (defun isearch-other-meta-char (&optional arg)
1640 `edit', the search string is edited in the minibuffer and the meta
1641 character is unread so that it applies to editing the string.
1671 ;; If KEY is a printing char, we handle it here
1677 (isearch-process-search-char key)
1700 isearch-other-control-char)))))
1706 (isearch-edit-string))
1716 ;; isearch-other-meta-char in the first place.
1720 (let ((ab-bel (isearch-string-out-of-window isearch-point)))
1723 (goto-char isearch-point)))
1761 (isearch-process-search-string key key)))))
1763 (defun isearch-quote-char ()
1766 (let ((char (read-quoted-char (isearch-message t))))
1770 (if (and isearch-regexp (= char ?\s))
1771 (if (subregexp-context-p isearch-string (length isearch-string))
1772 (isearch-process-search-string "[ ]" " ")
1773 (isearch-process-search-char char))
1775 (>= char ?\200)
1776 (<= char ?\377)
1777 (setq char (unibyte-char-to-multibyte char)))
1778 (isearch-process-search-char char))))
1780 (defun isearch-return-char ()
1783 (isearch-process-search-char ?\n))
1784 (make-obsolete 'isearch-return-char 'isearch-printing-char)
1786 (defun isearch-printing-char ()
1787 "Add this ordinary printing character to the search string and search."
1789 (let ((char last-command-char))
1790 (if (= char ?\S-\ )
1791 (setq char ?\s))
1793 (>= char ?\200)
1794 (<= char ?\377))
1796 (isearch-process-search-multibyte-characters char)
1797 (isearch-process-search-char (unibyte-char-to-multibyte char)))
1799 (isearch-process-search-multibyte-characters char)
1800 (isearch-process-search-char char)))))
1802 (defun isearch-process-search-char (char)
1807 ((memq char '(?* ??)) (isearch-fallback nil))
1808 ((eq char ?\}) (isearch-fallback t t))
1809 ((eq char ?|) (isearch-fallback t nil t)))
1811 ;; Append the char to the search string, update the message and re-search.
1812 (isearch-process-search-string
1813 (char-to-string char)
1814 (if (>= char ?\200)
1815 (char-to-string char)
1816 (isearch-text-char-description char))))
1818 (defun isearch-process-search-string (string message)
1819 (setq isearch-string (concat isearch-string string)
1842 (setq isearch-string (nth yank-pointer ring)
1843 isearch-message (mapconcat 'isearch-text-char-description
1844 isearch-string "")))))
1853 (isearch-edit-string)
1858 "Advance to the next search string in the ring."
1864 "Retreat to the previous search string in the ring."
1873 (completion (try-completion isearch-string ring)))
1876 ;; isearch-string stays the same
1878 ((or completion ; not nil, must be a string
1879 (= 0 (length isearch-string))) ; shouldn't have to say this
1880 (if (equal completion isearch-string) ;; no extension?
1885 (all-completions isearch-string ring))))
1888 (setq isearch-string completion))))
1894 "Complete the search string from the strings on the search ring.
1895 The completed string is then editable in the minibuffer.
1900 (mapconcat 'isearch-text-char-description
1901 isearch-string ""))
1902 (isearch-edit-string))
1910 (setq isearch-string (field-string))
1914 (insert isearch-string))))
1918 ;; Message string
1921 ;; Generate and print the message string.
1926 (string-match " +$" isearch-message))
1945 (progn (re-search-forward isearch-string (point) t)
1999 (defun isearch-search-string (string bound noerror)
2004 (len (length string))
2006 (setq pos1 (save-excursion (funcall func string bound noerror)))
2007 (if (and (char-table-p translation-table-for-input)
2008 (> (string-bytes string) len))
2011 (let ((x (aref translation-table-for-input (aref string i))))
2013 (or translated (setq translated (copy-sequence string)))
2026 (goto-char pos1))
2030 ;; Do the search with the current search string.
2034 (isearch-no-upper-case-p isearch-string isearch-regexp)))
2044 (isearch-search-string isearch-string nil t))
2064 (if (string-match
2084 (goto-char (isearch-point-state (car isearch-cmds)))))
2171 (goto-char beg)
2183 (get-char-property (point) 'invisible)))
2190 (goto-char (next-single-property-change (point) 'invisible
2219 (goto-char (next-overlay-change (point)))))
2234 (defun isearch-no-upper-case-p (string regexp-flag)
2238 (let (quote-flag (i 0) (len (length string)) found)
2240 (let ((char (aref string i)))
2241 (if (and regexp-flag (eq char ?\\))
2243 (if (and (not quote-flag) (not (eq char (downcase char))))
2248 ;; Even if there's no uppercase char, we want to detect the use
2249 ;; of [:upper:] or [:lower:] char-class, which indicates
2251 (and regexp-flag (string-match "\\[:\\(upp\\|low\\)er:]" string)
2254 (string-match (substring string 0 (match-beginning 0))
2262 (defun isearch-text-char-description (c)
2266 (t (char-to-string c))))
2270 (defun isearch-unread (&rest char-or-events)
2271 (mapc 'store-kbd-macro-event char-or-events)
2273 (append char-or-events unread-command-events)))
2300 ;; When active, *every* match for the current search string is
2312 ;; the search string or window-start changes;
2313 ;; - `isearch-string' is expected to contain the current search
2314 ;; string as entered by the user;
2320 ;; iff `isearch-string' is an invalid regexp.
2329 (defvar isearch-lazy-highlight-last-string nil)
2360 search string to change or the window to scroll). It is also used
2364 (or (not (equal isearch-string
2365 isearch-lazy-highlight-last-string))
2386 isearch-lazy-highlight-last-string isearch-string
2391 (unless (equal isearch-string "")
2403 (isearch-search-string
2404 isearch-lazy-highlight-last-string
2429 (goto-char (if isearch-forward
2447 (forward-char 1))
2452 (forward-char -1)))
2475 (goto-char (max (or isearch-lazy-highlight-start-limit (point-min))
2478 (goto-char (min (or isearch-lazy-highlight-end-limit (point-max))
2487 SEARCH is the string or regexp searched for.
2494 (setq isearch-string search