Function: browse-url-can-use-xdg-open

browse-url-can-use-xdg-open is a byte-compiled function defined in browse-url.el.gz.

Signature

(browse-url-can-use-xdg-open)

Documentation

Return non-nil if the "xdg-open" program can be used.

xdg-open is a desktop utility that calls your preferred web browser.

Source Code

;; Defined in /usr/src/emacs/lisp/net/browse-url.el.gz
(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 (or (getenv "DISPLAY") (getenv "WAYLAND_DISPLAY"))
       (executable-find "xdg-open")))