aboutsummaryrefslogtreecommitdiffhomepage
path: root/generic/pg-user.el
diff options
context:
space:
mode:
authorGravatar David Aspinall <da@inf.ed.ac.uk>2011-09-14 11:39:35 +0000
committerGravatar David Aspinall <da@inf.ed.ac.uk>2011-09-14 11:39:35 +0000
commit96fe322d111bf21a75343afab39d76785f9b29e7 (patch)
treee141965cf4650e8b94cc819178f7963b47aeec0d /generic/pg-user.el
parent518be597da9d4f5f6769ffec64fd3072a265f296 (diff)
proof-electric-terminator: allow a prefix argument to avoid electric action.
Addresses Trac #422
Diffstat (limited to 'generic/pg-user.el')
-rw-r--r--generic/pg-user.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/generic/pg-user.el b/generic/pg-user.el
index 02f76c27..37d16175 100644
--- a/generic/pg-user.el
+++ b/generic/pg-user.el
@@ -505,18 +505,22 @@ This a function is called by the custom-set property 'proof-set-value."
(proof-deftoggle proof-electric-terminator-enable
proof-electric-terminator-toggle)
-(defun proof-electric-terminator ()
+(defun proof-electric-terminator (&optional count)
"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)
+is non-nil, the command will be sent to the assistant.
+
+To side-step the electric action and possibly insert multiple
+characters, use a numeric prefix arg, like M-3 <terminator>."
+ (interactive "P")
(if (and
+ (not count)
proof-electric-terminator-enable
(not (proof-inside-comment (point)))
(not (proof-inside-string (point))))
(proof-assert-electric-terminator)
- (self-insert-command 1)))
+ (self-insert-command (prefix-numeric-value count))))