unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Should fancy-startup-screen really set browse-url-browser-function?
@ 2021-12-09 14:07 John Ankarström
  2021-12-09 17:09 ` Juri Linkov
  0 siblings, 1 reply; 3+ messages in thread
From: John Ankarström @ 2021-12-09 14:07 UTC (permalink / raw)
  To: emacs-devel

The startup screen for GUI Emacs (fancy-startup-screen) apparently sets
browse-url-browser-function to eww-browse-url. The setting is
buffer-local, but it affects any commands that the user might manually
run from the startup screen.

For example, I have a command that I use for searching the web:

(defun misc-search-web (query)
 "Search the web with `browse-url'."
 (interactive "sQuery: ")
 (browse-url (format "https://www.google.com/search?q=%s&ie=UTF-8&gbv=1"
                     (url-encode-url query))))

It is bound to C-c w, and I make frequent use of it, but I have been
surprised that it opens eww sometimes (namely, when the startup screen
is active).

When users ask how to set the default browser for Emacs, they're often
told to customize browse-url-browser-function, but there's no mention in
the docstring of the fact that this variable is commonly(?) overridden.

(I say "commonly" not because I know it is common, but because the
built-in startup screen does so, which sets an example for others to
follow.)

Should fancy-startup-screen (and major modes in general) really override
browse-url-browser-function?




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

* Re: Should fancy-startup-screen really set browse-url-browser-function?
  2021-12-09 14:07 Should fancy-startup-screen really set browse-url-browser-function? John Ankarström
@ 2021-12-09 17:09 ` Juri Linkov
  2021-12-10  0:41   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Juri Linkov @ 2021-12-09 17:09 UTC (permalink / raw)
  To: John Ankarström; +Cc: emacs-devel

> Should fancy-startup-screen (and major modes in general) really override
> browse-url-browser-function?

Maybe this would be better?

diff --git a/lisp/startup.el b/lisp/startup.el
index 3ac7532053..70c95af88f 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -2276,7 +2276,9 @@ normal-about-screen
   (insert "\tHow to report bugs and contribute improvements to Emacs\n\n")
 
   (insert-button "GNU and Freedom"
-		 'action (lambda (_button) (describe-gnu-project))
+		 'action (lambda (_button)
+                           (let ((browse-url-browser-function 'eww-browse-url))
+                             (describe-gnu-project)))
 		 'follow-link t)
   (insert "\t\tWhy we developed GNU Emacs and the GNU system\n")
 
-- 

etc.



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

* Re: Should fancy-startup-screen really set browse-url-browser-function?
  2021-12-09 17:09 ` Juri Linkov
@ 2021-12-10  0:41   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-10  0:41 UTC (permalink / raw)
  To: Juri Linkov; +Cc: John Ankarström, emacs-devel

Juri Linkov <juri@linkov.net> writes:

>> Should fancy-startup-screen (and major modes in general) really override
>> browse-url-browser-function?
>
> Maybe this would be better?

Makes sense to me.

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



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

end of thread, other threads:[~2021-12-10  0:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-09 14:07 Should fancy-startup-screen really set browse-url-browser-function? John Ankarström
2021-12-09 17:09 ` Juri Linkov
2021-12-10  0:41   ` Lars Ingebrigtsen

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