[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#34221: [PATCH] Make project-files work with remote files
From: |
Michael Albinus |
Subject: |
bug#34221: [PATCH] Make project-files work with remote files |
Date: |
Sat, 02 Feb 2019 10:18:11 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Felicián Németh <felician.nemeth@gmail.com> writes:
> Hello Dmitry,
Hi Felicián,
> I don't know if it is still necessary, but I updated the patch with
> renaming the defun in question by appending an "s" to its name.
I'm ready to commit it in your name. Reading the patch again, it might
be possible to simplify the code further.
> +(defun project--file-remote-names (local-files)
> + "Return LOCAL-FILES as if they were on the system of `default-directory'."
> + (let ((remote-id (file-remote-p default-directory)))
> + (if (not remote-id)
> + local-files
> + (mapcar (lambda (file)
> + (concat remote-id file))
> + local-files))))
concat accepts nil as argument. So the function could be rewritten:
(defun project--file-remote-names (local-files)
"Return LOCAL-FILES as if they were on the system of `default-directory'."
(let ((remote-id (file-remote-p default-directory)))
(mapcar (lambda (file)
(concat remote-id file))
local-files))))
With this simple body, it might even not needed as function. We would
have then (untested)
(let ((default-directory dir)
(remote-id (file-remote-p dir)
...
(mapcar (lambda (file) (concat remote-id file))
(split-string (shell-command-to-string command) "\0" t))
WDYT? Do you want to prepare a patch along these lines?
> Thanks,
> Felicián
Best regards, Michael.
- bug#34221: [PATCH] Make project-files work with remote files, Michael Albinus, 2019/02/01
- bug#34221: [PATCH] Make project-files work with remote files, Dmitry Gutov, 2019/02/01
- bug#34221: [PATCH] Make project-files work with remote files, Felicián Németh, 2019/02/02
- bug#34221: [PATCH] Make project-files work with remote files,
Michael Albinus <=
- bug#34221: [PATCH] Make project-files work with remote files, Felicián Németh, 2019/02/02
- bug#34221: [PATCH] Make project-files work with remote files, Dmitry Gutov, 2019/02/02
- bug#34221: [PATCH] Make project-files work with remote files, Michael Albinus, 2019/02/02
- bug#34221: [PATCH] Make project-files work with remote files, Dmitry Gutov, 2019/02/07
- bug#34221: [PATCH] Make project-files work with remote files, Michael Albinus, 2019/02/07
- bug#34221: [PATCH] Make project-files work with remote files, Michael Albinus, 2019/02/02