• Alan Mackenzie's avatar
    Tidy up the literal cacheing in CC Mode, optimizing c-full-pp-to-literal · 9dee49ed
    Alan Mackenzie authored
    (Intermediate commit)
    
    * lisp/progmodes/cc-engine.el, lisp/progmodes/cc-fonts.el
    * lisp/progmodes/cc-mode.el : Rename:
    c-state-semi-nonlit-pos-cache -> c-lit-pos-cache,
    c-state-semi-nonlit-pos-cache-limit -> c-lit-pos-cache-limit,
    c-state-semi-nonlit-near-cache -> c-semi-lit-near-cache,
    c-truncate-semi-nonlit-pos-cache -> c-truncate-lit-pos-cache,
    c-state-semi-trim-near-cache -> c-semi-trim-near-cache,
    c-state-semi-get-near-cache-entry -> c-semi-get-near-cache-entry,
    c-state-semi-put-near-cache-entry -> c-semi-put-near-cache-entry,
    c-state-semi-pp-to-literal -> c-semi-pp-to-literal,
    c-state-full-pp-to-literal -> c-full-pp-to-literal,
    c-state-semi-trim-cache -> c-trim-lit-pos-cache.
    
    * lisp/progmodes/cc-engine.el (c-semi-near-cache-limit): New variable.
    (c-truncate-lit-pos-cache): This now truncates the cache variables for all
    three lit- sub-caches.
    (c-semi-put-near-cache-entry): Increase c-semi-near-cache-limit to the
    position of the new entry.
    (c-full-near-cache-limit, c-full-lit-near-cache): New variables.
    (c-full-trim-near-cache, c-full-get-near-cache-entry)
    (c-full-put-near-cache-entry): New functions.
    (c-full-pp-to-literal): Amend to use the new functions, and to optimize the
    use of the available caches, similarly to c-semi-pp-to-literal.
    9dee49ed
cc-mode.el 106 KB