unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Underscore in filenames and M-x locate
@ 2007-05-02 14:13 Holger Sparr
  2007-05-03  6:19 ` Kevin Rodgers
       [not found] ` <mailman.157.1178173621.32220.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Holger Sparr @ 2007-05-02 14:13 UTC (permalink / raw)
  To: help-gnu-emacs


Hi,

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?

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



Holger

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Underscore in filenames and M-x locate
  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>
  1 sibling, 0 replies; 6+ messages in thread
From: Kevin Rodgers @ 2007-05-03  6:19 UTC (permalink / raw)
  To: help-gnu-emacs

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.]

In any case, apparently it's been that way since Peter Breton's
original implementation on 2000-03-30.

> 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)))

-- 
Kevin Rodgers
Denver, Colorado, USA

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Underscore in filenames and M-x locate
       [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
       [not found]     ` <mailman.210.1178262073.32220.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Holger Sparr @ 2007-05-03  7:48 UTC (permalink / raw)
  To: help-gnu-emacs


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 [.]. 

>> 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.

Thanks for your answer.

Holger

-- 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Underscore in filenames and M-x locate
  2007-05-03  7:48   ` Holger Sparr
@ 2007-05-04  6:54     ` Kevin Rodgers
       [not found]     ` <mailman.210.1178262073.32220.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 6+ messages in thread
From: Kevin Rodgers @ 2007-05-04  6:54 UTC (permalink / raw)
  To: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Proposal for new default (was: Underscore in filenames and M-x locate)
       [not found]     ` <mailman.210.1178262073.32220.help-gnu-emacs@gnu.org>
@ 2007-05-04 10:29       ` Holger Sparr
  2007-05-04 14:08         ` Peter Dyballa
  0 siblings, 1 reply; 6+ messages in thread
From: Holger Sparr @ 2007-05-04 10:29 UTC (permalink / raw)
  To: help-gnu-emacs


The addressed issue in the original post is really a minor problem.
Still I think, that including the Underscore character would be right
when using M-x locate with locate-word-at-point for a sensible default.

To whom do I have to direct my proposal?  Is the author to be contacted
or should this be mentioned in another group/mailing list? 

Thanks,
Holger


-- 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Proposal for new default (was: Underscore in filenames and M-x locate)
  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
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2007-05-04 14:08 UTC (permalink / raw)
  To: Holger Sparr; +Cc: help-gnu-emacs


Am 04.05.2007 um 12:29 schrieb Holger Sparr:

> To whom do I have to direct my proposal?  Is the author to be  
> contacted
> or should this be mentioned in another group/mailing list?

I'd write to the author. If, in this case, he accepts the change,  
then others on the GNU Emacs developers list will comment on it.

--
Mit friedvollen Grüßen

   Pete      <\
              _\     O  _
             |o \  _\\_/-\='
_____________(_)|-(_)  (_)___________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-05-04 14:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
     [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

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).