What does the elisp error "Wrong type argument: sequencep, t" mean?

Adam Rosenfield picture Adam Rosenfield · Oct 15, 2010 · Viewed 7.8k times · Source

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?

Answer

sds picture sds · Jul 13, 2013

The meaning of the error is that a function which expects a sequence received t instead; and the message tells you that t does not satisfy the predicate sequencep.

E.g., try evaluating (length t) and you will see in *Backtrace* (provided you set debug-on-error to t):

Debugger entered--Lisp error: (wrong-type-argument sequencep t)
  length(t)
  eval((length t) nil)

The message you see is produced by error-message-string:

(condition-case e (length t)
  (error (error-message-string e)))
==> "Wrong type argument: sequencep, t"