unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#54271: 28.0.91; browse-url-of-dired-file fails with wrong type argument error
@ 2022-03-06 11:54 Gustavo Barros
  2022-03-06 16:20 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Gustavo Barros @ 2022-03-06 11:54 UTC (permalink / raw)
  To: 54271

Hi All,

I've been trying out the pre-release and met an issue with 
`browse-url-of-dired-file'.

Whenever I try to use it, I get the error "url-file: Wrong type 
argument: number-or-marker-p, nil".

As far as I can tell, the issue is not related with file/mime type. 
I've tried it with files I'd expect would be opened with an external 
application and with Emacs: .png, .jpg, .odt, but also .org, .tex. All 
with the same results.

However, as far as I can tell, the issue arises for file names with no 
ascii characters.  If the file name is well behaved, it works as 
expected.  But as soon as, e.g. an accented letter is part of it, the 
issue is triggered.

To reproduce, start with `emacs -Q'. Create a file named 
"~/test/áçãü.org", open `dired', and navigate to that file, and hit "W" 
(`browse-url-of-dired-file') on it.  You should get the mentioned error 
"url-file: Wrong type argument: number-or-marker-p, nil".

The backtrace is:

#+begin_example
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p 
nil)
  url-file-asynch-callback(nil nil nil 
  "/home/gustavo/test/\303\203\302\241\303\203\302\247\303\203\302\243\303\203\302\274.org" 
  #<buffer  *url-file*> #f(compiled-function (&rest args) #<bytecode 
  0xa8380fab2697cef>) (nil))
  url-file(#s(url :type "file" :user nil :password nil :host "" 
  :portspec nil :filename 
  "/home/gustavo/test/%C3%83%C2%A1%C3%83%C2%A7%C3%83%..." :target nil 
  :attributes nil :fullness t :silent nil :use-cookies t :asynchronous 
  nil) #f(compiled-function (&rest args) #<bytecode 0xa8380fab2697cef>) 
  (nil))
  url-retrieve-internal("file:///home/gustavo/test/áçãü.org" 
  #f(compiled-function (&rest args) #<bytecode 0xa8380fab2697cef>) (nil) 
  nil nil)
  url-retrieve("file:///home/gustavo/test/áçãü.org" 
  #f(compiled-function (&rest args) #<bytecode 0xa8380fab2697cef>) nil 
  nil nil)
  url-retrieve-synchronously("file:///home/gustavo/test/áçãü.org")
  url-insert-file-contents("file:///home/gustavo/test/áçãü.org" t 
  nil nil nil)
  apply(url-insert-file-contents 
  ("file:///home/gustavo/test/áçãü.org" t nil nil nil))
  url-file-handler(insert-file-contents 
  "file:///home/gustavo/test/áçãü.org" t nil nil nil)
  insert-file-contents("file:///home/gustavo/test/áçãü.org" t)
  find-file-noselect-1(#<buffer áçãü.org> 
  "file:///home/gustavo/test/áçãü.org" nil nil "~/test/áçãü.org" 
  nil)
  find-file-noselect("file:///home/gustavo/test/\303\241\303\247\303\243\303\274.org" 
  nil nil nil)
  find-file-other-window("file:///home/gustavo/test/\303\241\303\247\303\243\303\274.org")
  browse-url-emacs("file:///home/gustavo/test/\303\241\303\247\303\243\303\274.org" 
  nil)
  browse-url("file:///home/gustavo/test/\303\241\303\247\303\243\303\274.org")
  browse-url-of-file("/home/gustavo/test/áçãü.org")
  browse-url-of-dired-file()
  funcall-interactively(browse-url-of-dired-file)
  command-execute(browse-url-of-dired-file)
#+end_example

Since I use this functionality somewhat regularly, and hadn't met it 
with 27.2, as far as I can tell this is a regression since then.

Best regards,
Gustavo.


In GNU Emacs 28.0.91 (build 2, x86_64-pc-linux-gnu, GTK+ Version 
3.24.20, cairo version 1.16.0)
 of 2022-03-04 built on gusbrs-laptop
Windowing system distributor 'The X.Org Foundation', version 
11.0.12013000
System Description: Linux Mint 20.3

Configured using:
 'configure --with-mailutils --with-xwidgets --with-modules
 --with-native-compilation'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LC_MONETARY: pt_BR.UTF-8
  value of $LC_NUMERIC: pt_BR.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Dired by name

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-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
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny rfc822 mml mml-sec epa
derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs
text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mail-utils time-date help-fns radix-tree cl-extra cl-print debug
backtrace help-mode find-func mm-util mail-prsvr url-cache url-auth
url-file url-dired url-handlers browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map seq byte-opt gv bytecomp byte-compile
cconv url-vars mailcap cus-start cus-load dired-aux cl-loaddefs cl-lib
dired dired-loaddefs iso-transl tooltip eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd 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 xwidget-internal dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 113226 6824)
 (symbols 48 8669 0)
 (strings 32 32041 1780)
 (string-bytes 1 920017)
 (vectors 16 16783)
 (vector-slots 8 347621 13344)
 (floats 8 35 40)
 (intervals 56 857 0)
 (buffers 992 17))





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#54271: 28.0.91; browse-url-of-dired-file fails with wrong type argument error
  2022-03-06 11:54 bug#54271: 28.0.91; browse-url-of-dired-file fails with wrong type argument error Gustavo Barros
@ 2022-03-06 16:20 ` Lars Ingebrigtsen
  2022-03-07  2:28   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-03-06 16:20 UTC (permalink / raw)
  To: Gustavo Barros; +Cc: 54271

Gustavo Barros <gusbrs.2016@gmail.com> writes:

> To reproduce, start with `emacs -Q'. Create a file named 
> "~/test/áçãü.org", open `dired', and navigate to that file, and hit "W" 
> (`browse-url-of-dired-file') on it.  You should get the mentioned error 
> "url-file: Wrong type argument: number-or-marker-p, nil".

This is basically a different symptom of bug#42431 and bug#52243, so
I've merged these bug report.  (I think the solution here is to rework
how `W' works, but since there are so many layers involved here --
browse-url-default-handlers, among other things -- it's not obvious what
the real fix here would be.  Perhaps just change browse-url-emacs to not
use url.el for file:// URLs?)

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#54271: 28.0.91; browse-url-of-dired-file fails with wrong type argument error
  2022-03-06 16:20 ` Lars Ingebrigtsen
@ 2022-03-07  2:28   ` Lars Ingebrigtsen
  2022-03-07  3:17     ` Gustavo Barros
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-03-07  2:28 UTC (permalink / raw)
  To: Gustavo Barros; +Cc: 54271

Lars Ingebrigtsen <larsi@gnus.org> writes:

> This is basically a different symptom of bug#42431 and bug#52243, so
> I've merged these bug report. 

And I've now fixed this in Emacs 29.

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#54271: 28.0.91; browse-url-of-dired-file fails with wrong type argument error
  2022-03-07  2:28   ` Lars Ingebrigtsen
@ 2022-03-07  3:17     ` Gustavo Barros
  2022-03-07  3:27       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Gustavo Barros @ 2022-03-07  3:17 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54271

Hi Lars,

On Mon, 07 Mar 2022 at 03:28, Lars Ingebrigtsen <larsi@gnus.org> wrote:

> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> This is basically a different symptom of bug#42431 and bug#52243, so
>> I've merged these bug report. 
>
> And I've now fixed this in Emacs 29.

Thank you very much.

If I may ask, since it is a bug fix, is there some hope on this for 
Emacs 28?

Best regards,
Gustavo.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#54271: 28.0.91; browse-url-of-dired-file fails with wrong type argument error
  2022-03-07  3:17     ` Gustavo Barros
@ 2022-03-07  3:27       ` Lars Ingebrigtsen
  2022-03-07  3:37         ` Gustavo Barros
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-03-07  3:27 UTC (permalink / raw)
  To: Gustavo Barros; +Cc: 54271

Gustavo Barros <gusbrs.2016@gmail.com> writes:

> If I may ask, since it is a bug fix, is there some hope on this for
> Emacs 28?

No, we're only fixing regressions in emacs-28 now, and this has
apparently been an issue in previous versions too, if I understand
correctly.

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#54271: 28.0.91; browse-url-of-dired-file fails with wrong type argument error
  2022-03-07  3:27       ` Lars Ingebrigtsen
