From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: samvid mistry Newsgroups: gmane.emacs.help Subject: insert-file-content on windows and WSL Date: Sat, 20 Jan 2024 12:00:46 +0530 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37600"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 20 07:31:40 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rR4tH-0009Yx-0y for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 20 Jan 2024 07:31:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rR4sg-0002x6-Hp; Sat, 20 Jan 2024 01:31:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rR4se-0002wr-5V for help-gnu-emacs@gnu.org; Sat, 20 Jan 2024 01:31:00 -0500 Original-Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rR4sc-000250-KJ for help-gnu-emacs@gnu.org; Sat, 20 Jan 2024 01:30:59 -0500 Original-Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-559d95f1e69so1583803a12.2 for ; Fri, 19 Jan 2024 22:30:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705732255; x=1706337055; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=m5xlyJNe4aGxdk3ReoLPbyJTaCs8AVu7KHBg4yKq0kM=; b=gBs8eYOpjKxv4ZLMlTuNawVPnDoKs9WzEsC+yCg+tVPTzIdmm+PvyLbFJogv+D0fIC YwUqjmONYR5jl8F2WjSporQvUbfFPTxpJXKxU5yhVtNiBxtbC0FUDftuYRw+S2jwdYwQ PxenX7XSGx32feO5PgIsPR5uHFV9vx8Kv43K+AsDYfRFdPx83NxTVcn8d+ZRT/fpOkMC txwuWii8hFDHNgPT/WcFxOYQdo+PmD3ZJdSmefzCkz4XSQMcyntn4HwhziUtdtEd4S1e UaquSDGJZOC5umljh1ShoYGd6Jnyj/hxFmhXrUcNQE7A+0kaCeBDYmGwZ+gDtLuZcc9T s+vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705732255; x=1706337055; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=m5xlyJNe4aGxdk3ReoLPbyJTaCs8AVu7KHBg4yKq0kM=; b=siaaMziudLC8+NZF5nQLvCEP4hgtK8gxI7D2N1mcdvGouv6/nVi+BX+sHePtgzteJd n45j2IT5q07T8h49zEYzPuiygqPGOMlh8ndI4KdPHDw5KJdWmD7/cGfMhXHB9Ejf9n5i 6B7DnHJourF8jibg1iS4mz3iXtbPWDJzNdt2Z5Y2s9strmvJDrQnA2kfQy+CtkXvLoM7 +FZc1nfTvUGn38PBS+WhcQWCx9YiWcvc0zHE6aMoBVQwsuvfZAVdATwAJNctRtumM6p+ erau+p9ltZ1EVfVN2qPbfzq/OaEMc6gtoqL/eX7zIJq9OOIg4Nta1c69djSzPJHw+Agt sdkw== X-Gm-Message-State: AOJu0YxzOQI1lun42JGa44wnLYXYfkvOGOJXGpJhBJ9pcCAgBg5o+cb2 3ujHWKwOTEaJHRSOnjuGL0KlyKKYF1J2orHZL9n8fDUYwAuMYo+MWt1HDPAgfeLcWSKx0YOwF8l Wag0Ca0+ssapg+YFIXhk0Vvdvaycd7vOqpsgqcg== X-Google-Smtp-Source: AGHT+IFI1gvt+cwwh0+TvFzv10CKwEtYx2M150NAkRwfT/losSmWAPJVOdUMrZlJKxUdLTNuaZ6s3LaXm8mG0Rkm7pA= X-Received: by 2002:aa7:c919:0:b0:55a:85b5:d48 with SMTP id b25-20020aa7c919000000b0055a85b50d48mr406092edt.39.1705732255500; Fri, 19 Jan 2024 22:30:55 -0800 (PST) Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=mistrysamvid@gmail.com; helo=mail-ed1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145758 Archived-At: 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