Hide temporary FUSE files in Tramp
* lisp/net/tramp-fuse.el (tramp-fuse-remove-hidden-files): New defsubst. (tramp-fuse-handle-directory-files) (tramp-fuse-handle-file-name-all-completions): Use it.
This commit is contained in:
parent
5dbaddc729
commit
007bf9a34c
1 changed files with 23 additions and 15 deletions
|
@ -44,6 +44,12 @@
|
|||
(delete-file (tramp-fuse-local-file-name filename) trash)
|
||||
(tramp-flush-file-properties v localname)))
|
||||
|
||||
(defsubst tramp-fuse-remove-hidden-files (files)
|
||||
"Remove hidden files from FILES."
|
||||
(cl-remove-if
|
||||
(lambda (x) (and (stringp x) (string-match-p "\\.fuse_hidden" x)))
|
||||
files))
|
||||
|
||||
(defun tramp-fuse-handle-directory-files
|
||||
(directory &optional full match nosort count)
|
||||
"Like `directory-files' for Tramp files."
|
||||
|
@ -75,7 +81,8 @@
|
|||
result)))
|
||||
(setq result (cons item result))))
|
||||
;; Return result.
|
||||
(if nosort result (sort result #'string<))))))
|
||||
(tramp-fuse-remove-hidden-files
|
||||
(if nosort result (sort result #'string<)))))))
|
||||
|
||||
(defun tramp-fuse-handle-file-attributes (filename &optional id-format)
|
||||
"Like `file-attributes' for Tramp files."
|
||||
|
@ -92,20 +99,21 @@
|
|||
|
||||
(defun tramp-fuse-handle-file-name-all-completions (filename directory)
|
||||
"Like `file-name-all-completions' for Tramp files."
|
||||
(all-completions
|
||||
filename
|
||||
(delete-dups
|
||||
(append
|
||||
(file-name-all-completions
|
||||
filename (tramp-fuse-local-file-name directory))
|
||||
;; Some storage systems do not return "." and "..".
|
||||
(let (result)
|
||||
(dolist (item '(".." ".") result)
|
||||
(when (string-prefix-p filename item)
|
||||
(catch 'match
|
||||
(dolist (elt completion-regexp-list)
|
||||
(unless (string-match-p elt item) (throw 'match nil)))
|
||||
(setq result (cons (concat item "/") result))))))))))
|
||||
(tramp-fuse-remove-hidden-files
|
||||
(all-completions
|
||||
filename
|
||||
(delete-dups
|
||||
(append
|
||||
(file-name-all-completions
|
||||
filename (tramp-fuse-local-file-name directory))
|
||||
;; Some storage systems do not return "." and "..".
|
||||
(let (result)
|
||||
(dolist (item '(".." ".") result)
|
||||
(when (string-prefix-p filename item)
|
||||
(catch 'match
|
||||
(dolist (elt completion-regexp-list)
|
||||
(unless (string-match-p elt item) (throw 'match nil)))
|
||||
(setq result (cons (concat item "/") result)))))))))))
|
||||
|
||||
(defun tramp-fuse-handle-file-readable-p (filename)
|
||||
"Like `file-readable-p' for Tramp files."
|
||||
|
|
Loading…
Add table
Reference in a new issue