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: Mon, 13 Jan 2003 17:56:53 -0500

Index: emacs/lisp/ido.el
diff -c emacs/lisp/ido.el:1.19 emacs/lisp/ido.el:1.20
*** emacs/lisp/ido.el:1.19      Sun Jan 12 17:27:17 2003
--- emacs/lisp/ido.el   Mon Jan 13 17:56:53 2003
***************
*** 416,423 ****
    :group 'ido)
  
  (defcustom ido-ignore-directories-merge nil
!   "*List of regexps or functions matching directory path names to ignore 
during merge.
! Directory paths matched by one of the regexps in this list are not inserted
  in merged file and directory lists."
    :type '(repeat (choice regexp function))
    :group 'ido)
--- 416,423 ----
    :group 'ido)
  
  (defcustom ido-ignore-directories-merge nil
!   "*List of regexps or functions matching directory names to ignore during 
merge.
! Directory names matched by one of the regexps in this list are not inserted
  in merged file and directory lists."
    :type '(repeat (choice regexp function))
    :group 'ido)
***************
*** 511,517 ****
    :type 'integer
    :group 'ido)
  
! (defcustom ido-max-prompt-path 0.35
    "*Non-zero means that the prompt string be limited to than number of 
characters.
  If value is a floating point number, it specifies a fraction of the frame 
width."
    :type '(choice
--- 511,517 ----
    :type 'integer
    :group 'ido)
  
! (defcustom ido-max-prompt-width 0.35
    "*Non-zero means that the prompt string be limited to than number of 
characters.
  If value is a floating point number, it specifies a fraction of the frame 
width."
    :type '(choice
***************
*** 533,539 ****
    :group 'ido)
  
  (defcustom ido-enable-last-directory-history t
!   "*Non-nil means that `ido' will remember latest selected directory paths.
  See `ido-last-directory-list' and `ido-save-directory-list-file'."
    :type 'boolean
    :group 'ido)
--- 533,539 ----
    :group 'ido)
  
  (defcustom ido-enable-last-directory-history t
!   "*Non-nil means that `ido' will remember latest selected directory names.
  See `ido-last-directory-list' and `ido-save-directory-list-file'."
    :type 'boolean
    :group 'ido)
***************
*** 547,553 ****
  
  (defcustom ido-work-directory-list-ignore-regexps nil
    "*List of regexps matching directories which should not be recorded.
! Directory paths matched by one of the regexps in this list are not inserted in
  the `ido-work-directory-list' list."
    :type '(repeat regexp)
    :group 'ido)
--- 547,553 ----
  
  (defcustom ido-work-directory-list-ignore-regexps nil
    "*List of regexps matching directories which should not be recorded.
! Directory names matched by one of the regexps in this list are not inserted in
  the `ido-work-directory-list' list."
    :type '(repeat regexp)
    :group 'ido)
***************
*** 555,571 ****
  
  (defcustom ido-enable-tramp-completion t
    "*Non-nil means that ido shall perform tramp method and server name 
completion.
! A tramp file name uses the following syntax: /method:address@hidden:path."
    :type 'boolean
    :group 'ido)
  
  (defcustom ido-record-ftp-work-directories t
!   "*Non-nil means that ftp paths are recorded in work directory list."
    :type 'boolean
    :group 'ido)
  
  (defcustom ido-merge-ftp-work-directories nil
!   "*Nil means that ftp paths in work directory list are ignored during merge."
    :type 'boolean
    :group 'ido)
  
--- 555,571 ----
  
  (defcustom ido-enable-tramp-completion t
    "*Non-nil means that ido shall perform tramp method and server name 
completion.
! A tramp file name uses the following syntax: /method:address@hidden:filename."
    :type 'boolean
    :group 'ido)
  
  (defcustom ido-record-ftp-work-directories t
!   "*Non-nil means that remote directories are recorded in work directory 
list."
    :type 'boolean
    :group 'ido)
  
  (defcustom ido-merge-ftp-work-directories nil
!   "*Nil means that remote directories in work directory list are ignored 
during merge."
    :type 'boolean
    :group 'ido)
  
***************
*** 735,765 ****
    :type 'hook
    :group 'ido)
  
! (defcustom ido-make-file-prompt-hook nil
    "*List of functions to run when the find-file prompt is created.
  Each function on the list may modify the following dynamically bound
  variables:
!   path   - the (abbreviated) directory path
!   max-width - the max width of the path; set to nil to inhibit truncation
    prompt - the basic prompt (e.g. \"Find File: \")
    literal - the string shown if doing `literal' find; set to nil to omit
    vc-off  - the string shown if version control is inhibited; set to nit to 
omit
!   prefix  - normally nil, but may be set to a fixed prefix for the path
  The following variables are available, but should not be changed:
!   ido-current-directory - the unabbreviated directory path
    item - equals 'file or 'dir depending on the current mode."
    :type 'hook
    :group 'ido)
  
! (defvar ido-rewrite-prompt-path-rules nil
!   "*Alist of rewriting rules for file paths.
! A list of elements of the form (FROM . TO) or (FROM . FUNC),
! each meaning to rewrite the path if matched by FROM by either
! substituting the matched string by TO or calling the function
! FUNC with the current path as its only argument and using the
! return value as the new path.  In addition, each FUNC may
! also modify the dynamic variables described for the
! variable `ido-make-file-prompt-hook'.")
  
  (defcustom ido-completion-buffer "*Ido Completions*"
    "*Name of completion buffer used by ido.
--- 735,765 ----
    :type 'hook
    :group 'ido)
  
! (defcustom ido-rewrite-file-prompt-functions nil
    "*List of functions to run when the find-file prompt is created.
  Each function on the list may modify the following dynamically bound
  variables:
!   dirname   - the (abbreviated) directory name to be modified by the hook 
functions
!   max-width - the max width of the resulting dirname; set to nil to inhibit 
truncation
    prompt - the basic prompt (e.g. \"Find File: \")
    literal - the string shown if doing `literal' find; set to nil to omit
    vc-off  - the string shown if version control is inhibited; set to nit to 
omit
!   prefix  - normally nil, but may be set to a fixed prefix for the dirname
  The following variables are available, but should not be changed:
!   ido-current-directory - the unabbreviated directory name
    item - equals 'file or 'dir depending on the current mode."
    :type 'hook
    :group 'ido)
  
! (defvar ido-rewrite-file-prompt-rules nil
!   "*Alist of rewriting rules for directory names in ido prompts.
! A list of elements of the form (FROM . TO) or (FROM . FUNC), each
! meaning to rewrite the directory name if matched by FROM by either
! substituting the matched string by TO or calling the function FUNC
! with the current directory name as its only argument and using the
! return value as the new directory name.  In addition, each FUNC may
! also modify the dynamic variables described for the variable
! `ido-rewrite-file-prompt-functions'.")
  
  (defcustom ido-completion-buffer "*Ido Completions*"
    "*Name of completion buffer used by ido.
***************
*** 804,810 ****
    :group 'ido)
  
  (defcustom ido-read-file-name-as-directory-commands '()
!   "List of commands which uses read-file-name to read a directory path.
  When `ido-everywhere' is non-nil, the commands in this list will read
  the directory using ido-read-directory-name."
    :type '(repeat symbol)
--- 804,810 ----
    :group 'ido)
  
  (defcustom ido-read-file-name-as-directory-commands '()
!   "List of commands which uses read-file-name to read a directory name.
  When `ido-everywhere' is non-nil, the commands in this list will read
  the directory using ido-read-directory-name."
    :type '(repeat symbol)
***************
*** 831,847 ****
    "History of buffers selected using `ido-switch-buffer'.")
  
  (defvar ido-last-directory-list nil
!   "List of last selected directory paths.
  See `ido-enable-last-directory-history' for details.")
  
  (defvar ido-work-directory-list nil
!   "List of actual working directory paths.
  The current directory is inserted at the front of this list whenever a
  file is opened with ido-find-file and family.")
  
  (defvar ido-work-file-list nil
    "List of actual work file names.
! The current file name (sans path) is inserted at the front of this list
  whenever a file is opened with ido-find-file and family.")
  
  (defvar ido-dir-file-cache nil
--- 831,847 ----
    "History of buffers selected using `ido-switch-buffer'.")
  
  (defvar ido-last-directory-list nil
!   "List of last selected directory names.
  See `ido-enable-last-directory-history' for details.")
  
  (defvar ido-work-directory-list nil
!   "List of actual working directory names.
  The current directory is inserted at the front of this list whenever a
  file is opened with ido-find-file and family.")
  
  (defvar ido-work-file-list nil
    "List of actual work file names.
! The current file name (sans directory) is inserted at the front of this list
  whenever a file is opened with ido-find-file and family.")
  
  (defvar ido-dir-file-cache nil
***************
*** 1394,1428 ****
    ;; Make the prompt for ido-read-internal
    (cond
     ((and (memq item '(file dir)) ido-current-directory)
!     (let ((path (abbreviate-file-name ido-current-directory))
!         (max-width (if (and ido-max-prompt-path (floatp ido-max-prompt-path))
!                        (floor (* (frame-width) ido-max-prompt-path))
!                      ido-max-prompt-path))
          (literal (and (boundp 'ido-find-literal) ido-find-literal "(literal) 
"))
          (vc-off (and ido-saved-vc-mt (not vc-master-templates) "[-VC] "))
          (prefix nil)
!         (rule ido-rewrite-prompt-path-rules))
        (let ((case-fold-search nil))
        (while rule
          (if (and (consp (car rule))
!                  (string-match (car (car rule)) path))
!             (setq path
                    (if (stringp (cdr (car rule)))
!                       (replace-match (cdr (car rule)) t nil path)
!                     (funcall (cdr (car rule)) path))))
          (setq rule (cdr rule))))
!       (run-hooks 'ido-make-file-prompt-hook)
        (concat prompt 
              ; (if ido-process-ignore-lists "" "&")
              (or literal "")
              (or vc-off  "")
              (or prefix "")
!             (let ((l (length path)))
                (if (and max-width (> max-width 0) (> l max-width))
!                   (let* ((s (substring path (- max-width))) 
                           (i (string-match "/" s)))
                      (concat "..." (if i (substring s i) s)))
!                 path)))))
     (t prompt)))
  
  ;; Here is very briefly how ido-find-file works:
--- 1394,1428 ----
    ;; Make the prompt for ido-read-internal
    (cond
     ((and (memq item '(file dir)) ido-current-directory)
!     (let ((dirname (abbreviate-file-name ido-current-directory))
!         (max-width (if (and ido-max-prompt-width (floatp 
ido-max-prompt-width))
!                        (floor (* (frame-width) ido-max-prompt-width))
!                      ido-max-prompt-width))
          (literal (and (boundp 'ido-find-literal) ido-find-literal "(literal) 
"))
          (vc-off (and ido-saved-vc-mt (not vc-master-templates) "[-VC] "))
          (prefix nil)
!         (rule ido-rewrite-file-prompt-rules))
        (let ((case-fold-search nil))
        (while rule
          (if (and (consp (car rule))
!                  (string-match (car (car rule)) dirname))
!             (setq dirname
                    (if (stringp (cdr (car rule)))
!                       (replace-match (cdr (car rule)) t nil dirname)
!                     (funcall (cdr (car rule)) dirname))))
          (setq rule (cdr rule))))
!       (run-hooks 'ido-rewrite-file-prompt-functions)
        (concat prompt 
              ; (if ido-process-ignore-lists "" "&")
              (or literal "")
              (or vc-off  "")
              (or prefix "")
!             (let ((l (length dirname)))
                (if (and max-width (> max-width 0) (> l max-width))
!                   (let* ((s (substring dirname (- max-width))) 
                           (i (string-match "/" s)))
                      (concat "..." (if i (substring s i) s)))
!                 dirname)))))
     (t prompt)))
  
  ;; Here is very briefly how ido-find-file works:
***************
*** 1723,1729 ****
      ido-selected))
  
  (defun ido-edit-input ()
!   "Edit ido path and input string. Terminate by RET."
    (interactive)
    (setq ido-text-init ido-text)
    (setq ido-exit 'edit)
--- 1723,1729 ----
      ido-selected))
  
  (defun ido-edit-input ()
!   "Edit absolute file name entered so far with ido; terminate by RET."
    (interactive)
    (setq ido-text-init ido-text)
    (setq ido-exit 'edit)
***************
*** 1884,1890 ****
              (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))
--- 1884,1890 ----
              (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))
***************
*** 1958,1964 ****
           (string-match "[$]" ido-text))
        (let ((evar (substitute-in-file-name (concat ido-current-directory 
ido-text))))
        (if (not (file-exists-p (file-name-directory evar)))
!           (message "Expansion generates non-existing directory path")
          (if (file-directory-p evar)
              (ido-set-current-directory evar)
            (let ((d (or (file-name-directory evar) "/"))
--- 1958,1964 ----
           (string-match "[$]" ido-text))
        (let ((evar (substitute-in-file-name (concat ido-current-directory 
ido-text))))
        (if (not (file-exists-p (file-name-directory evar)))
!           (message "Expansion generates non-existing directory.")
          (if (file-directory-p evar)
              (ido-set-current-directory evar)
            (let ((d (or (file-name-directory evar) "/"))
***************
*** 2319,2325 ****
        (exit-minibuffer))))
    
  (defun ido-copy-current-word (all)
!   "Insert current word (file name or path) from current buffer."
    (interactive "P")
    (let ((word (save-excursion
                (set-buffer ido-entry-buffer)
--- 2319,2325 ----
        (exit-minibuffer))))
    
  (defun ido-copy-current-word (all)
!   "Insert current word (file or directory name) from current buffer."
    (interactive "P")
    (let ((word (save-excursion
                (set-buffer ido-entry-buffer)
***************
*** 2494,2500 ****
      res))
  
  (defun ido-flatten-merged-list (items)
!   ;; Create a list of path names based on a merged directory list.
    (let (res)
      (while items
        (let* ((item (car items))
--- 2494,2500 ----
      res))
  
  (defun ido-flatten-merged-list (items)
!   ;; Create a list of directory names based on a merged directory list.
    (let (res)
      (while items
        (let* ((item (car items))
***************
*** 3220,3226 ****
  matches all files.  If there is only one match, select that file.
  If there is no common suffix, show a list of all matching files
  in a separate window.
! \\[ido-edit-input] Edit input string (including path).
  \\[ido-prev-work-directory] or \\[ido-next-work-directory] go to 
previous/next directory in work directory history.
  \\[ido-merge-work-directories] search for file in the work directory history.
  \\[ido-forget-work-directory] removes current directory from the work 
directory history.
--- 3220,3226 ----
  matches all files.  If there is only one match, select that file.
  If there is no common suffix, show a list of all matching files
  in a separate window.
! \\[ido-edit-input] Edit input string (including directory).
  \\[ido-prev-work-directory] or \\[ido-next-work-directory] go to 
previous/next directory in work directory history.
  \\[ido-merge-work-directories] search for file in the work directory history.
  \\[ido-forget-work-directory] removes current directory from the work 
directory history.




reply via email to

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