summaryrefslogtreecommitdiff
path: root/lisp/ido.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/ido.el')
-rw-r--r--lisp/ido.el71
1 files changed, 37 insertions, 34 deletions
diff --git a/lisp/ido.el b/lisp/ido.el
index 64ddf76d5eb..750eb6e6dfc 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -436,17 +436,16 @@ in merged file and directory lists."
:type '(repeat (choice regexp function))
:group 'ido)
-;;; Examples for setting the value of ido-ignore-buffers
-;(defun ido-ignore-c-mode (name)
-; "Ignore all c mode buffers -- example function for ido."
-; (save-excursion
-; (set-buffer name)
-; (string-match "^C$" mode-name)))
-;
-;(setq ido-ignore-buffers '("^ " ido-ignore-c-mode))
-
-;;; Examples for setting the value of ido-ignore-files
-;(setq ido-ignore-files '("^ " "\\.c$" "\\.h$"))
+;; Examples for setting the value of ido-ignore-buffers
+;;(defun ido-ignore-c-mode (name)
+;; "Ignore all c mode buffers -- example function for ido."
+;; (with-current-buffer name
+;; (derived-mode-p 'c-mode)))
+;;
+;;(setq ido-ignore-buffers '("^ " ido-ignore-c-mode))
+
+;; Examples for setting the value of ido-ignore-files
+;;(setq ido-ignore-files '("^ " "\\.c\\'" "\\.h\\'"))
(defcustom ido-default-file-method 'raise-frame
"*How to visit a new file when using `ido-find-file'.
@@ -1309,8 +1308,8 @@ Value is an integer which is number of chars to right of prompt.")
(unwind-protect
(with-current-buffer buf
(erase-buffer)
- (insert ";;; -*- coding: emacs-mule -*-\n")
- (setq buffer-file-coding-system 'emacs-mule)
+ (insert ";;; -*- coding: utf-8 -*-\n")
+ (setq buffer-file-coding-system 'utf-8)
(ido-pp 'ido-last-directory-list)
(ido-pp 'ido-work-directory-list)
(ido-pp 'ido-work-file-list)
@@ -2282,9 +2281,10 @@ If cursor is not at the end of the user input, move to end of input."
filename t))
((and ido-use-filename-at-point
- (setq fn (if (eq ido-use-filename-at-point 'guess)
- (with-no-warnings (ffap-guesser))
- (ffap-string-at-point)))
+ (setq fn (with-no-warnings
+ (if (eq ido-use-filename-at-point 'guess)
+ (ffap-guesser)
+ (ffap-string-at-point))))
(not (string-match "^http:/" fn))
(setq d (file-name-directory fn))
(file-directory-p d))
@@ -3356,7 +3356,7 @@ for first matching file."
(defun ido-to-end (items)
;; Move the elements from ITEMS to the end of `ido-temp-list'
- (mapcar
+ (mapc
(lambda (elem)
(setq ido-temp-list (delq elem ido-temp-list)))
items)
@@ -3364,6 +3364,8 @@ for first matching file."
(nconc ido-temp-list items)
(setq ido-temp-list items)))
+(declare-function tramp-tramp-file-p "tramp" (name))
+
(defun ido-file-name-all-completions-1 (dir)
(cond
((ido-nonreadable-directory-p dir) '())
@@ -3371,24 +3373,25 @@ for first matching file."
;; Caller must have done that if necessary.
((and ido-enable-tramp-completion
- (or (fboundp 'tramp-completion-mode)
+ (or (fboundp 'tramp-completion-mode-p)
(require 'tramp nil t))
(string-match "\\`/[^/]+[:@]\\'" dir))
;; Strip method:user@host: 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:user@host: => nil
- ;; /ftp:user@host:./ => 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 "./"))))))
+ (let* ((len (1- (length dir)))
+ (tramp-completion-mode t)
+ (compl
+ (or (file-name-all-completions "" dir)
+ ;; work around bug in ange-ftp.
+ ;; /ftp:user@host: => nil
+ ;; /ftp:user@host:./ => 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)))
@@ -3605,7 +3608,7 @@ for first matching file."
full-matches suffix-matches prefix-matches matches)
(setq ido-incomplete-regexp nil)
(condition-case error
- (mapcar
+ (mapc
(lambda (item)
(let ((name (ido-name item)))
(if (and (or non-prefix-dot
@@ -3650,7 +3653,7 @@ for first matching file."
(setq re (mapconcat #'regexp-quote (split-string ido-text "") ".*"))
(if ido-enable-prefix
(setq re (concat "\\`" re)))
- (mapcar
+ (mapc
(lambda (item)
(let ((name (ido-name item)))
(if (string-match re name)
@@ -4651,5 +4654,5 @@ DEF, if non-nil, is the default value."
(ido-read-internal 'list prompt hist def require-match initial-input)))
-;;; arch-tag: b63a3500-1735-41bd-8a01-05373f0864da
+;; arch-tag: b63a3500-1735-41bd-8a01-05373f0864da
;;; ido.el ends here