@ 2022-03-07  3:37         ` Gustavo Barros
  2022-03-07  3:57           ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Gustavo Barros @ 2022-03-07  3:37 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54271


On Mon, 07 Mar 2022 at 04:27, Lars Ingebrigtsen <larsi@gnus.org> wrote:

> Gustavo Barros <gusbrs.2016@gmail.com> writes:
>
>> If I may ask, since it is a bug fix, is there some hope on this for
>> Emacs 28?
>
> No, we're only fixing regressions in emacs-28 now, and this has
> apparently been an issue in previous versions too, if I understand
> correctly.

I'm not sure about the related issues of the merged reports.  But this 
particular symptom, as far as I understand, is an emacs-28 regression.

As I'd mentioned in the original report, I use this fairly frequently, 
and did not recall having problems with this while using the current 
release. Now I've just checked this statement and indeed, the failing 
example of this report works just fine with 27.2.  So, it is a 28 
regression, right?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#54271: 28.0.91; browse-url-of-dired-file fails with wrong type argument error
  2022-03-07  3:37         ` Gustavo Barros
@ 2022-03-07  3:57           ` Lars Ingebrigtsen
  2022-03-07  4:14             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-03-07  3:57 UTC (permalink / raw)
  To: Gustavo Barros; +Cc: 54271

Gustavo Barros <gusbrs.2016@gmail.com> writes:

> As I'd mentioned in the original report, I use this fairly frequently,
> and did not recall having problems with this while using the current
> release. Now I've just checked this statement and indeed, the failing
> example of this report works just fine with 27.2.  So, it is a 28
> regression, right?

Hm, right.  The change on master is too invasive for Emacs 28, though,
so perhaps something like the following would be better:

diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index ccb4e12a9f..6c86b8fab7 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -555,8 +555,7 @@ browse-url--non-html-file-url-p
 ;;;###autoload
 (defvar browse-url-default-handlers
   '(("\\`mailto:" . browse-url--mailto)
-    ("\\`man:" . browse-url--man)
-    (browse-url--non-html-file-url-p . browse-url-emacs))
+    ("\\`man:" . browse-url--man))
   "Like `browse-url-handlers' but populated by Emacs and packages.
 
 Emacs and external packages capable of browsing certain URLs


Which reverts to Emacs 27.2 behaviour for these files.

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





^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#54271: 28.0.91; browse-url-of-dired-file fails with wrong type argument error
  2022-03-07  3:57           ` Lars Ingebrigtsen
@ 2022-03-07  4:14             ` Lars Ingebrigtsen
  2022-03-07 10:01               ` Gustavo Barros
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-03-07  4:14 UTC (permalink / raw)
  To: Gustavo Barros; +Cc: 54271

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Which reverts to Emacs 27.2 behaviour for these files.

I've pushed a different fix for this to emacs-28 now that should restore
the documented way `W' is supposed to work.

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#54271: 28.0.91; browse-url-of-dired-file fails with wrong type argument error
  2022-03-07  4:14             ` Lars Ingebrigtsen
@ 2022-03-07 10:01               ` Gustavo Barros
  0 siblings, 0 replies; 9+ messages in thread
From: Gustavo Barros @ 2022-03-07 10:01 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54271


On Mon, 07 Mar 2022 at 05:14, Lars Ingebrigtsen <larsi@gnus.org> wrote:

> I've pushed a different fix for this to emacs-28 now that should 
> restore
> the documented way `W' is supposed to work.

Thank you very much.





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-03-07 10:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-06 11:54 bug#54271: 28.0.91; browse-url-of-dired-file fails with wrong type argument error Gustavo Barros
2022-03-06 16:20 ` Lars Ingebrigtsen
2022-03-07  2:28   ` Lars Ingebrigtsen
2022-03-07  3:17     ` Gustavo Barros
2022-03-07  3:27       ` Lars Ingebrigtsen
2022-03-07  3:37         ` Gustavo Barros
2022-03-07  3:57           ` Lars Ingebrigtsen
2022-03-07  4:14             ` Lars Ingebrigtsen
2022-03-07 10:01               ` Gustavo Barros

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).