bug#42429: 28.0.50; browse-url-of-dired doesn't work on directories

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#42429: 28.0.50; browse-url-of-dired doesn't work on directories

Lars Ingebrigtsen

To reproduce:

C-x C-f /tmp
Go to the "." directory
M-x browse-url-of-dired-file

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  file-truename(nil)
  find-file-noselect-1(#<buffer tmp<4>> "file:///tmp" nil nil "/tmp" (24379393 66306))
  find-file-noselect("file:///tmp" nil nil nil)
  find-file-other-window("file:///tmp")
  browse-url-emacs("file:///tmp" nil)
  apply(browse-url-emacs "file:///tmp" nil)
  browse-url("file:///tmp")
  browse-url-of-file("/tmp")
  browse-url-of-dired-file()
  funcall-interactively(browse-url-of-dired-file)
  call-interactively(browse-url-of-dired-file record nil)
  command-execute(browse-url-of-dired-file record)
  execute-extended-command(nil "browse-url-of-dired-file" nil)
  funcall-interactively(execute-extended-command nil "browse-url-of-dired-file" nil)
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

The question is...  should this work?  There's this commit from 2011,
which seems to suggest that it should?

But I have no idea what it's supposed to do.  Just pop up a dired
buffer?  It's an odd thing to support.

commit 2a86a00c4fbd998fedf778c65764f607f7da1855
Author:     Ralph Schleicher <[hidden email]>
AuthorDate: Sun May 8 14:34:51 2011 -0400
Commit:     Chong Yidong <[hidden email]>
CommitDate: Sun May 8 14:34:51 2011 -0400

    Expand file names during browse-url-of-dired-file (Bug#8259).
   
    * lisp/net/browse-url.el (browse-url-of-dired-file): Allow browsing of
    special file names `.' and `..'.




In GNU Emacs 28.0.50 (build 8, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0)
 of 2020-07-19 built on xo
Repository revision: 17f646128f04e9e8590f0371026a14d516f21c63
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Debian GNU/Linux bullseye/sid


--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Reply | Threaded
Open this post in threaded view
|

bug#42429: 28.0.50; browse-url-of-dired doesn't work on directories

Lars Ingebrigtsen
Lars Ingebrigtsen <[hidden email]> writes:

> Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
>   file-truename(nil)
>   find-file-noselect-1(#<buffer tmp<4>> "file:///tmp" nil nil "/tmp" (24379393 66306))
>   find-file-noselect("file:///tmp" nil nil nil)
>   find-file-other-window("file:///tmp")
>   browse-url-emacs("file:///tmp" nil)

It turns out that this is handled through the url-file-handler stuff...

(defun browse-url-emacs (url &optional same-window)

[...]

  (let ((file-name-handler-alist
         (cons (cons url-handler-regexp 'url-file-handler)
               file-name-handler-alist)))
    (if same-window (find-file url) (find-file-other-window url))))

(browse-url-emacs "file:///tmp" nil)

Michael, do you know anything about this?  :-)  I'm wholly unfamiliar
with the url-file-handler stuff or how it's supposed to work.

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no