hyperbole-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug request: no option to use eww as default browser when going through


From: 王江凯 JCRoinne
Subject: Bug request: no option to use eww as default browser when going through hyperbole menu C-h h f w and selecting a search engine
Date: Mon, 2 Aug 2021 22:26:29 +0800 (CST)

Dear Hyperbole curator,

Disclaimer: first time I do a bug request, so please pardon me if the style is not really to the point !

I have setup eww as the default browse-url-browser-function , thus the Action Button of Hyperbole works well in any buffer.

Except the Hyperbole menu buffer: I went through the manual, and looking at the function browse-url-default-browser , it seems there is no possibility to setup EWW for this function if there is a XDG-OPEN valid browser, here the code from browse-url.el.gz lines 906 to 950:

(defun browse-url-default-browser (url &rest args)
  "Find a suitable browser and ask it to load URL.
Default to the URL around or before point.

When called interactively, if variable `browse-url-new-window-flag' is
non-nil, load the document in a new window, if possible, otherwise use
a random existing one.  A non-nil interactive prefix argument reverses
the effect of `browse-url-new-window-flag'.

When called non-interactively, optional second argument ARGS is used
instead of `browse-url-new-window-flag'."
  (apply
   (cond
    ((memq system-type '(windows-nt ms-dos cygwin))
     'browse-url-default-windows-browser)
    ((memq system-type '(darwin))
     'browse-url-default-macosx-browser)
    ((browse-url-can-use-xdg-open) 'browse-url-xdg-open)
;;;    ((executable-find browse-url-gnome-moz-program) 'browse-url-gnome-moz)
    ((executable-find browse-url-mozilla-program) 'browse-url-mozilla)
    ((executable-find browse-url-firefox-program) 'browse-url-firefox)
    ((executable-find browse-url-chromium-program) 'browse-url-chromium)
;;;    ((executable-find browse-url-galeon-program) 'browse-url-galeon)
    ((executable-find browse-url-kde-program) 'browse-url-kde)
;;;    ((executable-find browse-url-netscape-program) 'browse-url-netscape)
;;;    ((executable-find browse-url-mosaic-program) 'browse-url-mosaic)
    ((executable-find browse-url-conkeror-program) 'browse-url-conkeror)
    ((executable-find browse-url-chrome-program) 'browse-url-chrome)
    ((executable-find browse-url-xterm-program) 'browse-url-text-xterm)
    ((locate-library "w3") 'browse-url-w3)
    (t
     (lambda (&rest _ignore) (error "No usable browser found"))))
   url args))

(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")))

I assume that the Hyperbole menu is using this function, which does not call the browse-url-browser-function . Could it be possible to have the browser-url-browser-function be called at the beginning of the cond of browser-url-default-browser ? Or have a modification of a similar effect.

I use:  Editor:      GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)

        Hyperbole:   7.1.3
        Sys Type:    x86_64-pc-linux-gnu
        OS Type:     gnu/linux
        Window Sys:  x
        News Reader: Gnus v5.13


thanks and keep up the good work ! I really like Hyperbole and Hycontrol, working on the other Hyrolo :-)

Best wishes,

JCR




 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]