From 959c0d50344af47e0422cfc3480fb6d13bfea5e1 Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Sat, 3 Oct 2009 16:32:03 +0000 Subject: proof-electric-terminator: check if inside a string/comment. --- generic/pg-user.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'generic') diff --git a/generic/pg-user.el b/generic/pg-user.el index af1a53cf..650cfc11 100644 --- a/generic/pg-user.el +++ b/generic/pg-user.el @@ -537,11 +537,15 @@ This is intended as a value for `proof-activate-scripting-hook'" proof-electric-terminator-toggle) (defun proof-electric-terminator () - "Insert the terminator, perhaps sending the command to the assistant. -If variable `proof-electric-terminator-enable' is non-nil, the command will be -sent to the assistant." + "Insert terminator char, maybe sending the command to the assistant. +If we are inside a comment or string, insert the terminator. +Otherwise, if the variable `proof-electric-terminator-enable' +is non-nil, the command will be sent to the assistant." (interactive) - (if proof-electric-terminator-enable + (if (and + proof-electric-terminator-enable + (not (proof-inside-comment (point))) + (not (proof-inside-string (point)))) (proof-assert-electric-terminator) (self-insert-command 1))) -- cgit v1.2.3