0

I'm on the first exercise section (Emacs Lisp Intro) and I'm not getting it; 3.12 exercises:

Write a function that tests whether the current value of `fill-column' is greater than the argument passed to the function, and if so, prints an appropriate message.

I have:

(defun is-fill-equal (number)
   "Is fill-column greater than the argument passed to the function."
   (interactive "p")
(if (= fill-column number)
    (message "They are equal.")
  (message "They are not equal."))

No matter what I try I get this error:

Debugger entered--Lisp error: (void-variable number)

1 Answers1

3

You are missing one parenthesis at the end. Try:

(defun is-fill-equal (number)
   "Is fill-column greater than the argument passed to the function."
   (interactive "p")
   (if (= fill-column number)
       (message "They are equal.")
     (message "They are not equal.")))

The reason for the error message is that you probably C-x e at the end of the function definition. As you are missing one parenthesis Emacs thinks that the expression you want to evaluate is (if (= fill-column number) ...) and number is unbound in that context.

pico
  • 1,349
  • 2
  • 10
  • 15