Article View: gnu.emacs.bug
Article #99006C-w, C-y in isearch-backward
From: Joe Wells
Date: Thu, 20 Dec 1990 03:00
Date: Thu, 20 Dec 1990 03:00
83 lines
3351 bytes
3351 bytes
In article <9012172047.AA28399@life.ai.mit.edu> wilber@homxb.att.com writes:
When C-w is used inside of an incremental search, it copies the word
after the point into the search string buffer. That works fine for
isearch-forward. But for isearch-backward the point moves to the the
wrong place after C-w for it to work in a useful way.
I'm including my fix. It also contains a fix to make C-w quote the word
it's grabbing when in isearch-*-regexp.
--
Enjoy,
Joe Wells <jbw@bu.edu>
----------------------------------------------------------------------
*** /usr/local/emacs/lisp/isearch.el Tue Dec 8 18:11:03 1987
--- isearch.el Wed Dec 19 21:56:00 1990
***************
*** 77,81 ****
(found-start nil)
(opoint (point))
! (inhibit-quit t)) ;Prevent ^G from quitting immediately.
(isearch-push-state)
(save-window-excursion
--- 77,82 ----
(found-start nil)
(opoint (point))
! (inhibit-quit t) ;Prevent ^G from quitting immediately.
! (length-added nil))
(isearch-push-state)
(save-window-excursion
***************
*** 108,112 ****
?\C-g
(read-char))))
! (setq quit-flag nil adjusted nil)
;; Meta character means exit search.
(cond ((and (>= char 128)
--- 109,113 ----
?\C-g
(read-char))))
! (setq quit-flag nil adjusted nil length-added 0)
;; Meta character means exit search.
(cond ((and (>= char 128)
***************
*** 176,180 ****
--- 177,184 ----
(forward-word 1))
(point))))))
+ (if regexp
+ (setq word (regexp-quote word)))
(setq search-string (concat search-string word)
+ length-added (length word)
search-message
(concat search-message
***************
*** 200,203 ****
--- 204,208 ----
(setq search-string (concat search-string
(char-to-string char))
+ length-added 1
search-message (concat search-message
(text-char-description char)))))
***************
*** 243,248 ****
;; Not regexp, not reverse, or no match at point.
(if (and other-end (not adjusted))
! (goto-char (if forward other-end
! (min opoint barrier (1+ other-end)))))
(isearch-search)))
(isearch-push-state))))))
--- 248,258 ----
;; Not regexp, not reverse, or no match at point.
(if (and other-end (not adjusted))
! (goto-char
! (if forward
! other-end
! ;;(min opoint barrier
! (+ other-end length-added)
! ;;)
! )))
(isearch-search)))
(isearch-push-state))))))
Technical Details
Message-ID:
<9012200300.AA10190@bigbird.bu.edu>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!shelby!apple!julius.cs.uiuc.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!tut.cis.ohio-state.edu!BIGBIRD.BU.EDU!jbwShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,5676891e5c87a98c X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1990-12-19 19:00:18 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!shelby!apple!julius.cs.uiuc.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!tut.cis.ohio-state.edu!BIGBIRD.BU.EDU!jbw From: jbw@BIGBIRD.BU.EDU (Joe Wells) Newsgroups: gnu.emacs.bug Subject: C-w, C-y in isearch-backward Message-ID: <9012200300.AA10190@bigbird.bu.edu> Date: 20 Dec 90 03:00:18 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 83 Approved: bug-gnu-emacs@prep.ai.mit.edu