/[emacs]/emacs/lisp/isearch.el
ViewVC logotype

Diff of /emacs/lisp/isearch.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.200 by rms, Mon Nov 19 06:21:29 2001 UTC revision 1.201 by kfogel, Wed Nov 28 22:34:20 2001 UTC
# Line 1073  Otherwise invoke whatever mouse-2 is bou Line 1073  Otherwise invoke whatever mouse-2 is bou
1073            (funcall binding click))))))            (funcall binding click))))))
1074    
1075    
1076  (defun isearch-yank-word ()  (defun isearch-yank-internal (jumpform)
1077    "Pull next word from buffer into search string."    "Pull the text from point to the point reached by JUMPFORM.
1078    (interactive)  JUMPFORM is a lambda expression that takes no arguments and returns a
1079    buffer position, possibly having moved point to that position.  For
1080    example, it might move point forward by a word and return point, or it
1081    might return the position of the end of the line."
1082    (isearch-yank-string    (isearch-yank-string
1083     (save-excursion     (save-excursion
1084       (and (not isearch-forward) isearch-other-end       (and (not isearch-forward) isearch-other-end
1085            (goto-char isearch-other-end))            (goto-char isearch-other-end))
1086       (buffer-substring-no-properties       (buffer-substring-no-properties (point) (funcall jumpform)))))
1087        (point) (progn (forward-word 1) (point))))))  
1088    (defun isearch-yank-char ()
1089      "Pull next letter from buffer into search string."
1090      (interactive)
1091      (isearch-yank-internal (lambda () (forward-char 1) (point))))
1092    
1093    (defun isearch-yank-word ()
1094      "Pull next word from buffer into search string."
1095      (interactive)
1096      (isearch-yank-internal (lambda () (forward-word 1) (point))))
1097    
1098  (defun isearch-yank-line ()  (defun isearch-yank-line ()
1099    "Pull rest of line from buffer into search string."    "Pull rest of line from buffer into search string."
1100    (interactive)    (interactive)
1101    (isearch-yank-string    (isearch-yank-internal (lambda () (line-end-position))))
    (save-excursion  
      (and (not isearch-forward) isearch-other-end  
           (goto-char isearch-other-end))  
      (buffer-substring-no-properties (point) (line-end-position)))))  
1102    
1103    
1104  (defun isearch-search-and-update ()  (defun isearch-search-and-update ()

Legend:
Removed from v.1.200  
changed lines
  Added in v.1.201

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26