diff Misc/python-mode.el @ 4508:7187c709ebfd legacy-trunk

(match-string): Added a definition for older Emacsen.
author Barry Warsaw <barry@python.org>
date Tue, 29 Oct 1996 15:32:57 +0000
parents 2343803318e4
children 38689aceae7b
line wrap: on
line diff
--- a/Misc/python-mode.el	Fri Oct 25 22:13:59 1996 +0000
+++ b/Misc/python-mode.el	Tue Oct 29 15:32:57 1996 +0000
@@ -2361,6 +2361,15 @@
     (set-buffer cbuf))
   (sit-for 0))
 
+;; older Emacsen don't have this function
+(if (not (fboundp 'match-string))
+    (defun match-string (n)
+      (let ((beg (match-beginning n))
+	    (end (match-end n)))
+	(if (and beg end)
+	    (buffer-substring beg end)
+	  nil))))
+
 (defun py-current-defun ()
   ;; tell add-log.el how to find the current function/method/variable
   (save-excursion