;; Emacs.
`(setq mark-active ,activate)))
+(defmacro c-set-keymap-parent (map parent)
+ (cond
+ ;; XEmacs
+ ((cc-bytecomp-fboundp 'set-keymap-parents)
+ `(set-keymap-parents ,map ,parent))
+ ;; Emacs
+ ((cc-bytecomp-fboundp 'set-keymap-parent)
+ `(set-keymap-parent ,map ,parent))
+ ;; incompatible
+ (t (error "CC Mode is incompatible with this version of Emacs"))))
+
(defmacro c-delete-and-extract-region (start end)
"Delete the text between START and END and return it."
(if (cc-bytecomp-fboundp 'delete-and-extract-region)
(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-set-keymap-parent t)
(def-edebug-spec c-safe t)
(def-edebug-spec c-save-buffer-state let*)
(def-edebug-spec c-tentative-buffer-changes t)
(defun c-make-inherited-keymap ()
(let ((map (make-sparse-keymap)))
- ;; Necessary to use `cc-bytecomp-fboundp' below since this
- ;; function is called from top-level forms that are evaluated
- ;; while cc-bytecomp is active when one does M-x eval-buffer.
- (cond
- ;; Emacs
- ((cc-bytecomp-fboundp 'set-keymap-parent)
- (set-keymap-parent map c-mode-base-map))
- ;; XEmacs
- ((fboundp 'set-keymap-parents)
- (set-keymap-parents map c-mode-base-map))
- ;; incompatible
- (t (error "CC Mode is incompatible with this version of Emacs")))
+ (c-set-keymap-parent map c-mode-base-map)
map))
(defun c-define-abbrev-table (name defs &optional doc)