unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* substitute-in-file-name is not distributive
@ 2012-10-10  5:36 Daniel Colascione
  2012-10-10  6:39 ` Andreas Schwab
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Daniel Colascione @ 2012-10-10  5:36 UTC (permalink / raw)
  To: Emacs development discussions

[-- Attachment #1: Type: text/plain, Size: 1392 bytes --]

I wrote a bit of code to handle Windows paths in being given to
read-file-name in a Cygwin Emacs --- it's just a simple
file-name-handler-alist entry that overrides substitute-in-file-name
for Windows paths to yield the corresponding Cygwin path. Why not view
Windows path syntax as a funky way to "quote" Cygwin paths? This
approach works fine, except for completion.

The trouble is that the core completion code makes unwarranted
assumptions about the behavior of expand-in-file-name. Specifically,
completion--tqw-all assumes that (equal (unquote (concat (qnew foo)
(qnew bar)) (unquote (quote (concat foo bar))). Why should that be the
case?

In my mockup, I'm trying to complete 'c:\'. I have a 'c:\bin';
converting the path 'c:\bin' to Cygwin yields "/usr/bin" on my
machine. The trouble is that when we try to get all the completions
for 'c:\', which "unquoted" is '/' on my machine. completion--tqw-all
wants to paste '/' and 'bin' together to yield '/bin', but my s-i-f-n
handler returns '/usr/bin', so completion--qw-all's last cl-assert fails.

I don't think it's fair to assume that substitute-in-file-name
distributes over all components of a path. Unfortunately, simply
removing the assertion causes mysterious failures elsewhere. The
assumption of a distributing s-i-f-n seems baked into the code.

Is there another way to do what I want here?




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 235 bytes --]

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

end of thread, other threads:[~2012-10-31  3:41 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-10  5:36 substitute-in-file-name is not distributive Daniel Colascione
2012-10-10  6:39 ` Andreas Schwab
2012-10-10 15:31 ` Eli Zaretskii
2012-10-10 16:48   ` Daniel Colascione
2012-10-10 17:18     ` Eli Zaretskii
2012-10-10 17:40       ` Daniel Colascione
2012-10-11  3:25   ` Stephen Leake
2012-10-25  3:20 ` Stefan Monnier
2012-10-25  3:28   ` Daniel Colascione
2012-10-27 16:08     ` Stefan Monnier
2012-10-28 19:09     ` Stefan Monnier
2012-10-30  4:10       ` Daniel Colascione
2012-10-30 13:15         ` Stefan Monnier
2012-10-30 15:01           ` Daniel Colascione
2012-10-30 18:58             ` Stefan Monnier
2012-10-30 20:12               ` Daniel Colascione
2012-10-30 21:24                 ` Stefan Monnier
2012-10-30 21:34                   ` Daniel Colascione
2012-10-31  3:41                     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

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

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