APPROVE COMMIT
2008-02-10  Ville Skyttä  <scop(a)xemacs.org>
	* rpm-spec-mode.el (rpm-increase-release-tag): Increase last digit
	of the release tag instead of the first (eg. Y of X.Y, not X), with
	some heuristics in deciding what the desired "last" digit is.
	(rpm-spec-mode-version): Set to 0.12.1x.
Index: rpm-spec-mode.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/prog-modes/rpm-spec-mode.el,v
retrieving revision 1.25
diff -u -r1.25 rpm-spec-mode.el
--- rpm-spec-mode.el	1 Nov 2007 20:02:33 -0000	1.25
+++ rpm-spec-mode.el	9 Feb 2008 22:37:14 -0000
@@ -63,7 +63,7 @@
 
 ;;; Code:
 
-(defconst rpm-spec-mode-version "0.12x" "Version of
`rpm-spec-mode'.")
+(defconst rpm-spec-mode-version "0.12.1x" "Version of
`rpm-spec-mode'.")
 
 (defgroup rpm-spec nil
   "RPM spec mode with Emacs/XEmacs enhancements."
@@ -1233,14 +1233,17 @@
   (save-excursion
     (goto-char (point-min))
     (if (search-forward-regexp
-         "^\\(Release[ \t]*:[ \t]*\\)\\([0-9]+\\)\\(.*\\)" nil t)
-        (let ((release (1+ (string-to-int (match-string 2)))))
-          (setq release (concat (int-to-string release) (match-string 3)))
+         ;; Try to find the last digit-only group of a dot-separated release string
+         (concat "^\\(Release[ \t]*:[ \t]*\\)"
+                 "\\(.*[ \t\\.}]\\)\\([0-9]+\\)\\([ \t\\.%].*\\|$\\)") nil t)
+        (let ((release (1+ (string-to-int (match-string 3)))))
+          (setq release
+                (concat (match-string 2) (int-to-string release) (match-string 4)))
           (replace-match (concat (match-string 1) release))
           (message "Release tag changed to %s." release))
       (if (search-forward-regexp "^Release[ \t]*:[ \t]*%{?\\([^}]*\\)}?$" nil
t)
           (rpm-increase-release-with-macros)
-        (message "No Release tag found...")))))
+        (message "No Release tag to increase found...")))))
 
 ;;------------------------------------------------------------
 
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches