aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJuri Linkov <[email protected]>2008-12-18 01:17:07 +0000
committerJuri Linkov <[email protected]>2008-12-18 01:17:07 +0000
commitb87573f01cdcad6c706fa76a1e7a68ecb1d95eb8 (patch)
tree49399fd29bd0f88048314e9fc12daed49e7d79f3 /lisp
parent579d2d62aa3cee4a06a4488bd7f6d0b6d4450056 (diff)
(minibuffer-local-isearch-map): Unbind "C-w" from
`isearch-edit-string-set-word'. (isearch-edit-string-set-word): Remove. (isearch-occur): Imitate the C function `wordify' by replacing non-word character with the \\W+ regexp. (isearch-search-fun): Add `isearch-nonincremental' to the condition of using a non-lax version of `word-search-forward'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/isearch.el31
2 files changed, 24 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3a3657b4b8..87f319c397 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
+2008-12-18 Juri Linkov <[email protected]>
+
+ * isearch.el (minibuffer-local-isearch-map): Unbind "C-w" from
+ `isearch-edit-string-set-word'.
+ (isearch-edit-string-set-word): Remove.
+ (isearch-occur): Imitate the C function `wordify' by replacing
+ non-word character with the \\W+ regexp.
+ (isearch-search-fun): Add `isearch-nonincremental' to the
+ condition of using a non-lax version of `word-search-forward'.
+
2008-12-17 Daiki Ueno <[email protected]>
* epa-file.el (epa-file-insert-file-contents): Set
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 1e0b49bc14..c65fb1a414 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -509,7 +509,6 @@ This is like `describe-bindings', but displays only Isearch keys."
(define-key map "\M-\t" 'isearch-complete-edit)
(define-key map "\C-s" 'isearch-forward-exit-minibuffer)
(define-key map "\C-r" 'isearch-reverse-exit-minibuffer)
- (define-key map "\C-w" 'isearch-edit-string-set-word)
(define-key map "\C-f" 'isearch-yank-char-in-minibuffer)
(define-key map [right] 'isearch-yank-char-in-minibuffer)
map)
@@ -1194,15 +1193,6 @@ If first char entered is \\[isearch-yank-word-or-char], then do word search inst
(isearch-abort) ;; outside of let to restore outside global values
)))
-;; Obsolete usage of `C-s M-e C-w'. Remove after 23.1.
-(defvar isearch-new-word)
-(defun isearch-edit-string-set-word ()
- "Do word search after exiting `isearch-edit-string'."
- (interactive)
- (message "This feature is obsolete since 23.1; use `M-s w' instead.")
- (setq isearch-word t isearch-new-word t))
-
-
(defun isearch-nonincremental-exit-minibuffer ()
(interactive)
(setq isearch-nonincremental t)
@@ -1395,7 +1385,12 @@ string. NLINES has the same meaning as in `occur'."
(interactive
(list
(cond
- (isearch-word (concat "\\b" (regexp-quote isearch-string) "\\b"))
+ (isearch-word (concat "\\b" (replace-regexp-in-string
+ "\\W+" "\\W+"
+ (replace-regexp-in-string
+ "^\\W+\\|\\W+$" "" isearch-string)
+ nil t)
+ "\\b"))
(isearch-regexp isearch-string)
(t (regexp-quote isearch-string)))
(if current-prefix-arg (prefix-numeric-value current-prefix-arg))))
@@ -2200,12 +2195,14 @@ Can be changed via `isearch-search-fun-function' for special needs."
(funcall isearch-search-fun-function)
(cond
(isearch-word
- ;; Use lax versions to not fail at the end of the word while the user
- ;; adds and removes characters in the search string
- (if (not (eq (length isearch-string)
- (length (isearch-string-state (car isearch-cmds)))))
- (if isearch-forward 'word-search-forward-lax 'word-search-backward-lax)
- (if isearch-forward 'word-search-forward 'word-search-backward)))
+ ;; Use lax versions to not fail at the end of the word while
+ ;; the user adds and removes characters in the search string
+ ;; (or when using nonincremental word isearch)
+ (if (or isearch-nonincremental
+ (eq (length isearch-string)
+ (length (isearch-string-state (car isearch-cmds)))))
+ (if isearch-forward 'word-search-forward 'word-search-backward)
+ (if isearch-forward 'word-search-forward-lax 'word-search-backward-lax)))
(isearch-regexp
(if isearch-forward 're-search-forward 're-search-backward))
(t