Index: complete.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/complete.el,v retrieving revision 1.72 diff -u -r1.72 complete.el --- complete.el 14 Apr 2007 20:23:31 -0000 1.72 +++ complete.el 4 Jun 2007 16:14:39 -0000 @@ -590,17 +590,32 @@ pred nil)) ;; Find an initial list of possible completions - (if (not (setq p (string-match (concat PC-delim-regex - (if filename "\\|\\*" "")) - str - (+ (length dirname) offset)))) - - ;; Minibuffer contains no hyphens -- simple case! - (setq poss (all-completions (if env-on - basestr str) - table - pred)) - + (unless (setq p (string-match (concat PC-delim-regex + (if filename "\\|\\*" "")) + str + (+ (length dirname) offset))) + + ;; Minibuffer contains no hyphens -- simple case! + (setq poss (all-completions (if env-on basestr str) + table + pred)) + (unless (or filename poss) + (setq + ;; unexploded str + ;; str (mapconcat #'list str "-") + regex (concat "\\`" + (mapconcat #'list str + (if filename "[^/.]*[/.]" "[^-]*-")) + ;; (replace-regexp-in-string + ;; "-" "[^-]*-" + ;; (mapconcat #'list str "-")) + ) + p 1) + (goto-char beg) + (delete-region beg end) + (setq end (+ beg (length str))) + (insert str))) + (when p ;; Use all-completions to do an initial cull. This is a big win, ;; since all-completions is written in C! (let ((compl (all-completions (if env-on @@ -609,6 +624,9 @@ table pred))) (setq p compl) + (when (and str (not compl)) + (setq ;; str unexploded + p nil)) (while p (and (string-match regex (car p)) (progn