From 96fe322d111bf21a75343afab39d76785f9b29e7 Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Wed, 14 Sep 2011 11:39:35 +0000 Subject: proof-electric-terminator: allow a prefix argument to avoid electric action. Addresses Trac #422 --- 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 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 ." + (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)))) -- cgit v1.2.3