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.
This commit is contained in:
Stefan Kangas 2023-08-19 11:48:58 +02:00
parent eb61bbacef
commit 2b311a47dd
10 changed files with 20 additions and 31 deletions

View file

@ -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)

View file

@ -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+\\>"

View file

@ -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."

View file

@ -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")))

View file

@ -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

View file

@ -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 " ")

View file

@ -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)

View file

@ -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)

View file

@ -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

View file

@ -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 ()