aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2003-01-13 22:56:53 +0000
committerKim F. Storm2003-01-13 22:56:53 +0000
commit362cdb6189f3ef2c8db47cb2fb7d27d23fd2efdc (patch)
tree878438b1a5f149a514838d45ef74cc8a9ed9522f
parentefdc16c957f23854a9aba554261c79677cf43154 (diff)
downloademacs-362cdb6189f3ef2c8db47cb2fb7d27d23fd2efdc.tar.gz
emacs-362cdb6189f3ef2c8db47cb2fb7d27d23fd2efdc.zip
(ido-ignore-directories-merge): Doc fix.
(ido-max-prompt-width): Renamed from ido-max-prompt-path. (ido-enable-last-directory-history): Doc fix. (ido-work-directory-list-ignore-regexps): Doc fix. (ido-enable-tramp-completion): Doc fix. (ido-record-ftp-work-directories): Doc fix. (ido-merge-ftp-work-directories): Doc fix. (ido-rewrite-file-prompt-functions): Renamed from ido-make-file-prompt-hook. Directory name is now in dynamic variable `dirname' (instead of `path'). (ido-rewrite-file-prompt-rules): Renamed from ido-rewrite-prompt-path-rules. (ido-read-file-name-as-directory-commands): Doc fix. (ido-last-directory-list): Doc fix. (ido-work-directory-list): Doc fix. (ido-work-file-list): Doc fix. (ido-make-prompt): Directory name now in `dirname' var. (ido-edit-input): Doc fix. (ido-complete): Fix error message. (ido-copy-current-word): Doc fix. (ido-find-file): Doc fix.
-rw-r--r--lisp/ido.el90
1 files changed, 45 insertions, 45 deletions
diff --git a/lisp/ido.el b/lisp/ido.el
index 3157a81fe99..82b9485de33 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -416,8 +416,8 @@ This allows the current directory to be opened immediate with `dired'."
416 :group 'ido) 416 :group 'ido)
417 417
418(defcustom ido-ignore-directories-merge nil 418(defcustom ido-ignore-directories-merge nil
419 "*List of regexps or functions matching directory path names to ignore during merge. 419 "*List of regexps or functions matching directory names to ignore during merge.
420Directory paths matched by one of the regexps in this list are not inserted 420Directory names matched by one of the regexps in this list are not inserted
421in merged file and directory lists." 421in merged file and directory lists."
422 :type '(repeat (choice regexp function)) 422 :type '(repeat (choice regexp function))
423 :group 'ido) 423 :group 'ido)
@@ -511,7 +511,7 @@ non-negletable amount of time; setting this variable reduces that time."
511 :type 'integer 511 :type 'integer
512 :group 'ido) 512 :group 'ido)
513 513
514(defcustom ido-max-prompt-path 0.35 514(defcustom ido-max-prompt-width 0.35
515 "*Non-zero means that the prompt string be limited to than number of characters. 515 "*Non-zero means that the prompt string be limited to than number of characters.
516If value is a floating point number, it specifies a fraction of the frame width." 516If value is a floating point number, it specifies a fraction of the frame width."
517 :type '(choice 517 :type '(choice
@@ -533,7 +533,7 @@ If value is a floating point number, it specifies a fraction of the frame width.
533 :group 'ido) 533 :group 'ido)
534 534
535(defcustom ido-enable-last-directory-history t 535(defcustom ido-enable-last-directory-history t
536 "*Non-nil means that `ido' will remember latest selected directory paths. 536 "*Non-nil means that `ido' will remember latest selected directory names.
537See `ido-last-directory-list' and `ido-save-directory-list-file'." 537See `ido-last-directory-list' and `ido-save-directory-list-file'."
538 :type 'boolean 538 :type 'boolean
539 :group 'ido) 539 :group 'ido)
@@ -547,7 +547,7 @@ See `ido-work-directory-list' and `ido-save-directory-list-file'."
547 547
548(defcustom ido-work-directory-list-ignore-regexps nil 548(defcustom ido-work-directory-list-ignore-regexps nil
549 "*List of regexps matching directories which should not be recorded. 549 "*List of regexps matching directories which should not be recorded.
550Directory paths matched by one of the regexps in this list are not inserted in 550Directory names matched by one of the regexps in this list are not inserted in
551the `ido-work-directory-list' list." 551the `ido-work-directory-list' list."
552 :type '(repeat regexp) 552 :type '(repeat regexp)
553 :group 'ido) 553 :group 'ido)
@@ -555,17 +555,17 @@ the `ido-work-directory-list' list."
555 555
556(defcustom ido-enable-tramp-completion t 556(defcustom ido-enable-tramp-completion t
557 "*Non-nil means that ido shall perform tramp method and server name completion. 557 "*Non-nil means that ido shall perform tramp method and server name completion.
558A tramp file name uses the following syntax: /method:user@host:path." 558A tramp file name uses the following syntax: /method:user@host:filename."
559 :type 'boolean 559 :type 'boolean
560 :group 'ido) 560 :group 'ido)
561 561
562(defcustom ido-record-ftp-work-directories t 562(defcustom ido-record-ftp-work-directories t
563 "*Non-nil means that ftp paths are recorded in work directory list." 563 "*Non-nil means that remote directories are recorded in work directory list."
564 :type 'boolean 564 :type 'boolean
565 :group 'ido) 565 :group 'ido)
566 566
567(defcustom ido-merge-ftp-work-directories nil 567(defcustom ido-merge-ftp-work-directories nil
568 "*Nil means that ftp paths in work directory list are ignored during merge." 568 "*Nil means that remote directories in work directory list are ignored during merge."
569 :type 'boolean 569 :type 'boolean
570 :group 'ido) 570 :group 'ido)
571 571
@@ -735,31 +735,31 @@ Each function on the list may modify the dynamically bound variable
735 :type 'hook 735 :type 'hook
736 :group 'ido) 736 :group 'ido)
737 737
738(defcustom ido-make-file-prompt-hook nil 738(defcustom ido-rewrite-file-prompt-functions nil
739 "*List of functions to run when the find-file prompt is created. 739 "*List of functions to run when the find-file prompt is created.
740Each function on the list may modify the following dynamically bound 740Each function on the list may modify the following dynamically bound
741variables: 741variables:
742 path - the (abbreviated) directory path 742 dirname - the (abbreviated) directory name to be modified by the hook functions
743 max-width - the max width of the path; set to nil to inhibit truncation 743 max-width - the max width of the resulting dirname; set to nil to inhibit truncation
744 prompt - the basic prompt (e.g. \"Find File: \") 744 prompt - the basic prompt (e.g. \"Find File: \")
745 literal - the string shown if doing `literal' find; set to nil to omit 745 literal - the string shown if doing `literal' find; set to nil to omit
746 vc-off - the string shown if version control is inhibited; set to nit to omit 746 vc-off - the string shown if version control is inhibited; set to nit to omit
747 prefix - normally nil, but may be set to a fixed prefix for the path 747 prefix - normally nil, but may be set to a fixed prefix for the dirname
748The following variables are available, but should not be changed: 748The following variables are available, but should not be changed:
749 ido-current-directory - the unabbreviated directory path 749 ido-current-directory - the unabbreviated directory name
750 item - equals 'file or 'dir depending on the current mode." 750 item - equals 'file or 'dir depending on the current mode."
751 :type 'hook 751 :type 'hook
752 :group 'ido) 752 :group 'ido)
753 753
754(defvar ido-rewrite-prompt-path-rules nil 754(defvar ido-rewrite-file-prompt-rules nil
755 "*Alist of rewriting rules for file paths. 755 "*Alist of rewriting rules for directory names in ido prompts.
756A list of elements of the form (FROM . TO) or (FROM . FUNC), 756A list of elements of the form (FROM . TO) or (FROM . FUNC), each
757each meaning to rewrite the path if matched by FROM by either 757meaning to rewrite the directory name if matched by FROM by either
758substituting the matched string by TO or calling the function 758substituting the matched string by TO or calling the function FUNC
759FUNC with the current path as its only argument and using the 759with the current directory name as its only argument and using the
760return value as the new path. In addition, each FUNC may 760return value as the new directory name. In addition, each FUNC may
761also modify the dynamic variables described for the 761also modify the dynamic variables described for the variable
762variable `ido-make-file-prompt-hook'.") 762`ido-rewrite-file-prompt-functions'.")
763 763
764(defcustom ido-completion-buffer "*Ido Completions*" 764(defcustom ido-completion-buffer "*Ido Completions*"
765 "*Name of completion buffer used by ido. 765 "*Name of completion buffer used by ido.
@@ -804,7 +804,7 @@ Must be set before enabling ido mode."
804 :group 'ido) 804 :group 'ido)
805 805
806(defcustom ido-read-file-name-as-directory-commands '() 806(defcustom ido-read-file-name-as-directory-commands '()
807 "List of commands which uses read-file-name to read a directory path. 807 "List of commands which uses read-file-name to read a directory name.
808When `ido-everywhere' is non-nil, the commands in this list will read 808When `ido-everywhere' is non-nil, the commands in this list will read
809the directory using ido-read-directory-name." 809the directory using ido-read-directory-name."
810 :type '(repeat symbol) 810 :type '(repeat symbol)
@@ -831,17 +831,17 @@ the file name using normal read-file-name style."
831 "History of buffers selected using `ido-switch-buffer'.") 831 "History of buffers selected using `ido-switch-buffer'.")
832 832
833(defvar ido-last-directory-list nil 833(defvar ido-last-directory-list nil
834 "List of last selected directory paths. 834 "List of last selected directory names.
835See `ido-enable-last-directory-history' for details.") 835See `ido-enable-last-directory-history' for details.")
836 836
837(defvar ido-work-directory-list nil 837(defvar ido-work-directory-list nil
838 "List of actual working directory paths. 838 "List of actual working directory names.
839The current directory is inserted at the front of this list whenever a 839The current directory is inserted at the front of this list whenever a
840file is opened with ido-find-file and family.") 840file is opened with ido-find-file and family.")
841 841
842(defvar ido-work-file-list nil 842(defvar ido-work-file-list nil
843 "List of actual work file names. 843 "List of actual work file names.
844The current file name (sans path) is inserted at the front of this list 844The current file name (sans directory) is inserted at the front of this list
845whenever a file is opened with ido-find-file and family.") 845whenever a file is opened with ido-find-file and family.")
846 846
847(defvar ido-dir-file-cache nil 847(defvar ido-dir-file-cache nil
@@ -1394,35 +1394,35 @@ This function also adds a hook to the minibuffer."
1394 ;; Make the prompt for ido-read-internal 1394 ;; Make the prompt for ido-read-internal
1395 (cond 1395 (cond
1396 ((and (memq item '(file dir)) ido-current-directory) 1396 ((and (memq item '(file dir)) ido-current-directory)
1397 (let ((path (abbreviate-file-name ido-current-directory)) 1397 (let ((dirname (abbreviate-file-name ido-current-directory))
1398 (max-width (if (and ido-max-prompt-path (floatp ido-max-prompt-path)) 1398 (max-width (if (and ido-max-prompt-width (floatp ido-max-prompt-width))
1399 (floor (* (frame-width) ido-max-prompt-path)) 1399 (floor (* (frame-width) ido-max-prompt-width))
1400 ido-max-prompt-path)) 1400 ido-max-prompt-width))
1401 (literal (and (boundp 'ido-find-literal) ido-find-literal "(literal) ")) 1401 (literal (and (boundp 'ido-find-literal) ido-find-literal "(literal) "))
1402 (vc-off (and ido-saved-vc-mt (not vc-master-templates) "[-VC] ")) 1402 (vc-off (and ido-saved-vc-mt (not vc-master-templates) "[-VC] "))
1403 (prefix nil) 1403 (prefix nil)
1404 (rule ido-rewrite-prompt-path-rules)) 1404 (rule ido-rewrite-file-prompt-rules))
1405 (let ((case-fold-search nil)) 1405 (let ((case-fold-search nil))
1406 (while rule 1406 (while rule
1407 (if (and (consp (car rule)) 1407 (if (and (consp (car rule))
1408 (string-match (car (car rule)) path)) 1408 (string-match (car (car rule)) dirname))
1409 (setq path 1409 (setq dirname
1410 (if (stringp (cdr (car rule))) 1410 (if (stringp (cdr (car rule)))
1411 (replace-match (cdr (car rule)) t nil path) 1411 (replace-match (cdr (car rule)) t nil dirname)
1412 (funcall (cdr (car rule)) path)))) 1412 (funcall (cdr (car rule)) dirname))))
1413 (setq rule (cdr rule)))) 1413 (setq rule (cdr rule))))
1414 (run-hooks 'ido-make-file-prompt-hook) 1414 (run-hooks 'ido-rewrite-file-prompt-functions)
1415 (concat prompt 1415 (concat prompt
1416 ; (if ido-process-ignore-lists "" "&") 1416 ; (if ido-process-ignore-lists "" "&")
1417 (or literal "") 1417 (or literal "")
1418 (or vc-off "") 1418 (or vc-off "")
1419 (or prefix "") 1419 (or prefix "")
1420 (let ((l (length path))) 1420 (let ((l (length dirname)))
1421 (if (and max-width (> max-width 0) (> l max-width)) 1421 (if (and max-width (> max-width 0) (> l max-width))
1422 (let* ((s (substring path (- max-width))) 1422 (let* ((s (substring dirname (- max-width)))
1423 (i (string-match "/" s))) 1423 (i (string-match "/" s)))
1424 (concat "..." (if i (substring s i) s))) 1424 (concat "..." (if i (substring s i) s)))
1425 path))))) 1425 dirname)))))
1426 (t prompt))) 1426 (t prompt)))
1427 1427
1428;; Here is very briefly how ido-find-file works: 1428;; Here is very briefly how ido-find-file works:
@@ -1723,7 +1723,7 @@ If INITIAL is non-nil, it specifies the initial input string."
1723 ido-selected)) 1723 ido-selected))
1724 1724
1725(defun ido-edit-input () 1725(defun ido-edit-input ()
1726 "Edit ido path and input string. Terminate by RET." 1726 "Edit absolute file name entered so far with ido; terminate by RET."
1727 (interactive) 1727 (interactive)
1728 (setq ido-text-init ido-text) 1728 (setq ido-text-init ido-text)
1729 (setq ido-exit 'edit) 1729 (setq ido-exit 'edit)
@@ -1884,7 +1884,7 @@ If INITIAL is non-nil, it specifies the initial input string."
1884 (if (eq method 'dired) 1884 (if (eq method 'dired)
1885 (dired-goto-file (expand-file-name file)))) 1885 (dired-goto-file (expand-file-name file))))
1886 ((string-match "[[*?]" filename) 1886 ((string-match "[[*?]" filename)
1887 (setq path (concat ido-current-directory filename)) 1887 (setq path (concat ido-current-directory filename))
1888 (ido-record-command method path) 1888 (ido-record-command method path)
1889 (ido-record-work-directory) 1889 (ido-record-work-directory)
1890 (funcall method path)) 1890 (funcall method path))
@@ -1958,7 +1958,7 @@ If INITIAL is non-nil, it specifies the initial input string."
1958 (string-match "[$]" ido-text)) 1958 (string-match "[$]" ido-text))
1959 (let ((evar (substitute-in-file-name (concat ido-current-directory ido-text)))) 1959 (let ((evar (substitute-in-file-name (concat ido-current-directory ido-text))))
1960 (if (not (file-exists-p (file-name-directory evar))) 1960 (if (not (file-exists-p (file-name-directory evar)))
1961 (message "Expansion generates non-existing directory path") 1961 (message "Expansion generates non-existing directory.")
1962 (if (file-directory-p evar) 1962 (if (file-directory-p evar)
1963 (ido-set-current-directory evar) 1963 (ido-set-current-directory evar)
1964 (let ((d (or (file-name-directory evar) "/")) 1964 (let ((d (or (file-name-directory evar) "/"))
@@ -2319,7 +2319,7 @@ If repeated, insert text from buffer instead."
2319 (exit-minibuffer)))) 2319 (exit-minibuffer))))
2320 2320
2321(defun ido-copy-current-word (all) 2321(defun ido-copy-current-word (all)
2322 "Insert current word (file name or path) from current buffer." 2322 "Insert current word (file or directory name) from current buffer."
2323 (interactive "P") 2323 (interactive "P")
2324 (let ((word (save-excursion 2324 (let ((word (save-excursion
2325 (set-buffer ido-entry-buffer) 2325 (set-buffer ido-entry-buffer)
@@ -2494,7 +2494,7 @@ for first matching file."
2494 res)) 2494 res))
2495 2495
2496(defun ido-flatten-merged-list (items) 2496(defun ido-flatten-merged-list (items)
2497 ;; Create a list of path names based on a merged directory list. 2497 ;; Create a list of directory names based on a merged directory list.
2498 (let (res) 2498 (let (res)
2499 (while items 2499 (while items
2500 (let* ((item (car items)) 2500 (let* ((item (car items))
@@ -3220,7 +3220,7 @@ If no buffer or file is found, prompt for a new one.
3220matches all files. If there is only one match, select that file. 3220matches all files. If there is only one match, select that file.
3221If there is no common suffix, show a list of all matching files 3221If there is no common suffix, show a list of all matching files
3222in a separate window. 3222in a separate window.
3223\\[ido-edit-input] Edit input string (including path). 3223\\[ido-edit-input] Edit input string (including directory).
3224\\[ido-prev-work-directory] or \\[ido-next-work-directory] go to previous/next directory in work directory history. 3224\\[ido-prev-work-directory] or \\[ido-next-work-directory] go to previous/next directory in work directory history.
3225\\[ido-merge-work-directories] search for file in the work directory history. 3225\\[ido-merge-work-directories] search for file in the work directory history.
3226\\[ido-forget-work-directory] removes current directory from the work directory history. 3226\\[ido-forget-work-directory] removes current directory from the work directory history.