# HG changeset patch # User Stefan Monnier # Date 1178640134 0 # Node ID 98ca0b616c8983707516dc461bd6c53b23c81016 # Parent 52034b3003ea1d34bffb0b5d59e6e0bf9e0cd13f (compilation-find-file): Add a big comment. diff -r 52034b3003ea -r 98ca0b616c89 lisp/progmodes/compile.el --- a/lisp/progmodes/compile.el Tue May 08 15:59:45 2007 +0000 +++ b/lisp/progmodes/compile.el Tue May 08 16:02:14 2007 +0000 @@ -1863,7 +1863,24 @@ (let* ((name (read-file-name (format "Find this %s in (default %s): " compilation-error filename) - spec-dir filename t nil)) + spec-dir filename t nil + ;; The predicate below is fine when called from + ;; minibuffer-complete-and-exit, but it's too + ;; restrictive otherwise, since it also prevents the + ;; user from completing "fo" to "foo/" when she + ;; wants to enter "foo/bar". + ;; + ;; Try to make sure the user can only select + ;; a valid answer. This predicate may be ignored, + ;; tho, so we still have to double-check afterwards. + ;; TODO: We should probably fix read-file-name so + ;; that it never ignores this predicate, even when + ;; using popup dialog boxes. + ;; (lambda (name) + ;; (if (file-directory-p name) + ;; (setq name (expand-file-name filename name))) + ;; (file-exists-p name)) + )) (origname name)) (cond ((not (file-exists-p name))