From: Barry Warsaw Date: Tue, 29 Oct 1996 15:32:57 +0000 (+0000) Subject: (match-string): Added a definition for older Emacsen. X-Git-Tag: v1.5a1~968 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3622e0d09098530744b736148b89c3c81649019b;p=thirdparty%2FPython%2Fcpython.git (match-string): Added a definition for older Emacsen. --- diff --git a/Misc/python-mode.el b/Misc/python-mode.el index 4e33cf4755f6..846c9ab0cc4f 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