summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1996-10-29 15:32:57 (GMT)
committerBarry Warsaw <barry@python.org>1996-10-29 15:32:57 (GMT)
commit3622e0d09098530744b736148b89c3c81649019b (patch)
tree448b22e0addba96dc19004eec0b74eae8829811f
parentabcb38250b3d743f48463b34757cd4f6dc77ce34 (diff)
downloadcpython-3622e0d09098530744b736148b89c3c81649019b.zip
cpython-3622e0d09098530744b736148b89c3c81649019b.tar.gz
cpython-3622e0d09098530744b736148b89c3c81649019b.tar.bz2
(match-string): Added a definition for older Emacsen.
-rw-r--r--Misc/python-mode.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el
index 4e33cf4..846c9ab 100644
--- a/Misc/python-mode.el
+++ b/Misc/python-mode.el
@@ -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