From 1ddb2ea0f3425c5eb53dff1a6703ebb73f41f622 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Fri, 21 May 2010 01:33:09 +0300 Subject: [PATCH] * isearch.el (isearch-yank-word-or-char): Pull next subword when `subword-mode' is activated. (Bug#6220) --- lisp/ChangeLog | 5 +++++ lisp/isearch.el | 8 ++++++-- lisp/progmodes/subword.el | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 15dc5d2aa9..4735ee6000 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-12-15 Masatake YAMATO + + * isearch.el (isearch-yank-word-or-char): Pull next subword + when `subword-mode' is activated. (Bug#6220) + 2010-05-20 Mark A. Hershberger * isearch.el (isearch-update-post-hook): New hook. diff --git a/lisp/isearch.el b/lisp/isearch.el index c44238ede2..ea5836edc4 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1540,14 +1540,18 @@ or it might return the position of the end of the line." (interactive "p") (isearch-yank-internal (lambda () (forward-char arg) (point)))) +(declare-function subword-forward "subword" (&optional arg)) (defun isearch-yank-word-or-char () - "Pull next character or word from buffer into search string." + "Pull next character, subword or word from buffer into search string. +Subword is used when `subword-mode' is activated. " (interactive) (isearch-yank-internal (lambda () (if (or (= (char-syntax (or (char-after) 0)) ?w) (= (char-syntax (or (char-after (1+ (point))) 0)) ?w)) - (forward-word 1) + (if (and (boundp 'subword-mode) subword-mode) + (subword-forward 1) + (forward-word 1)) (forward-char 1)) (point)))) (defun isearch-yank-word () diff --git a/lisp/progmodes/subword.el b/lisp/progmodes/subword.el index 4081791ae2..7df42c8b9a 100644 --- a/lisp/progmodes/subword.el +++ b/lisp/progmodes/subword.el @@ -76,7 +76,7 @@ ;; the old `c-forward-into-nomenclature' originally contributed by ;; Terry_Glanfield dot Southern at rxuk dot xerox dot com. -;; TODO: ispell-word and subword oriented C-w in isearch. +;; TODO: ispell-word. ;;; Code: -- 2.20.1