GNU bug report logs - #58464
28.1; browse-url-emacs doesn't work for local files on Windows

Previous Next

Package: emacs;

Reported by: Pascal Quesseveur <pquessev <at> gmail.com>

Date: Wed, 12 Oct 2022 06:44:02 UTC

Severity: normal

Tags: moreinfo

Found in version 28.1

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 58464 in the body.
You can then email your comments to 58464 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Wed, 12 Oct 2022 06:44:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pascal Quesseveur <pquessev <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 12 Oct 2022 06:44:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pascal Quesseveur <pquessev <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.1; browse-url-emacs doesn't work for local files on Windows
Date: Wed, 12 Oct 2022 08:43:15 +0200
emacs -Q
(browse-url-emacs "file://C:/Windows/win.ini") -> Emacs hangs, nothing
is displayed, C-g
(browse-url-emacs "file:///C:/Windows/win.ini") -> file content is
displayed, Message buffer contains:

File exists, but cannot be read
#<buffer win.ini</Windows>>



In GNU Emacs 28.1 (build 2, x86_64-w64-mingw32)
 of 2022-04-21 built on AVALON
Windowing system distributor 'Microsoft Corp.', version 10.0.19044
System Description: Microsoft Windows 10 Pro (v10.0.2009.19044.2006)

Configured using:
 'configure --with-modules --without-dbus --with-native-compilation
 --without-compress-install CFLAGS=-O2'

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES
NATIVE_COMP NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS XPM ZLIB

(NATIVE_COMP present but libgccjit not available)

Important settings:
  value of $LANG: FRA
  locale-coding-system: cp1252

Major mode: Summary

Minor modes in effect:
  display-time-mode: t
  shell-dirtrack-mode: t
  icomplete-mode: t
  windmove-mode: t
  auto-image-file-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
c:/Users/Public/emacs-site/lisp/bbdb-3.2.2.2/bbdb hides c:/Users/quessev/.emacs.d/elpa/bbdb-3.2.2.2/bbdb
c:/Users/Public/emacs-site/lisp/bbdb-3.2.2.2/bbdb-wl hides c:/Users/quessev/.emacs.d/elpa/bbdb-3.2.2.2/bbdb-wl
c:/Users/Public/emacs-site/lisp/bbdb-3.2.2.2/bbdb-vm hides c:/Users/quessev/.emacs.d/elpa/bbdb-3.2.2.2/bbdb-vm
c:/Users/Public/emacs-site/lisp/bbdb-3.2.2.2/bbdb-tex hides c:/Users/quessev/.emacs.d/elpa/bbdb-3.2.2.2/bbdb-tex
c:/Users/Public/emacs-site/lisp/bbdb-3.2.2.2/bbdb-snarf hides c:/Users/quessev/.emacs.d/elpa/bbdb-3.2.2.2/bbdb-snarf
c:/Users/Public/emacs-site/lisp/bbdb-3.2.2.2/bbdb-site hides c:/Users/quessev/.emacs.d/elpa/bbdb-3.2.2.2/bbdb-site
c:/Users/Public/emacs-site/lisp/bbdb-3.2.2.2/bbdb-rmail hides c:/Users/quessev/.emacs.d/elpa/bbdb-3.2.2.2/bbdb-rmail
c:/Users/Public/emacs-site/lisp/bbdb-3.2.2.2/bbdb-pkg hides c:/Users/quessev/.emacs.d/elpa/bbdb-3.2.2.2/bbdb-pkg
c:/Users/Public/emacs-site/lisp/bbdb-3.2.2.2/bbdb-pgp hides c:/Users/quessev/.emacs.d/elpa/bbdb-3.2.2.2/bbdb-pgp
c:/Users/Public/emacs-site/lisp/bbdb-3.2.2.2/bbdb-mua hides c:/Users/quessev/.emacs.d/elpa/bbdb-3.2.2.2/bbdb-mua
c:/Users/Public/emacs-site/lisp/bbdb-3.2.2.2/bbdb-mu4e hides c:/Users/quessev/.emacs.d/elpa/bbdb-3.2.2.2/bbdb-mu4e
c:/Users/Public/emacs-site/lisp/bbdb-3.2.2.2/bbdb-migrate hides c:/Users/quessev/.emacs.d/elpa/bbdb-3.2.2.2/bbdb-migrate
c:/Users/Public/emacs-site/lisp/bbdb-3.2.2.2/bbdb-mhe hides c:/Users/quessev/.emacs.d/elpa/bbdb-3.2.2.2/bbdb-mhe
c:/Users/Public/emacs-site/lisp/bbdb-3.2.2.2/bbdb-message hides c:/Users/quessev/.emacs.d/elpa/bbdb-3.2.2.2/bbdb-message
c:/Users/Public/emacs-site/lisp/bbdb-3.2.2.2/bbdb-ispell hides c:/Users/quessev/.emacs.d/elpa/bbdb-3.2.2.2/bbdb-ispell
c:/Users/Public/emacs-site/lisp/bbdb-3.2.2.2/bbdb-gnus hides c:/Users/quessev/.emacs.d/elpa/bbdb-3.2.2.2/bbdb-gnus
c:/Users/Public/emacs-site/lisp/bbdb-3.2.2.2/bbdb-com hides c:/Users/quessev/.emacs.d/elpa/bbdb-3.2.2.2/bbdb-com
c:/Users/Public/emacs-site/lisp/bbdb-3.2.2.2/bbdb-anniv hides c:/Users/quessev/.emacs.d/elpa/bbdb-3.2.2.2/bbdb-anniv
c:/Users/quessev/.emacs.d/lisp/vcard-qsr/vcard hides c:/Users/quessev/.emacs.d/elpa/vcard-0.2.2/vcard
c:/Users/quessev/.emacs.d/lisp/vcard-qsr/vcard-parse hides c:/Users/quessev/.emacs.d/elpa/vcard-0.2.2/vcard-parse
c:/Users/quessev/.emacs.d/lisp/vcard-qsr/vcard-mode hides c:/Users/quessev/.emacs.d/elpa/vcard-0.2.2/vcard-mode
c:/Users/Public/emacs-site/lisp/utils/wdired hides c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/wdired
c:/Users/Public/emacs-site/lisp/utils/ls-lisp hides c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/ls-lisp
c:/Users/Public/emacs-site/lisp/utils/iimage hides c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/iimage
c:/Users/Public/emacs-site/lisp/utils/calculator hides c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/calculator
c:/Users/Public/emacs-site/lisp/utils/table hides c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/textmodes/table
c:/Users/Public/emacs-site/lisp/remember/remember hides c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/textmodes/remember
c:/Users/Public/emacs-site/lisp/utils/rlogin hides c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/net/rlogin
c:/Users/Public/emacs-site/lisp/dictionary-1.8.7/dictionary hides c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/net/dictionary

