From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Rogers Newsgroups: gmane.emacs.devel Subject: Re: Another issue with thingatpt Date: Sun, 31 Dec 2006 12:24:22 -0500 Message-ID: <17815.62022.147181.758643@rgrjr.dyndns.org> References: <003001c727be$349c5a80$0203a8c0@HomeNetbbb0> <20061225.094150.13771816.wl@gnu.org> <20061227.115042.56977126.wl@gnu.org> <17810.55182.483602.421178@rgrjr.dyndns.org> <17815.10669.22210.825181@rgrjr.dyndns.org> <4597820F.9080906@easy-emacs.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1167585880 16965 80.91.229.12 (31 Dec 2006 17:24:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 31 Dec 2006 17:24:40 +0000 (UTC) Cc: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 31 18:24:38 2006 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 1H14QH-0005NQ-Ta for ged-emacs-devel@m.gmane.org; Sun, 31 Dec 2006 18:24:38 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H14QH-0007Ks-C1 for ged-emacs-devel@m.gmane.org; Sun, 31 Dec 2006 12:24:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H14Q3-0007Ik-KP for emacs-devel@gnu.org; Sun, 31 Dec 2006 12:24:23 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H14Q3-0007Hy-6T for emacs-devel@gnu.org; Sun, 31 Dec 2006 12:24:23 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H14Q2-0007He-Ss for emacs-devel@gnu.org; Sun, 31 Dec 2006 12:24:22 -0500 Original-Received: from [24.128.218.106] (helo=rgrjr.dyndns.org) by monty-python.gnu.org with smtp (Exim 4.52) id 1H14Q2-0003FA-Iy for emacs-devel@gnu.org; Sun, 31 Dec 2006 12:24:22 -0500 Original-Received: (qmail 10100 invoked by uid 500); 31 Dec 2006 17:24:22 -0000 Original-To: Andreas Roehler In-Reply-To: <4597820F.9080906@easy-emacs.de> X-Mailer: VM 7.19 under Emacs 22.0.91.1 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:64568 Archived-At: From: Andreas Roehler Date: Sun, 31 Dec 2006 10:25:35 +0100 > Both interfaces (ffap and thing-at-point) are already customizable, > though in different ways. There is no `defcustom'-form in thingatpt.el, it's done mostly with `defvar'. Wouldn't conceive that as customizable. Not in the sense of defcustom, no. But someone who can't "customize" it themselves via setq is probably not going to be able to change these hairy regexps and/or char-classes without shooting themselves in the foot. It's not just a matter of understanding Emacs regexps, but understanding how thing-at-point uses them. In any case, it seems to me that users shouldn't need to change the regexp proper, since that is defined by RFC3986, just the set of punctuation characters to drop at the end. The only thing that needs to be customized is just the "lose the punctuation" heuristic, IMHO. And the definition of "punctuation" should be enlarged so that it addresses Slawomir's issue with parens, which are not even allowed internally. The problem mentioned originally however shouldn't occur, as ,---- | (defvar thing-at-point-url-path-regexp | "[^]\t\n \"'()<>[^`{}]*[^]\t\n \"'()<>[^`{}.,;]+" | "A regular expression probably matching the host and filename or e-mail part of a URL.") `---- includes that char. The error must reside elsewhere. Regards, Andreas Roehler It does include a ";" in the second character class, but both are inverted. The second set is the same as the first set with the addition of ".,;", which is why it refuses to match any of these characters at the end of the URL. This would be easier to see if the regexp were written this way: (defvar thing-at-point-url-path-regexp (concat "[^]\t\n \"'()<>[^`{}]*" "[^]\t\n \"'()<>[^`{}.,;]+") "A regular expression probably matching the host and filename or e-mail part of a URL.") -- Bob