From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: michael@cadilhac.name (=?iso-8859-1?Q?Micha=EBl?= Cadilhac) Newsgroups: gmane.emacs.devel Subject: Re: Your last change to browse-url is bogus. Date: Thu, 13 Sep 2007 00:50:59 +0200 Organization: Epita/LRDE Message-ID: <87fy1j1orw.fsf@cadilhac.name> References: <87ejh42mo4.fsf@cadilhac.name> <20070912.215405.160495149.mituharu@math.s.chiba-u.ac.jp> <87sl5k10yl.fsf@cadilhac.name> <20070912.231800.210864712.mituharu@math.s.chiba-u.ac.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1423435311==" X-Trace: sea.gmane.org 1189637728 3224 80.91.229.12 (12 Sep 2007 22:55:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 12 Sep 2007 22:55:28 +0000 (UTC) Cc: hannes@saeurebad.de, emacs-devel@gnu.org To: YAMAMOTO Mitsuharu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 13 00:55:23 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 1IVb77-0002qB-M1 for ged-emacs-devel@m.gmane.org; Thu, 13 Sep 2007 00:55:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IVb77-0000Js-97 for ged-emacs-devel@m.gmane.org; Wed, 12 Sep 2007 18:55:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IVb73-0000Hd-MZ for emacs-devel@gnu.org; Wed, 12 Sep 2007 18:55:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IVb71-0000Dr-7i for emacs-devel@gnu.org; Wed, 12 Sep 2007 18:55:12 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IVb71-0000Dg-3a for emacs-devel@gnu.org; Wed, 12 Sep 2007 18:55:11 -0400 Original-Received: from smtp3-g19.free.fr ([212.27.42.29]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IVb70-0003CW-IT for emacs-devel@gnu.org; Wed, 12 Sep 2007 18:55:10 -0400 Original-Received: from smtp3-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp3-g19.free.fr (Postfix) with ESMTP id D23173957; Thu, 13 Sep 2007 00:55:09 +0200 (CEST) Original-Received: from localhost (ivr94-6-82-230-255-91.fbx.proxad.net [82.230.255.91]) by smtp3-g19.free.fr (Postfix) with ESMTP id BEBEB38E4; Thu, 13 Sep 2007 00:55:06 +0200 (CEST) X-Website: http://michael.cadilhac.name Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEU/JREXDATg1LV8UCao i1fQpmoP3Nd6AAACa0lEQVQ4jWWUQW7jMAxFqZEPICJzAjXeM6W8dyNqX9ji/a8yn04xnWIEJLD9 LJH85DcJFyJV3erqPty8ExHfBikXSdn0WVezC0hOAQiA2nCsAHOqEnPe4k+puU8zw/t+xquqjRKA 4lHsmQBT8C5pDtBwfwH8VdcHI5+FHtjRxrQRwZsf3hNjZRKAPEzHEdH9mFNSYb5dQK3r8KM6ftNy KikAirDZFWdVkDqbxjGFbAcwbQCxxc8mPRHUGOcCIMgMACV23RfJTch3gC6ofT3qCdG0NyUUPfYF yQrKCIAnuYsgX2qPzW2i9sNrfSOSPPZQiygtCNlCjlpXJV38lIKshF/AZzsAMoArdCKNHfXukPuJ ImbLh+9J2gXwap0QpZ7NjZ7ekdkFcDiqPiLGcHmuvaG/AHgy62s52Lae1ABoA7D6d2kDoAvgbnyD ZutEd6lTHOXfYPHVJDH1K8a1+oyrjoZpAGn1x5pfwPr2E9yjxSpk50/gEyKgD/+BD/KzN3tQ13b8 Cx5loF0AgnZf5IUny9hRHQOYBllHDM+6s3oviZBu77mFjDm621Np3hkjR90wE1BkTYvhdDgDgCmR xWChFfcYAOqMm5NZkVWMur8AL5+oeMQOob2FmY76FiM+PrDDZypwGdqokSlAaQOmGH6mW8KpsOwl 0YOLedjSITr6scNRF8D4PesH33QmLrx8AzjpV/3kkg025w2gfAFYKCLluJAc4Ap+h18oo4S8wzaY klDsBUTiY8EZFkg5Iass75FubC9wd8qa0u9+gRxAsAKEaRAo6iB+vwCMGmdBjvgidQGA1ntMX4CS ZYGV/wADyL80LIX/UAAAAABJRU5ErkJggg== In-Reply-To: <20070912.231800.210864712.mituharu@math.s.chiba-u.ac.jp> (YAMAMOTO Mitsuharu's message of "Wed, 12 Sep 2007 23:18:00 +0900 (JST)") User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux) X-Detected-Kernel: Linux 2.4-2.6 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:78719 Archived-At: --===============1423435311== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable YAMAMOTO Mitsuharu writes: >>>>>> On Wed, 12 Sep 2007 15:13:06 +0200, michael@cadilhac.name (Micha=EBl= Cadilhac) said: > >>> %-escaping in browse-url-file-url (filename -> url) and those in >>> other places such as browse-url-netscape (url -> url) are >>> inherently different operations. > >> Not quite. I may have a too low-level point of view, but they are >> the same operations, they are just not used for the same purpose. > > "Inherently different" might have been an exaggeration. Do you agree > that they are semantically different operations? I'm not sure we will agree on the terms, but we're probably saying the same thing=A0:-) >>> I think consolidating these two operations into one function only >>> because they look similar is over-refactoring and shouldn't be done >>> in order to avoid re-escaping or re-unescaping by mistake. > >> Well, I'm not so sure. Their purpose is to escape characters in a >> way we don't want to duplicate too much. The =ABproblem=BB you're >> pointing out is the reason why I made the escaping function take the >> set of characters to escape in a first place. > > IMO, differentiating them just by an argument makes the semantical > difference more or less implicit. IMO, the semantical difference is to be taken care of by the caller, not this tool function. All the callers need a function to url-encode a set of chars in a string, so there's a point in creating such a function, nop=A0? > What is worse, the function name `browse-url-encode-url' looks as if > it takes a URL as an argument. I do agree that the function name doesn't tell the right thing. At first, I'd have preferred something like `browse-url-encode-chars-in-string' (when the change consisted in calling this function with the set of chars to be escaped), but if factoring the regexp is not considered as over-factoring (which I'm not sure), this name is too generic. > I think operations on filename and URL should be deliberately > separated (except for purely basic string operations). This is IMO a basic string operation, but the current function is not generic enough. >> What would you do? > > Maybe I would revert browse-url-file-url to the one that doesn't use > browse-url-encode-url [...]. Also I would use more explicit and > specific name in place of browse-url-encode-url (e.g., > browse-url-escape-confusing-characters). > An alternative way would be, as you suggested, to give characters to > be escaped as an argument to browse-url-encode-url, but rename the > function so it looks like a low-level string operation. Well, for now on I'm not sure which one of the possibilities is the good one (and I'm getting sleepy=A0:)). If someone has a strong feeling about that around here, it'd be nice to hear him! =2D-=20 | Micha=EBl `Micha' Cadilhac | Le second degr=E9, = | | http://michael.cadilhac.name | c'est un peu = | | JID/MSN: | le verlan s=E9mantique. = | `---- michael.cadilhac@gmail.com | - = --' --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.2 (GNU/Linux) iD8DBQFG6G1ZUJhDmOfFA3URAqV5AKDCKk/EDB3M9O4p8VzVm/4TNmI8uwCgzRkM 57JVamCcp6z8tIQ6M9Ov1Ks= =aaPu -----END PGP SIGNATURE----- --=-=-=-- --===============1423435311== 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 --===============1423435311==--