From da6deda8d41c0a7ce4ddcc4b3569c7aa295238df Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Mon, 17 Jun 2019 20:22:06 +0000 Subject: [PATCH] Move defvars of c-doc-line-join-re + two others from cc-fonts.el to cc-mode.el This is because these variables are needed at runtime even when cc-fonts.el hasn't been loaded, as in XEmacs when font locking hasn't been enabled. * lisp/progmodes/cc-fonts.el (c-doc-line-join-re) (c-doc-bright-comment-start-re, c-doc-line-join-end-ch): Move definitions to cc-mode.el. --- lisp/progmodes/cc-fonts.el | 8 ++++---- lisp/progmodes/cc-mode.el | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 269d2c90b79..4e81b3b1e20 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -2584,18 +2584,18 @@ need for `pike-font-lock-extra-types'.") ;;; Doc comments. -(defvar c-doc-line-join-re regexp-unmatchable) -;; Matches a join of two lines in a doc comment. +(cc-bytecomp-defvar c-doc-line-join-re) +;; matches a join of two lines in a doc comment. ;; This should not be changed directly, but instead set by ;; `c-setup-doc-comment-style'. This variable is used in `c-find-decl-spots' ;; in (e.g.) autodoc style comments to bridge the gap between a "@\n" at an ;; EOL and the token following "//!" on the next line. -(defvar c-doc-bright-comment-start-re regexp-unmatchable) +(cc-bytecomp-defvar c-doc-bright-comment-start-re) ;; Matches the start of a "bright" comment, one whose contents may be ;; fontified by, e.g., `c-font-lock-declarations'. -(defvar c-doc-line-join-end-ch nil) +(cc-bytecomp-defvar c-doc-line-join-end-ch) ;; A list of characters, each being a last character of a doc comment marker, ;; e.g. the ! from pike autodoc's "//!". diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 5d0fda389ca..5c18879712c 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -128,6 +128,25 @@ ; ' (require 'cc-fonts) ;) +;; 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). + +(defvar c-doc-line-join-re regexp-unmatchable) +;; Matches a join of two lines in a doc comment. +;; This should not be changed directly, but instead set by +;; `c-setup-doc-comment-style'. This variable is used in `c-find-decl-spots' +;; in (e.g.) autodoc style comments to bridge the gap between a "@\n" at an +;; EOL and the token following "//!" on the next line. + +(defvar c-doc-bright-comment-start-re regexp-unmatchable) +;; Matches the start of a "bright" comment, one whose contents may be +;; fontified by, e.g., `c-font-lock-declarations'. + +(defvar c-doc-line-join-end-ch nil) +;; A list of characters, each being a last character of a doc comment marker, +;; e.g. the ! from pike autodoc's "//!". + ;; Other modes and packages which depend on CC Mode should do the ;; following to make sure everything is loaded and available for their -- 2.39.2