unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4300: 23.1.50; bad function name: browse-url-default-browser
@ 2009-08-31 17:13 Leo
  2011-07-12 21:37 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Leo @ 2009-08-31 17:13 UTC (permalink / raw)
  To: emacs-pretest-bug

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

,----[ C-h f browse-url-default-browser RET ]
| browse-url-default-browser is a compiled Lisp function in
| `browse-url.el'.
| 
| (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 NEW-WINDOW is
| used instead of `browse-url-new-window-flag'.
| 
| The order attempted is gnome-moz-remote, Mozilla, Firefox,
| Galeon, Konqueror, Netscape, Mosaic, Lynx in an xterm, and then W3.
| 
| [back]
`----

The only thing that is related to 'default' is it uses url around point
by default. But the name is misleading, for example, emacs-w3m uses it
to open a default external browser, but it will open bizarre browsers on
OS X or Windows.

I wonder if the function name can be improved, for example,
browse-url-try-browsers.

Thanks.

Leo





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

* bug#4300: 23.1.50; bad function name: browse-url-default-browser
  2009-08-31 17:13 bug#4300: 23.1.50; bad function name: browse-url-default-browser Leo
@ 2011-07-12 21:37 ` Lars Magne Ingebrigtsen
  2011-07-13  1:56   ` Leo
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-07-12 21:37 UTC (permalink / raw)
  To: Leo; +Cc: 4300

Leo <sdl.web@gmail.com> writes:

> ,----[ C-h f browse-url-default-browser RET ]
> | browse-url-default-browser is a compiled Lisp function in
> | `browse-url.el'.

[...]

> The only thing that is related to 'default' is it uses url around point
> by default. But the name is misleading, for example, emacs-w3m uses it
> to open a default external browser, but it will open bizarre browsers on
> OS X or Windows.
>
> I wonder if the function name can be improved, for example,
> browse-url-try-browsers.

I think the function name is clear enough, and renaming it would
introduce churn for little extra gain, so I'm closing this report.

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





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

* bug#4300: 23.1.50; bad function name: browse-url-default-browser
  2011-07-12 21:37 ` Lars Magne Ingebrigtsen
@ 2011-07-13  1:56   ` Leo
  2011-07-13  8:12     ` Lawrence Mitchell
  0 siblings, 1 reply; 6+ messages in thread
From: Leo @ 2011-07-13  1:56 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 4300

On 2011-07-13 05:37 +0800, Lars Magne Ingebrigtsen wrote:
> I think the function name is clear enough, and renaming it would
> introduce churn for little extra gain, so I'm closing this report.

Lars,

The function name is misleading in that it does not find the default
browser on the OS to open url. For example, on OSX, it opens up an
xterm, which is ridiculous to most OSX users.

Changing a function name to better introduces no churn and helps 3rd
party developers improve their code.

Cheers,
Leo





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

* bug#4300: 23.1.50; bad function name: browse-url-default-browser
  2011-07-13  1:56   ` Leo
@ 2011-07-13  8:12     ` Lawrence Mitchell
  2011-07-13 10:23       ` Leo
  2011-07-13 13:50       ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 6+ messages in thread
From: Lawrence Mitchell @ 2011-07-13  8:12 UTC (permalink / raw)
  To: 4300

Leo wrote:
> On 2011-07-13 05:37 +0800, Lars Magne Ingebrigtsen wrote:
>> I think the function name is clear enough, and renaming it would
>> introduce churn for little extra gain, so I'm closing this report.

> Lars,

> The function name is misleading in that it does not find the default
> browser on the OS to open url. For example, on OSX, it opens up an
> xterm, which is ridiculous to most OSX users.

> Changing a function name to better introduces no churn and helps 3rd
> party developers improve their code.

How about this patch, which doesn't change the name, but does stop
it from lying.  It also removes the (unnecessary, and indeed
incorrect) implementation description from
browse-url-default-browser.

diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index ac12030..e18b42a 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -214,13 +214,7 @@
 
 ;;;###autoload
 (defcustom browse-url-browser-function
-  (cond
-   ((memq system-type '(windows-nt ms-dos cygwin))
-    'browse-url-default-windows-browser)
-   ((memq system-type '(darwin))
-    'browse-url-default-macosx-browser)
-   (t
-    'browse-url-default-browser))
+  'browse-url-default-browser
   "Function to display the current buffer in a WWW browser.
 This is used by the `browse-url-at-point', `browse-url-at-mouse', and
 `browse-url-of-file' commands.
@@ -908,12 +902,13 @@ 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 NEW-WINDOW is
-used instead of `browse-url-new-window-flag'.
-
-The order attempted is gnome-moz-remote, Mozilla, Firefox,
-Galeon, Konqueror, Netscape, Mosaic, Lynx in an xterm, and then W3."
+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)

-- 
Lawrence Mitchell <wence@gmx.li>






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

* bug#4300: 23.1.50; bad function name: browse-url-default-browser
  2011-07-13  8:12     ` Lawrence Mitchell
@ 2011-07-13 10:23       ` Leo
  2011-07-13 13:50       ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 6+ messages in thread
From: Leo @ 2011-07-13 10:23 UTC (permalink / raw)
  To: Lawrence Mitchell; +Cc: 4300

On 2011-07-13 16:12 +0800, Lawrence Mitchell wrote:
> How about this patch, which doesn't change the name, but does stop
> it from lying.  It also removes the (unnecessary, and indeed
> incorrect) implementation description from
> browse-url-default-browser.

Sounds like a good change ;)

Leo





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

* bug#4300: 23.1.50; bad function name: browse-url-default-browser
  2011-07-13  8:12     ` Lawrence Mitchell
  2011-07-13 10:23       ` Leo
@ 2011-07-13 13:50       ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-07-13 13:50 UTC (permalink / raw)
  To: 4300

Lawrence Mitchell <wence@gmx.li> writes:

> How about this patch, which doesn't change the name, but does stop
> it from lying.  It also removes the (unnecessary, and indeed
> incorrect) implementation description from
> browse-url-default-browser.

Thanks; applied.

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






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

end of thread, other threads:[~2011-07-13 13:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-31 17:13 bug#4300: 23.1.50; bad function name: browse-url-default-browser Leo
2011-07-12 21:37 ` Lars Magne Ingebrigtsen
2011-07-13  1:56   ` Leo
2011-07-13  8:12     ` Lawrence Mitchell
2011-07-13 10:23       ` Leo
2011-07-13 13:50       ` Lars Magne 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).