;;; cc-defs.el --- compile time definitions for CC Mode
-;; Copyright (C) 1985, 1987, 1992-2013 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2015 Free Software Foundation, Inc.
;; Authors: 2003- Alan Mackenzie
;; 1998- Martin Stjernholm
;; Silence the compiler.
(cc-bytecomp-defvar c-enable-xemacs-performance-kludge-p) ; In cc-vars.el
-(cc-bytecomp-defun buffer-syntactic-context-depth) ; XEmacs
(cc-bytecomp-defun region-active-p) ; XEmacs
-(cc-bytecomp-defvar zmacs-region-stays) ; XEmacs
-(cc-bytecomp-defvar zmacs-regions) ; XEmacs
(cc-bytecomp-defvar mark-active) ; Emacs
(cc-bytecomp-defvar deactivate-mark) ; Emacs
(cc-bytecomp-defvar inhibit-point-motion-hooks) ; Emacs
(cc-bytecomp-defvar parse-sexp-lookup-properties) ; Emacs
(cc-bytecomp-defvar text-property-default-nonsticky) ; Emacs 21
-(cc-bytecomp-defvar lookup-syntax-properties) ; XEmacs
(cc-bytecomp-defun string-to-syntax) ; Emacs 21
\f
\f
;;; Variables also used at compile time.
-(defconst c-version "5.32.4"
+(defconst c-version "5.32.5"
"CC Mode version number.")
(defconst c-version-sym (intern c-version))
(put 'cc-eval-when-compile 'lisp-indent-hook 0))
+(eval-and-compile
+ (defalias 'c--macroexpand-all
+ (if (fboundp 'macroexpand-all)
+ 'macroexpand-all 'cl-macroexpand-all)))
\f
;;; Macros.
(defmacro c-region-is-active-p ()
;; Return t when the region is active. The determination of region
;; activeness is different in both Emacs and XEmacs.
+ ;; FIXME? Emacs has region-active-p since 23.1, so maybe this test
+ ;; should be updated.
(if (cc-bytecomp-boundp 'mark-active)
;; Emacs.
'mark-active
(defmacro c-set-region-active (activate)
;; Activate the region if ACTIVE is non-nil, deactivate it
;; otherwise. Covers the differences between Emacs and XEmacs.
- (if (cc-bytecomp-fboundp 'zmacs-activate-region)
+ (if (fboundp 'zmacs-activate-region)
;; XEmacs.
`(if ,activate
(zmacs-activate-region)
;; `c-parse-state'.
`(progn
- (if (and ,(cc-bytecomp-fboundp 'buffer-syntactic-context-depth)
+ (if (and ,(fboundp 'buffer-syntactic-context-depth)
c-enable-xemacs-performance-kludge-p)
- ,(when (cc-bytecomp-fboundp 'buffer-syntactic-context-depth)
+ ,(when (fboundp 'buffer-syntactic-context-depth)
;; XEmacs only. This can improve the performance of
;; c-parse-state to between 3 and 60 times faster when
;; braces are hung. It can also degrade performance by
;; Make edebug understand the macros.
;(eval-after-load "edebug" ; 2006-07-09: def-edebug-spec is now in subr.el.
; '(progn
-(def-edebug-spec cc-eval-when-compile t)
+(def-edebug-spec cc-eval-when-compile (&rest def-form))
(def-edebug-spec c-point t)
(def-edebug-spec c-set-region-active t)
(def-edebug-spec c-safe t)
;; suppressed.
`(unwind-protect
(c-save-buffer-state ()
- (c-clear-cpp-delimiters ,beg ,end)
+ (save-restriction
+ (widen)
+ (c-clear-cpp-delimiters ,beg ,end))
,`(c-with-cpps-commented-out ,@forms))
(c-save-buffer-state ()
- (c-set-cpp-delimiters ,beg ,end))))
+ (save-restriction
+ (widen)
+ (c-set-cpp-delimiters ,beg ,end)))))
\f
(defsubst c-intersect-lists (list alist)
;; return the element of ALIST that matches the first element found
(let ((buf (generate-new-buffer " test"))
parse-sexp-lookup-properties
parse-sexp-ignore-comments
- lookup-syntax-properties)
+ lookup-syntax-properties) ; XEmacs
(with-current-buffer buf
(set-syntax-table (make-syntax-table))
immediately, i.e. at the same time as the `c-lang-defconst' form
itself is evaluated."
;; Evaluate at macro expansion time, i.e. in the
- ;; `cl-macroexpand-all' inside `c-lang-defconst'.
+ ;; `c--macroexpand-all' inside `c-lang-defconst'.
(eval form))
-;; Only used at compile time - suppress "might not be defined at runtime".
-(declare-function cl-macroexpand-all "cl" (form &optional env))
-
(defmacro c-lang-defconst (name &rest args)
"Set the language specific values of the language constant NAME.
The second argument can optionally be a docstring. The rest of the
(let* ((sym (intern (symbol-name name) c-lang-constants))
;; Make `c-lang-const' expand to a straightforward call to
- ;; `c-get-lang-constant' in `cl-macroexpand-all' below.
+ ;; `c-get-lang-constant' in `c--macroexpand-all' below.
;;
;; (The default behavior, i.e. to expand to a call inside
;; `eval-when-compile' should be equivalent, since that macro
;; reason, but we also use this expansion handle
;; `c-lang-defconst-eval-immediately' and to register
;; dependencies on the `c-lang-const's in VAL.)
- (setq val (cl-macroexpand-all val))
+ (setq val (c--macroexpand-all val))
(setq bindings (cons (cons assigned-mode val) bindings)
args (cdr args))))
;;(message (concat "Loading %s to get the source "
;; "value for language constant %s")
;; file name)
- (load file))
+ (load file nil t))
(unless (setq assignment-entry (cdar file-entry))
;; The load didn't fill in the source for the