Features:
(tabify time-stamp shadow warnings emacsbug mm-archive gnus-fun
mailalias mule-util sort smiley gnus-cite mail-extr gnus-async
gnus-bcklg qp gnus-ml emms-info-libtag emms-player-vlc emms-player-mpv
emms-player-mplayer emms-playlist-limit emms-volume
emms-volume-mixerctl emms-volume-pulse emms-volume-amixer emms-i18n
emms-stream-info emms-mode-line-icon emms-playlist-sort
emms-last-played emms-playing-time emms-player-simple emms-streams
emms-show-all emms-tag-editor emms-mark emms-mode-line
emms-info-ogginfo emms-info-mp3info emms-info later-do
emms-playlist-mode emms-source-playlist emms-source-file locate
music-list music-album emms-setup emms emms-compat gnus-topic nndraft
nnmh gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg
gnus-art mm-uu mml2015 mm-view mml-smime smime dig nnml utf-7 gnutls
nnfolder cl-extra help-mode gnus-cache gnus-sum network-stream nsm
nntp gnus-group gnus-undo gnus-start gnus-dbus dbus gnus-cloud nnimap
nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range
gnus-win time highlight-current-line color-theme smtpmail tumblesocks
tumblesocks-view tumblesocks-compose markdown-mode noutline outline
htmlize tumblesocks-user tumblesocks-api oauth sasl sasl-anonymous
sasl-login sasl-plain hex-util hmac-sha1 shr kinsoku svg dom
plantuml-mode xml dash thingatpt html2help footnote rx muse-odf
muse-xml muse-help muse-bbcode muse-blosxom muse-wiki muse-texinfo
texnfo-upd texinfo texinfo-loaddefs muse-latex muse-html muse-docbook
muse-xml-common cus-edit pp cus-load muse-publish muse-project
muse-protocols muse-regexps muse muse-nested-tags muse-mode u-vm-color
org-import-icalendar icalendar diary-lib diary-loaddefs bbdb-sc
supercite regi bbdb-migrate bbdb-snarf bbdb-message sendmail message
rmc puny dired-explore dired-sort-menu acid dired-arc file-op dired-x
dired dired-loaddefs rfc822 mml mml-sec mm-decode mm-bodies mm-encode
mail-parse rfc2231 gmm-utils mailheader bbdb-rmail rmailsum bbdb-gnus
bbdb-mua gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045
ietf-drums mail-utils mm-util mail-prsvr wid-edit bbdb-com pcase crm
mailabbrev find-func bbdb bbdb-site timezone tramp tramp-loaddefs
trampver tramp-integration files-x tramp-compat shell pcomplete
parse-time iso8601 time-date format-spec which idb gud easy-mmode
compile text-property-search comint ansi-color ring qproj-opascal jsee
javadoc-lookup ido jserial jswat qproj-java jdok tempo xml-parse
doxymacs qproj-cpp qproj server dos-indent generic generic-x cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs lunar solar cal-dst cal-tex cal-iso cal-menu calendar
cal-loaddefs epa-file epa derived epg rfc6068 epg-config ps-mule ipp
cl printing ps-print ps-print-loaddefs ps-def lpr icomplete windmove
advice image-file image-converter edmacro kmacro info package
browse-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode
mwheel dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode
register page tab-bar menu-bar rfn-eshadow isearch easymenu timer
select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese
eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese composite emoji-zwj charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads
w32notify w32 lcms2 multi-tty make-network-process native-compile
emacs)

