emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ido and hosts named with a single letter.


From: Michaël Cadilhac
Subject: Ido and hosts named with a single letter.
Date: Sun, 26 Nov 2006 21:00:38 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.90 (gnu/linux)

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.

*** 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  <address@hidden>
+ 
+       * ido.el (ido-read-internal): Allow single letter named hosts.
+       (ido-complete, ido-make-file-list, ido-exhibit): Ditto.
+ 
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: address@hidden --'                                   -  --'

Attachment: pgp5Vbb7G0AWy.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]