ben  committed 9ac0e6f

fix problems running texinfmt, 21.4

texinfmt.el: Add defn of match-string-no-properties, not in 21.4.

  • Participants
  • Parent commits 69a56c7
  • Branches default

Comments (0)

Files changed (2)

+2004-12-07  Ben Wing  <>
+	* texinfmt.el:
+	* texinfmt.el (fboundp):
+	* texinfmt.el (match-string-no-properties): New.
+	Add defn of match-string-no-properties, not in 21.4.
 2004-12-06  Ben Wing  <>
 	* Makefile:
     (defmacro defcustom (var value doc &rest ignore)
       `(defvar ,var ,value ,doc)))
+(or (fboundp 'match-string-no-properties) ;; XEmacs: not in 21.4
+(defun match-string-no-properties (num &optional string)
+  "Return string of text matched by last search, without text properties.
+NUM specifies which parenthesized expression in the last regexp.
+ Value is nil if NUMth pair didn't match, or there were less than NUM pairs.
+Zero means the entire text matched by the whole regexp or whole string.
+STRING should be given if the last search was by `string-match' on STRING."
+  (if (match-beginning num)
+      (if string
+	  (let ((result
+		 (substring string (match-beginning num) (match-end num))))
+	    (set-text-properties 0 (length result) nil result)
+	    result)
+	(buffer-substring-no-properties (match-beginning num)
+					(match-end num))))))
 (defvar texinfmt-version "2.40 of  6 Dec 2002")
 (defun texinfmt-version (&optional here)