diff options
author | Alan Mackenzie <acm@muc.de> | 2019-01-22 14:37:54 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2019-01-22 14:37:54 +0000 |
commit | 9eaf5e052a802a7b0560f983f2bb786e13ce2488 (patch) | |
tree | e89f066d7a0621e703df5b80eef9491278b2f612 /lisp/progmodes/cc-langs.el | |
parent | f97b734ffb2b70f3d94e46453a236b46e0704901 (diff) | |
download | emacs-9eaf5e052a802a7b0560f983f2bb786e13ce2488.tar.gz emacs-9eaf5e052a802a7b0560f983f2bb786e13ce2488.tar.bz2 emacs-9eaf5e052a802a7b0560f983f2bb786e13ce2488.zip |
Extend electric-pair-mode actions to < and >, and also to ( and ) in literals
* lisp/progmodes/cc-cmds.el (c-electric-lt-gt): Actuate electric-pair-mode if
a < or > is typed in a context where this is meaningful (#include, or
template).
(c-electric-paren): Allow electric-pair-mode activity in a comment or string.
* lisp/progmodes/cc-defs.el (c-make-keywords-re): Fix a bug where lists of
source symbols could get overwritten when parameter adorn is set to
'appendable.
* list/progmodes/cc-langs.el (c-cpp-include-key): New lang const and var.
Diffstat (limited to 'lisp/progmodes/cc-langs.el')
-rw-r--r-- | lisp/progmodes/cc-langs.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 4bd4914a2d7..53342713b4a 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -927,6 +927,19 @@ file name in angle brackets or quotes." '("include")) objc '("include" "import")) +(c-lang-defconst c-cpp-include-key + ;; Matches an include directive anchored at BOL including any trailing + ;; whitespace, e.g. " # include " + t (if (and (c-lang-const c-anchored-cpp-prefix) + (c-lang-const c-cpp-include-directives)) + (concat + (c-lang-const c-anchored-cpp-prefix) + (c-make-keywords-re 'appendable + (c-lang-const c-cpp-include-directives)) + "[ \t]*") + "a\\`")) ; Doesn't match anything +(c-lang-defvar c-cpp-include-key (c-lang-const c-cpp-include-key)) + (c-lang-defconst c-opt-cpp-macro-define "Cpp directive (without the prefix) that is followed by a macro definition, or nil if the language doesn't have any." |