diff options
| author | David Aspinall | 2009-10-03 16:32:03 +0000 |
|---|---|---|
| committer | David Aspinall | 2009-10-03 16:32:03 +0000 |
| commit | 959c0d50344af47e0422cfc3480fb6d13bfea5e1 (patch) | |
| tree | 3a3fcdfd1084a97e3b1bb7d0f58c81f6ac204922 /generic/pg-user.el | |
| parent | 6818e58fece6dd2040fa32ff6fda7bf77d35c0d4 (diff) | |
proof-electric-terminator: check if inside a string/comment.
Diffstat (limited to 'generic/pg-user.el')
| -rw-r--r-- | generic/pg-user.el | 12 |
1 files changed, 8 insertions, 4 deletions
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))) |
