GNU bug report logs - #78060
30.1; browse-url-can-use-xdg-open does not detect my graphical display

Previous Next

Package: emacs;

Reported by: Rémi Letot <hobbes <at> poukram.net>

Date: Fri, 25 Apr 2025 15:48:03 UTC

Severity: normal

Found in version 30.1

To reply to this bug, email your comments to 78060 AT debbugs.gnu.org.

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#78060; Package emacs. (Fri, 25 Apr 2025 15:48:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Rémi Letot <hobbes <at> poukram.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 25 Apr 2025 15:48:03 GMT) Full text and rfc822 format available.

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

From: Rémi Letot <hobbes <at> poukram.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.1; browse-url-can-use-xdg-open does not detect my graphical display
Date: Fri, 25 Apr 2025 11:23:50 +0200
Hello,

while trying to debug why emacs keeps using firefox when I switched to
librewolf as default browser, I tracked it down to
browse-url-can-use-xdg-open returning nil, which makes
browse-url-default-browser use the next one in its list, namely firefox.

But I'm on a graphical display, and browse-url-can-use-xdg-open does
behave nicely in emacs -Q.

Now I'm using the emacs server, started by a systemd user unit, maybe
that's why emacs doesn't see a DISPLAY or WAYLAND_DISPLAY variable.

I noticed that there is display-graphic-p that returns t in my system,
so maybe browse-url-can-use-xdg-open could be changed like this:

(defun browse-url-can-use-xdg-open ()
  "Return non-nil if the \"xdg-open\" program can be used.
xdg-open is a desktop utility that calls your preferred web browser."
  ;; The exact set of situations where xdg-open works is complicated,
  ;; and it would be a pain to duplicate xdg-open's situation-specific
  ;; code here, as the code is a moving target.  So assume that
  ;; xdg-open will work if there is a graphical display; this should
  ;; be good enough for platforms Emacs is likely to be running on.
  (and (display-graphic-p)
       (executable-find "xdg-open")))

Thanks


In GNU Emacs 30.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.49,
 cairo version 1.18.4) of 2025-03-30, modified by Debian built on sbuild
System Description: Debian GNU/Linux trixie/sid

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/libexec
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-libsystemd --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/30.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/30.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --build
 x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/libexec --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --with-libsystemd
 --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/30.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/30.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --with-pgtk
 'CFLAGS=-g -O2 -Werror=implicit-function-declaration
 -ffile-prefix-map=/build/reproducible-path/emacs-30.1+1=. -fstack-protector-strong
 -fstack-clash-protection -Wformat -Werror=format-security
 -fcf-protection -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'
 LDFLAGS=-Wl,-z,relro'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB

