branch: master commit be1367a01d4e322ab592d1882371852005f773c4 Author: Stephen Leake <stephen_le...@stephe-leake.org> Commit: Stephen Leake <stephen_le...@stephe-leake.org>
Fix bugs in uniquify-files * packages/uniquify-files/file-complete-root-relative.el: (fc-root-rel-completion-table-list): Enforce directory-file-name for root. * packages/uniquify-files/uniquify-files.el: (locate-uniquified-file-iter-2): Set completion-category-overrides. --- packages/uniquify-files/file-complete-root-relative.el | 6 +++--- packages/uniquify-files/uniquify-files.el | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/uniquify-files/file-complete-root-relative.el b/packages/uniquify-files/file-complete-root-relative.el index 3f66809..929afdc 100644 --- a/packages/uniquify-files/file-complete-root-relative.el +++ b/packages/uniquify-files/file-complete-root-relative.el @@ -368,7 +368,7 @@ STRING, PRED, ACTION are completion table arguments." (list '(category . project-file) '(styles . (file-root-rel)) - (cons 'root root)))) + (cons 'root (directory-file-name root))))) ((null action) ;; Called from `try-completion'; should never get here (see @@ -379,7 +379,7 @@ STRING, PRED, ACTION are completion table arguments." '(lambda ;; Called from `test-completion' t)) ;; Called from all-completions - (let ((regex (fc-root-rel--pcm-pattern-list string root)) + (let ((regex (fc-root-rel--pcm-pattern-list string (directory-file-name root))) (result nil) (case-fold-search completion-ignore-case)) @@ -394,7 +394,7 @@ STRING, PRED, ACTION are completion table arguments." (cond ((eq action 'lambda) ;; Called from `test-completion' - (fc-root-rel--valid-completion string result root)) + (fc-root-rel--valid-completion string result (directory-file-name root))) ((eq action t) ;; Called from all-completions diff --git a/packages/uniquify-files/uniquify-files.el b/packages/uniquify-files/uniquify-files.el index 59575c2..a281ebb 100644 --- a/packages/uniquify-files/uniquify-files.el +++ b/packages/uniquify-files/uniquify-files.el @@ -808,8 +808,10 @@ In the user input string, `*' is treated as a wildcard." (defun locate-uniquified-file-iter-2 (iter &optional predicate default prompt) "Same as `locate-uniquified-file-iter', but the internal completion table is the list returned by `path-iter-all-files'." - (let ((table (path-iter-all-files iter)) - (completion-styles '(uniquify-file))) + (let* ((table (path-iter-all-files iter)) + (table-styles (cdr (assq 'styles (completion-metadata "" table nil)))) + (completion-category-overrides + (list (list 'project-file (cons 'styles table-styles))))) (completing-read (format (concat (or prompt "file") " (%s): ") default) table predicate t nil nil default)