Memory information:
((conses 16 654839 79861)
 (symbols 48 33806 10)
 (strings 32 171534 8080)
 (string-bytes 1 5621311)
 (vectors 16 50230)
 (vector-slots 8 875194 57078)
 (floats 8 1118 352)
 (intervals 56 2638 204)
 (buffers 992 34))

-- 
Pascal Quesseveur




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Wed, 12 Oct 2022 07:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 58464 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pascal Quesseveur <pquessev <at> gmail.com>
Cc: 58464 <at> debbugs.gnu.org
Subject: Re: bug#58464: 28.1;
 browse-url-emacs doesn't work for local files on Windows
Date: Wed, 12 Oct 2022 10:26:39 +0300
> From: Pascal Quesseveur <pquessev <at> gmail.com>
> Date: Wed, 12 Oct 2022 08:43:15 +0200
> 
> 
> emacs -Q
> (browse-url-emacs "file://C:/Windows/win.ini") -> Emacs hangs, nothing
> is displayed, C-g
> (browse-url-emacs "file:///C:/Windows/win.ini") -> file content is
> displayed, Message buffer contains:
> 
> File exists, but cannot be read
> #<buffer win.ini</Windows>>

With Emacs 29, I get a different message:

  Use M-x make-directory RET RET to create the directory and its parents

That's because the file's name and its default-directory are
incorrect:

  M-: buffer-file-name RET
   => X:/C:/Windows/win.ini
  M-: default-directory RET
   => X:/C:/Windows/

(where X is the driver letter of what happens to be the current drive
when I invoke Emacs).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Wed, 12 Oct 2022 11:10:01 GMT) Full text and rfc822 format available.

Message #11 received at 58464 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Pascal Quesseveur <pquessev <at> gmail.com>
Cc: 58464 <at> debbugs.gnu.org
Subject: Re: bug#58464: 28.1; browse-url-emacs doesn't work for local files
 on Windows
Date: Wed, 12 Oct 2022 13:09:41 +0200
Pascal Quesseveur <pquessev <at> gmail.com> writes:

> emacs -Q
> (browse-url-emacs "file://C:/Windows/win.ini") -> Emacs hangs, nothing
> is displayed, C-g

That's the wrong syntax, but Emacs shouldn't hang...

> (browse-url-emacs "file:///C:/Windows/win.ini") -> file content is
> displayed, Message buffer contains:
>
> File exists, but cannot be read
> #<buffer win.ini</Windows>>

