From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [cloos@jhcloos.com: Re: [jidanni@jidanni.org: ffap not UTF-8 ready]] Date: Wed, 10 Jan 2007 18:48:29 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1168666878 30339 80.91.229.12 (13 Jan 2007 05:41:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 13 Jan 2007 05:41:18 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 13 06:41:15 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 1H5bdi-0003hZ-4A for ged-emacs-devel@m.gmane.org; Sat, 13 Jan 2007 06:41:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H5bdi-0005ey-0U for ged-emacs-devel@m.gmane.org; Sat, 13 Jan 2007 00:41:14 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H5bdS-0005bA-KA for emacs-devel@gnu.org; Sat, 13 Jan 2007 00:40:58 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H5bdS-0005aP-0O for emacs-devel@gnu.org; Sat, 13 Jan 2007 00:40:58 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H5bdR-0005aD-S8 for emacs-devel@gnu.org; Sat, 13 Jan 2007 00:40:57 -0500 Original-Received: from [209.226.175.110] (helo=tomts43-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H5bdP-0004nw-VT; Sat, 13 Jan 2007 00:40:56 -0500 Original-Received: from alfajor.home ([70.55.83.78]) by tomts43-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070113054054.POB11361.tomts43-srv.bellnexxia.net@alfajor.home>; Sat, 13 Jan 2007 00:40:54 -0500 Original-Received: by alfajor.home (Postfix, from userid 20848) id 86ABD1C219; Wed, 10 Jan 2007 18:48:29 -0500 (EST) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Wed\, 10 Jan 2007 18\:05\:59 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux) 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:65171 Archived-At: > [I sent this message twice but did not get a response.] > Would someone please DTRT and ack? I've committed the patch below. Stefan --- ffap.el 07 d=E9c 2006 21:44:40 -0500 1.60 +++ ffap.el 10 jan 2007 18:44:40 -0500=09 @@ -1,7 +1,7 @@ ;;; ffap.el --- find file (or url) at point =20 ;; Copyright (C) 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004, -;; 2005, 2006 Free Software Foundation, Inc. +;; 2005, 2006, 2007 Free Software Foundation, Inc. =20 ;; Author: Michelangelo Grigni ;; Maintainer: FSF @@ -310,7 +310,7 @@ ;; ;; It pays to put a big fancy regexp here, since ffap-guesser is ;; much more time-consuming than regexp searching: - "[/:.~a-zA-Z]/\\|@[a-zA-Z][-a-zA-Z0-9]*\\." + "[/:.~[:alpha:]]/\\|@[[:alpha:]][-[:alnum:]]*\\." "*Regular expression governing movements of `ffap-next'." :type 'regexp :group 'ffap) @@ -426,7 +426,7 @@ ;; (ffap-machine-p "mathcs" 5678 nil 'ping) ;; (ffap-machine-p "foo.bonk" nil nil 'ping) ;; (ffap-machine-p "foo.bonk.com" nil nil 'ping) - (if (or (string-match "[^-a-zA-Z0-9.]" host) ; Illegal chars (?) + (if (or (string-match "[^-[:alnum:].]" host) ; Illegal chars (?) (not (string-match "[^0-9]" host))) ; 1: a number? 2: quick reject nil (let* ((domain @@ -575,7 +575,7 @@ (ffap-ftp-regexp (ffap-host-to-filename mach)) )) =20 -(defvar ffap-newsgroup-regexp "^[a-z]+\\.[-+a-z_0-9.]+$" +(defvar ffap-newsgroup-regexp "^[[:lower:]]+\\.[-+[:lower:]_0-9.]+$" "Strings not matching this fail `ffap-newsgroup-p'.") (defvar ffap-newsgroup-heads ; entirely inadequate '("alt" "comp" "gnu" "misc" "news" "sci" "soc" "talk") @@ -601,7 +601,7 @@ (setq heads nil)) (error nil))) (or ret (not heads) - (let ((head (string-match "\\`\\([a-z]+\\)\\." string))) + (let ((head (string-match "\\`\\([[:lower:]]+\\)\\." string))) (and head (setq head (substring string 0 (match-end 1))) (member head heads) (setq ret string)))) @@ -780,7 +780,7 @@ ("" . ffap-completable) ; completion, slow on some systems ("\\.info\\'" . ffap-info) ; gzip.info ("\\`info/" . ffap-info-2) ; info/emacs - ("\\`[-a-z]+\\'" . ffap-info-3) ; (emacs)Top [only in the parentheses] + ("\\`[-[:lower:]]+\\'" . ffap-info-3) ; (emacs)Top [only in the parent= heses] ("\\.elc?\\'" . ffap-el) ; simple.el, simple.elc (emacs-lisp-mode . ffap-el-mode) ; rmail, gnus, simple, custom ;; (lisp-interaction-mode . ffap-el-mode) ; maybe @@ -969,15 +969,15 @@ ;; Slightly controversial decisions: ;; * strip trailing "@" and ":" ;; * no commas (good for latex) - (file "--:$+<>@-Z_a-z~*?" "<@" "@>;.,!:") + (file "--:$+<>@-Z_[:lower:]~*?" "<@" "@>;.,!:") ;; An url, or maybe a email/news message-id: - (url "--:=3D&?$+@-Z_a-z~#,%;*" "^A-Za-z0-9" ":;.,!?") + (url "--:=3D&?$+@-Z_[:lower:]~#,%;*" "^[:alnum:]" ":;.,!?") ;; Find a string that does *not* contain a colon: - (nocolon "--9$+<>@-Z_a-z~" "<@" "@>;.,!?") + (nocolon "--9$+<>@-Z_[:lower:]~" "<@" "@>;.,!?") ;; A machine: - (machine "-a-zA-Z0-9." "" ".") + (machine "-[:alnum:]." "" ".") ;; Mathematica paths: allow backquotes - (math-mode ",-:$+<>@-Z_a-z~`" "<" "@>;.,!?`:") + (math-mode ",-:$+<>@-Z_[:lower:]~`" "<" "@>;.,!?`:") ) "Alist of \(MODE CHARS BEG END\), where MODE is a symbol, possibly a major-mode name, or one of the symbol @@ -1062,7 +1062,7 @@ (let ((name (ffap-string-at-point 'url))) (cond ((string-match "^url:" name) (setq name (substring name 4))) - ((and (string-match "\\`[^:@]+@[^:@]+[a-zA-Z0-9]\\'" name) + ((and (string-match "\\`[^:@]+@[^:@]+[[:alnum:]]\\'" name) ;; "foo@bar": could be "mailto" or "news" (a Message-ID). ;; Without "<>" it must be "mailto". Otherwise could be ;; either, so consult `ffap-foo-at-bar-prefix'. @@ -1074,7 +1074,7 @@ "mailto"))) (and prefix (setq name (concat prefix ":" name)))))) ((ffap-newsgroup-p name) (setq name (concat "news:" name))) - ((and (string-match "\\`[a-z0-9]+\\'" name) ; + ((and (string-match "\\`[[:alnum:]]+\\'" name) ; (equal (ffap-string-around) "<>") ;; (ffap-user-p name): (not (string-match "~" (expand-file-name (concat "~" name))))