emacs-diffs
[Top][All Lists]
Advanced

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

master 2b311a47dd0: Assume that font-lock is preloaded


From: Stefan Kangas
Subject: master 2b311a47dd0: Assume that font-lock is preloaded
Date: Fri, 25 Aug 2023 14:37:29 -0400 (EDT)

branch: master
commit 2b311a47dd0cde82fb9d32c303f13700cae4f0b3
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>

    Assume that font-lock is preloaded
    
    * lisp/org/ox-beamer.el (org-mode): Assume that font-lock is
    preloaded, which it has been since Emacs 22.1.
    * lisp/textmodes/reftex.el (reftex-use-fonts): Make function obsolete
    in favor of variable.  Update all callers.
---
 lisp/cedet/semantic/fw.el      |  5 ++---
 lisp/cedet/semantic/grammar.el |  9 ++-------
 lisp/org/ox-beamer.el          |  9 ++++-----
 lisp/textmodes/reftex-cite.el  |  4 ++--
 lisp/textmodes/reftex-index.el |  4 ++--
 lisp/textmodes/reftex-sel.el   |  2 +-
 lisp/textmodes/reftex-toc.el   |  2 +-
 lisp/textmodes/reftex-vars.el  |  1 -
 lisp/textmodes/reftex.el       | 12 +++++-------
 lisp/vc/cvs-status.el          |  3 +--
 10 files changed, 20 insertions(+), 31 deletions(-)

diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el
index 30704760c1d..184a74c8c2e 100644
--- a/lisp/cedet/semantic/fw.el
+++ b/lisp/cedet/semantic/fw.el
@@ -434,9 +434,8 @@ FILE, NOWARN, RAWFILE, and WILDCARDS are passed into 
`find-file-noselect'."
 ;;       ))
 ;;   "Highlighted Semantic keywords.")
 
-;; (when (fboundp 'font-lock-add-keywords)
-;;   (font-lock-add-keywords 'emacs-lisp-mode
-;;                           semantic-fw-font-lock-keywords))
+;; (font-lock-add-keywords 'emacs-lisp-mode
+;;                         semantic-fw-font-lock-keywords)
 
 
 (provide 'semantic/fw)
diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el
index 2dccd87a710..60c57210b8f 100644
--- a/lisp/cedet/semantic/grammar.el
+++ b/lisp/cedet/semantic/grammar.el
@@ -1156,18 +1156,13 @@ END is the limit of the search."
     ("^\\(\\(\\sw\\|\\s_\\)+\\)[ \n\r\t]*:"
      1 font-lock-function-name-face)
     (semantic--grammar-macros-matcher
-     1 ,(if (boundp 'font-lock-builtin-face)
-            'font-lock-builtin-face
-          'font-lock-preprocessor-face))
+     1 font-lock-builtin-face)
     ("\\$\\(\\sw\\|\\s_\\)*"
      0 font-lock-variable-name-face)
     ("<\\(\\(\\sw\\|\\s_\\)+\\)>"
      1 font-lock-type-face)
     (,semantic-grammar-lex-c-char-re
-     0 ,(if (boundp 'font-lock-constant-face)
-            'font-lock-constant-face
-          'font-lock-string-face)
-     t)
+     0 font-lock-constant-face t)
     ;; Must highlight :keyword here, because ':' is a punctuation in
     ;; grammar mode!
     ("[\r\n\t ]+:\\sw+\\>"
diff --git a/lisp/org/ox-beamer.el b/lisp/org/ox-beamer.el
index 689bf1559b4..2590bd5fa72 100644
--- a/lisp/org/ox-beamer.el
+++ b/lisp/org/ox-beamer.el
@@ -924,11 +924,10 @@ holding export options."
   "Support for editing Beamer oriented Org mode files."
   :lighter " Bm")
 
-(when (fboundp 'font-lock-add-keywords)
-  (font-lock-add-keywords
-   'org-mode
-   '((":\\(B_[a-z]+\\|BMCOL\\):" 1 'org-beamer-tag prepend))
-   'prepend))
+(font-lock-add-keywords
+ 'org-mode
+ '((":\\(B_[a-z]+\\|BMCOL\\):" 1 'org-beamer-tag prepend))
+ 'prepend)
 
 (defface org-beamer-tag '((t (:box (:line-width 1 :color grey40))))
   "The special face for beamer tags."
diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el
index 6beae816257..eaa03c96fe9 100644
--- a/lisp/textmodes/reftex-cite.el
+++ b/lisp/textmodes/reftex-cite.el
@@ -566,7 +566,7 @@ If FORMAT is non-nil `format' entry accordingly."
           (reftex-get-bib-field "booktitle" entry "in: %s"))
          (t ""))))
     (setq authors (reftex-truncate authors 30 t t))