Important settings:
  value of $LANG: fr_BE.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  eat-eshell-visual-command-mode: t
  eat-eshell-mode: t
  eshell-syntax-highlighting-global-mode: t
  server-mode: t
  repeat-mode: t
  global-hl-line-mode: t
  diredfl-global-mode: t
  org-roam-db-autosync-mode: t
  which-key-mode: t
  marginalia-mode: t
  vertico-mode: t
  override-global-mode: t
  savehist-mode: t
  default-text-scale-mode: t
  windmove-mode: t
  recentf-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-bisect hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-bisect
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-bundle hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-bundle
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-base hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-base
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-process hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-process
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-autorevert hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-autorevert
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-extras hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-extras
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-margin hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-margin
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-subtree hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-subtree
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-blame hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-blame
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-core hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-core
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-bookmark hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-bookmark
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-refs hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-refs
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/git-rebase hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/git-rebase
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-gitignore hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-gitignore
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-pull hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-pull
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-branch hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-branch
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-git hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-git
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-log hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-log
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-mode hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-mode
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/git-commit hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/git-commit
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-apply hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-apply
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-worktree hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-worktree
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-status hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-status
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-reset hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-reset
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-merge hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-merge
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-diff hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-diff
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-transient hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-transient
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-notes hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-notes
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-clone hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-clone
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-remote hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-remote
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-sparse-checkout hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-sparse-checkout
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-push hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-push
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-wip hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-wip
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-sequence hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-sequence
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-ediff hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-ediff
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-reflog hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-reflog
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-stash hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-stash
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-tag hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-tag
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-patch hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-patch
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-commit hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-commit
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-repos hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-repos
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-submodule hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-submodule
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-fetch hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-fetch
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-files hides /home/hobbes/.emacs.d/elpa/magit-4.3.2/magit-files
/home/hobbes/.emacs.d/elpa/git-commit-4.1.2/magit-section hides /home/hobbes/.emacs.d/elpa/magit-section-4.3.2/magit-section
/usr/share/emacs/site-lisp/emms/emms-auto hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-auto
/usr/share/emacs/site-lisp/emms/emms-later-do hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-later-do
/usr/share/emacs/site-lisp/emms/emms-player-mpv hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-player-mpv
/usr/share/emacs/site-lisp/emms/emms-info hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-info
/usr/share/emacs/site-lisp/emms/emms-tag-editor hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-tag-editor
/usr/share/emacs/site-lisp/emms/emms-setup hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-setup
/usr/share/emacs/site-lisp/emms/emms-volume-mixerctl hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-volume-mixerctl
/usr/share/emacs/site-lisp/emms/emms-cache hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-cache
/usr/share/emacs/site-lisp/emms/emms-info-opusinfo hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-info-opusinfo
/usr/share/emacs/site-lisp/emms/emms-librefm-scrobbler hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-librefm-scrobbler
/usr/share/emacs/site-lisp/emms/emms-history hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-history
/usr/share/emacs/site-lisp/emms/emms-browser hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-browser
/usr/share/emacs/site-lisp/emms/emms-info-mp3info hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-info-mp3info
/usr/share/emacs/site-lisp/emms/emms-player-mplayer hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-player-mplayer
/usr/share/emacs/site-lisp/emms/emms-last-played hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-last-played
/usr/share/emacs/site-lisp/emms/emms-lyrics hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-lyrics
/usr/share/emacs/site-lisp/emms/emms-player-xine hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-player-xine
/usr/share/emacs/site-lisp/emms/emms-player-vlc hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-player-vlc
/usr/share/emacs/site-lisp/emms/emms-playlist-sort hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-playlist-sort
/usr/share/emacs/site-lisp/emms/jack hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/jack
/usr/share/emacs/site-lisp/emms/emms-info-metaflac hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-info-metaflac
/usr/share/emacs/site-lisp/emms/emms-info-libtag hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-info-libtag
/usr/share/emacs/site-lisp/emms/emms-i18n hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-i18n
/usr/share/emacs/site-lisp/emms/emms-volume-amixer hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-volume-amixer
/usr/share/emacs/site-lisp/emms/emms-playing-time hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-playing-time
/usr/share/emacs/site-lisp/emms/emms-player-mpd hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-player-mpd
/usr/share/emacs/site-lisp/emms/emms-stream-info hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-stream-info
/usr/share/emacs/site-lisp/emms/emms-mark hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-mark
/usr/share/emacs/site-lisp/emms/emms-compat hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-compat
/usr/share/emacs/site-lisp/emms/emms-mode-line-icon hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-mode-line-icon
/usr/share/emacs/site-lisp/emms/emms hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms
/usr/share/emacs/site-lisp/emms/emms-source-playlist hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-source-playlist
/usr/share/emacs/site-lisp/emms/emms-volume-pulse hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-volume-pulse
/usr/share/emacs/site-lisp/emms/emms-librefm-stream hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-librefm-stream
/usr/share/emacs/site-lisp/emms/emms-player-simple hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-player-simple
/usr/share/emacs/site-lisp/emms/emms-url hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-url
/usr/share/emacs/site-lisp/emms/emms-info-ogginfo hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-info-ogginfo
/usr/share/emacs/site-lisp/emms/emms-player-mpg321-remote hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-player-mpg321-remote
/usr/share/emacs/site-lisp/emms/emms-metaplaylist-mode hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-metaplaylist-mode
/usr/share/emacs/site-lisp/emms/emms-maint hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-maint
/usr/share/emacs/site-lisp/emms/emms-playlist-mode hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-playlist-mode
/usr/share/emacs/site-lisp/emms/emms-info-exiftool hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-info-exiftool
/usr/share/emacs/site-lisp/emms/emms-mode-line hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-mode-line
/usr/share/emacs/site-lisp/emms/emms-show-all hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-show-all
/usr/share/emacs/site-lisp/emms/emms-source-file hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-source-file
/usr/share/emacs/site-lisp/emms/emms-streams hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-streams
/usr/share/emacs/site-lisp/emms/emms-info-tinytag hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-info-tinytag
/usr/share/emacs/site-lisp/emms/emms-volume hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-volume
/usr/share/emacs/site-lisp/emms/emms-score hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-score
/usr/share/emacs/site-lisp/emms/emms-playlist-limit hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-playlist-limit
/usr/share/emacs/site-lisp/emms/emms-cue hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-cue
/usr/share/emacs/site-lisp/emms/emms-bookmarks hides /usr/share/emacs/site-lisp/elpa-src/emms-6.0/emms-bookmarks
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-mime-parts hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-mime-parts
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-notification hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-notification
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-thread hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-thread
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-icalendar hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-icalendar
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-speedbar hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-speedbar
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-config hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-config
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-context hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-context
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-update hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-update
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-obsolete hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-obsolete
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-folders hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-folders
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-autoloads hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-autoloads
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-window hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-window
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-draft hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-draft
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-contrib hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-contrib
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-view hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-view
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-actions hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-actions
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-helpers hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-helpers
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-modeline hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-modeline
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-query-items hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-query-items
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-message hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-message
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-compose hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-compose
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-vars hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-vars
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-transient hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-transient
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-headers hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-headers
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-server hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-server
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-contacts hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-contacts
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-pkg hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-pkg
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-bookmarks hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-bookmarks
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-lists hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-lists
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-search hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-search
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-org hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-org
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-main hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-main
/usr/share/emacs/site-lisp/elpa/mu4e-1.12.9/mu4e-mark hides /usr/share/emacs/site-lisp/elpa-src/mu4e-1.12.9/mu4e-mark
/home/hobbes/.emacs.d/elpa/modus-themes-4.7.0/theme-loaddefs hides /usr/share/emacs/30.1/lisp/theme-loaddefs
/home/hobbes/.emacs.d/elpa/transient-0.8.7/transient hides /usr/share/emacs/30.1/lisp/transient

