]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
(match-string): Added a definition for older Emacsen.
authorBarry Warsaw <barry@python.org>
Tue, 29 Oct 1996 15:32:57 +0000 (15:32 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 29 Oct 1996 15:32:57 +0000 (15:32 +0000)
Misc/python-mode.el

index 4e33cf4755f6e75e9a5a2cbf877c6ca31eb2f3b4..846c9ab0cc4f2638ff5a65572a36ed8f68e04865 100644 (file)
@@ -2361,6 +2361,15 @@ local bindings to py-newline-and-indent."))
     (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