Assume font-lock-mode variable is not void

* lisp/align.el (align-rules-list):
* lisp/cedet/semantic/idle.el
(semantic-idle-summary-useful-context-p):
* lisp/org/org-table.el (org-table-edit-field):
* lisp/org/org.el (org-restart-font-lock):
* lisp/progmodes/antlr-mode.el (antlr-language-option-extra):
* lisp/progmodes/idlwave.el (idlwave-choose):
* lisp/progmodes/sql.el (sql-product-font-lock):
* lisp/progmodes/verilog-mode.el
(verilog-save-font-no-change-functions, verilog-preprocess):
* lisp/vc/cvs-status.el:
* lisp/vc/smerge-mode.el (smerge-mode):
* lisp/woman.el (woman-decode-buffer): Assume font-lock-mode variable
is not void; it is preloaded.
This commit is contained in:
Stefan Kangas 2021-02-05 01:14:17 +01:00
parent a92167674f
commit bbe88cd82e
11 changed files with 12 additions and 17 deletions

View file

@ -424,7 +424,7 @@ The possible settings for `align-region-separate' are:
(backward-word 1)
(looking-at
"\\(goto\\|return\\|new\\|delete\\|throw\\)"))
(if (and (boundp 'font-lock-mode) font-lock-mode)
(if font-lock-mode
(eq (get-text-property (point) 'face)
'font-lock-comment-face)
(eq (caar (c-guess-basic-syntax)) 'c)))))))

View file

@ -716,8 +716,7 @@ specific to a major mode. For example, in jde mode:
(defun semantic-idle-summary-useful-context-p ()
"Non-nil if we should show a summary based on context."
(if (and (boundp 'font-lock-mode)
font-lock-mode
(if (and font-lock-mode
(memq (get-text-property (point) 'face)
semantic-idle-summary-out-of-context-faces))
;; The best I can think of at the moment is to disable

View file

@ -2008,7 +2008,7 @@ toggle `org-table-follow-field-mode'."
(let ((b (save-excursion (skip-chars-backward "^|") (point)))
(e (save-excursion (skip-chars-forward "^|\r\n") (point))))
(remove-text-properties b e '(invisible t intangible t))
(if (and (boundp 'font-lock-mode) font-lock-mode)
(if font-lock-mode
(font-lock-fontify-block))))
(t
(let ((pos (point-marker))

View file

@ -5520,7 +5520,7 @@ highlighting was done, nil otherwise."
(defun org-restart-font-lock ()
"Restart `font-lock-mode', to force refontification."
(when (and (boundp 'font-lock-mode) font-lock-mode)
(when font-lock-mode
(font-lock-mode -1)
(font-lock-mode 1)))

View file

@ -2047,7 +2047,7 @@ Called in PHASE `after-insertion', see `antlr-options-alists'."
(let ((new-language (antlr-language-option t)))
(or (null new-language)
(eq new-language antlr-language)
(let ((font-lock (and (boundp 'font-lock-mode) font-lock-mode)))
(let ((font-lock font-lock-mode))
(if font-lock (font-lock-mode 0))
(antlr-mode)
(and font-lock (null font-lock-mode) (font-lock-mode 1)))))))

View file

@ -6876,7 +6876,6 @@ sort the list before displaying."
(let ((completion-ignore-case t)) ; install correct value
(apply function args))
(if (and (derived-mode-p 'idlwave-shell-mode)
(boundp 'font-lock-mode)
(not font-lock-mode))
;; For the shell, remove the fontification of the word before point
(let ((beg (save-excursion

View file

@ -2829,9 +2829,7 @@ configured."
;; Force font lock to reinitialize if it is already on
;; Otherwise, we can wait until it can be started.
(when (and (fboundp 'font-lock-mode)
(boundp 'font-lock-mode)
font-lock-mode)
(when font-lock-mode
(font-lock-mode-internal nil)
(font-lock-mode-internal t))

View file

@ -3442,7 +3442,7 @@ For insignificant changes, see instead `verilog-save-buffer-state'."
(verilog-run-hooks 'verilog-before-save-font-hook)
(let* ((verilog-save-font-mod-hooked (- (point-max) (point-min)))
;; Significant speed savings with no font-lock properties
(fontlocked (when (and (boundp 'font-lock-mode) font-lock-mode)
(fontlocked (when font-lock-mode
(font-lock-mode 0)
t)))
(run-hook-with-args 'before-change-functions (point-min) (point-max))
@ -5535,7 +5535,7 @@ FILENAME to find directory to run in, or defaults to `buffer-file-name'."
default nil nil
'verilog-preprocess-history default)))))
(unless command (setq command (verilog-expand-command verilog-preprocessor)))
(let* ((fontlocked (and (boundp 'font-lock-mode) font-lock-mode))
(let* ((fontlocked font-lock-mode)
(dir (file-name-directory (or filename buffer-file-name)))
(cmd (concat "cd " dir "; " command)))
(with-output-to-temp-buffer "*Verilog-Preprocessed*"

View file

@ -356,9 +356,8 @@ the list is a three-string list TAG, KIND, REV."
(defvar font-lock-mode)
;; (defun cvs-refontify (beg end)
;; (when (and (boundp 'font-lock-mode)
;; font-lock-mode
;; (fboundp 'font-lock-fontify-region))
;; (when (and font-lock-mode
;; (fboundp 'font-lock-fontify-region))
;; (font-lock-fontify-region (1- beg) (1+ end))))
(defun cvs-status-trees ()

View file

@ -1410,7 +1410,7 @@ with a \\[universal-argument] prefix, makes up a 3-way conflict."
\\{smerge-mode-map}"
:group 'smerge :lighter " SMerge"
(when (and (boundp 'font-lock-mode) font-lock-mode)
(when font-lock-mode
(save-excursion
(if smerge-mode
(font-lock-add-keywords nil smerge-font-lock-keywords 'append)

View file

@ -2114,7 +2114,7 @@ No external programs are used."
(interactive) ; mainly for testing
(WoMan-log-begin)
(run-hooks 'woman-pre-format-hook)
(and (boundp 'font-lock-mode) font-lock-mode (font-lock-mode -1))
(and font-lock-mode (font-lock-mode -1))
;; (fundamental-mode)
(let ((start-time (current-time))
time)