[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/ido.el
From: |
Kim F . Storm |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/ido.el |
Date: |
Wed, 15 Jun 2005 18:44:09 -0400 |
Index: emacs/lisp/ido.el
diff -c emacs/lisp/ido.el:1.62 emacs/lisp/ido.el:1.63
*** emacs/lisp/ido.el:1.62 Tue Jun 14 15:32:41 2005
--- emacs/lisp/ido.el Wed Jun 15 22:44:09 2005
***************
*** 770,775 ****
--- 770,781 ----
"*Font used by ido for highlighting its indicators."
:group 'ido)
+ (defface ido-incomplete-regexp
+ '((t
+ (:inherit font-lock-warning-face)))
+ "Ido face for indicating incomplete regexps."
+ :group 'ido)
+
(defcustom ido-make-file-list-hook nil
"*List of functions to run when the list of matching files is created.
Each function on the list may modify the dynamically bound variable
***************
*** 959,964 ****
--- 965,972 ----
Is set by ido functions to the current minibuffer-depth, so that
it doesn't interfere with other minibuffer usage.")
+ (defvar ido-incomplete-regexp nil
+ "Non-nil if an incomplete regexp is entered.")
;;; Variables with dynamic bindings.
;;; Declared here to keep the byte compiler quiet.
***************
*** 2170,2175 ****
--- 2178,2186 ----
(interactive)
(let (res)
(cond
+ (ido-incomplete-regexp
+ ;; Do nothing
+ )
((and (memq ido-cur-item '(file dir))
(string-match "[$]" ido-text))
(let ((evar (substitute-in-file-name (concat ido-current-directory
ido-text))))
***************
*** 2394,2401 ****
(defun ido-exit-minibuffer ()
"Exit minibuffer, but make sure we have a match if one is needed."
(interactive)
! (if (or (not ido-require-match)
! (ido-existing-item-p))
(exit-minibuffer)))
(defun ido-select-text ()
--- 2405,2413 ----
(defun ido-exit-minibuffer ()
"Exit minibuffer, but make sure we have a match if one is needed."
(interactive)
! (if (and (or (not ido-require-match)
! (ido-existing-item-p))
! (not ido-incomplete-regexp))
(exit-minibuffer)))
(defun ido-select-text ()
***************
*** 3275,3296 ****
full-matches
prefix-matches
matches)
! (mapcar
! (lambda (item)
! (let ((name (ido-name item)))
! (if (and (or non-prefix-dot
! (if (= (aref ido-text 0) ?.)
! (= (aref name 0) ?.)
! (/= (aref name 0) ?.)))
! (string-match re name))
! (cond
! ((and full-re (string-match full-re name))
! (setq full-matches (cons item full-matches)))
! ((and prefix-re (string-match prefix-re name))
! (setq prefix-matches (cons item prefix-matches)))
! (t (setq matches (cons item matches))))))
! t)
! items)
(if prefix-matches
(setq matches (nconc prefix-matches matches)))
(if full-matches
--- 3287,3316 ----
full-matches
prefix-matches
matches)
! (setq ido-incomplete-regexp nil)
! (condition-case error
! (mapcar
! (lambda (item)
! (let ((name (ido-name item)))
! (if (and (or non-prefix-dot
! (if (= (aref ido-text 0) ?.)
! (= (aref name 0) ?.)
! (/= (aref name 0) ?.)))
! (string-match re name))
! (cond
! ((and full-re (string-match full-re name))
! (setq full-matches (cons item full-matches)))
! ((and prefix-re (string-match prefix-re name))
! (setq prefix-matches (cons item prefix-matches)))
! (t (setq matches (cons item matches))))))
! t)
! items)
! (invalid-regexp
! (setq ido-incomplete-regexp t
! ;; Consider the invalid regexp message internally as a
! ;; special-case single match, and handle appropriately
! ;; elsewhere.
! matches (cdr error))))
(if prefix-matches
(setq matches (nconc prefix-matches matches)))
(if full-matches
***************
*** 4048,4054 ****
(setq first (format "%s" fn))
(put-text-property 0 ln 'face
(if (= (length comps) 1)
! 'ido-only-match
'ido-first-match)
first)
(if ind (setq first (concat first ind)))
--- 4068,4076 ----
(setq first (format "%s" fn))
(put-text-property 0 ln 'face
(if (= (length comps) 1)
! (if ido-incomplete-regexp
! 'ido-incomplete-regexp
! 'ido-only-match)
'ido-first-match)
first)
(if ind (setq first (concat first ind)))
***************
*** 4063,4076 ****
(ido-report-no-match
(nth 6 ido-decorations)) ;; [No match]
(t "")))
!
((null (cdr comps)) ;one match
! (concat (if (> (length (ido-name (car comps))) (length name))
! ;; when there is one match, show the matching file name
in full
! (concat (nth 4 ido-decorations) ;; [ ... ]
! (ido-name (car comps))
! (nth 5 ido-decorations))
! "")
(if (not ido-use-faces) (nth 7 ido-decorations)))) ;;
[Matched]
(t ;multiple matches
(let* ((items (if (> ido-max-prospects 0) (1+ ido-max-prospects)
999))
--- 4085,4106 ----
(ido-report-no-match
(nth 6 ido-decorations)) ;; [No match]
(t "")))
! (ido-incomplete-regexp
! (concat " " (car comps)))
((null (cdr comps)) ;one match
! (concat (if (if (not ido-enable-regexp)
! (= (length (ido-name (car comps))) (length name))
! ;; We can't rely on the length of the input
! ;; for regexps, so explicitly check for a
! ;; complete match
! (string-match name (ido-name (car comps)))
! (string-equal (match-string 0 (ido-name (car comps)))
! (ido-name (car comps))))
! ""
! ;; when there is one match, show the matching file name
in full
! (concat (nth 4 ido-decorations) ;; [ ... ]
! (ido-name (car comps))
! (nth 5 ido-decorations)))
(if (not ido-use-faces) (nth 7 ido-decorations)))) ;;
[Matched]
(t ;multiple matches
(let* ((items (if (> ido-max-prospects 0) (1+ ido-max-prospects)
999))