help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Underscore in filenames and M-x locate


From: Kevin Rodgers
Subject: Re: Underscore in filenames and M-x locate
Date: Fri, 04 May 2007 00:54:00 -0600
User-agent: Thunderbird 1.5.0.10 (Macintosh/20070221)

Holger Sparr wrote:
Kevin Rodgers wrote:

Holger Sparr wrote:
When using M-x locate the default pattern to use is evaluated by
`locate-word-at-point'.
Why isn't the Underscore included in the expression of characters to
skip for a sensible default value?
Uh, because underscore is not a _word_ constituent character?
Still, locate-word-at-point could be changed to use \sw instead
of [-a-zA-Z0-9.]

Neither is [.].

Indeed, nor is [-].

Possibly the expression could be customized by the user or the active
region could be passed as the search-string.
You could try:

(require 'locate)
(defalias 'locate-word-at-point 'word-at-point)
(autoload 'word-at-point "thingatpt")

or:

(require 'locate)
(defalias 'locate-word-at-point
          (lambda () (symbol-name symbol-at-point)))

Of course I can do that. But if "_" is a proper character in filenames
then why not change the default.

I guess I took "word" in the name of the function too literally.  But if
you want to match any valid file name character, it's simpler to exclude
the few invalid characters (NULL, slash, perhaps colon, etc. depending
on the platform).

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

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