From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: Re: yank char by char onto end of search string Date: Fri, 28 Nov 2003 09:27:55 +0200 Organization: JURTA Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87y8u17y10.fsf@mail.jurta.org> References: <873cc9dxel.fsf@jidanni.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1070004808 4908 80.91.224.253 (28 Nov 2003 07:33:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 28 Nov 2003 07:33:28 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 28 08:33:25 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1APd80-0005uT-00 for ; Fri, 28 Nov 2003 08:33:25 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1APe42-0001Pe-44 for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Nov 2003 03:33:22 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1APe3x-0001NS-Ov for bug-gnu-emacs@gnu.org; Fri, 28 Nov 2003 03:33:17 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1APe3E-0008Bb-R9 for bug-gnu-emacs@gnu.org; Fri, 28 Nov 2003 03:33:03 -0500 Original-Received: from [64.246.52.22] (helo=ns5.tangramltd.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1APe2x-0007Tn-Cp for bug-gnu-emacs@gnu.org; Fri, 28 Nov 2003 03:32:15 -0500 Original-Received: from 80-235-35-71-dsl.mus.estpak.ee ([80.235.35.71] helo=mail.jurta.org) by ns5.tangramltd.com with esmtp (Exim 4.20) id 1APd5P-00016J-QM; Fri, 28 Nov 2003 09:30:44 +0200 Original-To: Dan Jacobson In-Reply-To: <873cc9dxel.fsf@jidanni.org> (Dan Jacobson's message of "Fri, 28 Nov 2003 10:44:50 +0800") User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ns5.tangramltd.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jurta.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:6209 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:6209 Dan Jacobson writes: > Gentlemen, > C-s runs the command isearch-forward... > Type C-w to yank word from buffer onto end of search string and search for it. > Type C-y to yank rest of line onto end of search string and search for it. > Yes, but how about also providing a key to just yank one character at a time?! > Indeed, often a whole word is just to much. Why, how could Stallman > never have though of this? I've already used isearch yank char feature for years. Here is what I have in my .emacs: ,---- | (define-key isearch-mode-map "\C-f" 'isearch-yank-char) | (defun isearch-yank-char () | "Pull next character from buffer into search string." | (interactive) | (isearch-yank-string | (save-excursion | (and (not isearch-forward) isearch-other-end | (goto-char isearch-other-end)) | (buffer-substring (point) (min (1+ (point)) (point-max)))))) `---- Sorry, I have not yet submitted a patch for isearch.el [I have many other unsubmitted enhancements too]. Even though isearch in CVS already has a new function isearch-yank-word-or-char that uses a heuristic to decide to grab either a character or a word, it rarely guesses it right. Most often there is a need to search only a part of word, for example, to search all forms of a word (both singular and plural forms, all inflected verbs, etc.) To do this the function `isearch-yank-char' is needed to yank a whole word char by char without ending (such as "-s", "-ing", "-ed"). Very often this function is useful to yank a word without final single quote (') which in some syntaxes is part of a word. -- http://www.jurta.org/emacs/