Features:
(shadow bbdb-message mail-extr emacsbug two-column consult-register
helpful cc-langs cc-vars cc-defs imenu trace cl-print edebug debug
backtrace info-look f elisp-refs embark-consult consult eat color
em-unix em-term em-script em-pred em-ls em-hist em-glob em-extpipe
em-cmpl em-basic em-banner em-tramp tramp trampver tramp-integration
tramp-message tramp-compat tramp-loaddefs eshell-syntax-highlighting
em-dirs em-prompt em-alias esh-mode esh-var shell-pop term disp-table
ehelp image-file image-converter org-indent oc-basic ol-eww ol-rmail
ol-mhe ol-irc ol-info ol-gnus nnselect ol-docview doc-view filenotify
ol-bibtex bibtex ol-bbdb ol-w3m ol-doi org-link-doi mm-archive jka-compr
eww mm-url mastodon-media textsec uni-scripts idna-mapping ucs-normalize
uni-confusable textsec-check mastodon-profile network-stream
mastodon-auth mastodon-client plstore help-fns radix-tree vertico-sort
server cus-start repeat logview datetime extmap bindat emms-info-libtag
emms-librefm-stream emms-librefm-scrobbler emms-playlist-limit
emms-volume emms-volume-mixerctl emms-volume-pulse emms-volume-amixer
emms-i18n emms-history emms-score emms-stream-info
emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon
emms-browser sort emms-playlist-sort emms-last-played emms-player-xine
emms-player-mpd emms-playing-time emms-lyrics emms-url emms-streams
emms-show-all emms-tag-editor emms-mark emms-mode-line emms-cache
emms-info-exiftool emms-info-tinytag emms-info-metaflac
emms-info-opusinfo emms-info-ogginfo emms-info-mp3info emms-info
emms-later-do emms-playlist-mode emms-player-vlc emms-player-mpv
emms-player-mplayer emms-player-simple emms-source-playlist
emms-source-file locate emms-setup emms emms-compat epa-file wallabag
wallabag-org wallabag-util wallabag-db wallabag-faces request mastodon
mastodon-transient tp transient mastodon-search mastodon-widget
mastodon-tl image-mode exif url-cache mpv tq org-timer org-clock
mastodon-toot facemenu mastodon-iso persist emojify advice apropos
tar-mode arc-mode archive-mode ht mastodon-http url-http url-auth url-gw
ob-sql-mode sql view plantuml-mode pyvenv visual-fill-column socks nsm
elpher elfeed-org elfeed-show elfeed-search elfeed-csv elfeed
elfeed-curl elfeed-log elfeed-db elfeed-lib url-queue xml-query mu4e
mu4e-org mu4e-notification notifications mu4e-main smtpmail mu4e-view
mu4e-mime-parts mu4e-headers mu4e-thread mu4e-actions mu4e-compose
mu4e-draft mu4e-search mu4e-lists mu4e-bookmarks mu4e-mark mu4e-message
flow-fill mule-util hl-line mu4e-contacts mu4e-update mu4e-folders
mu4e-context mu4e-query-items mu4e-server mu4e-modeline mu4e-vars
mu4e-helpers mu4e-config mu4e-window ido mu4e-obsolete gnorb gnorb-org
gnorb-bbdb gnorb-gnus gnorb-registry gnus-registry registry eieio-base
gnorb-utils bbdb-mua spam spam-stat bbdb-com bbdb bbdb-site timezone
gnus-uu yenc gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime
gnutls dig gnus-sum shr pixel-fill kinsoku url-file svg dom gnus-group
gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail
mail-source utf7 nnoo parse-time iso8601 gnus-spec gnus-int gnus-range
gnus-win gnus nnheader range message sendmail yank-media puny diredfl
dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068
epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils
gmm-utils mailheader ob-http ob-http-mode s org-roam-export ox-odt
rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse
nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar ox-html table
ox-ascii ox-publish ox org-roam-protocol emacsql-sqlite-builtin
org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id
org-roam-node crm org-roam-db org-roam-utils org-roam-compat org-roam
org-capture org-attach emacsql-sqlite emacsql emacsql-compiler
magit-section cursor-sensor llama ob-makefile ob-org ob-lilypond
ob-plantuml ob-screen ob-perl ob-sqlite ob-sql ob-octave ob-dot ob-ditaa
ob-ocaml ob-ruby ob-R ob-python python project ob-eshell eshell esh-cmd
esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-module-loaddefs
esh-util files-x ob-shell shell org-habit org-agenda org-crypt
org-protocol org-checklist which-key avy bookmark embark-org org-element
org-persist xdg org-id org-refile org-element-ast inline avl-tree
generator embark orderless marginalia vertico compat wgrep grep compile
text-property-search edmacro kmacro use-package-bind-key bind-key ztree
ztree-diff ztree-diff-model ztree-dir ztree-view ztree-protocol
ztree-util savehist default-text-scale modus-vivendi-tinted-theme
modus-themes auto-package-update easy-mmode dash use-package-ensure
use-package-core comp comp-cstr cl-extra help-mode warnings comp-run
comp-common windmove finder-inf recentf tree-widget ffap saveplace cl
org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src
sh-script smie treesit executable ob-comint org-pcomplete pcomplete
comint ansi-osc ansi-color ring org-list org-footnote org-faces
org-entities time-date noutline outline ob-emacs-lisp ob-core ob-eval
org-cycle org-table ol rx org-fold org-fold-core org-keys oc
org-loaddefs thingatpt find-func cal-menu calendar cal-loaddefs
org-version org-compat org-macs format-spec bbdb-loaddefs cus-edit pp
cus-load wid-edit consult-dir-autoloads counsel-autoloads
diredfl-autoloads eat-autoloads elfeed-org-autoloads elfeed-autoloads
elpher-autoloads embark-consult-autoloads consult-autoloads
embark-autoloads emojify-autoloads eshell-syntax-highlighting-autoloads
git-commit-autoloads gnorb-autoloads helpful-autoloads
elisp-refs-autoloads f-autoloads ivy-prescient-autoloads
logview-autoloads datetime-autoloads extmap-autoloads
marginalia-autoloads mastodon-autoloads modus-themes-autoloads
mpv-autoloads nov-autoloads esxml-autoloads ob-http-autoloads
ob-sql-mode-autoloads orderless-autoloads async-autoloads
org-roam-autoloads emacsql-autoloads persist-autoloads
prescient-autoloads request-autoloads solarized-theme-autoloads
swiper-autoloads ivy-autoloads tp-autoloads
treemacs-icons-dired-autoloads treemacs-magit-autoloads magit-autoloads
pcase transient-autoloads magit-section-autoloads llama-autoloads
treemacs-autoloads cfrs-autoloads posframe-autoloads ht-autoloads
hydra-autoloads lv-autoloads pfuture-autoloads ace-window-autoloads
avy-autoloads dash-autoloads vertico-autoloads
visual-fill-column-autoloads wgrep-autoloads info with-editor-autoloads
mu4e-autoloads package browse-url url url-proxy url-privacy url-expand
url-methods url-history url-cookie generate-lisp-file url-domsuf
url-util mailcap url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs icons password-cache json subr-x map byte-opt gv
bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip
cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/pgtk-win pgtk-win term/common-win touch-screen
pgtk-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
nadvice seq simple cl-generic indonesian philippine 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 abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo gtk pgtk lcms2 multi-tty move-toolbar
make-network-process native-compile emacs)

