From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.devel Subject: Re: url library and GnuTLS, and Emacs-issued certificates Date: Mon, 28 Mar 2011 08:51:25 +0200 Message-ID: <87ei5rwxea.fsf@marauder.physik.uni-ulm.de> References: <87mxkojpk4.fsf@lifelogs.com> <87hbawtbq7.fsf@stupidchicken.com> <878vw8hznm.fsf_-_@lifelogs.com> <87ei5xsvl6.fsf@lifelogs.com> <87hbatofix.fsf@stupidchicken.com> <87pqpegk61.fsf@lifelogs.com> <87zkoivw48.fsf@marauder.physik.uni-ulm.de> <87k4fmgehh.fsf@lifelogs.com> Reply-To: Reiner Steib NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1301295104 21728 80.91.229.12 (28 Mar 2011 06:51:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 Mar 2011 06:51:44 +0000 (UTC) Cc: emacs-devel@gnu.org To: Ted Zlatanov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 28 08:51:39 2011 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.69) (envelope-from ) id 1Q46Ic-0007AC-UH for ged-emacs-devel@m.gmane.org; Mon, 28 Mar 2011 08:51:39 +0200 Original-Received: from localhost ([127.0.0.1]:37823 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q46Ic-000430-IN for ged-emacs-devel@m.gmane.org; Mon, 28 Mar 2011 02:51:38 -0400 Original-Received: from [140.186.70.92] (port=38048 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q46IV-00042t-7u for emacs-devel@gnu.org; Mon, 28 Mar 2011 02:51:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q46IT-0003H4-Up for emacs-devel@gnu.org; Mon, 28 Mar 2011 02:51:30 -0400 Original-Received: from mail.uni-ulm.de ([134.60.1.11]:41675) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q46IT-0003Gg-ME for emacs-devel@gnu.org; Mon, 28 Mar 2011 02:51:29 -0400 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.175]) by mail.uni-ulm.de (8.14.3/8.14.2) with ESMTP id p2S6pPW4007662; Mon, 28 Mar 2011 08:51:25 +0200 (MEST) Original-Received: from localhost (localhost [127.0.0.1]) by bridgekeeper.physik.uni-ulm.de (Postfix) with ESMTP id EEEBA10901; Mon, 28 Mar 2011 08:51:24 +0200 (CEST) X-Face: P05mdcZT&lL[-s2=mw~RsllZ0zZAb?vdE}.s, emacs-devel@gnu.org In-Reply-To: <87k4fmgehh.fsf@lifelogs.com> (Ted Zlatanov's message of "Sat, 26 Mar 2011 09:09:46 -0500") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.1 (gnu/linux) X-DCC-z.dcc-servers-Metrics: poseidon 1049; Body=2 Fuz1=2 Fuz2=2 X-Virus-Scanned: by amavisd-new X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.60.1.11 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:137770 Archived-At: On Sat, Mar 26 2011, Ted Zlatanov wrote: > On Sat, 26 Mar 2011 Reiner Steib wrote: > RS> On Sat, Mar 26 2011, Ted Zlatanov wrote: >>> - `(let* ((http (string-match "\\`http:" ,location)) >>> + `(let* ((http (string-match "\\`\\(https\\|http\\):" ,location)) > > RS> - `(let* ((http (string-match "\\`http:" ,location)) > RS> + `(let* ((http (string-match "\\`https?:" ,location)) > > (I *knew* I'd have to explain it :) > > It's rarely used so I wasn't worried about optimizing it. I didn't think about optimizing neither. Though regexp-opt suggests that "https?" is preferable: ELISP> (regexp-opt '("http" "https")) "https?" > Showing both versions in an alternation makes it easier to see both > schemes are supported at a glance. I think "https?" also makes this clear and it is more readable - especially since it doesn't require unnecessary grouping. BTW: emacs/lisp$ grep -e 'http[\\].*https' -e 'https[\\].*http' *.el */*.el|wc -l 1 emacs/lisp$ grep -e 'https[?]' *.el */*.el|wc -l 12 Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/