unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: samvid mistry <mistrysamvid@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: insert-file-content on windows and WSL
Date: Sat, 20 Jan 2024 12:00:46 +0530	[thread overview]
Message-ID: <CAO=nQuuGmLw7Bd+n_s_WSn3=Kb=L2z+dt6D2VLnJWYe0CyvVJA@mail.gmail.com> (raw)

Hey,

I was playing with some code and found an unusual behaviour of
insert-file-contents. I am running GNU Emacs 29.1 *on Windows*. When I am
in a file/buffer that is within WSL, accessed using
`//wsl.localhost/Ubuntu/...`, I can open WSL paths without the prefix,
i.e., I can write `(insert-file-contents "/home/samvid/davmail.log")`
instead of `(insert-file-contents
"//wsl.localhost/Ubuntu/home/samvid/davmail.log")` and it will open the
correct file. However, running `(insert-file-contents
"/home/samvid/davmail.log")` when I am in a buffer/file on windows
filesystem, it will run into this error

`(file-missing "Opening input file" "No such file or directory"
"c:/home/samvid/davmail.log")`

I tried looking at the C code implementation but it is completely beyond me
to comprehend. Was wondering if someone can give me a summary on how this
behaviour is implemented and if there is a chance to tweak it somehow to be
able to open WSL paths while being on windows filesystem without the
`//wsl...` prefix.

Thanks,
Samvid


             reply	other threads:[~2024-01-20  6:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-20  6:30 samvid mistry [this message]
2024-01-20 10:25 ` insert-file-content on windows and WSL Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAO=nQuuGmLw7Bd+n_s_WSn3=Kb=L2z+dt6D2VLnJWYe0CyvVJA@mail.gmail.com' \
    --to=mistrysamvid@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).