Mercurial > emacs
comparison lisp/ido.el @ 64168:f7e7dd269327
* ido.el (ido-use-filename-at-point): New choice `guess'.
(ido-file-internal): Try ffap-guesser if selected.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Fri, 08 Jul 2005 10:07:39 +0000 |
parents | fad9662db4a9 |
children | 8b29b8961758 fbb2bea03df9 |
comparison
equal
deleted
inserted
replaced
64167:35e5dc0d4ab4 | 64168:f7e7dd269327 |
---|---|
576 :group 'ido) | 576 :group 'ido) |
577 | 577 |
578 | 578 |
579 (defcustom ido-use-filename-at-point nil | 579 (defcustom ido-use-filename-at-point nil |
580 "*Non-nil means that ido shall look for a filename at point. | 580 "*Non-nil means that ido shall look for a filename at point. |
581 May use `ffap-guesser' to guess whether text at point is a filename. | |
581 If found, use that as the starting point for filename selection." | 582 If found, use that as the starting point for filename selection." |
582 :type 'boolean | 583 :type '(choice |
584 (const :tag "Disabled" nil) | |
585 (const :tag "Guess filename" guess) | |
586 (other :tag "Use literal filename" t)) | |
583 :group 'ido) | 587 :group 'ido) |
584 | 588 |
585 | 589 |
586 (defcustom ido-use-url-at-point nil | 590 (defcustom ido-use-url-at-point nil |
587 "*Non-nil means that ido shall look for a URL at point. | 591 "*Non-nil means that ido shall look for a URL at point. |
2049 (ffap-gopher-at-point))))) | 2053 (ffap-gopher-at-point))))) |
2050 (setq ido-exit 'ffap | 2054 (setq ido-exit 'ffap |
2051 filename t)) | 2055 filename t)) |
2052 | 2056 |
2053 ((and ido-use-filename-at-point | 2057 ((and ido-use-filename-at-point |
2054 (setq fn (ffap-string-at-point)) | 2058 (setq fn (if (eq ido-use-filename-at-point 'guess) |
2059 (ffap-guesser) | |
2060 (ffap-string-at-point))) | |
2055 (not (string-match "^http:/" fn)) | 2061 (not (string-match "^http:/" fn)) |
2056 (setq d (file-name-directory fn)) | 2062 (setq d (file-name-directory fn)) |
2057 (file-directory-p d)) | 2063 (file-directory-p d)) |
2058 (setq ido-current-directory d) | 2064 (setq ido-current-directory d) |
2059 (setq initial (file-name-nondirectory fn)))))) | 2065 (setq initial (file-name-nondirectory fn)))))) |