diff options
author | Alan Mackenzie <acm@muc.de> | 2021-12-19 14:26:06 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2021-12-19 14:29:30 +0000 |
commit | 22b8d6813217187e3121338b93deabe62add99c1 (patch) | |
tree | 053f53cf82888c67aa47334f43e18df25a0543d9 /lisp/progmodes/cc-mode.el | |
parent | 09af054dabd163125571ac470834cdb6de5ba672 (diff) | |
download | emacs-22b8d6813217187e3121338b93deabe62add99c1.tar.gz emacs-22b8d6813217187e3121338b93deabe62add99c1.tar.bz2 emacs-22b8d6813217187e3121338b93deabe62add99c1.zip |
CC Mode: Remove annoying background fontification. Should fix bug #52298
Partially revert the commits from 2021-10-24 - 2021-10-26, "CC Mode: Fontify
"found types" which are recognized after being first scanned".
This removes the background fontification which ran off of a 0.1s timer, but
leaves the facility of normal fontification causing the fontification
throughout the buffer of newly found types.
* lisp/progmodes/cc-fonts.el (c-find-types-background)
(c-type-finder-timer-func): Remove.
* lisp/progmodes/cc-mode.el (c-type-finder-timer, c-inhibit-type-finder)
(c-type-finder-pos, c-post-gc-hook): Remove.
(c-leave-cc-mode-mode): Remove the manipulations of c-type-finder-timer and
c-post-gc-hook.
(c-basic-common-init): Remove the manipulations of c-type-finder-pos,
c-type-finder-timer, and c-post-gc-hook.
* lisp/progmodes/cc-vars.el (c-type-finder-time-slot)
(c-type-finder-repeat-time, c-type-finder-chunk-size): Remove.
* doc/misc/cc-mode.texi (Found Types): Remove. Amend some menu entries.
Diffstat (limited to 'lisp/progmodes/cc-mode.el')
-rw-r--r-- | lisp/progmodes/cc-mode.el | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index f9435c9ceee..ae2ca397661 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -129,16 +129,6 @@ ; ' (require 'cc-fonts) ;) -(defvar c-type-finder-timer nil) -;; The variable which holds the repeating idle timer which triggers off the -;; background type finding search. - -(defvar c-inhibit-type-finder nil) -;; When non-nil (set by `c-post-gc-hook') don't perform the type finding -;; activities the next time `c-type-finder-timer' triggers. This ensures -;; keyboard/mouse input will be dealt with when garbage collection is taking a -;; large portion of CPU time. - ;; The following three really belong to cc-fonts.el, but they are required ;; even when cc-fonts.el hasn't been loaded (this happens in XEmacs when ;; font-lock-mode is nil). @@ -197,10 +187,7 @@ c-buffer-is-cc-mode)) (throw 'found nil))) (remove-hook 'post-command-hook 'c-post-command) - (remove-hook 'post-gc-hook 'c-post-gc-hook) - (and c-type-finder-timer - (progn (cancel-timer c-type-finder-timer) - (setq c-type-finder-timer nil))))) + (remove-hook 'post-gc-hook 'c-post-gc-hook))) (c-save-buffer-state () (c-clear-char-properties (point-min) (point-max) 'category) (c-clear-char-properties (point-min) (point-max) 'syntax-table) @@ -596,12 +583,6 @@ preferably use the `c-mode-menu' language constant directly." ;; currently no such text property. (make-variable-buffer-local 'c-max-syn-tab-mkr) -;; `c-type-finder-pos' is a marker marking the current place in a CC Mode -;; buffer which is due to be searched next for "found types", or nil if the -;; searching is complete. -(defvar c-type-finder-pos nil) -(make-variable-buffer-local 'c-type-finder-pos) - (defun c-basic-common-init (mode default-style) "Initialize the syntax handling routines and the line breaking/filling code. Intended to be used by other packages that embed CC Mode. @@ -774,17 +755,6 @@ that requires a literal mode spec at compile time." ;; c-after-font-lock-init. (add-hook 'after-change-functions 'c-after-change nil t) (add-hook 'post-command-hook 'c-post-command) - (setq c-type-finder-pos - (save-restriction - (widen) - (move-marker (make-marker) (point-min)))) - - ;; Install the functionality for seeking "found types" at mode startup: - (or c-type-finder-timer - (setq c-type-finder-timer - (run-at-time - c-type-finder-repeat-time nil #'c-type-finder-timer-func))) - (add-hook 'post-gc-hook #'c-post-gc-hook) (when (boundp 'font-lock-extend-after-change-region-function) (set (make-local-variable 'font-lock-extend-after-change-region-function) @@ -2028,9 +1998,6 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".") c-new-id-end nil c-new-id-is-type nil))) -(defun c-post-gc-hook (&optional _stats) ; For XEmacs. - (setq c-inhibit-type-finder t)) - (defun c-before-change (beg end) ;; Function to be put on `before-change-functions'. Primarily, this calls ;; the language dependent `c-get-state-before-change-functions'. It is |