[Top][All Lists]

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

Re: incremental search

From: Stefan Monnier
Subject: Re: incremental search
Date: Thu, 23 Nov 2006 14:25:17 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> I usually switch to regexp incremental search when this happens.

> C-s \<man\>

Interestingly enough, isearch.el does have support for word search (via the
isearch-word variable), but I don't see any command that makes it available
to the user.

The code below allows you to toggle this state with M-w while in isearch.

(defun isearch-toggle-word ()
  "Toggle word searching on or off."
  ;; The status stack is left unchanged.
  (setq isearch-word (not isearch-word))
  (if isearch-word (setq isearch-regexp nil))
  (setq isearch-success t isearch-adjusted t)

(define-key isearch-mode-map "\M-w" 'isearch-toggle-word)

-- Stefan

reply via email to

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