So it works fine when you use the right syntax for the URL, but the
problem is the misleading message?   (Also noted in bug#42431 and
bug#58302 -- it's not Windows-specific, but a bug in all handling of
`file-name-handler-alist' for non-file "files".)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Wed, 12 Oct 2022 11:11:02 GMT) Full text and rfc822 format available.

Message #14 received at 58464 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Pascal Quesseveur <pquessev <at> gmail.com>, 58464 <at> debbugs.gnu.org
Subject: Re: bug#58464: 28.1; browse-url-emacs doesn't work for local files
 on Windows
Date: Wed, 12 Oct 2022 13:10:24 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> emacs -Q
>> (browse-url-emacs "file://C:/Windows/win.ini") -> Emacs hangs, nothing
>> is displayed, C-g
>> (browse-url-emacs "file:///C:/Windows/win.ini") -> file content is
>> displayed, Message buffer contains:
>> 
>> File exists, but cannot be read
>> #<buffer win.ini</Windows>>
>
> With Emacs 29, I get a different message:
>
>   Use M-x make-directory RET RET to create the directory and its parents
>
> That's because the file's name and its default-directory are
> incorrect:
>
>   M-: buffer-file-name RET
>    => X:/C:/Windows/win.ini
>   M-: default-directory RET
>    => X:/C:/Windows/
>
> (where X is the driver letter of what happens to be the current drive
> when I invoke Emacs).

Was this with the first or the second URL?




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 12 Oct 2022 12:56:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Wed, 12 Oct 2022 13:05:01 GMT) Full text and rfc822 format available.

Message #19 received at 58464 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: pquessev <at> gmail.com
Cc: 58464 <at> debbugs.gnu.org
Subject: Re: bug#58464: 28.1; browse-url-emacs doesn't work for local files
 on Windows
Date: Wed, 12 Oct 2022 16:04:24 +0300
[Please use Reply All to keep the bug tracker on the CC list.]

> From: Pascal Quesseveur <pquessev <at> gmail.com>
> Date: Wed, 12 Oct 2022 12:31:20 +0200
> 
> >"EZ" == Eli Zaretskii <eliz <at> gnu.org> writes:
> 
>   EZ> With Emacs 29, I get a different message:
> 
>   EZ>   Use M-x make-directory RET RET to create the directory and its
>   EZ>   parents
> 
> But does the first call with 2 slashes work with Emacs 29?

It doesn't hang as with Emacs 28, but it is broken in a slightly
different way: *Messages* says the same, but buffer-file-name is
X:/Windows/win.ini (i.e. the C: drive letter was lost), and
default-directory is accordingly X:/Windows.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Wed, 12 Oct 2022 13:15:01 GMT) Full text and rfc822 format available.

Message #22 received at 58464 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: pquessev <at> gmail.com, 58464 <at> debbugs.gnu.org
Subject: Re: bug#58464: 28.1;
 browse-url-emacs doesn't work for local files on Windows
Date: Wed, 12 Oct 2022 16:13:58 +0300
> Cc: 58464 <at> debbugs.gnu.org
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Wed, 12 Oct 2022 13:09:41 +0200
> 
> Pascal Quesseveur <pquessev <at> gmail.com> writes:
> 
> > emacs -Q
> > (browse-url-emacs "file://C:/Windows/win.ini") -> Emacs hangs, nothing
> > is displayed, C-g
> 
> That's the wrong syntax, but Emacs shouldn't hang...

Emacs 29 doesn't hang, at least on my system.

> > (browse-url-emacs "file:///C:/Windows/win.ini") -> file content is
> > displayed, Message buffer contains:
> >
> > File exists, but cannot be read
> > #<buffer win.ini</Windows>>
> 
> So it works fine when you use the right syntax for the URL, but the
> problem is the misleading message?

No, the misleading message is likely just a symptom of the root
cause.  The root cause is that the buffer-file-name is set
incorrectly, and likewise the default-directory.

It could be that the original problem (with displaying images given by
the file:// URL) doesn't work, but that is not yet certain, AFAIU.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Wed, 12 Oct 2022 13:15:02 GMT) Full text and rfc822 format available.

Message #25 received at 58464 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: pquessev <at> gmail.com, 58464 <at> debbugs.gnu.org
Subject: Re: bug#58464: 28.1; browse-url-emacs doesn't work for local files
 on Windows
Date: Wed, 12 Oct 2022 16:14:46 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: Pascal Quesseveur <pquessev <at> gmail.com>,  58464 <at> debbugs.gnu.org
> Date: Wed, 12 Oct 2022 13:10:24 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > With Emacs 29, I get a different message:
> >
> >   Use M-x make-directory RET RET to create the directory and its parents
> >
> > That's because the file's name and its default-directory are
> > incorrect:
> >
> >   M-: buffer-file-name RET
> >    => X:/C:/Windows/win.ini
> >   M-: default-directory RET
> >    => X:/C:/Windows/
> >
> > (where X is the driver letter of what happens to be the current drive
> > when I invoke Emacs).
> 
> Was this with the first or the second URL?

The second.  I sent the results with the first one a few minutes ago.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Wed, 12 Oct 2022 13:19:02 GMT) Full text and rfc822 format available.

Message #28 received at 58464 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: pquessev <at> gmail.com, 58464 <at> debbugs.gnu.org
Subject: Re: bug#58464: 28.1; browse-url-emacs doesn't work for local files
 on Windows
Date: Wed, 12 Oct 2022 15:18:10 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> No, the misleading message is likely just a symptom of the root
> cause.  The root cause is that the buffer-file-name is set
> incorrectly, and likewise the default-directory.

Well...  have a look at bug#bug#42431, it analyses the problem.  (Which
is that any usage if insert-file-contents that doesn't reference an
actual file on the file system will signal an error, and that's a
mistake, I think?)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Wed, 12 Oct 2022 14:26:01 GMT) Full text and rfc822 format available.

Message #31 received at 58464 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: pquessev <at> gmail.com, 58464 <at> debbugs.gnu.org
Subject: Re: bug#58464: 28.1; browse-url-emacs doesn't work for local files
 on Windows
Date: Wed, 12 Oct 2022 17:25:08 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: pquessev <at> gmail.com,  58464 <at> debbugs.gnu.org
> Date: Wed, 12 Oct 2022 15:18:10 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > No, the misleading message is likely just a symptom of the root
> > cause.  The root cause is that the buffer-file-name is set
> > incorrectly, and likewise the default-directory.
> 
> Well...  have a look at bug#bug#42431, it analyses the problem.  (Which
> is that any usage if insert-file-contents that doesn't reference an
> actual file on the file system will signal an error, and that's a
> mistake, I think?)

So why isn't what I proposed there TRT?  We _know_ we are visiting a
local file, so why not convert the file:// URL to a local file name
before doing anything with it?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Wed, 12 Oct 2022 14:43:02 GMT) Full text and rfc822 format available.

Message #34 received at 58464 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: pquessev <at> gmail.com, 58464 <at> debbugs.gnu.org
Subject: Re: bug#58464: 28.1; browse-url-emacs doesn't work for local files
 on Windows
Date: Wed, 12 Oct 2022 16:42:49 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Well...  have a look at bug#bug#42431, it analyses the problem.  (Which
>> is that any usage if insert-file-contents that doesn't reference an
>> actual file on the file system will signal an error, and that's a
>> mistake, I think?)
>
> So why isn't what I proposed there TRT?  We _know_ we are visiting a
> local file, so why not convert the file:// URL to a local file name
> before doing anything with it?

For local files, yes -- but it's a more general problem, and should
(also) be fixed in general.

(But also see bug#58302 -- browse-url-emacs shouldn't be calling these
functions at all.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Wed, 12 Oct 2022 15:56:02 GMT) Full text and rfc822 format available.

Message #37 received at 58464 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: pquessev <at> gmail.com, 58464 <at> debbugs.gnu.org
Subject: Re: bug#58464: 28.1; browse-url-emacs doesn't work for local files
 on Windows
Date: Wed, 12 Oct 2022 18:55:03 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: pquessev <at> gmail.com,  58464 <at> debbugs.gnu.org
> Date: Wed, 12 Oct 2022 16:42:49 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> Well...  have a look at bug#bug#42431, it analyses the problem.  (Which
> >> is that any usage if insert-file-contents that doesn't reference an
> >> actual file on the file system will signal an error, and that's a
> >> mistake, I think?)
> >
> > So why isn't what I proposed there TRT?  We _know_ we are visiting a
> > local file, so why not convert the file:// URL to a local file name
> > before doing anything with it?
> 
> For local files, yes -- but it's a more general problem, and should
> (also) be fixed in general.

I'm not sure I follow: file:// URLs always point to local files, no?
And if you think about remote files in the sense of Tramp, then that's
transparently handled by the "normal" file I/O primitives.  So what is
the more general problem to solve here?  And why converting file://
URLs to file-name format is not TRT?

> (But also see bug#58302 -- browse-url-emacs shouldn't be calling these
> functions at all.)

How else can Emacs visit files except via insert-file-contents?  Or
what do you mean by "these functions"?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Wed, 12 Oct 2022 15:58:02 GMT) Full text and rfc822 format available.

Message #40 received at 58464 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: pquessev <at> gmail.com, 58464 <at> debbugs.gnu.org
Subject: Re: bug#58464: 28.1; browse-url-emacs doesn't work for local files
 on Windows
Date: Wed, 12 Oct 2022 17:57:13 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> I'm not sure I follow: file:// URLs always point to local files, no?

browse-url-emacs takes any URL, not just file:// URL.

(browse-url-emacs "https://gnus.org/") "works fine", except for the same
error messages.

>> (But also see bug#58302 -- browse-url-emacs shouldn't be calling these
>> functions at all.)
>
> How else can Emacs visit files except via insert-file-contents?  Or
> what do you mean by "these functions"?

`url-file-handler'.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Wed, 12 Oct 2022 16:08:02 GMT) Full text and rfc822 format available.

Message #43 received at 58464 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: pquessev <at> gmail.com, 58464 <at> debbugs.gnu.org
Subject: Re: bug#58464: 28.1; browse-url-emacs doesn't work for local files
 on Windows
Date: Wed, 12 Oct 2022 19:07:32 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: pquessev <at> gmail.com,  58464 <at> debbugs.gnu.org
> Date: Wed, 12 Oct 2022 17:57:13 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > I'm not sure I follow: file:// URLs always point to local files, no?
> 
> browse-url-emacs takes any URL, not just file:// URL.
> 
> (browse-url-emacs "https://gnus.org/") "works fine", except for the same
> error messages.

But this bug report ius about file:// URLs, not about anything else.

> >> (But also see bug#58302 -- browse-url-emacs shouldn't be calling these
> >> functions at all.)
> >
> > How else can Emacs visit files except via insert-file-contents?  Or
> > what do you mean by "these functions"?
> 
> `url-file-handler'.

Which ends up calling the same functions?




bug closed, send any further explanations to 58464 <at> debbugs.gnu.org and Pascal Quesseveur <pquessev <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 13 Oct 2022 06:44:03 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 13 Oct 2022 06:44:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Thu, 13 Oct 2022 07:56:02 GMT) Full text and rfc822 format available.

Message #50 received at 58464 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: pquessev <at> gmail.com, 58464 <at> debbugs.gnu.org
Subject: Re: bug#58464: 28.1; browse-url-emacs doesn't work for local files
 on Windows
Date: Thu, 13 Oct 2022 09:54:52 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> browse-url-emacs takes any URL, not just file:// URL.
>> 
>> (browse-url-emacs "https://gnus.org/") "works fine", except for the same
>> error messages.
>
> But this bug report ius about file:// URLs, not about anything else.

I've now fixed the general problem, and I think I've also fixed the
Windows-specific file:-specific problem on the trunk.




bug marked as fixed in version 29.1, send any further explanations to 58464 <at> debbugs.gnu.org and Pascal Quesseveur <pquessev <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 13 Oct 2022 07:56:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Thu, 13 Oct 2022 10:30:02 GMT) Full text and rfc822 format available.

Message #55 received at 58464 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: pquessev <at> gmail.com, 58464 <at> debbugs.gnu.org
Subject: Re: bug#58464: 28.1; browse-url-emacs doesn't work for local files
 on Windows
Date: Thu, 13 Oct 2022 13:29:25 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: pquessev <at> gmail.com,  58464 <at> debbugs.gnu.org
> Date: Thu, 13 Oct 2022 09:54:52 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> browse-url-emacs takes any URL, not just file:// URL.
> >> 
> >> (browse-url-emacs "https://gnus.org/") "works fine", except for the same
> >> error messages.
> >
> > But this bug report ius about file:// URLs, not about anything else.
> 
> I've now fixed the general problem, and I think I've also fixed the
> Windows-specific file:-specific problem on the trunk.

Thanks.  But this part:

  -  if (NILP (handler) && !NILP (visit) && current_buffer->modtime.tv_nsec < 0)
  +  if (save_errno != 0)

might cause us signal an error when VISIT is nil, something that
didn't happen before.

(I also am not sure it is 100% reliable to rely on save_errno being
non-zero whenever we encounter an error, especially in the
file-handlers case.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Thu, 13 Oct 2022 11:32:02 GMT) Full text and rfc822 format available.

Message #58 received at 58464 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: pquessev <at> gmail.com, Paul Eggert <eggert <at> cs.ucla.edu>, 58464 <at> debbugs.gnu.org
Subject: Re: bug#58464: 28.1; browse-url-emacs doesn't work for local files
 on Windows
Date: Thu, 13 Oct 2022 13:30:39 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> Thanks.  But this part:
>
>   -  if (NILP (handler) && !NILP (visit) && current_buffer->modtime.tv_nsec < 0)
>   +  if (save_errno != 0)
>
> might cause us signal an error when VISIT is nil, something that
> didn't happen before.
>
> (I also am not sure it is 100% reliable to rely on save_errno being
> non-zero whenever we encounter an error, especially in the
> file-handlers case.)

That's Paul's change -- added to the CCs.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Thu, 13 Oct 2022 15:46:02 GMT) Full text and rfc822 format available.

Message #61 received at 58464 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: pquessev <at> gmail.com, eggert <at> cs.ucla.edu, 58464 <at> debbugs.gnu.org
Subject: Re: bug#58464: 28.1; browse-url-emacs doesn't work for local files
 on Windows
Date: Thu, 13 Oct 2022 18:44:59 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: pquessev <at> gmail.com,  58464 <at> debbugs.gnu.org, Paul Eggert
>  <eggert <at> cs.ucla.edu>
> Date: Thu, 13 Oct 2022 13:30:39 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Thanks.  But this part:
> >
> >   -  if (NILP (handler) && !NILP (visit) && current_buffer->modtime.tv_nsec < 0)
> >   +  if (save_errno != 0)
> >
> > might cause us signal an error when VISIT is nil, something that
> > didn't happen before.
> >
> > (I also am not sure it is 100% reliable to rely on save_errno being
> > non-zero whenever we encounter an error, especially in the
> > file-handlers case.)
> 
> That's Paul's change -- added to the CCs.

Oops, sorry about that.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Thu, 13 Oct 2022 16:42:02 GMT) Full text and rfc822 format available.

Message #64 received at 58464 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Eli Zaretskii <eliz <at> gnu.org>
Cc: pquessev <at> gmail.com, 58464 <at> debbugs.gnu.org
Subject: Re: bug#58464: 28.1; browse-url-emacs doesn't work for local files on
 Windows
Date: Thu, 13 Oct 2022 09:40:54 -0700
[Message part 1 (text/plain, inline)]
On 2022-10-13 04:30, Lars Ingebrigtsen wrote:
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
>> Thanks.  But this part:
>>
>>    -  if (NILP (handler) && !NILP (visit) && current_buffer->modtime.tv_nsec < 0)
>>    +  if (save_errno != 0)
>>
>> might cause us signal an error when VISIT is nil, something that
>> didn't happen before.

We should be OK there. If VISIT is nil, SAVE_ERRNO must be zero.

>> (I also am not sure it is 100% reliable to rely on save_errno being
>> non-zero whenever we encounter an error, especially in the
>> file-handlers case.)

Should be OK here too. In the file-handlers case, SAVE_ERRNO is zero.

I installed the attached to help document and check this.
[0001-Improve-checks-for-recent-File-exists-fixup.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58464; Package emacs. (Thu, 13 Oct 2022 19:17:01 GMT) Full text and rfc822 format available.

Message #67 received at 58464 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: pquessev <at> gmail.com, larsi <at> gnus.org, 58464 <at> debbugs.gnu.org
Subject: Re: bug#58464: 28.1; browse-url-emacs doesn't work for local files on
 Windows
Date: Thu, 13 Oct 2022 22:15:45 +0300
> Date: Thu, 13 Oct 2022 09:40:54 -0700
> Cc: pquessev <at> gmail.com, 58464 <at> debbugs.gnu.org
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> 
> >>    -  if (NILP (handler) && !NILP (visit) && current_buffer->modtime.tv_nsec < 0)
> >>    +  if (save_errno != 0)
> >>
> >> might cause us signal an error when VISIT is nil, something that
> >> didn't happen before.
> 
> We should be OK there. If VISIT is nil, SAVE_ERRNO must be zero.
> 
> >> (I also am not sure it is 100% reliable to rely on save_errno being
> >> non-zero whenever we encounter an error, especially in the
> >> file-handlers case.)
> 
> Should be OK here too. In the file-handlers case, SAVE_ERRNO is zero.

Famous last words.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 11 Nov 2022 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 282 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.