all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Ido and hosts named with a single letter.
@ 2006-11-26 20:00 Michaël Cadilhac
  2006-11-27  9:43 ` Kim F. Storm
  0 siblings, 1 reply; 9+ messages in thread
From: Michaël Cadilhac @ 2006-11-26 20:00 UTC (permalink / raw)



[-- Attachment #1.1.1: Type: text/plain, Size: 314 bytes --]


Try this :
emacs -Q
M-x ido-mode
C-x C-f /tmp

Everything's okey.
Now, do the same but before, add a line with a `w' in your known hosts:
echo w >> ~/.ssh/known_hosts

It will result in the error « Login failed ». Disgracious.

I propose the following patch, which makes ido allow such host names.


[-- Attachment #1.1.2: ido.patch --]
[-- Type: text/x-patch, Size: 3327 bytes --]

*** lisp/ido.el.~1.110.~	2006-10-16 14:42:24.000000000 +0200
--- lisp/ido.el	2006-11-24 18:31:06.000000000 +0100
***************
*** 2068,2074 ****
  	      (ido-set-current-directory (file-name-directory (substring ido-current-directory 0 -1))))
  	  (setq ido-set-default-item t))
  
! 	 ((and (string-match (if ido-enable-tramp-completion "..[:@]\\'" "..:\\'") ido-selected)
  	       (ido-is-root-directory)) ;; Ange-ftp or Tramp
  	  (ido-set-current-directory ido-current-directory ido-selected)
  	  (ido-trace "tramp prefix" ido-selected)
--- 2068,2074 ----
  	      (ido-set-current-directory (file-name-directory (substring ido-current-directory 0 -1))))
  	  (setq ido-set-default-item t))
  
! 	 ((and (string-match (if ido-enable-tramp-completion ".[:@]\\'" ".:\\'") ido-selected)
  	       (ido-is-root-directory)) ;; Ange-ftp or Tramp
  	  (ido-set-current-directory ido-current-directory ido-selected)
  	  (ido-trace "tramp prefix" ido-selected)
***************
*** 2426,2432 ****
       ((and (= 1 (length ido-matches))
  	   (not (and ido-enable-tramp-completion
  		     (string-equal ido-current-directory "/")
! 		     (string-match "..[@:]\\'" (ido-name (car ido-matches))))))
        ;; only one choice, so select it.
        (if (not ido-confirm-unique-completion)
  	  (exit-minibuffer)
--- 2426,2432 ----
       ((and (= 1 (length ido-matches))
  	   (not (and ido-enable-tramp-completion
  		     (string-equal ido-current-directory "/")
! 		     (string-match ".[@:]\\'" (ido-name (car ido-matches))))))
        ;; only one choice, so select it.
        (if (not ido-confirm-unique-completion)
  	  (exit-minibuffer)
***************
*** 3433,3439 ****
        (let ((default-directory ido-current-directory))
  	(ido-to-end ;; move ftp hosts and visited files to end
  	 (delq nil (mapcar
! 		    (lambda (x) (if (or (string-match "..:\\'" x)
  					(and (not (ido-final-slash x))
  					     (get-file-buffer x))) x))
  		    ido-temp-list)))))
--- 3433,3439 ----
        (let ((default-directory ido-current-directory))
  	(ido-to-end ;; move ftp hosts and visited files to end
  	 (delq nil (mapcar
! 		    (lambda (x) (if (or (string-match ".:\\'" x)
  					(and (not (ido-final-slash x))
  					     (get-file-buffer x))) x))
  		    ido-temp-list)))))
***************
*** 4149,4155 ****
  	    (setq refresh t))
  	  ))
  
! 	 ((and (string-match (if ido-enable-tramp-completion "..[:@]\\'" "..:\\'") contents)
  	       (ido-is-root-directory)) ;; Ange-ftp or tramp
  	  (ido-set-current-directory ido-current-directory contents)
  	  (when (ido-is-slow-ftp-host)
--- 4149,4155 ----
  	    (setq refresh t))
  	  ))
  