Memory information:
((conses 16 1874640 338921) (symbols 48 62924 3)
 (strings 32 487185 23881) (string-bytes 1 27954593)
 (vectors 16 138755) (vector-slots 8 2482039 115310)
 (floats 8 1044 14587) (intervals 56 20621 3001) (buffers 992 38))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78060; Package emacs. (Fri, 25 Apr 2025 16:00:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Rémi Letot <hobbes <at> poukram.net>
Cc: 78060 <at> debbugs.gnu.org
Subject: Re: bug#78060: 30.1;
 browse-url-can-use-xdg-open does not detect my graphical display
Date: Fri, 25 Apr 2025 18:59:30 +0300
> From: Rémi Letot <hobbes <at> poukram.net>
> Date: Fri, 25 Apr 2025 11:23:50 +0200
> 
> while trying to debug why emacs keeps using firefox when I switched to
> librewolf as default browser, I tracked it down to
> browse-url-can-use-xdg-open returning nil, which makes
> browse-url-default-browser use the next one in its list, namely firefox.
> 
> But I'm on a graphical display, and browse-url-can-use-xdg-open does
> behave nicely in emacs -Q.
> 
> Now I'm using the emacs server, started by a systemd user unit, maybe
> that's why emacs doesn't see a DISPLAY or WAYLAND_DISPLAY variable.

Yes, you need do stuff that requires GUI from
server-after-make-frame-hook.

> I noticed that there is display-graphic-p that returns t in my system,
> so maybe browse-url-can-use-xdg-open could be changed like this:
> 
> (defun browse-url-can-use-xdg-open ()
>   "Return non-nil if the \"xdg-open\" program can be used.
> xdg-open is a desktop utility that calls your preferred web browser."
>   ;; The exact set of situations where xdg-open works is complicated,
>   ;; and it would be a pain to duplicate xdg-open's situation-specific
>   ;; code here, as the code is a moving target.  So assume that
>   ;; xdg-open will work if there is a graphical display; this should
>   ;; be good enough for platforms Emacs is likely to be running on.
>   (and (display-graphic-p)
>        (executable-find "xdg-open")))

That'd be incorrect, because the fact that the Emacs display is a
text-only display doesn't mean the rest of the system cannot show GUI
windows.  For example, imagine this is invoked from "emacs -nw" on a
graphical terminal.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78060; Package emacs. (Fri, 25 Apr 2025 19:03:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Rémi Letot <hobbes <at> poukram.net>
Cc: 78060 <at> debbugs.gnu.org
Subject: Re: bug#78060: 30.1; browse-url-can-use-xdg-open does not detect my
 graphical display
Date: Fri, 25 Apr 2025 22:02:01 +0300
> From: Rémi Letot <hobbes <at> poukram.net>
> Cc: 78060 <at> debbugs.gnu.org
> Date: Fri, 25 Apr 2025 20:36:20 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> From: Rémi Letot <hobbes <at> poukram.net>
> >> Date: Fri, 25 Apr 2025 11:23:50 +0200
> >> 
> >> while trying to debug why emacs keeps using firefox when I switched to
> >> librewolf as default browser, I tracked it down to
> >> browse-url-can-use-xdg-open returning nil, which makes
> >> browse-url-default-browser use the next one in its list, namely firefox.
> >> 
> >> But I'm on a graphical display, and browse-url-can-use-xdg-open does
> >> behave nicely in emacs -Q.
> >> 
> >> Now I'm using the emacs server, started by a systemd user unit, maybe
> >> that's why emacs doesn't see a DISPLAY or WAYLAND_DISPLAY variable.
> >
> > Yes, you need do stuff that requires GUI from
> > server-after-make-frame-hook.
> 
> damn, I understand the words that you write, but I have no idea how to
> use it :-)

Define a function in your init file that arranges for xdg-open to be
called, and add that function to server-after-make-frame-hook.  Then
your code will run after the server already created a GUI frame, and
all the Emacs features that need the GUI system will work as expected.

> Now maybe that's not a real emacs bug, would you prefer that I restart
> that discussion on the mailing list ?

Feel free, if the above is not clear.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78060; Package emacs. (Sat, 26 Apr 2025 06:06:05 GMT) Full text and rfc822 format available.

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

From: Rémi Letot <hobbes <at> poukram.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78060 <at> debbugs.gnu.org
Subject: Re: bug#78060: 30.1; browse-url-can-use-xdg-open does not detect my
 graphical display
Date: Fri, 25 Apr 2025 20:36:20 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Rémi Letot <hobbes <at> poukram.net>
>> Date: Fri, 25 Apr 2025 11:23:50 +0200
>> 
>> while trying to debug why emacs keeps using firefox when I switched to
>> librewolf as default browser, I tracked it down to
>> browse-url-can-use-xdg-open returning nil, which makes
>> browse-url-default-browser use the next one in its list, namely firefox.
>> 
>> But I'm on a graphical display, and browse-url-can-use-xdg-open does
>> behave nicely in emacs -Q.
>> 
>> Now I'm using the emacs server, started by a systemd user unit, maybe
>> that's why emacs doesn't see a DISPLAY or WAYLAND_DISPLAY variable.
>
> Yes, you need do stuff that requires GUI from
> server-after-make-frame-hook.

damn, I understand the words that you write, but I have no idea how to
use it :-)

