From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Johannes Weiner Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] lisp/net/browse-url.el: Bugfixes regarding Elinks support (improved resend) Date: Wed, 19 Sep 2007 13:13:02 +0200 Message-ID: <20070919111302.GB13654@saeurebad.de> References: <20070914105143.GA5686@saeurebad.de> <20070917124843.GA26157@saeurebad.de> <87zlzjj7ta.fsf@cadilhac.name> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0266124371==" X-Trace: sea.gmane.org 1190200402 12817 80.91.229.12 (19 Sep 2007 11:13:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 19 Sep 2007 11:13:22 +0000 (UTC) Cc: Emacs development discussions To: =?iso-8859-1?Q?Micha=EBl?= Cadilhac Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 19 13:13:19 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IXxUZ-0007PG-Po for ged-emacs-devel@m.gmane.org; Wed, 19 Sep 2007 13:13:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IXxUY-0002mx-5U for ged-emacs-devel@m.gmane.org; Wed, 19 Sep 2007 07:13:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IXxUS-0002gn-T7 for emacs-devel@gnu.org; Wed, 19 Sep 2007 07:13:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IXxUS-0002eW-1I for emacs-devel@gnu.org; Wed, 19 Sep 2007 07:13:08 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IXxUR-0002eK-Oo for emacs-devel@gnu.org; Wed, 19 Sep 2007 07:13:07 -0400 Original-Received: from saeurebad.de ([85.214.36.134]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IXxUR-0008AQ-4c for emacs-devel@gnu.org; Wed, 19 Sep 2007 07:13:07 -0400 Original-Received: by saeurebad.de (Postfix, from userid 1000) id 5E2EB2F0146; Wed, 19 Sep 2007 13:13:02 +0200 (CEST) Mail-Followup-To: =?iso-8859-1?Q?Micha=EBl?= Cadilhac , Emacs development discussions In-Reply-To: <87zlzjj7ta.fsf@cadilhac.name> User-Agent: Mutt/1.5.16 (2007-06-11) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:79296 Archived-At: --===============0266124371== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+nBD6E3TurpgldQp" Content-Disposition: inline --+nBD6E3TurpgldQp Content-Type: multipart/mixed; boundary="GID0FwUMdk1T2AWN" Content-Disposition: inline --GID0FwUMdk1T2AWN Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Micha, On Wed, Sep 19, 2007 at 11:58:09AM +0200, Micha=EBl Cadilhac wrote: > Johannes Weiner writes: > > The current browse-url-elinks function is broken! > > > > Patch including ChangeLog entry attached. >=20 > Can you please send me this patch updated against the current CVS > repository? Yes. Patch attached. Hannes PS: You renamed the first argument in browse-url-url-encode-chars to `text' but the function body still refers to `url'. It works thanks to dynamic scoping, but I think this is not what you intended (since `text' is never u= sed at all in the body). --GID0FwUMdk1T2AWN Content-Type: text/x-diff; charset=us-ascii Content-Disposition: inline; filename="emacs-browse-url-elinks-fixes-r2.patch" Content-Transfer-Encoding: quoted-printable Index: lisp/ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/lisp/ChangeLog,v retrieving revision 1.11774 diff -u -r1.11774 ChangeLog --- lisp/ChangeLog 19 Sep 2007 07:52:19 -0000 1.11774 +++ lisp/ChangeLog 19 Sep 2007 11:09:20 -0000 @@ -1,3 +1,11 @@ +2007-09-19 Johannes Weiner + + * net/browse-url.el (browse-url-elinks-new-window): New function. + (browse-url-elinks): Use browse-url-elinks-new-window. Accept + optional second argument `new-window'. Fix typo in doc-string. + (browse-url-elinks-sentinel): Use browse-url-elinks-new-window. + Improved error message. + 2007-09-19 Glenn Morris =20 * net/socks.el (socks-open-network-stream): Signal an explicit Index: lisp/net/browse-url.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/lisp/net/browse-url.el,v retrieving revision 1.63 diff -u -r1.63 browse-url.el --- lisp/net/browse-url.el 17 Sep 2007 15:59:41 -0000 1.63 +++ lisp/net/browse-url.el 19 Sep 2007 11:09:20 -0000 @@ -1517,8 +1517,17 @@ (apply #'start-process (concat "KDE " url) nil browse-url-kde-program (append browse-url-kde-args (list url)))) =20 +(defun browse-url-elinks-new-window (url) + "Ask the Elinks WWW browser to load URL in a new window." + (let ((process-environment (browse-url-process-environment))) =20 + (apply #'start-process + (append (list (concat "elinks:" url) + nil) + browse-url-elinks-wrapper + (list "elinks" url))))) + ;;;###autoload -(defun browse-url-elinks (url) +(defun browse-url-elinks (url &optional new-window) "Ask the Elinks WWW browser to load URL. Default to the URL around the point. =20 @@ -1526,36 +1535,36 @@ none yet running, a newly started instance. =20 The Elinks command will be prepended by the program+arguments -from `elinks-browse-url-wrapper'." +from `browse-url-elinks-wrapper'." (interactive (browse-url-interactive-arg "URL: ")) (setq url (browse-url-encode-url url)) - (let ((process-environment (browse-url-process-environment)) - (elinks-ping-process (start-process "elinks-ping" nil - "elinks" "-remote" "ping()"))) - (set-process-sentinel elinks-ping-process - `(lambda (process change) - (browse-url-elinks-sentinel process ,url))))) + (if new-window + (browse-url-elinks-new-window url) + (let ((process-environment (browse-url-process-environment)) + (elinks-ping-process (start-process "elinks-ping" nil + "elinks" "-remote" "ping()"))) + (set-process-sentinel elinks-ping-process + `(lambda (process change) + (browse-url-elinks-sentinel process ,url)))))) =20 (defun browse-url-elinks-sentinel (process url) "Determines if Elinks is running or a new one has to be started." - (let ((exit-status (process-exit-status process)) - (process-environment (browse-url-process-environment))) + (let ((exit-status (process-exit-status process))) ;; Try to determine if an instance is running or if we have to ;; create a new one. (case exit-status (5 ;; No instance, start a new one. - (apply #'start-process - (append (list (concat "elinks:" url) nil) - browse-url-elinks-wrapper - (list "elinks" url)))) + (browse-url-elinks-new-window url)) (0 ;; Found an instance, open URL in new tab. - (start-process (concat "elinks:" url) nil - "elinks" "-remote" - (concat "openURL(\"" url "\",new-tab)"))) + (let ((process-environment (browse-url-process-environment))) + (start-process (concat "elinks:" url) nil + "elinks" "-remote" + (concat "openURL(\"" url "\",new-tab)")))) (otherwise - (error "Undefined exit-code of process `elinks'"))))) + (error "Unrecognized exit-code %d of process `elinks'" + exit-status))))) =20 (provide 'browse-url) =20 --GID0FwUMdk1T2AWN-- --+nBD6E3TurpgldQp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFG8QQ+dvEGNHGk3KARAs5DAJ9VVwYSFbSxbS5Qb/rSYUzcsQeZEACeNvYw BvPBRZ5vl6taH3XuvFG5XXU= =MiT9 -----END PGP SIGNATURE----- --+nBD6E3TurpgldQp-- --===============0266124371== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============0266124371==--