emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master bbe88cd 1/2: Assume font-lock-mode variable is not void


From: Stefan Kangas
Subject: master bbe88cd 1/2: Assume font-lock-mode variable is not void
Date: Thu, 4 Feb 2021 19:28:07 -0500 (EST)

branch: master
commit bbe88cd82e4bbfd76df06223614ab74d1022c119
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    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.
---
 lisp/align.el                  | 2 +-
 lisp/cedet/semantic/idle.el    | 3 +--
 lisp/org/org-table.el          | 2 +-
 lisp/org/org.el                | 2 +-
 lisp/progmodes/antlr-mode.el   | 2 +-
 lisp/progmodes/idlwave.el      | 1 -
 lisp/progmodes/sql.el          | 4 +---
 lisp/progmodes/verilog-mode.el | 4 ++--
 lisp/vc/cvs-status.el          | 5 ++---
 lisp/vc/smerge-mode.el         | 2 +-
 lisp/woman.el                  | 2 +-
 11 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/lisp/align.el b/lisp/align.el
index 4d78393..1a1d3dd 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -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)))))))
diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el
index 73954f0..9f1bcfa 100644
--- a/lisp/cedet/semantic/idle.el
+++ b/lisp/cedet/semantic/idle.el
@@ -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
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index ef4672e..1248efa 100644
--- a/lisp/org/org-table.el
+++ b/lisp/org/org-table.el
@@ -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))
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 2d21a44..e6a5cca 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -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)))
 
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el
index 527cb03..e5b9ac0 100644
--- a/lisp/progmodes/antlr-mode.el
+++ b/lisp/progmodes/antlr-mode.el
@@ -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)))))))
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index c118924..e8e55ae 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -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
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index 4d027f3..f1f4d61 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -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))
 
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index e5c2c80..f934ef7 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -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*"
diff --git a/lisp/vc/cvs-status.el b/lisp/vc/cvs-status.el
index ff3a294..26fb620 100644
--- a/lisp/vc/cvs-status.el
+++ b/lisp/vc/cvs-status.el
@@ -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 ()
diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el
index f50b254..c66a4fb 100644
--- a/lisp/vc/smerge-mode.el
+++ b/lisp/vc/smerge-mode.el
@@ -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)
diff --git a/lisp/woman.el b/lisp/woman.el
index 1d3c8d1..9a03d30 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]