summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-cmds.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/cc-cmds.el')
-rw-r--r--lisp/progmodes/cc-cmds.el38
1 files changed, 37 insertions, 1 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 8dc0714dacf..7cd6cb0dda0 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -4909,7 +4909,8 @@ If a fill prefix is specified, it overrides all the above."
(setq c-lit-limits (c-literal-limits nil nil t)))
(unless c-lit-type
(setq c-lit-type (c-literal-type c-lit-limits)))
- (if (memq (cond ((c-query-and-set-macro-start) 'cpp)
+ (if (memq (cond ((memq c-lit-type '(c c++ string)) c-lit-type)
+ ((c-query-and-set-macro-start) 'cpp)
((null c-lit-type) 'code)
(t c-lit-type))
c-ignore-auto-fill)
@@ -5145,6 +5146,41 @@ details."
(delete-char 1))))
+
+;; Text conversion support.
+
+(defun c-post-text-conversion ()
+ "Notice that the character `last-command-event' has been inserted.
+If said character is an electric character such as `*' or `{', delete
+it, then call the appropriate CC Mode function to electrically insert
+it again."
+ (cond ((eq last-command-event ?#)
+ (delete-char -1)
+ (c-electric-pound nil) t)
+ ((memq last-command-event '(?{ ?}))
+ (delete-char -1)
+ (c-electric-brace nil) t)
+ ((memq last-command-event '(?\( ?\)))
+ (delete-char -1)
+ (c-electric-paren nil) t)
+ ((eq last-command-event ?*)
+ (delete-char -1)
+ (c-electric-star nil) t)
+ ((eq last-command-event ?/)
+ (delete-char -1)
+ (c-electric-slash nil) t)
+ ((memq last-command-event '(?\; ?,))
+ (delete-char -1)
+ (c-electric-semi&comma nil) t)
+ ((eq last-command-event ?:)
+ (delete-char -1)
+ (c-electric-colon nil) t)
+ ((memq last-command-event '(?> ?<))
+ (delete-char -1)
+ (c-electric-lt-gt nil) t)))
+
+
+
(cc-provide 'cc-cmds)
;; Local Variables: