comparison lisp/prim/isearch-mode.el @ 104:cf808b4c4290 r20-1b4

Import from CVS: tag r20-1b4
author cvs
date Mon, 13 Aug 2007 09:16:51 +0200
parents 131b0175ea99
children 360340f9fd5f
comparison
equal deleted inserted replaced
103:30eda07fe280 104:cf808b4c4290
192 (define-key map "\C-j" 'isearch-printing-char) 192 (define-key map "\C-j" 'isearch-printing-char)
193 (define-key map "\t" 'isearch-printing-char) 193 (define-key map "\t" 'isearch-printing-char)
194 194
195 (define-key map "\C-w" 'isearch-yank-word) 195 (define-key map "\C-w" 'isearch-yank-word)
196 (define-key map "\C-y" 'isearch-yank-line) 196 (define-key map "\C-y" 'isearch-yank-line)
197 (define-key map "\M-y" 'isearch-yank-kill)
197 198
198 ;; Define keys for regexp chars * ? | 199 ;; Define keys for regexp chars * ? |
199 (define-key map "*" 'isearch-*-char) 200 (define-key map "*" 'isearch-*-char)
200 (define-key map "?" 'isearch-*-char) 201 (define-key map "?" 'isearch-*-char)
201 (define-key map "|" 'isearch-|-char) 202 (define-key map "|" 'isearch-|-char)
349 ;; Non-standard bindings 350 ;; Non-standard bindings
350 ;; Type \\[isearch-toggle-regexp] to toggle regular expression with normal searching. 351 ;; Type \\[isearch-toggle-regexp] to toggle regular expression with normal searching.
351 ;; Type \\[isearch-edit-string] to edit the search string in the minibuffer. 352 ;; Type \\[isearch-edit-string] to edit the search string in the minibuffer.
352 ;; Terminate editing and return to incremental searching with CR. 353 ;; Terminate editing and return to incremental searching with CR.
353 354
354 (interactive "P") 355 (interactive "_P")
355 (isearch-mode t (not (null regexp-p)) nil (not (interactive-p)))) 356 (isearch-mode t (not (null regexp-p)) nil (not (interactive-p))))
356 357
357 (defun isearch-forward-regexp () 358 (defun isearch-forward-regexp ()
358 "\ 359 "\
359 Do incremental search forward for regular expression. 360 Do incremental search forward for regular expression.
360 Like ordinary incremental search except that your input 361 Like ordinary incremental search except that your input
361 is treated as a regexp. See \\[isearch-forward] for more info." 362 is treated as a regexp. See \\[isearch-forward] for more info."
362 (interactive) 363 (interactive "_")
363 (isearch-mode t t nil (not (interactive-p)))) 364 (isearch-mode t t nil (not (interactive-p))))
364 365
365 (defun isearch-backward (&optional regexp-p) 366 (defun isearch-backward (&optional regexp-p)
366 "\ 367 "\
367 Do incremental search backward. 368 Do incremental search backward.
368 With a prefix argument, do an incremental regular expression search instead. 369 With a prefix argument, do an incremental regular expression search instead.
369 See \\[isearch-forward] for more information." 370 See \\[isearch-forward] for more information."
370 (interactive "P") 371 (interactive "_P")
371 (isearch-mode nil (not (null regexp-p)) nil (not (interactive-p)))) 372 (isearch-mode nil (not (null regexp-p)) nil (not (interactive-p))))
372 373
373 (defun isearch-backward-regexp () 374 (defun isearch-backward-regexp ()
374 "\ 375 "\
375 Do incremental search backward for regular expression. 376 Do incremental search backward for regular expression.
376 Like ordinary incremental search except that your input 377 Like ordinary incremental search except that your input
377 is treated as a regexp. See \\[isearch-forward] for more info." 378 is treated as a regexp. See \\[isearch-forward] for more info."
378 (interactive) 379 (interactive "_")
379 (isearch-mode nil t nil (not (interactive-p)))) 380 (isearch-mode nil t nil (not (interactive-p))))
380 381
381 382 ;; This function is way wrong, because you can't scroll the help
383 ;; screen; as soon as you press a key, it's gone. I don't know of a
384 ;; good way to fix it, though. -hniksic
382 (defun isearch-mode-help () 385 (defun isearch-mode-help ()
383 (interactive) 386 (interactive "_")
384 (describe-function 'isearch-forward) 387 (describe-function 'isearch-forward)
385 (isearch-update)) 388 (isearch-update))
386 389
387 390
388 ;;;================================================================== 391 ;;;==================================================================
826 (isearch-pop-state)) 829 (isearch-pop-state))
827 (isearch-update)) 830 (isearch-update))
828 831
829 832
830 (defun isearch-yank (chunk) 833 (defun isearch-yank (chunk)
831 ;; Helper for isearch-yank-word and isearch-yank-line 834 ;; Helper for isearch-yank-* functions. CHUNK can be a string or a
835 ;; function.
832 (let ((word (if (stringp chunk) 836 (let ((word (if (stringp chunk)
833 chunk 837 chunk
834 (save-excursion 838 (save-excursion
835 (and (not isearch-forward) isearch-other-end 839 (and (not isearch-forward) isearch-other-end
836 (goto-char isearch-other-end)) 840 (goto-char isearch-other-end))
862 866
863 (defun isearch-yank-line () 867 (defun isearch-yank-line ()
864 "Pull rest of line from buffer into search string." 868 "Pull rest of line from buffer into search string."
865 (interactive) 869 (interactive)
866 (isearch-yank 'end-of-line)) 870 (isearch-yank 'end-of-line))
871
872 (defun isearch-yank-kill ()
873 "Pull rest of line from kill ring into search string."
874 (interactive)
875 (isearch-yank (current-kill 0)))
867 876
868 (defun isearch-yank-sexp () 877 (defun isearch-yank-sexp ()
869 "Pull next expression from buffer into search string." 878 "Pull next expression from buffer into search string."
870 (interactive) 879 (interactive)
871 (isearch-yank 'forward-sexp)) 880 (isearch-yank 'forward-sexp))
1272 (put 'isearch-exit 'isearch-command t) 1281 (put 'isearch-exit 'isearch-command t)
1273 (put 'isearch-printing-char 'isearch-command t) 1282 (put 'isearch-printing-char 'isearch-command t)
1274 (put 'isearch-printing-char 'isearch-command t) 1283 (put 'isearch-printing-char 'isearch-command t)
1275 (put 'isearch-yank-word 'isearch-command t) 1284 (put 'isearch-yank-word 'isearch-command t)
1276 (put 'isearch-yank-line 'isearch-command t) 1285 (put 'isearch-yank-line 'isearch-command t)
1286 (put 'isearch-yank-kill 'isearch-command t)
1277 (put 'isearch-yank-sexp 'isearch-command t) 1287 (put 'isearch-yank-sexp 'isearch-command t)
1278 (put 'isearch-*-char 'isearch-command t) 1288 (put 'isearch-*-char 'isearch-command t)
1279 (put 'isearch-*-char 'isearch-command t) 1289 (put 'isearch-*-char 'isearch-command t)
1280 (put 'isearch-|-char 'isearch-command t) 1290 (put 'isearch-|-char 'isearch-command t)
1281 (put 'isearch-toggle-regexp 'isearch-command t) 1291 (put 'isearch-toggle-regexp 'isearch-command t)