Package: emacs-pgtk
Version: 1:29.3+1-2~bpo12+1
Severity: normal

After upgrading from Emacs 28 to 29 and switching from xorg to
wayland, I have noticed emacs sometimes fail to open URLs. It seems to
be an ordering issue in my session: it seems like Emacs sometimes
starts before Sway is fully setup and the environment properly
populated, which makes it use the incorrect WAYLAND_DISPLAY variable.

This, in itself, is a bug in my setup: Emacs should be started
properly.

*But* my bug here is this fails completely silently. No URL gets
opened at all, which is *really* disruptive because I can open a bunch
of URLs while reading my mail, then i go to my browser and nothing is
there and now I've lost data.

Instead, browse-url should fail noisily if it fails to load a URL. If
I look at the `browse-url' source, for example at the end we see this
kind of failure, which happens when no browser can be found at all:

    (if (functionp function)
        (apply function url args)
      (error "No suitable browser for URL %s" url))))

That is what I would expect the handler to do in this case, something
like "uh, we can't find your wayland display, so we're just dropping
this URL to the floor, sorry".

That function also has that mysterious blob:

              (progn
                ;; The `display' frame parameter is probably wrong.
                ;; See bug#53969 for some context.
                ;; (setenv "WAYLAND_DISPLAY" dpy)
                )
            (setenv "DISPLAY" dpy)))

... which refers to:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=53969

... which I'm struggling to understand. If I uncomment that blob, the
bug, actually, just completely goes away which i find quite puzzling.

A.

-- System Information:
Debian Release: 12.5
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'stable-debug'), (500, 'stable'), 
(1, 'experimental'), (1, 'unstable'), (1, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.6.13+bpo-amd64 (SMP w/16 CPU threads; PREEMPT)
Locale: LANG=fr_CA.UTF-8, LC_CTYPE=fr_CA.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages emacs-pgtk depends on:
ii  emacs-bin-common              1:29.3+1-2~bpo12+1
ii  emacs-common                  1:29.3+1-2~bpo12+1
ii  libacl1                       2.3.1-3
ii  libasound2                    1.2.8-1+b1
ii  libc6                         2.36-9+deb12u7
ii  libcairo2                     1.16.0-7
ii  libdbus-1-3                   1.14.10-1~deb12u1
ii  libfontconfig1                2.14.1-4
ii  libfreetype6                  2.12.1+dfsg-5
ii  libgccjit0                    12.2.0-14
ii  libgdk-pixbuf-2.0-0           2.42.10+dfsg-1+b1
ii  libgif7                       5.2.1-2.5
ii  libglib2.0-0                  2.74.6-2+deb12u2
ii  libgmp10                      2:6.2.1+dfsg1-1.1
ii  libgnutls30                   3.7.9-2+deb12u2
ii  libgpm2                       1.20.7-10+b1
ii  libgtk-3-0                    3.24.38-2~deb12u1
ii  libharfbuzz0b                 6.0.0+dfsg-3
ii  libjansson4                   2.14-2
ii  libjpeg62-turbo               1:2.1.5-2
ii  liblcms2-2                    2.14-2
ii  libotf1                       0.9.16-4
ii  libpango-1.0-0                1.50.12+ds-1
ii  libpng16-16t64 [libpng16-16]  1.6.43-5
ii  librsvg2-2                    2.54.7+dfsg-1~deb12u1
ii  libselinux1                   3.4-1+b6
ii  libsqlite3-0                  3.40.1-2
ii  libsystemd0                   252.22-1~deb12u1
ii  libtiff6                      4.5.0-6+deb12u1
ii  libtinfo6                     6.4-4
ii  libtree-sitter0               0.20.7-1
ii  libwebp7                      1.2.4-0.2+deb12u1
ii  libwebpdemux2                 1.2.4-0.2+deb12u1
ii  libxml2                       2.9.14+dfsg-1.3~deb12u1
ii  zlib1g                        1:1.2.13.dfsg-1

Versions of packages emacs-pgtk recommends:
ii  fonts-noto-color-emoji  2.042-0+deb12u1

Versions of packages emacs-pgtk suggests:
ii  emacs-common-non-dfsg  1:28.2+1-2

-- no debconf information

Reply via email to