all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Scott Frazer <frazer.scott@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: keyboard regexp shortcuts
Date: Fri, 17 Aug 2012 14:04:25 -0400	[thread overview]
Message-ID: <k0m133$fr6$1@ger.gmane.org> (raw)
In-Reply-To: <5C3FB161-5143-43E7-BF06-84B0D72468E0@gmail.com>

On 8/17/12 10:20 AM, Perry Smith wrote:
> Very often, I do a regex search (M-C-s) of \_<foo\_> because I don't want to find bad_foo_dog.
>
> Typing the \ _ < and \ _ > is tedious.  Can someone suggest a way to make that easier?
>
> Thank you,
> Perry
>

Here's what I use:

(defun my-isearch-word ()
   "Surround current input with word/symbol delimiters and turn on regexp matching if necessary."
   (interactive)
   (unless isearch-regexp
     (isearch-toggle-regexp))
   (setq isearch-string (concat "\\_<" isearch-string "\\_>")
         isearch-message (mapconcat 'isearch-text-char-description isearch-string ""))
   (isearch-search-and-update))

(define-key isearch-mode-map (kbd "M-w") 'my-isearch-word)





  reply	other threads:[~2012-08-17 18:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-17 14:20 keyboard regexp shortcuts Perry Smith
2012-08-17 18:04 ` Scott Frazer [this message]
2012-08-17 18:54   ` Jambunathan K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='k0m133$fr6$1@ger.gmane.org' \
    --to=frazer.scott@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.