emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/ido.el


From: Kim F . Storm
Subject: [Emacs-diffs] Changes to emacs/lisp/ido.el
Date: Wed, 19 Oct 2005 18:21:19 -0400

Index: emacs/lisp/ido.el
diff -c emacs/lisp/ido.el:1.78 emacs/lisp/ido.el:1.79
*** emacs/lisp/ido.el:1.78      Mon Oct  3 16:45:35 2005
--- emacs/lisp/ido.el   Wed Oct 19 22:21:18 2005
***************
*** 1084,1092 ****
          (setq truncate-lines t)))))
  
  (defun ido-is-tramp-root (&optional dir)
-   (setq dir (or dir ido-current-directory))
    (and ido-enable-tramp-completion
!        (string-match "\\`/[^/][^/]+:\\([^/:@address@hidden)?\\'" dir)))
  
  (defun ido-is-root-directory (&optional dir)
    (setq dir (or dir ido-current-directory))
--- 1084,1092 ----
          (setq truncate-lines t)))))
  
  (defun ido-is-tramp-root (&optional dir)
    (and ido-enable-tramp-completion
!        (string-match "\\`/[^/]+[@:]\\'"
!                    (or dir ido-current-directory))))
  
  (defun ido-is-root-directory (&optional dir)
    (setq dir (or dir ido-current-directory))
***************
*** 1507,1517 ****
  
  (defun ido-set-current-directory (dir &optional subdir no-merge)
    ;; Set ido's current directory to DIR or DIR/SUBDIR
!   (setq dir (ido-final-slash dir t))
    (setq ido-use-merged-list nil
        ido-try-merged-list (not no-merge))
!   (if subdir
!       (setq dir (ido-final-slash (concat dir subdir) t)))
    (if (equal dir ido-current-directory)
        nil
      (ido-trace "cd" dir)
--- 1507,1522 ----
  
  (defun ido-set-current-directory (dir &optional subdir no-merge)
    ;; Set ido's current directory to DIR or DIR/SUBDIR
!   (unless (and ido-enable-tramp-completion
!              (string-match "\\`/[^/address@hidden'" dir))
!     (setq dir (ido-final-slash dir t)))
    (setq ido-use-merged-list nil
        ido-try-merged-list (not no-merge))
!   (when subdir
!     (setq dir (concat dir subdir))
!     (unless (and ido-enable-tramp-completion
!                (string-match "\\`/[^/address@hidden'" dir))
!       (setq dir (ido-final-slash dir t))))
    (if (equal dir ido-current-directory)
        nil
      (ido-trace "cd" dir)
***************
*** 3102,3128 ****
     ((ido-nonreadable-directory-p dir) '())
     ;; do not check (ido-directory-too-big-p dir) here.
     ;; Caller must have done that if necessary.
-    ((and ido-enable-tramp-completion
-        (string-match "\\`/\\([^/:]+:\\([^/:@address@hidden)?\\)\\'" dir))
  
!     ;; Trick tramp's file-name-all-completions handler to DTRT, as it
!     ;; has some pretty obscure requirements.  This seems to work...
!     ;; /ftp:          => (f-n-a-c "/ftp:" "")
!     ;; /ftp:kfs:      => (f-n-a-c "" "/ftp:kfs:")
!     ;; /ftp:kfs@      => (f-n-a-c "ftp:kfs@" "/")
!     ;; /ftp:address@hidden:  => (f-n-a-c "" "/ftp:address@hidden:")
!     ;; Currently no attempt is made to handle multi: stuff.
! 
!     (let* ((prefix (match-string 1 dir))
!          (user-flag (match-beginning 2))
!          (len (and prefix (length prefix)))
!          compl)
!       (if user-flag
!         (setq dir (substring dir 1)))
!       (require 'tramp nil t)
!       (ido-trace "tramp complete" dir)
!       (setq compl (file-name-all-completions dir (if user-flag "/" "")))
!       (if (> len 0)
          (mapcar (lambda (c) (substring c len)) compl)
        compl)))
     (t
--- 3107,3135 ----
     ((ido-nonreadable-directory-p dir) '())
     ;; do not check (ido-directory-too-big-p dir) here.
     ;; Caller must have done that if necessary.
  
!    ((and ido-enable-tramp-completion
!        (or (fboundp 'tramp-completion-mode)
!            (require 'tramp nil t))
!        (string-match "\\`/[^/]+[:@]\\'" dir))
!     ;; Strip method:address@hidden: part of tramp completions.
!     ;; Tramp completions do not include leading slash.
!     (let ((len (1- (length dir)))
!         (compl
!          (or (file-name-all-completions "" dir)
!              ;; work around bug in ange-ftp.
!              ;; /ftp:address@hidden: => nil
!              ;; /ftp:address@hidden:./ => ok
!              (and
!               (not (string= "/ftp:" dir))
!               (tramp-tramp-file-p dir)
!               (fboundp 'tramp-ftp-file-name-p)
!               (funcall 'tramp-ftp-file-name-p dir)
!               (string-match ":\\'" dir)
!               (file-name-all-completions "" (concat dir "./"))))))
!       (if (and compl
!              (> (length (car compl)) len)
!              (string= (substring (car compl) 0 len) (substring dir 1)))
          (mapcar (lambda (c) (substring c len)) compl)
        compl)))
     (t
***************
*** 3193,3205 ****
                              (if ido-file-extensions-order
                                  #'ido-file-extension-lessp
                                #'ido-file-lessp)))
!     (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
                (lambda (x) (if (string-equal (substring x 0 1) ".") x))
--- 3200,3213 ----
                              (if ido-file-extensions-order
                                  #'ido-file-extension-lessp
                                #'ido-file-lessp)))
!     (unless (ido-is-tramp-root ido-current-directory)
!       (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
                (lambda (x) (if (string-equal (substring x 0 1) ".") x))




reply via email to

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