unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Underscore in filenames and M-x locate
Date: Fri, 04 May 2007 00:54:00 -0600	[thread overview]
Message-ID: <f1ela5$7tt$1@sea.gmane.org> (raw)
In-Reply-To: <lnslae2vqz.fsf@mfk.tu-dresden.de>

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	other threads:[~2007-05-04  6:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-02 14:13 Underscore in filenames and M-x locate Holger Sparr
2007-05-03  6:19 ` Kevin Rodgers
     [not found] ` <mailman.157.1178173621.32220.help-gnu-emacs@gnu.org>
2007-05-03  7:48   ` Holger Sparr
2007-05-04  6:54     ` Kevin Rodgers [this message]
     [not found]     ` <mailman.210.1178262073.32220.help-gnu-emacs@gnu.org>
2007-05-04 10:29       ` Proposal for new default (was: Underscore in filenames and M-x locate) Holger Sparr
2007-05-04 14:08         ` Peter Dyballa

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='f1ela5$7tt$1@sea.gmane.org' \
    --to=kevin.d.rodgers@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).