views:

70

answers:

1

I'm trying to byte-compile cc-mode 5.31.3 using emacs 23.1.1 as follows:

$ emacs -batch --no-site-file -q -f batch-byte-compile *.el

But two of the files are failing to compile (in addition to numerous warnings):

In c-init-language-vars-for:
cc-mode.el:168:10:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:168:10:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:162:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:162:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:163:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:163:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:164:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:164:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:165:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:165:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:166:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:166:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:167:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:167:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:562:4:Error: Wrong type argument: sequencep, t

In c-make-styles-buffer-local:
cc-styles.el:634:6:Warning: `mapcar' called for effect; use `mapc' or `dolist'
    instead
cc-styles.el:636:9:Error: Wrong type argument: sequencep, t

What do these two errors mean, and how can I fix them?

Line 562 of cc-mode.el is this:

  (c-update-modeline)

Where c-update-modeline is a function defined in cc-cmds.el that takes no arguments. Line 636 of cc-styles.el part of this function:

(defun c-make-styles-buffer-local (&optional this-buf-only-p)
  "Make all CC Mode style variables buffer local.
If `this-buf-only-p' is non-nil, the style variables will be made
buffer local only in the current buffer.  Otherwise they'll be made
permanently buffer local in any buffer that changes their values.

The buffer localness of the style variables are normally controlled
with the variable `c-style-variables-are-local-p', so there's seldom
any reason to call this function directly."

  ;; style variables
  (let ((func (if this-buf-only-p
          'make-local-variable
        'make-variable-buffer-local))
    (varsyms (cons 'c-indentation-style (copy-alist c-style-variables))))
    (delq 'c-special-indent-hook varsyms)
    (mapcar func varsyms)
    ;; Hooks must be handled specially
    (if this-buf-only-p    ;;;;;;;;; LINE 636 ;;;;;;;;;;;;;;;;;;
        (make-local-hook 'c-special-indent-hook)
      (make-variable-buffer-local 'c-special-indent-hook)
      (setq c-style-variables-are-local-p t))
    ))

These error messages don't make sense. Could the fact that I already have a different version of cc-mode installed with emacs be affecting this? How do you recompile cc-mode?

A: 

I'm still confused about these error messages, but the answer is that cc-mode 5.31.3 is rather old and can't be compiled with emacs 23 (I was trying to compile cc-mode for curiosity's sake). emacs 23 ships with an updated version of cc-mode, version 5.31.7 -- run the interactive command c-version to get the version of cc-mode you're using.

For those who want to recompile cc-mode (and not use the compiled cc-mode.elc that ships with emacs), you should use download the latest version from anonymous CVS

Adam Rosenfield