unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Karl Fogel <kfogel@floss.red-bean.com>
Cc: emacs-devel@gnu.org
Subject: Re: isearch-yank-char
Date: 30 Apr 2004 13:57:37 -0500	[thread overview]
Message-ID: <874qr15m5a.fsf@floss.red-bean.com> (raw)
In-Reply-To: <87u0z1xasi.fsf@mail.jurta.org>

Juri Linkov <juri@jurta.org> writes:
> Karl Fogel <kfogel@floss.red-bean.com> writes:
> > Thanks!  I'll try it out.
> >
> > Is this your full patch?  If there's more, post it & I'll test with
> > that (i.e., including the keybindings and anything else).
> 
> The full patch is below:

Interesting!  This patch goes further, and changes C-w back to
'isearch-yank-word' (instead of 'isearch-yank-word-or-char').

I'm not sure whether it's good or bad.  Just wanted to point out that
this patch implements something slightly different from the proposal I
made.  (Nothing wrong with implementing a different proposal, as long
as people know what it is.)

Thanks for posting, I'm sure I won't be the only one testing this.

-Karl


> Index: lisp/isearch.el
> ===================================================================
> RCS file: /cvsroot/emacs/emacs/lisp/isearch.el,v
> retrieving revision 1.226
> retrieving revision 1.227
> diff -c -r1.226 -r1.227
> *** lisp/isearch.el	4 Mar 2004 16:54:08 -0000	1.226
> --- lisp/isearch.el	29 Apr 2004 15:28:55 -0000	1.227
> ***************
> *** 294,300 ****
>       (define-key map " " 'isearch-whitespace-chars)
>       (define-key map [?\S-\ ] 'isearch-whitespace-chars)
>   
> !     (define-key map "\C-w" 'isearch-yank-word-or-char)
>       (define-key map "\C-y" 'isearch-yank-line)
>   
>       ;; Define keys for regexp chars * ? |.
> --- 294,302 ----
>       (define-key map " " 'isearch-whitespace-chars)
>       (define-key map [?\S-\ ] 'isearch-whitespace-chars)
>   
> !     (define-key map "\C-b" 'isearch-del-char)
> !     (define-key map "\C-f" 'isearch-yank-char)
> !     (define-key map "\C-w" 'isearch-yank-word)
>       (define-key map "\C-y" 'isearch-yank-line)
>   
>       ;; Define keys for regexp chars * ? |.
> ***************
> *** 448,459 ****
>   As you type characters, they add to the search string and are found.
>   The following non-printing keys are bound in `isearch-mode-map'.
>   
> ! Type \\[isearch-delete-char] to cancel characters from end of search string.
>   Type \\[isearch-exit] to exit, leaving point at location found.
>   Type LFD (C-j) to match end of line.
>   Type \\[isearch-repeat-forward] to search again forward,\
>    \\[isearch-repeat-backward] to search again backward.
> ! Type \\[isearch-yank-word-or-char] to yank word from buffer onto end of search\
>    string and search for it.
>   Type \\[isearch-yank-line] to yank rest of line onto end of search string\
>    and search for it.
> --- 450,464 ----
>   As you type characters, they add to the search string and are found.
>   The following non-printing keys are bound in `isearch-mode-map'.
>   
> ! Type \\[isearch-delete-char] to cancel last input item from end of search string.
> ! Type \\[isearch-del-char] to cancel last character from end of search string.
>   Type \\[isearch-exit] to exit, leaving point at location found.
>   Type LFD (C-j) to match end of line.
>   Type \\[isearch-repeat-forward] to search again forward,\
>    \\[isearch-repeat-backward] to search again backward.
> ! Type \\[isearch-yank-char] to yank character from buffer onto end of search\
> !  string and search for it.
> ! Type \\[isearch-yank-word] to yank word from buffer onto end of search\
>    string and search for it.
>   Type \\[isearch-yank-line] to yank rest of line onto end of search string\
>    and search for it.
> ***************
> *** 486,492 ****
>   you want to use.
>   
>   The above keys, bound in `isearch-mode-map', are often controlled by
> !  options; do M-x apropos on search-.* to find them.
>   Other control and meta characters terminate the search
>    and are then executed normally (depending on `search-exit-option').
>   Likewise for function keys and mouse button events.
> --- 491,497 ----
>   you want to use.
>   
>   The above keys, bound in `isearch-mode-map', are often controlled by
> !  options; do \\[apropos] on search-.* to find them.
>   Other control and meta characters terminate the search
>    and are then executed normally (depending on `search-exit-option').
>   Likewise for function keys and mouse button events.
> ***************
> *** 789,795 ****
>   \\[isearch-ring-retreat-edit] to replace the search string with the previous item in the search ring.
>   \\[isearch-complete-edit] to complete the search string using the search ring.
>   \\<isearch-mode-map>
> ! If first char entered is \\[isearch-yank-word-or-char], then do word search instead."
>   
>     ;; This code is very hairy for several reasons, explained in the code.
>     ;; Mainly, isearch-mode must be terminated while editing and then restarted.
> --- 794,800 ----
>   \\[isearch-ring-retreat-edit] to replace the search string with the previous item in the search ring.
>   \\[isearch-complete-edit] to complete the search string using the search ring.
>   \\<isearch-mode-map>
> ! If first char entered is \\[isearch-yank-word], then do word search instead."
>   
>     ;; This code is very hairy for several reasons, explained in the code.
>     ;; Mainly, isearch-mode must be terminated while editing and then restarted.
> ***************
> *** 1053,1058 ****
> --- 1058,1073 ----
>       (isearch-pop-state))
>     (isearch-update))
>   
> + (defun isearch-del-char ()
> +   "Discard last character and move point back.
> + If there is no previous character, just beep."
> +   (interactive)
> +   (if (equal isearch-string "")
> +       (ding)
> +     (setq isearch-string (substring isearch-string 0 -1)
> +           isearch-message (mapconcat 'isearch-text-char-description
> +                                      isearch-string "")))
> +   (isearch-search-and-update))
>   
>   (defun isearch-yank-string (string)
>     "Pull STRING into search string."
> ***************
> *** 1114,1120 ****
>        (buffer-substring-no-properties (point) (funcall jumpform)))))
>   
>   (defun isearch-yank-char ()
> !   "Pull next letter from buffer into search string."
>     (interactive)
>     (isearch-yank-internal (lambda () (forward-char 1) (point))))
>   
> --- 1129,1135 ----
>        (buffer-substring-no-properties (point) (funcall jumpform)))))
>   
>   (defun isearch-yank-char ()
> !   "Pull next character from buffer into search string."
>     (interactive)
>     (isearch-yank-internal (lambda () (forward-char 1) (point))))
> 
> -- 
> Juri Linkov
> http://www.jurta.org/emacs/

  reply	other threads:[~2004-04-30 18:57 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-26  4:42 isearch-yank-char Juri Linkov
2004-04-25 23:03 ` isearch-yank-char Karl Fogel
2004-04-25 23:17   ` isearch-yank-char Karl Fogel
2004-04-26  6:15   ` isearch-yank-char Juri Linkov
2004-04-26 14:10 ` isearch-yank-char Richard Stallman
2004-04-26 22:42 ` isearch-yank-char Stefan Monnier
2004-04-26 23:03   ` isearch-yank-char Miles Bader
2004-04-26 22:48     ` isearch-yank-char Karl Fogel
2004-04-27  8:09       ` isearch-yank-char Juri Linkov
2004-04-27  9:11         ` isearch-yank-char Juri Linkov
2004-04-27  9:41         ` isearch-yank-char David Kastrup
2004-04-27 22:49           ` isearch-yank-char Karl Fogel
2004-04-28  5:04           ` isearch-yank-char Juri Linkov
2004-04-29 22:08             ` isearch-yank-char Karl Fogel
2004-04-30  4:48               ` isearch-yank-char Juri Linkov
2004-04-29 22:53                 ` isearch-yank-char Karl Fogel
2004-04-30  8:27                   ` isearch-yank-char Juri Linkov
2004-04-30 11:23                     ` isearch-yank-char Romain Francoise
2004-04-30 13:47                     ` isearch-yank-char Karl Fogel
2004-04-30 20:55                       ` isearch-yank-char Juri Linkov
2004-04-30 17:34                         ` isearch-yank-char Karl Fogel
2004-05-01  0:15                           ` isearch-yank-char Juri Linkov
2004-04-30 18:57                             ` Karl Fogel [this message]
2004-05-01  1:04                               ` isearch-yank-char Juri Linkov
2004-05-01 20:02                                 ` isearch-yank-char Kim F. Storm
2004-05-02 11:32                                   ` isearch-yank-char Juri Linkov
2004-05-03 12:40                                 ` isearch-yank-char Robert J. Chassell
2004-05-02 11:19                               ` isearch-yank-char Richard Stallman
2004-05-03 19:24                                 ` isearch-yank-char Karl Fogel
2004-05-04 20:08                                   ` isearch-yank-char Richard Stallman
2004-04-30  8:31               ` isearch-yank-char Alan Mackenzie
2004-04-30  9:52                 ` isearch-yank-char Juri Linkov
2004-04-30 10:12                 ` isearch-yank-char Miles Bader
2004-04-30 13:58                 ` isearch-yank-char Karl Fogel
2004-04-27  9:36       ` isearch-yank-char Kim F. Storm
2004-04-28  5:02   ` isearch-yank-char Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874qr15m5a.fsf@floss.red-bean.com \
    --to=kfogel@floss.red-bean.com \
    --cc=emacs-devel@gnu.org \
    --cc=kfogel@red-bean.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).