:type 'boolean
:group 'ido)
+(defcustom ido-cannot-complete-command 'ido-completion-help
+ "*Command run when `ido-complete' can't complete any more.
+The most useful values are `ido-completion-help', which pops up a
+window with completion alternatives, or `ido-next-match' or
+`ido-prev-match', which cycle the buffer list."
+ :type 'function
+ :group 'ido)
+
+
(defcustom ido-record-commands t
"*Non-nil means that `ido' will record commands in command history.
Note that the non-ido equivalent command is recorded."
(defvar ido-buffer-history nil
"History of buffers selected using `ido-switch-buffer'.")
-(defvar ido-xemacs (string-match "XEmacs" (emacs-version))
- "Non-nil if we are running XEmacs. Otherwise, assume we are running Emacs.")
-
(defvar ido-last-directory-list nil
"List of last selected directory paths.
See `ido-enable-last-directory-history' for details.")
((not ido-matches)
(when ido-completion-buffer
- (setq this-command 'ido-completion-help)
- (ido-completion-help)))
+ (call-interactively (setq this-command ido-cannot-complete-command))))
((= 1 (length ido-matches))
;; only one choice, so select it.
(delete-region (minibuffer-prompt-end) (point))
(insert res))
;; else nothing to complete
- (ido-completion-help)
+ (call-interactively (setq this-command ido-cannot-complete-command))
)))))
(defun ido-complete-space ()
res)
(while paths
(setq path (car paths)
- paths (cdr paths)
paths (cdr paths))
(if (and (string-match "^/" path)
(file-exists-p path))
(ido-all-completions))
(t
(copy-sequence (or ido-matches ido-cur-list)))))))
- (if ido-xemacs
+ (if (featurep 'xemacs)
;; XEmacs extents are put on by default, doesn't seem to be
;; any way of switching them off.
;; This obscure code avoids a byte compiler warning in Emacs.
(select-frame-set-input-focus newframe)
(raise-frame newframe)
(select-frame newframe)
- (if (not ido-xemacs)
+ (unless (featurep 'xemacs)
(set-mouse-position (selected-frame) (1- (frame-width)) 0)))
(select-window win))
(t
(display-buffer buffer))
((eq method 'otherframe)
- (progn
- (switch-to-buffer-other-frame buffer)
- (if (not ido-xemacs)
- (if (fboundp 'select-frame-set-input-focus)
- (select-frame-set-input-focus (selected-frame))
- (set-mouse-position (selected-frame) (1- (frame-width)) 0)))
- )))))
+ (switch-to-buffer-other-frame buffer)
+ (unless (featurep 'xemacs)
+ (select-frame-set-input-focus (selected-frame)))
+ ))))
(defun ido-window-buffer-p (buffer)
"Minibuffer setup hook for `ido'."
;; Copied from `icomplete-minibuffer-setup-hook'.
(when (and (boundp 'ido-completing-read)
- (or ido-xemacs (= ido-use-mycompletion-depth (minibuffer-depth))))
+ (or (featurep 'xemacs)
+ (= ido-use-mycompletion-depth (minibuffer-depth))))
(add-hook 'pre-command-hook 'ido-tidy nil t)
(add-hook 'post-command-hook 'ido-exhibit nil t)
(setq cua-inhibit-cua-keys t)
- (when ido-xemacs
+ (when (featurep 'xemacs)
(ido-exhibit)
(goto-char (point-min)))
(run-hooks 'ido-minibuffer-setup-hook)))
(defun ido-read-file-name (prompt &optional dir default-filename mustmatch initial predicate)
"Read file name, prompting with PROMPT and completing in directory DIR.
See `read-file-name' for additional parameters."
- (message "%S %S %S %S" this-command ido-read-file-name-non-ido
- predicate (memq this-command ido-read-file-name-non-ido))
(cond
((or (eq predicate 'file-directory-p)
(memq this-command ido-read-file-name-as-directory-commands))
(ido-read-directory-name prompt dir default-filename mustmatch initial))
((and (not (memq this-command ido-read-file-name-non-ido))
(or (null predicate) (eq predicate 'file-exists-p)))
- (message "gotit")
(let (filename
ido-saved-vc-mt
(vc-master-templates (and (boundp 'vc-master-templates) vc-master-templates))