Subject: Re: bug#17559: 24.3.50; Partial completion does not complete underscore delimited input

From: Andreas Politz <[email-masked]>
Date: Fri, 23 May 2014 20:19:14 +0200

Stefan Monnier <[email-masked]> writes:

> severity 17559 wishlist

Would something like the following be sufficient ?

=== modified file 'lisp/minibuffer.el'
*** lisp/minibuffer.el	2013-10-04 02:12:16 +0000
--- lisp/minibuffer.el	2014-05-23 18:14:44 +0000
***************
*** 3187,3193 ****
                  (string-match completion-pcm--delim-wild-regex str
                                (car bounds)))
        (if (zerop (car bounds))
!           (mapconcat 'string str "-")
          ;; If there's a boundary, it's trickier.  The main use-case
          ;; we consider here is file-name completion.  We'd like
          ;; to expand ~/eee to ~/e/e/e and /eee to /e/e/e.
--- 3187,3200 ----
                  (string-match completion-pcm--delim-wild-regex str
                                (car bounds)))
        (if (zerop (car bounds))
!           (let ((separator
!                  (or (completion-metadata-get
!                       (completion-metadata str table pred)
!                       'completion-initials-separator)
!                      (plist-get completion-extra-properties
!                                 :completion-initials-separator)
!                      "-")))
!             (mapconcat 'string str separator))
          ;; If there's a boundary, it's trickier.  The main use-case
          ;; we consider here is file-name completion.  We'd like
          ;; to expand ~/eee to ~/e/e/e and /eee to /e/e/e.

This appears to work, but I have little clue about the underlying
partial completion matching algorithm.

Andreas