emacs-wiki-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[emacs-wiki-discuss] [PATCH] Fix emacs-wiki-regexp-emacs-revision settin


From: Sergey Vlasov
Subject: [emacs-wiki-discuss] [PATCH] Fix emacs-wiki-regexp-emacs-revision setting
Date: Tue, 30 Aug 2005 22:35:43 +0400

Hello!

Loading emacs-wiki (current development version) sometimes fails
depending on the previous state of Emacs.  This command always
reproduces the problem for me (on GNU Emacs 21.3):

$ emacs -q --no-site-file --batch --eval "(progn (require 'font-lock) 
(add-to-list 'load-path default-directory) (string-match \"\\\\(x\\\\)\" 
\"0123456789x\") (require 'emacs-wiki))"
Args out of range: "21.3.1", 10, 11

Even if loading does not fail, the emacs-wiki-regexp-emacs-revision
variable is not set correctly.

The problem is caused by wrong usage of save-match-data in the
calculation of emacs-wiki-regexp-emacs-revision - match-string is
called outside of save-match-data.  This patch fixes the problem:

--- emacs-wiki/emacs-wiki-regexps.el.emacs-revision     2005-08-29 21:51:00 
+0400
+++ emacs-wiki/emacs-wiki-regexps.el    2005-08-30 09:40:25 +0400
@@ -83,11 +83,11 @@
   :group 'emacs-wiki-regexp)
 
 (defvar emacs-wiki-regexp-emacs-revision
-  (and (save-match-data
-         (string-match "^[0-9]+\\.[0-9]+\\.\\([0-9]+\\)"
-                       emacs-version))
-       (match-string 1 emacs-version)
-       (string-to-number (match-string 1 emacs-version)))
+  (save-match-data
+    (and (string-match "^[0-9]+\\.[0-9]+\\.\\([0-9]+\\)"
+                      emacs-version)
+        (match-string 1 emacs-version)
+        (string-to-number (match-string 1 emacs-version))))
   "The revision number of this version of Emacs.")
 
 (defun emacs-wiki-extreg-usable-p ()

-- 
Sergey Vlasov

Attachment: pgpdGsfP9XmC0.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]