• Alan Mackenzie's avatar
    Improve C++ raw string fontification. · 29ec1e48
    Alan Mackenzie authored
    Integrate the handling of raw string and ordinary string fontification.
    
    * lisp/progmodes/cc-defs.el (c-font-lock-flush)
    (c-search-forward-char-property-without-value-on-char): new macros.
    (c-point): In the 'eoll arm, check for eobp.
    (c-search-forward-char-property-with-value-on-char): Handle the &optional
    limit argument being nil.
    (c-clear-char-property-with-value-on-char-function)
    (c-clear-char-property-with-value-on-char): Return the position of the first
    cleared property.
    
    * lisp/progmodes/cc-engine.el (c-find-decl-prefix-search): Don't spuriously
    recognize the change of face at a ) as the start of a string (a
    "pseudo match").
    (c-old-beg-rs c-old-end-rs): New variables.
    (c-raw-string-pos): Analyze raw string delimiters more carefully.
    (c-raw-string-in-end-delim): New function.
    (c-depropertize-raw-string): Largely rewritten.
    (c-before-change-check-raw-strings): New functionality: only remove the
    syntax-table text properties from raw strings whose delimiters are about to
    change.
    (c-propertize-raw-string-id): New function.
    (c-after-change-re-mark-raw-strings): Remove, incorporating functionality into
    other functions.
    (c-propertize-raw-string-opener): Largely rewritten.
    (c-after-change-re-mark-raw-strings): Removed.
    (c-after-change-unmark-raw-strings, c-after-change-unmark-raw-strings): New
    functions.
    
    * lisp/progmodes/cc-fonts.el (c-font-lock-raw-strings): Largely rewritten.
    
    * lisp/progmodes/cc-langs.el (c-before-font-lock-functions): Replace
    c-after-change-re-mark-unbalanced-strings by
    c-after-change-mark-abnormal-strings in the t, c+objc, c++ and java sections.
    Add c-after-change-unmark-raw-strings and remove
    c-after-change-re-mark-raw-strings from the c++ section.
    
    * lisp/progmodes/cc-mode.el (c-old-BEG c-old-END): Remove.
    (c-old-END-literality): New variable.
    (c-depropertize-CPP): Remove syntax-table properties from raw strings within
    macros.
    (c-before-change-check-unbalanced-strings): Call
    c-truncate-semi-nonlit-pos-cache to preserve the integrity of the cache.
    (c-before-change-check-unbalanced-strings): Call
    c-truncate-semi-nonlit-pos-cache, largely rewritten.
    (c-after-change-re-mark-unbalanced-strings): Renamed to
    c-after-change-mark-abnormal-strings.  Call c-maybe-re-mark-raw-string.
    29ec1e48
cc-langs.el 148 KB