! 	 ((and (string-match (if ido-enable-tramp-completion ".[:@]\\'" ".:\\'") contents)
  	       (ido-is-root-directory)) ;; Ange-ftp or tramp
  	  (ido-set-current-directory ido-current-directory contents)
  	  (when (ido-is-slow-ftp-host)
*** lisp/ChangeLog.~1.10261.~	2006-11-06 15:42:02.000000000 +0100
--- lisp/ChangeLog	2006-11-24 18:34:40.000000000 +0100
***************
*** 0 ****
--- 1,5 ----
+ 2006-11-24  Michaël Cadilhac  <michael.cadilhac@lrde.org>
+ 
+ 	* ido.el (ido-read-internal): Allow single letter named hosts.
+ 	(ido-complete, ido-make-file-list, ido-exhibit): Ditto.
+ 

[-- Attachment #1.1.3: Type: text/plain, Size: 403 bytes --]


TIA!

-- 
/!\ My mail address has changed, please update your files accordingly.
 |      Michaël `Micha' Cadilhac   |  In a World without Walls and Fences,  |
 |         Epita/LRDE Promo 2007   |     who needs Windows and Gates?       |
 |  http://michael.cadilhac.name   |          -- Dino Esposito              |
 `--  -   JID: micha@amessage.be --'                                   -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: Ido and hosts named with a single letter.
  2006-11-26 20:00 Ido and hosts named with a single letter Michaël Cadilhac
@ 2006-11-27  9:43 ` Kim F. Storm
  2006-11-27 17:04   ` Michaël Cadilhac
  0 siblings, 1 reply; 9+ messages in thread
From: Kim F. Storm @ 2006-11-27  9:43 UTC (permalink / raw)
  Cc: emacs-devel

michael@cadilhac.name (Michaël Cadilhac) writes:

> Try this :
> emacs -Q
> M-x ido-mode
> C-x C-f /tmp
>
> Everything's okey.
> Now, do the same but before, add a line with a `w' in your known hosts:
> echo w >> ~/.ssh/known_hosts
>
> It will result in the error « Login failed ». Disgracious.

Thank you for the report.

>
> I propose the following patch, which makes ido allow such host names.

I have not checked, but IIRC, the .. is deliberate.

I would fear that this change will break ido on Windoze as it may then
confuse single letter hostnames and drive letters, e.g. c: vs. c: ...

I'll look for another way to fix this.


-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: Ido and hosts named with a single letter.
  2006-11-27  9:43 ` Kim F. Storm
@ 2006-11-27 17:04   ` Michaël Cadilhac
  2006-11-28  8:58     ` Kim F. Storm
  2006-11-30 20:52     ` Ido and hosts named with a single letter Kim F. Storm
  0 siblings, 2 replies; 9+ messages in thread
From: Michaël Cadilhac @ 2006-11-27 17:04 UTC (permalink / raw)
  Cc: emacs-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 677 bytes --]

storm@cua.dk (Kim F. Storm) writes:

> michael@cadilhac.name (Michaël Cadilhac) writes:
>
>> Try this :
>> emacs -Q
>> M-x ido-mode
>> C-x C-f /tmp
>>
>> Everything's okey.
>> Now, do the same but before, add a line with a `w' in your known hosts:
>> echo w >> ~/.ssh/known_hosts
>>
>> It will result in the error « Login failed ». Disgracious.

> IIRC, the .. is deliberate.
>
> I would fear that this change will break ido on Windoze as it may then
> confuse single letter hostnames and drive letters, e.g. c: vs. c: ...

You're completely right. The simpler solution is to not allow one
letter hostnames on MS Windows. 

Maybe with the following :


[-- Attachment #1.1.2: ido.patch --]
[-- Type: text/x-patch, Size: 3986 bytes --]

*** lisp/ido.el.~1.110.~	2006-10-16 14:42:24.000000000 +0200
--- lisp/ido.el	2006-11-27 16:58:30.000000000 +0100
***************
*** 1111,1116 ****
--- 1111,1122 ----
  ;; Set to 'ignore to inhibit switching between find-file/switch-buffer.
  (defvar ido-context-switch-command)
  
+ ;; Regexp that matches a hostname.
+ (defconst ido-hostname-regexp
+   (if (memq system-type '(ms-dos windows-nt))
+       ".."
+     "."))
+ 
  ;;; FUNCTIONS
  
  (defun ido-active (&optional merge)
***************
*** 2068,2074 ****
  	      (ido-set-current-directory (file-name-directory (substring ido-current-directory 0 -1))))
  	  (setq ido-set-default-item t))
  
! 	 ((and (string-match (if ido-enable-tramp-completion "..[:@]\\'" "..:\\'") ido-selected)
  	       (ido-is-root-directory)) ;; Ange-ftp or Tramp
  	  (ido-set-current-directory ido-current-directory ido-selected)
  	  (ido-trace "tramp prefix" ido-selected)
--- 2074,2082 ----
  	      (ido-set-current-directory (file-name-directory (substring ido-current-directory 0 -1))))
  	  (setq ido-set-default-item t))
  
! 	 ((and (string-match (concat ido-hostname-regexp
! 				     (if ido-enable-tramp-completion  "[:@]\\'" ":\\'"))
! 			     ido-selected)
  	       (ido-is-root-directory)) ;; Ange-ftp or Tramp
  	  (ido-set-current-directory ido-current-directory ido-selected)
  	  (ido-trace "tramp prefix" ido-selected)
***************
*** 2426,2432 ****
       ((and (= 1 (length ido-matches))
  	   (not (and ido-enable-tramp-completion
  		     (string-equal ido-current-directory "/")
! 		     (string-match "..[@:]\\'" (ido-name (car ido-matches))))))
        ;; only one choice, so select it.
        (if (not ido-confirm-unique-completion)
  	  (exit-minibuffer)
--- 2434,2441 ----
       ((and (= 1 (length ido-matches))
  	   (not (and ido-enable-tramp-completion
  		     (string-equal ido-current-directory "/")
! 		     (string-match (concat ido-hostname-regexp "[@:]\\'")
! 				   (ido-name (car ido-matches))))))
        ;; only one choice, so select it.
        (if (not ido-confirm-unique-completion)
  	  (exit-minibuffer)
***************
*** 3433,3439 ****
        (let ((default-directory ido-current-directory))
  	(ido-to-end ;; move ftp hosts and visited files to end
  	 (delq nil (mapcar
! 		    (lambda (x) (if (or (string-match "..:\\'" x)
  					(and (not (ido-final-slash x))
  					     (get-file-buffer x))) x))
  		    ido-temp-list)))))
--- 3442,3448 ----
        (let ((default-directory ido-current-directory))
  	(ido-to-end ;; move ftp hosts and visited files to end
  	 (delq nil (mapcar
! 		    (lambda (x) (if (or (string-match (concat ido-hostname-regexp ":\\'") x)
  					(and (not (ido-final-slash x))
  					     (get-file-buffer x))) x))
  		    ido-temp-list)))))
***************
*** 4149,4155 ****
  	    (setq refresh t))
  	  ))
  
! 	 ((and (string-match (if ido-enable-tramp-completion "..[:@]\\'" "..:\\'") contents)
  	       (ido-is-root-directory)) ;; Ange-ftp or tramp
  	  (ido-set-current-directory ido-current-directory contents)
  	  (when (ido-is-slow-ftp-host)
--- 4158,4166 ----
  	    (setq refresh t))
  	  ))
  
! 	 ((and (string-match (concat ido-hostname-regexp
! 				     (if ido-enable-tramp-completion "[:@]\\'" ":\\'"))
! 			     contents)
  	       (ido-is-root-directory)) ;; Ange-ftp or tramp
  	  (ido-set-current-directory ido-current-directory contents)
  	  (when (ido-is-slow-ftp-host)
*** lisp/ChangeLog.~1.10261.~	2006-11-06 15:42:02.000000000 +0100
--- lisp/ChangeLog	2006-11-27 17:00:03.000000000 +0100
***************
*** 0 ****
--- 1,7 ----
+ 2006-11-27  Michaël Cadilhac  <michael.cadilhac@lrde.org>
+ 
+ 	* ido.el (ido-hostname-regexp): New.  Regexp that matches a hostname.
+ 	(ido-read-internal): Use it, allowing single letter named hosts on non
+ 	MS Windows systems.
+ 	(ido-complete, ido-make-file-list, ido-exhibit): Ditto.
+ 

[-- Attachment #1.1.3: Type: text/plain, Size: 165 bytes --]



But it's probably better to do that : if the file actually exists (c:
should exist, I suppose), then use it. Otherwise, use tramp.

I can propose the following :


[-- Attachment #1.1.4: ido-2.patch --]
[-- Type: text/x-patch, Size: 4288 bytes --]

*** lisp/ido.el.~1.110.~	2006-10-16 14:42:24.000000000 +0200
--- lisp/ido.el	2006-11-27 17:54:36.000000000 +0100
***************
*** 1142,1147 ****
--- 1142,1152 ----
  	  (pop-to-buffer b t t)
  	  (setq truncate-lines t)))))
  
+ (defun ido-local-file-exists-p (file)
+   "Tell if FILE exists locally."
+   (let (file-name-handler-alist)
+     (file-exists-p file)))
+ 
  (defun ido-unc-hosts (&optional query)
    "Return list of UNC host names."
    (let ((hosts
***************
*** 2068,2074 ****
  	      (ido-set-current-directory (file-name-directory (substring ido-current-directory 0 -1))))
  	  (setq ido-set-default-item t))
  
! 	 ((and (string-match (if ido-enable-tramp-completion "..[:@]\\'" "..:\\'") ido-selected)
  	       (ido-is-root-directory)) ;; Ange-ftp or Tramp
  	  (ido-set-current-directory ido-current-directory ido-selected)
  	  (ido-trace "tramp prefix" ido-selected)
--- 2073,2080 ----
  	      (ido-set-current-directory (file-name-directory (substring ido-current-directory 0 -1))))
  	  (setq ido-set-default-item t))
  
! 	 ((and (not (ido-local-file-exists-p ido-selected))
! 	       (string-match (if ido-enable-tramp-completion ".[:@]\\'" ".:\\'") ido-selected)
  	       (ido-is-root-directory)) ;; Ange-ftp or Tramp
  	  (ido-set-current-directory ido-current-directory ido-selected)
  	  (ido-trace "tramp prefix" ido-selected)
***************
*** 2426,2432 ****
       ((and (= 1 (length ido-matches))
  	   (not (and ido-enable-tramp-completion
  		     (string-equal ido-current-directory "/")
! 		     (string-match "..[@:]\\'" (ido-name (car ido-matches))))))
        ;; only one choice, so select it.
        (if (not ido-confirm-unique-completion)
  	  (exit-minibuffer)
--- 2432,2439 ----
       ((and (= 1 (length ido-matches))
  	   (not (and ido-enable-tramp-completion
  		     (string-equal ido-current-directory "/")
! 		     (not (ido-local-file-exists-p (ido-name (car ido-matches))))
! 		     (string-match ".[@:]\\'" (ido-name (car ido-matches))))))
        ;; only one choice, so select it.
        (if (not ido-confirm-unique-completion)
  	  (exit-minibuffer)
***************
*** 3433,3441 ****
        (let ((default-directory ido-current-directory))
  	(ido-to-end ;; move ftp hosts and visited files to end
  	 (delq nil (mapcar
! 		    (lambda (x) (if (or (string-match "..:\\'" x)
  					(and (not (ido-final-slash x))
! 					     (get-file-buffer x))) x))
  		    ido-temp-list)))))
      (ido-to-end  ;; move . files to end
       (delq nil (mapcar
--- 3440,3450 ----
        (let ((default-directory ido-current-directory))
  	(ido-to-end ;; move ftp hosts and visited files to end
  	 (delq nil (mapcar
! 		    (lambda (x) (if (or (and (not (ido-local-file-exists-p x))
! 					     (string-match ".:\\'" x))
  					(and (not (ido-final-slash x))
! 					     (let (file-name-handler-alist)
! 					       (get-file-buffer x)))) x))
  		    ido-temp-list)))))
      (ido-to-end  ;; move . files to end
       (delq nil (mapcar
***************
*** 4149,4155 ****
  	    (setq refresh t))
  	  ))
  
! 	 ((and (string-match (if ido-enable-tramp-completion "..[:@]\\'" "..:\\'") contents)
  	       (ido-is-root-directory)) ;; Ange-ftp or tramp
  	  (ido-set-current-directory ido-current-directory contents)
  	  (when (ido-is-slow-ftp-host)
--- 4158,4165 ----
  	    (setq refresh t))
  	  ))
  
! 	 ((and (not (ido-local-file-exists-p contents))
! 	       (string-match (if ido-enable-tramp-completion ".[:@]\\'" ".:\\'") contents)
  	       (ido-is-root-directory)) ;; Ange-ftp or tramp
  	  (ido-set-current-directory ido-current-directory contents)
  	  (when (ido-is-slow-ftp-host)
*** lisp/ChangeLog.~1.10261.~	2006-11-06 15:42:02.000000000 +0100
--- lisp/ChangeLog	2006-11-27 17:58:48.000000000 +0100
***************
*** 0 ****
--- 1,8 ----
+ 2006-11-27  Michaël Cadilhac  <michael.cadilhac@lrde.org>
+ 
+ 	* ido.el (ido-local-file-exists-p): New. Tell if a file exists
+ 	locally, i.e. without using file name handlers.
+ 	(ido-read-internal): Allow mono letter host names, avoiding the
+ 	`c:' problem by testing if the file exists locally.
+ 	(ido-complete, ido-make-file-list, ido-exhibit): Ditto.
+ 

[-- Attachment #1.1.5: Type: text/plain, Size: 648 bytes --]


but I really don't know if it works on Windows.

BTW, something tickles me about all that: why functions like
file-exists-p & co doesn't check if the file is not an actual
stat(2)-able file before getting any fanciness with file name
handlers ?

-- 
/!\ My mail address has changed, please update your files accordingly.
 |      Michaël `Micha' Cadilhac   |  «Tu aimeras ton prochain.»            |
 |         Epita/LRDE Promo 2007   |    D'abord, Dieu ou pas,               |
 |  http://michael.cadilhac.name   |       j'ai horreur qu'on me tutoie.    |
 `--  -   JID: micha@amessage.be --'           -- P. Desproges         -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: Ido and hosts named with a single letter.
  2006-11-27 17:04   ` Michaël Cadilhac
@ 2006-11-28  8:58     ` Kim F. Storm
  2006-11-28 13:13       ` File name handlers and local files Michaël Cadilhac
  2006-11-30 20:52     ` Ido and hosts named with a single letter Kim F. Storm
  1 sibling, 1 reply; 9+ messages in thread
From: Kim F. Storm @ 2006-11-28  8:58 UTC (permalink / raw)
  Cc: emacs-devel


Hi Michael,

Thank you very much for working on this.

The first approach will probably work, but I definitely like
the second approach better.

I'll try it on Windoze and let you know if it works.


>
> BTW, something tickles me about all that: why functions like
> file-exists-p & co doesn't check if the file is not an actual
> stat(2)-able file before getting any fanciness with file name
> handlers ?

Yes, I've been hit by this many times while working on ido.

Your "ido-local-file-exists-p" approach is clever.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* File name handlers and local files.
  2006-11-28  8:58     ` Kim F. Storm
@ 2006-11-28 13:13       ` Michaël Cadilhac
  2006-11-28 14:50         ` Michael Albinus
  2006-11-28 14:54         ` Andreas Schwab
  0 siblings, 2 replies; 9+ messages in thread
From: Michaël Cadilhac @ 2006-11-28 13:13 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 1421 bytes --]

storm@cua.dk (Kim F. Storm) writes:

>> BTW, something tickles me about all that: why functions like
>> file-exists-p & co doesn't check if the file is not an actual
>> stat(2)-able file before getting any fanciness with file name
>> handlers ?
>
> Yes, I've been hit by this many times while working on ido.

It's probably worth the ask in another thread.

Let's suppose my sysadmin is a weird guy. Very weird. And he decided
that a common NFS data directory will be created on the / with the
name 'data:', because he had a difficult childhood and loves The
Windows Way.

When I try to edit a file in that directory, I use : C-x C-f /data:/test

Oh, weirder! Even if a `data:' directory exists, it just tries to use
tramp !

Okey, this is a hard case, because the `test' file doesn't exist, and
it may exist on the distant host `data'.

But simpler: let's just try (file-exists-p "/data:"). The file name
handler having the precedence on local files, it tries to ssh to
`data:'. Isn't that a pity?

-- 
/!\ My mail address has changed, please update your files accordingly.
 |      Michaël `Micha' Cadilhac   |  «Tu aimeras ton prochain.»            |
 |         Epita/LRDE Promo 2007   |    D'abord, Dieu ou pas,               |
 |  http://michael.cadilhac.name   |       j'ai horreur qu'on me tutoie.    |
 `--  -   JID: micha@amessage.be --'           -- P. Desproges         -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: File name handlers and local files.
  2006-11-28 13:13       ` File name handlers and local files Michaël Cadilhac
@ 2006-11-28 14:50         ` Michael Albinus
  2006-11-28 15:13           ` Michaël Cadilhac
  2006-11-28 14:54         ` Andreas Schwab
  1 sibling, 1 reply; 9+ messages in thread
From: Michael Albinus @ 2006-11-28 14:50 UTC (permalink / raw)
  Cc: emacs-devel

michael@cadilhac.name (Michaël Cadilhac) writes:

> Let's suppose my sysadmin is a weird guy. Very weird. And he decided
> that a common NFS data directory will be created on the / with the
> name 'data:', because he had a difficult childhood and loves The
> Windows Way.
>
> When I try to edit a file in that directory, I use : C-x C-f /data:/test

You shall type C-x C-f /:/data:/test

See Emacs manual "(emacs)Quoted File Names".

Best regards, Michael.

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

* Re: File name handlers and local files.
  2006-11-28 13:13       ` File name handlers and local files Michaël Cadilhac
  2006-11-28 14:50         ` Michael Albinus
@ 2006-11-28 14:54         ` Andreas Schwab
  1 sibling, 0 replies; 9+ messages in thread
From: Andreas Schwab @ 2006-11-28 14:54 UTC (permalink / raw)
  Cc: emacs-devel

michael@cadilhac.name (Michaël Cadilhac) writes:

> When I try to edit a file in that directory, I use : C-x C-f /data:/test
>
> Oh, weirder! Even if a `data:' directory exists, it just tries to use
> tramp !

Use "/:/data:/test" instead.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: File name handlers and local files.
  2006-11-28 14:50         ` Michael Albinus
@ 2006-11-28 15:13           ` Michaël Cadilhac
  0 siblings, 0 replies; 9+ messages in thread
From: Michaël Cadilhac @ 2006-11-28 15:13 UTC (permalink / raw)
  Cc: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 1012 bytes --]

Michael Albinus <michael.albinus@gmx.de> writes:

> michael@cadilhac.name (Michaël Cadilhac) writes:
>
>> Let's suppose my sysadmin is a weird guy. Very weird. And he decided
>> that a common NFS data directory will be created on the / with the
>> name 'data:', because he had a difficult childhood and loves The
>> Windows Way.
>>
>> When I try to edit a file in that directory, I use : C-x C-f /data:/test
>
> You shall type C-x C-f /:/data:/test
>
> See Emacs manual "(emacs)Quoted File Names".

Right, but Ido has problems with that, and this is due to the
awkwardness of those functions AFAICT.

-- 
/!\ My mail address has changed, please update your files accordingly.
 |      Michaël `Micha' Cadilhac   |  Ajoutez du whisky                     |
 |         Epita/LRDE Promo 2007   |           à n'importe quel texte,      |
 |  http://michael.cadilhac.name   |    ça vous fera un beau pangramme.     |
 `--  -   JID: micha@amessage.be --'          -- Michel Clavel         -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: Ido and hosts named with a single letter.
  2006-11-27 17:04   ` Michaël Cadilhac
  2006-11-28  8:58     ` Kim F. Storm
@ 2006-11-30 20:52     ` Kim F. Storm
  1 sibling, 0 replies; 9+ messages in thread
From: Kim F. Storm @ 2006-11-30 20:52 UTC (permalink / raw)
  Cc: emacs-devel

michael@cadilhac.name (Michaël Cadilhac) writes:


> But it's probably better to do that : if the file actually exists (c:
> should exist, I suppose), then use it. Otherwise, use tramp.
>
> I can propose the following :
>
>
> *** lisp/ido.el.~1.110.~	2006-10-16 14:42:24.000000000 +0200
> --- lisp/ido.el	2006-11-27 17:54:36.000000000 +0100
> ***************
> *** 1142,1147 ****
> --- 1142,1152 ----
>   	  (pop-to-buffer b t t)
>   	  (setq truncate-lines t)))))
>   
> + (defun ido-local-file-exists-p (file)
> +   "Tell if FILE exists locally."
> +   (let (file-name-handler-alist)
> +     (file-exists-p file)))
> + 
> ...

I checked that this approach does work on Windoze (as far as I could see).

I changed a few things, and committed the change.

Thanks for working on improving ido.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

end of thread, other threads:[~2006-11-30 20:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-26 20:00 Ido and hosts named with a single letter Michaël Cadilhac
2006-11-27  9:43 ` Kim F. Storm
2006-11-27 17:04   ` Michaël Cadilhac
2006-11-28  8:58     ` Kim F. Storm
2006-11-28 13:13       ` File name handlers and local files Michaël Cadilhac
2006-11-28 14:50         ` Michael Albinus
2006-11-28 15:13           ` Michaël Cadilhac
2006-11-28 14:54         ` Andreas Schwab
2006-11-30 20:52     ` Ido and hosts named with a single letter Kim F. Storm

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.