I'm trying to use xdg-open from a graphical frame, so
server-after-make-frame-hook has run...

>> I noticed that there is display-graphic-p that returns t in my system,
>> so maybe browse-url-can-use-xdg-open could be changed like this:
>> 
>> (defun browse-url-can-use-xdg-open ()
>>   "Return non-nil if the \"xdg-open\" program can be used.
>> xdg-open is a desktop utility that calls your preferred web browser."
>>   ;; The exact set of situations where xdg-open works is complicated,
>>   ;; and it would be a pain to duplicate xdg-open's situation-specific
>>   ;; code here, as the code is a moving target.  So assume that
>>   ;; xdg-open will work if there is a graphical display; this should
>>   ;; be good enough for platforms Emacs is likely to be running on.
>>   (and (display-graphic-p)
>>        (executable-find "xdg-open")))
>
> That'd be incorrect, because the fact that the Emacs display is a
> text-only display doesn't mean the rest of the system cannot show GUI
> windows.  For example, imagine this is invoked from "emacs -nw" on a
> graphical terminal.

Ah, right, I thought it would work there too, but it doesn't.

Now browse-url-can-use-xdg-open is not my only problem, it's a bit more
involved than I thought: xdg-open does work in a term buffer, but not
from eshell. So something more is needed, and I have no idea what...

