From: Michael Albinus <michael.albinus@gmx.de>
To: "Felicián Németh" <felician.nemeth@gmail.com>
Cc: 34221@debbugs.gnu.org, Dmitry Gutov <dgutov@yandex.ru>
Subject: bug#34221: [PATCH] Make project-files work with remote files
Date: Sat, 02 Feb 2019 10:18:11 +0100 [thread overview]
Message-ID: <87ftt6zgz0.fsf@gmx.de> (raw)
In-Reply-To: <CAGLaV2ZrkZooDVhbNc=u+c2933xtik4EqVLuTbaD1OcBrdnXww@mail.gmail.com> ("Felicián Németh"'s message of "Sat, 2 Feb 2019 09:36:48 +0100")
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.
next prev parent reply other threads:[~2019-02-02 9:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-27 12:21 bug#34221: [PATCH] Make project-files work with remote files Felicián Németh
2019-01-28 7:12 ` Michael Albinus
2019-01-28 8:10 ` Felicián Németh
2019-01-28 8:29 ` Michael Albinus
2019-01-30 8:15 ` Felicián Németh
2019-01-30 8:34 ` Michael Albinus
2019-02-01 3:16 ` Dmitry Gutov
2019-02-01 8:14 ` Michael Albinus
2019-02-02 0:10 ` Dmitry Gutov
2019-02-02 8:36 ` Felicián Németh
2019-02-02 9:18 ` Michael Albinus [this message]
2019-02-02 10:16 ` Felicián Németh
2019-02-02 11:59 ` Dmitry Gutov
2019-02-02 12:13 ` Michael Albinus
2019-02-07 11:05 ` Dmitry Gutov
2019-02-07 11:14 ` Michael Albinus
2019-02-02 12:26 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ftt6zgz0.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=34221@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
--cc=felician.nemeth@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.