aboutsummaryrefslogtreecommitdiffhomepage
path: root/generic
diff options
context:
space:
mode:
authorGravatar David Aspinall <da@inf.ed.ac.uk>2000-09-18 14:11:29 +0000
committerGravatar David Aspinall <da@inf.ed.ac.uk>2000-09-18 14:11:29 +0000
commitcaaee83b3543e0968818ccba95b846045fdf8279 (patch)
tree86ef77a12ffb1d59a14a3888a0fb146b36700b08 /generic
parent578b9bf5b1ea4f5c3f1cd1bda2cdce3f86fececf (diff)
Emulate buffer-syntactic-context on FSF Emacs
Diffstat (limited to 'generic')
-rw-r--r--generic/proof-compat.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/generic/proof-compat.el b/generic/proof-compat.el
index 31b57cb3..8bf90643 100644
--- a/generic/proof-compat.el
+++ b/generic/proof-compat.el
@@ -131,6 +131,16 @@ Otherwise treat \\ in NEWTEXT string as special:
(concat rtn-str (substring str start)))))
+(or (fboundp 'buffer-syntactic-context)
+(defun buffer-syntactic-context (&optional buffer)
+ (save-excursion
+ (if buffer (set-buffer buffer))
+ (let ((pp (parse-partial-sexp 1 (point))))
+ (cond
+ ((nth 3 pp) 'string)
+ ((nth 7 pp) 'block-comment)
+ ((nth 4 pp) 'comment))))))
+
;; In case Emacs is not aware of the function read-shell-command,