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: Tue, 14 Jan 2003 16:31:49 -0500

Index: emacs/lisp/ido.el
diff -c emacs/lisp/ido.el:1.22 emacs/lisp/ido.el:1.23
*** emacs/lisp/ido.el:1.22      Tue Jan 14 16:12:20 2003
--- emacs/lisp/ido.el   Tue Jan 14 16:31:47 2003
***************
*** 1621,1634 ****
                 (edit (eq ido-exit 'edit))
                 (d ido-current-directory)
                 (f ido-text-init)
!                (path t))
            (setq ido-text-init "")
!           (while path
!             (setq path (if edit
                             (read-file-name (concat prompt "[EDIT] ") d 
(concat d f) nil f)
                           f)
!                   d (or (file-name-directory path) "/")
!                   f (file-name-nondirectory path)
                    edit t)
              (if (or 
                   (file-directory-p d)
--- 1621,1634 ----
                 (edit (eq ido-exit 'edit))
                 (d ido-current-directory)
                 (f ido-text-init)
!                (new t))
            (setq ido-text-init "")
!           (while new
!             (setq new (if edit
                             (read-file-name (concat prompt "[EDIT] ") d 
(concat d f) nil f)
                           f)
!                   d (or (file-name-directory new) "/")
!                   f (file-name-nondirectory new)
                    edit t)
              (if (or 
                   (file-directory-p d)
***************
*** 1642,1648 ****
                  (progn
                    (ido-set-current-directory d nil (eq ido-exit 'chdir))
                    (setq ido-text-init f
!                         path nil))))))
         (t
          (setq ido-text-init (read-string (concat prompt "[EDIT] ") 
ido-final-text))))
        nil)
--- 1642,1648 ----
                  (progn
                    (ido-set-current-directory d nil (eq ido-exit 'chdir))
                    (setq ido-text-init f
!                         new nil))))))
         (t
          (setq ido-text-init (read-string (concat prompt "[EDIT] ") 
ido-final-text))))
        nil)
***************
*** 1868,1880 ****
         ((memq method '(dired list-directory))
        (if (equal filename ".")
            (setq filename ""))
!       (let* ((path (ido-final-slash (concat ido-current-directory filename) 
t))
!              (file (substring path 0 -1)))
          (cond
!          ((file-directory-p path)
!           (ido-record-command method path)
!           (ido-record-work-directory path)
!           (funcall method path))
           ((file-directory-p ido-current-directory)
            (cond
             ((file-exists-p file)
--- 1868,1880 ----
         ((memq method '(dired list-directory))
        (if (equal filename ".")
            (setq filename ""))
!       (let* ((dirname (ido-final-slash (concat ido-current-directory 
filename) t))
!              (file (substring dirname 0 -1)))
          (cond
!          ((file-directory-p dirname)
!           (ido-record-command method dirname)
!           (ido-record-work-directory dirname)
!           (funcall method dirname))
           ((file-directory-p ido-current-directory)
            (cond
             ((file-exists-p file)
***************
*** 1884,1901 ****
              (if (eq method 'dired)
                  (dired-goto-file (expand-file-name file))))
             ((string-match "[[*?]" filename)
!             (setq path (concat ido-current-directory filename))
!             (ido-record-command method path)
              (ido-record-work-directory)
!             (funcall method path))
             ((y-or-n-p (format "Directory %s does not exist. Create it " 
filename))
!             (ido-record-command method path)
!             (ido-record-work-directory path)
!             (make-directory-internal path)
!             (funcall method path))
             (t
              ;; put make-directory command on history
!             (ido-record-command 'make-directory path))))
           (t (error "No such directory")))))
  
         ((eq method 'write)
--- 1884,1901 ----
              (if (eq method 'dired)
                  (dired-goto-file (expand-file-name file))))
             ((string-match "[[*?]" filename)
!             (setq dirname (concat ido-current-directory filename))
!             (ido-record-command method dirname)
              (ido-record-work-directory)
!             (funcall method dirname))
             ((y-or-n-p (format "Directory %s does not exist. Create it " 
filename))
!             (ido-record-command method dirname)
!             (ido-record-work-directory dirname)
!             (make-directory-internal dirname)
!             (funcall method dirname))
             (t
              ;; put make-directory command on history
!             (ido-record-command 'make-directory dirname))))
           (t (error "No such directory")))))
  
         ((eq method 'write)
***************
*** 2305,2316 ****
    "Insert file name of current buffer.
  If repeated, insert text from buffer instead."
    (interactive "P")
!   (let* ((path (buffer-file-name ido-entry-buffer))
!        (name (and path (file-name-nondirectory path))))
      (when name
        (setq ido-text-init 
            (if (or all 
!                   (not (equal (file-name-directory path) 
ido-current-directory))
                    (not (string-match "\\.[^.]*\\'" name)))
                name
            (substring name 0 (1+ (match-beginning 0)))))
--- 2305,2316 ----
    "Insert file name of current buffer.
  If repeated, insert text from buffer instead."
    (interactive "P")
!   (let* ((bfname (buffer-file-name ido-entry-buffer))
!        (name (and bfname (file-name-nondirectory bfname))))
      (when name
        (setq ido-text-init 
            (if (or all 
!                   (not (equal (file-name-directory bfname) 
ido-current-directory))
                    (not (string-match "\\.[^.]*\\'" name)))
                name
            (substring name 0 (1+ (match-beginning 0)))))
***************
*** 2477,2495 ****
  
  (defun ido-wide-find-dirs-or-files (dir file &optional prefix finddir)
    ;; As ido-run-find-command, but returns a list of cons pairs ("file" . 
"dir")
!   (let ((paths 
         (split-string 
          (shell-command-to-string
           (concat "find " dir " -name \"" (if prefix "" "*") file "*\" -type " 
(if finddir "d" "f") " -print"))))
!       path d f
        res)
!     (while paths
!       (setq path (car paths)
!           paths (cdr paths))
!       (if (and (string-match "^/" path)
!              (file-exists-p path))
!         (setq d (file-name-directory path)
!               f (file-name-nondirectory path)
                res (cons (cons (if finddir (ido-final-slash f t) f) d) res))))
      res))
  
--- 2477,2495 ----
  
  (defun ido-wide-find-dirs-or-files (dir file &optional prefix finddir)
    ;; As ido-run-find-command, but returns a list of cons pairs ("file" . 
"dir")
!   (let ((filenames 
         (split-string 
          (shell-command-to-string
           (concat "find " dir " -name \"" (if prefix "" "*") file "*\" -type " 
(if finddir "d" "f") " -print"))))
!       filename d f
        res)
!     (while filenames
!       (setq filename (car filenames)
!           filenames (cdr filenames))
!       (if (and (string-match "^/" filename)
!              (file-exists-p filename))
!         (setq d (file-name-directory filename)
!               f (file-name-nondirectory filename)
                res (cons (cons (if finddir (ido-final-slash f t) f) d) res))))
      res))
  




reply via email to

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