-    (when (reftex-use-fonts)
+    (when reftex-use-fonts
       (put-text-property 0 (length key)     'face reftex-label-face
                          key)
       (put-text-property 0 (length authors) 'face reftex-bib-author-face
@@ -609,7 +609,7 @@ If FORMAT is non-nil `format' entry accordingly."
     (push text lines)
     (setq text (mapconcat #'identity (nreverse lines) "\n     "))
 
-    (when (reftex-use-fonts)
+    (when reftex-use-fonts
       (put-text-property 0 (length text) 'face reftex-bib-author-face text))
     (concat key "\n     " text "\n\n")))
 
diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el
index c8a45f068d1..7cb15c7e99a 100644
--- a/lisp/textmodes/reftex-index.el
+++ b/lisp/textmodes/reftex-index.el
@@ -536,7 +536,7 @@ SPC=view TAB=goto RET=goto+hide [e]dit [q]uit [r]escan 
[f]ollow [?]Help
                    (nth 2 (car reftex-index-restriction-data))
                  reftex-index-restriction-indicator)))
 
-      (if (reftex-use-fonts)
+      (if reftex-use-fonts
           (put-text-property (point-min) (point)
                              'face reftex-index-header-face))
       (cursor-intangible-mode 1)
@@ -567,7 +567,7 @@ SPC=view TAB=goto RET=goto+hide [e]dit [q]uit [r]escan 
[f]ollow [?]Help
          (context-indent (concat indent "  "))
          (section-chars (mapcar #'identity reftex-index-section-letters))
          (this-section-char 0)
-         (font (reftex-use-fonts))
+         (font reftex-use-fonts)
          (bor (car reftex-index-restriction-data))
          (eor (nth 1 reftex-index-restriction-data))
          (mouse-face
diff --git a/lisp/textmodes/reftex-sel.el b/lisp/textmodes/reftex-sel.el
index 3c9f9ca94c8..61baf9408c2 100644
--- a/lisp/textmodes/reftex-sel.el
+++ b/lisp/textmodes/reftex-sel.el
@@ -204,7 +204,7 @@ During a selection process, these are the local bindings.
   ;;           a used member near to this one, as a possible starting point.
   ;; XR-PREFIX is the prefix to put in front of labels.
   ;; TOC-BUFFER means this is to fill the toc buffer.
-  (let* ((font (reftex-use-fonts))
+  (let* ((font reftex-use-fonts)
          (cnt 0)
          (index -1)
          (toc-indent " ")
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el
index de49b7c6c70..312ccb0f2be 100644
--- a/lisp/textmodes/reftex-toc.el
+++ b/lisp/textmodes/reftex-toc.el
@@ -263,7 +263,7 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels 
[f]ollow [x]r [?]Help
 ------------------------------------------------------------------------------
 " (abbreviate-file-name reftex-last-toc-master)))
 
-      (if (reftex-use-fonts)
+      (if reftex-use-fonts
           (put-text-property (point-min) (point) 'font-lock-face 
reftex-toc-header-face))
       (cursor-intangible-mode 1)
       (add-text-properties (point-min) (point)
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index 60ee40180d1..ebe49ae9fef 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -1933,7 +1933,6 @@ The value of this variable will only have any effect when
 
 (defcustom reftex-use-fonts t
   "Non-nil means, use fonts in *toc* and selection buffers.
-Font-lock must be loaded as well to actually get fontified display.
 When changing this option, a rescan may be necessary to activate the change."
   :group 'reftex-fontification-configurations
   :type 'boolean)
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 50bec6ef172..22efb527740 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -2027,15 +2027,9 @@ IGNORE-WORDS List of words which should be removed from 
the string."
 ;;;
 ;;; Fontification and Highlighting
 
-(defun reftex-use-fonts ()
-  ;; Return t if we can and want to use fonts.
-  (and ; window-system
-       reftex-use-fonts
-       (featurep 'font-lock)))
-
 (defun reftex-refontify ()
   ;; Return t if we need to refontify context
-  (and (reftex-use-fonts)
+  (and reftex-use-fonts
        (or (eq t reftex-refontify-context)
            (and (eq 1 reftex-refontify-context)
                 ;; Test of we use the font-lock version of x-symbol
@@ -2342,6 +2336,10 @@ Your bug report will be posted to the AUCTeX bug 
reporting list.
 
 (define-obsolete-function-alias 'reftex-window-height #'window-height "30.1")
 
+(defun reftex-use-fonts ()
+  (declare (obsolete "use variable `reftex-use-fonts' instead." "30.1"))
+  reftex-use-fonts)
+
 (provide 'reftex)
 
 ;;; reftex.el ends here
diff --git a/lisp/vc/cvs-status.el b/lisp/vc/cvs-status.el
index 7982cd89efc..30296573796 100644
--- a/lisp/vc/cvs-status.el
+++ b/lisp/vc/cvs-status.el
@@ -354,8 +354,7 @@ the list is a three-string list TAG, KIND, REV."
 
 (defvar font-lock-mode)
 ;; (defun cvs-refontify (beg end)
-;;   (when (and font-lock-mode
-;;             (fboundp 'font-lock-fontify-region))
+;;   (when font-lock-mode
 ;;     (font-lock-fontify-region (1- beg) (1+ end))))
 
 (defun cvs-status-trees ()



reply via email to

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