emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Occur in Word Isearch


From: Juri Linkov
Subject: Occur in Word Isearch
Date: Sun, 09 Nov 2008 23:09:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu)

`M-s w word M-s o' displays a *Occur* buffer with wrong matches because
it takes no care about word boundaries.  The following patch should fix this.

Index: lisp/isearch.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/isearch.el,v
retrieving revision 1.331
diff -c -r1.331 isearch.el
*** lisp/isearch.el     19 Oct 2008 22:33:17 -0000      1.331
--- lisp/isearch.el     9 Nov 2008 21:07:54 -0000
***************
*** 1384,1390 ****
  string.  NLINES has the same meaning as in `occur'."
    (interactive
     (list
!     (if isearch-regexp isearch-string (regexp-quote isearch-string))
      (if current-prefix-arg (prefix-numeric-value current-prefix-arg))))
    (let ((case-fold-search isearch-case-fold-search)
        ;; set `search-upper-case' to nil to not call
--- 1390,1399 ----
  string.  NLINES has the same meaning as in `occur'."
    (interactive
     (list
!     (cond
!      (isearch-word (concat "\\b" (regexp-quote isearch-string) "\\b"))
!      (isearch-regexp isearch-string)
!      (t (regexp-quote isearch-string)))
      (if current-prefix-arg (prefix-numeric-value current-prefix-arg))))
    (let ((case-fold-search isearch-case-fold-search)
        ;; set `search-upper-case' to nil to not call

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]