Now maybe that's not a real emacs bug, would you prefer that I restart
that discussion on the mailing list ?

Thanks a lot,
-- 
Rémi




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78060; Package emacs. (Sun, 27 Apr 2025 10:11:02 GMT) Full text and rfc822 format available.

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

From: Rémi Letot <hobbes <at> poukram.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78060 <at> debbugs.gnu.org
Subject: Re: bug#78060: 30.1; browse-url-can-use-xdg-open does not detect my
 graphical display
Date: Sun, 27 Apr 2025 12:10:30 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Rémi Letot <hobbes <at> poukram.net>
>> Cc: 78060 <at> debbugs.gnu.org
>> Date: Fri, 25 Apr 2025 20:36:20 +0200
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>> >> From: Rémi Letot <hobbes <at> poukram.net>
>> >> Date: Fri, 25 Apr 2025 11:23:50 +0200
>> >> 
>> >> while trying to debug why emacs keeps using firefox when I switched to
>> >> librewolf as default browser, I tracked it down to
>> >> browse-url-can-use-xdg-open returning nil, which makes
>> >> browse-url-default-browser use the next one in its list, namely firefox.
>> >> 
>> >> But I'm on a graphical display, and browse-url-can-use-xdg-open does
>> >> behave nicely in emacs -Q.
>> >> 
>> >> Now I'm using the emacs server, started by a systemd user unit, maybe
>> >> that's why emacs doesn't see a DISPLAY or WAYLAND_DISPLAY variable.
>> >
>> > Yes, you need do stuff that requires GUI from
>> > server-after-make-frame-hook.
>> 
>> damn, I understand the words that you write, but I have no idea how to
>> use it :-)
>
> Define a function in your init file that arranges for xdg-open to be
> called, and add that function to server-after-make-frame-hook.  Then
> your code will run after the server already created a GUI frame, and
> all the Emacs features that need the GUI system will work as expected.

