Subject: bug#6830: widget-complete bad completions in :type 'file

From: Chong Yidong <[email-masked]>
Date: Mon, 05 Mar 2012 11:07:44 +0800

Eli Zaretskii <[email-masked]> writes:

> What do you get on GNU/Linux for the values of `field',
> `before_field', and `after_field'?

This is from doing M-x customize-variable RET abbrev-file-name RET, and
doing C-M-i after the end of the file name in the editable field:

(gdb) pp after_field
boundary
(gdb) pp before_field
completion
(gdb) pp field
completion

>> FWIW, increasing the priority of the `completion' overlay does not cause
>> widget file name completion to fail on GNU/Linux.  Could you try on
>> Windows?
>
> Give me a patch to try, and I will.

=== modified file 'lisp/minibuffer.el'
*** lisp/minibuffer.el	2012-02-23 15:41:12 +0000
--- lisp/minibuffer.el	2012-03-05 03:04:20 +0000
***************
*** 1483,1488 ****
--- 1483,1489 ----
            (minibuffer-completion-predicate predicate)
            (ol (make-overlay start end nil nil t)))
        (overlay-put ol 'field 'completion)
+       (overlay-put ol 'priority 5)
        (when completion-in-region-mode-predicate
          (completion-in-region-mode 1)
          (setq completion-in-region--data