From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: ispell.el doesn't work any more Date: Sat, 17 Sep 2005 13:54:41 +0300 Message-ID: References: <87wtll3opb.fsf@freemail.hu> <87psra82rj.fsf@jurta.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1126955396 7850 80.91.229.2 (17 Sep 2005 11:09:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 17 Sep 2005 11:09:56 +0000 (UTC) Cc: mange@freemail.hu, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 17 13:09:54 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EGaZH-0004ng-EU for ged-emacs-devel@m.gmane.org; Sat, 17 Sep 2005 13:09:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EGaYe-0000JV-58 for ged-emacs-devel@m.gmane.org; Sat, 17 Sep 2005 07:08:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EGaSJ-0007aA-VC for emacs-devel@gnu.org; Sat, 17 Sep 2005 07:02:04 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EGaSH-0007Z2-KR for emacs-devel@gnu.org; Sat, 17 Sep 2005 07:02:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EGaNs-0006f7-97 for emacs-devel@gnu.org; Sat, 17 Sep 2005 06:57:28 -0400 Original-Received: from [192.114.186.20] (helo=nitzan.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EGaLE-0005iz-SS for emacs-devel@gnu.org; Sat, 17 Sep 2005 06:54:45 -0400 Original-Received: from HOME-C4E4A596F7 (IGLD-84-228-141-68.inter.net.il [84.228.141.68]) by nitzan.inter.net.il (MOS 3.6.5-GR) with ESMTP id BLE81043 (AUTH halo1); Sat, 17 Sep 2005 13:54:39 +0300 (IDT) Original-To: Juri Linkov In-reply-to: <87psra82rj.fsf@jurta.org> (message from Juri Linkov on Fri, 16 Sep 2005 01:01:48 +0300) 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:43034 Archived-At: > From: Juri Linkov > Date: Fri, 16 Sep 2005 01:01:48 +0300 > Cc: mange@freemail.hu, emacs-devel@gnu.org > > > That approach seems good to me. It will work with aspell 0.50 as > > well as it would have worked with ispell. > > > > Does anyone see a problem with that patch? > > This patch seems good for versions older than 0.60, but now I get > another error for version numbers greater than 0.60: > > Debugger entered--Lisp error: (error "Invalid version syntax: '0.60.3-20050121'") > signal(error ("Invalid version syntax: '0.60.3-20050121'")) > error("Invalid version syntax: '%s'" "0.60.3-20050121") > version-to-list("0.60.3-20050121") > version<("0.60.3-20050121" "0.60") > ispell-check-version() > ispell-init-process() > ispell-buffer-local-words() > ispell-accept-buffer-local-defs() > ispell-word(nil nil nil) > call-interactively(ispell-word) That's because version-to-list doesn't support this syntax of version numbers. In addition, it isn't case-insensitive to strings it does support, like "alpha". So how about the following patch, which fixes the case-fold issue, improves the doc string, and extends the valid syntax for version numbers? Index: lisp/subr.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/subr.el,v retrieving revision 1.478 diff -u -r1.478 subr.el --- lisp/subr.el 26 Aug 2005 12:31:55 -0000 1.478 +++ lisp/subr.el 17 Sep 2005 10:52:52 -0000 @@ -2862,9 +2862,11 @@ (defvar version-regexp-alist - '(("^a\\(lpha\\)?$" . -3) - ("^b\\(eta\\)?$" . -2) - ("^\\(pre\\|rc\\)$" . -1)) + '(("^[-_]?a\\(lpha\\)?$" . -3) + ("^[-_]$" . -3) ; treat "1.2.3-20050920" and "1.2-3" as alpha releases + ("^[-_]cvs$" . -3) ; treat "1.2.3-CVS" as alpha release + ("^[-_]?b\\(eta\\)?$" . -2) + ("^[-_]?\\(pre\\|rc\\)$" . -1)) "*Specify association between non-numeric version part and a priority. This association is used to handle version string like \"1.0pre2\", @@ -2887,6 +2889,9 @@ Where: REGEXP regexp used to match non-numeric part of a version string. + It should begin with a `^' anchor and end with a `$' to + prevent false hits. Letter-case is ignored while matching + REGEXP. PRIORITY negative integer which indicate the non-numeric priority.") @@ -2903,9 +2908,12 @@ SEPARATOR ::= `version-separator' (which see) | `version-regexp-alist' (which see). +The NUMBER part is optional if SEPARATOR is a match for an element +in `version-regexp-alist'. + As an example of valid version syntax: - 1.0pre2 1.0.7.5 22.8beta3 0.9alpha1 + 1.0pre2 1.0.7.5 22.8beta3 0.9alpha1 6.9.30Beta As an example of invalid version syntax: @@ -2928,7 +2936,7 @@ (error "Invalid version string: '%s'" ver)) (save-match-data (let ((i 0) - case-fold-search ; ignore case in matching + (case-fold-search t) ; ignore case in matching lst s al) (while (and (setq s (string-match "[0-9]+" ver i)) (= s i))