From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.bugs Subject: bug#4531: 23.1; browse-url with unknown func in browse-url-browser-function Date: Wed, 23 Sep 2009 11:22:37 +1000 Message-ID: <87r5tya202.fsf@blah.blah> Reply-To: Kevin Ryde , 4531@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1253670444 14231 80.91.229.12 (23 Sep 2009 01:47:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Sep 2009 01:47:24 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 23 03:47:17 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MqGwu-00068H-Jc for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Sep 2009 03:47:17 +0200 Original-Received: from localhost ([127.0.0.1]:38522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqGwu-0002GH-3U for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Sep 2009 21:47:16 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqGwp-0002GC-Kf for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2009 21:47:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqGwk-0002G0-GV for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2009 21:47:11 -0400 Original-Received: from [199.232.76.173] (port=41645 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqGwk-0002Fx-Bd for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2009 21:47:06 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:45614) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MqGwj-0004Fx-NL for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2009 21:47:06 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8N1l3Ww015231; Tue, 22 Sep 2009 18:47:03 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8N1U5Bu012212; Tue, 22 Sep 2009 18:30:05 -0700 Resent-Date: Tue, 22 Sep 2009 18:30:05 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Kevin Ryde Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Wed, 23 Sep 2009 01:30:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 4531 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125366898211170 (code B ref -1); Wed, 23 Sep 2009 01:30:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 23 Sep 2009 01:23:02 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8N1N0Ii011165 for ; Tue, 22 Sep 2009 18:23:01 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqGZP-0002Da-RD for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2009 21:22:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqGZK-0002B4-LR for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2009 21:22:59 -0400 Original-Received: from [199.232.76.173] (port=52475 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqGZK-0002B1-IS for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2009 21:22:54 -0400 Original-Received: from mailout2-14.pacific.net.au ([125.255.80.141]:34880 helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MqGZJ-0006a3-R8 for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2009 21:22:54 -0400 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout2.pacific.net.au (Postfix) with ESMTP id 24F3B190D10 for ; Wed, 23 Sep 2009 11:22:46 +1000 (EST) Original-Received: from blah.blah (ppp2FD6.dyn.pacific.net.au [61.8.47.214]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id 3D1718C2D for ; Wed, 23 Sep 2009 11:22:45 +1000 (EST) Original-Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1MqGZ3-0006I8-Nw for bug-gnu-emacs@gnu.org; Wed, 23 Sep 2009 11:22:37 +1000 User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Tue, 22 Sep 2009 21:47:11 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31378 Archived-At: --=-=-= If browse-url-browser-function is an unknown symbol the error from browse-url isn't very helpful. Eg. M-: (setq browse-url-browser-function 'FOOBAR-browse-url) M-x browse-url http://www.gnu.org => Wrong type argument: listp, FOOBAR-browse-url I hoped it would say the problem is the symbol is unbound, not that it's supposed to be a list. (The value can be a list of course, but if the value is a symbol then it's surely meant to be the name of a function.) Sending symbols down the `apply' leg of `browse-url' would give => Symbol's function definition is void: FOOBAR-browse-url which I think is a much better. 2009-09-23 Kevin Ryde * net/browse-url.el (browse-url): Pass any symbol in browse-url-browser-function to `apply', since if you've mistakenly put an unbound symbol then the error from apply is much clearer that the function you wanted is not available. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=browse-url.el.symbolp.diff --- browse-url.el.~1.80.~ 2009-09-23 11:08:37.000000000 +1000 +++ browse-url.el 2009-09-23 11:16:22.000000000 +1000 @@ -778,7 +778,11 @@ ;; which may not even exist any more. (if (stringp (frame-parameter (selected-frame) 'display)) (setenv "DISPLAY" (frame-parameter (selected-frame) 'display))) - (if (functionp browse-url-browser-function) + ;; send any symbol to `apply', not just fboundp ones, since + ;; void-function from apply is clearer than wrong-type-argument + ;; from dolist + (if (or (symbolp browse-url-browser-function) + (functionp browse-url-browser-function)) (apply browse-url-browser-function url args) ;; The `function' can be an alist; look down it for first match ;; and apply the function (which might be a lambda). --=-=-= In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5) of 2009-08-03 on raven, modified by Debian configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_AU value of $XMODIFIERS: nil locale-coding-system: iso-latin-1-unix default-enable-multibyte-characters: t --=-=-=--