But I don't want to run xdg-open when a frame has been created, only
when I click on a link in a mail, a doc, or interactively in eshell...

Now after a bit of digging, there are actually two problems.

First is that emacs does not inheritate my environment when started by a
systemd user service.

If I restart the systemd service from a terminal, I get my environment
and most things work as they should.

That seems to be a limitation of systemd user services. There are ways
around that problem, but they are far too involved in things that I
don't really master, so I just disabled the user service.

Now emacs server is started whenever I first start emacs, which make my
first invocation a bit slower, but that's not a big problem since I
don't restart my session that often.

Second problem: now I have my environment. I can echo $WAYLAND_DISPLAY,
DISPLAY... start graphical programs like librewolf from eshell or other
emacs facilities... everything seems to be ok.

But even like that, xdg-open doesn't work for most things when launched
from emacs.

It works fine when launched from term with bash as my shell, but not
from eshell or any emacs direct facility.

As my initial goal was to start librewolf as my secondary browser, I
just

(setq browse-url-generic-program "librewolf" 
      browse-url-secondary-browser-function 'browse-url-generic )

So my immediate problem is solved.

BUT xdg-open still doesn't work for most things.

Strangely enough, "xdg-open ~/" does open my file manager on home, but
that's the only thing that I managed to achieve. When I pass it a file,
it just doesn't open anything.

I straced it, it does fork something, but then nothing appears on my
desktop, I have no error message anywhere that I could find, and
xdg-open's return code is 0.

Now, again, I don't know if that should be considered an emacs bug, so
feel free to close the bug if you think it should be handled elsewhere. 

Thanks,
-- 
Rémi Letot




This bug report was last modified 6 days ago.

Previous Next


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