all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* how to make find-file treat space/dashes like any other character?
@ 2019-05-30 14:58 Thouis (Ray) Jones
  2019-05-30 17:36 ` Emanuel Berg via help-gnu-emacs
  0 siblings, 1 reply; 2+ messages in thread
From: Thouis (Ray) Jones @ 2019-05-30 14:58 UTC (permalink / raw)
  To: help-gnu-emacs

Is there an easy way to configure find-file and its ilk to treat spaces &
dashes like any other character in file completion?

If I have three files in a directory with names:
abc 123.txt
abc-123.txt
abc_123.txt

Completing filenames from "abc" in find-file will preferentially choose the
first, then the second, then the last.  I'd like for it to treat each of
these the same (stopping at "abc" and prompting with a list of completions).

It looks like this might be hard-coded in completion--try-word-completion,
and I've started to try to write defadvice for this function, but am hoping
there is an easier way.

Thanks,
Thouis Jones


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

* Re: how to make find-file treat space/dashes like any other character?
  2019-05-30 14:58 how to make find-file treat space/dashes like any other character? Thouis (Ray) Jones
@ 2019-05-30 17:36 ` Emanuel Berg via help-gnu-emacs
  0 siblings, 0 replies; 2+ messages in thread
From: Emanuel Berg via help-gnu-emacs @ 2019-05-30 17:36 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: Ingemar Holmgren

Thouis (Ray) Jones wrote:

> Is there an easy way to configure find-file
> and its ilk to treat spaces & dashes like any
> other character in file completion?
>
> If I have three files in a directory with names:
> abc 123.txt
> abc-123.txt
> abc_123.txt

UAAAH!

Spaces in filenames are strictly forbidden! [1]

Dashes are the way to go. Even more so, it is
the-way-to-go!

Underscores are the_way_to_go when there is
a tradition behind it, e.g.
the C programming language.

> Completing filenames from "abc" in find-file
> will preferentially choose the first, then
> the second, then the last. I'd like for it to
> treat each of these the same (stopping at
> "abc" and prompting with a list of
> completions).

I just set up a test directory and touch(1)ed
3 files with the exact same filenames you
mention. Then I did `find-file', wrote "abc",
and when I hit TAB, I got a list of
completions, including all three files, just
as expected.

I wonder why you don't? :O


[1] RFC Emanuel Berg

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




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

end of thread, other threads:[~2019-05-30 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-30 14:58 how to make find-file treat space/dashes like any other character? Thouis (Ray) Jones
2019-05-30 17:36 ` Emanuel Berg via help-gnu-emacs

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.