comparison lisp/ido.el @ 48030:4086fbc6ad65

(ido-cannot-complete-command): New defcustom, default to ido-completion-help (similar to iswitchb-cannot-complete-hook). (ido-complete): Call value of ido-cannot-complete-command rather than ido-completion-help when no common completion.
author Kim F. Storm <storm@cua.dk>
date Sun, 27 Oct 2002 21:31:19 +0000
parents 01727f34cb9d
children 40a74df31521
comparison
equal deleted inserted replaced
48029:b3495cf753c5 48030:4086fbc6ad65
486 text is a prefix \(this behavior is like the standard unix- or 486 text is a prefix \(this behavior is like the standard unix- or
487 emacs-completion works). 487 emacs-completion works).
488 Value can be toggled within `ido' using `ido-toggle-prefix'." 488 Value can be toggled within `ido' using `ido-toggle-prefix'."
489 :type 'boolean 489 :type 'boolean
490 :group 'ido) 490 :group 'ido)
491
492 (defcustom ido-cannot-complete-command 'ido-completion-help
493 "*Command run when `ido-complete' can't complete any more.
494 The most useful values are `ido-completion-help', which pops up a
495 window with completion alternatives, or `ido-next-match' or
496 `ido-prev-match', which cycle the buffer list."
497 :type 'function
498 :group 'ido)
499
491 500
492 (defcustom ido-record-commands t 501 (defcustom ido-record-commands t
493 "*Non-nil means that `ido' will record commands in command history. 502 "*Non-nil means that `ido' will record commands in command history.
494 Note that the non-ido equivalent command is recorded." 503 Note that the non-ido equivalent command is recorded."
495 :type 'boolean 504 :type 'boolean
1926 (setq ido-exit 'refresh) 1935 (setq ido-exit 'refresh)
1927 (exit-minibuffer)))) 1936 (exit-minibuffer))))
1928 1937
1929 ((not ido-matches) 1938 ((not ido-matches)
1930 (when ido-completion-buffer 1939 (when ido-completion-buffer
1931 (setq this-command 'ido-completion-help) 1940 (call-interactively (setq this-command ido-cannot-complete-command))))
1932 (ido-completion-help)))
1933 1941
1934 ((= 1 (length ido-matches)) 1942 ((= 1 (length ido-matches))
1935 ;; only one choice, so select it. 1943 ;; only one choice, so select it.
1936 (exit-minibuffer)) 1944 (exit-minibuffer))
1937 1945
1944 ;; move exact match to front if not in prefix mode 1952 ;; move exact match to front if not in prefix mode
1945 (setq ido-rescan (not ido-enable-prefix)) 1953 (setq ido-rescan (not ido-enable-prefix))
1946 (delete-region (minibuffer-prompt-end) (point)) 1954 (delete-region (minibuffer-prompt-end) (point))
1947 (insert res)) 1955 (insert res))
1948 ;; else nothing to complete 1956 ;; else nothing to complete
1949 (ido-completion-help) 1957 (call-interactively (setq this-command ido-cannot-complete-command))
1950 ))))) 1958 )))))
1951 1959
1952 (defun ido-complete-space () 1960 (defun ido-complete-space ()
1953 "Try completion unless inserting the space makes sense." 1961 "Try completion unless inserting the space makes sense."
1954 (interactive) 1962 (interactive)