emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/uniquify-files bce1da7 10/22: Fix bugs in uniquify-file


From: Stefan Monnier
Subject: [elpa] externals/uniquify-files bce1da7 10/22: Fix bugs in uniquify-files
Date: Tue, 1 Dec 2020 17:36:20 -0500 (EST)

branch: externals/uniquify-files
commit bce1da75a0c5f5ac97f301e28a1c9ddea708d62e
Author: Stephen Leake <stephen_leake@stephe-leake.org>
Commit: Stephen Leake <stephen_leake@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.
---
 file-complete-root-relative.el | 6 +++---
 uniquify-files.el              | 6 ++++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/file-complete-root-relative.el b/file-complete-root-relative.el
index 3f66809..929afdc 100644
--- a/file-complete-root-relative.el
+++ b/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/uniquify-files.el b/uniquify-files.el
index 59575c2..a281ebb 100644
--- a/uniquify-files.el
+++ b/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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]