Here's a sample of the code that I have:

(define-error 'unsupported-mode-error "Unsupported mode")
(condition-case e
    (if (eq 'a 'a)
        (message "test")
      (signal 'unsupported-mode-error major-mode))
   (signal (car e) (cdr e)))
   (message "error")))

With lexical-binding in the current file, I get Warning: Unused lexical argument e warning, although I'm clearly using e. Is this a bug or a misunderstanding on my part? And how could I avoid this warning?

  • 3
    Looks like a bug to me.
    – wvxvw
    Mar 16, 2015 at 15:46
  • 1
    Looks like a bug to me too.
    – Drew
    Mar 16, 2015 at 17:05
  • 1
    Alright, I'll submit the bug.
    – abo-abo
    Mar 16, 2015 at 18:44

1 Answer 1


This is related to bug #15103, as is now fixed in 25.1.

Earlier Emacs versions can do this to silence the warning:

(setq byte-compile--use-old-handlers nil)
  • 1
    Not all earlier versions, just 24.4, IIRC.
    – Dmitry
    Mar 16, 2015 at 19:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.