0

For some reason I am getting errors for built-in variables that are available in the documentation.

For instance, evaluating in the scratch buffer the following all return:

Symbol's function definition is void:

  • emacs-major-version
  • emacs-minor-version
  • display-time-24hr-format

This is so weird because there is documentation for all of these, they show up in auto-complete and I see other users using them.

I can not use these in my .emacs or anywhere else. Interestingly however, I can set some of them using customize. For instance:

(display-time-24hr-format t) does work in the customize block

Does anyone have any advice?

2

You get Symbol's function definition is void because those are variables, not functions.

Below will work:

M-: emacs-major-version

Below will not work:

M-: (emacs-major-version)
  • Ah yes, silly mistake. However, can you help me with (display-time-24-hr-format t) which I am pretty sure is a function? – Startec Aug 2 '16 at 19:00
  • 2
    @Startec Nope, That's a variable too. Looks like you are partially evaluating the auto-generated customize forms.. (setq display-time-2hr-format t) will work. If something shows up in C-h v, that's a variable. If something shows up in C-h f, that's a function. – Kaushal Modi Aug 2 '16 at 19:02
  • You should be evaluating the whole (customize-set-variables ..) form, not just elements of array in it. – Kaushal Modi Aug 2 '16 at 19:04
  • I am still learning lisp and wanted to write it myself. I thought I could just use that because it looked like (blink-cursor-mode t) These slight differences are rough. – Startec Aug 2 '16 at 19:06
  • @Startec blink-cursor-mode is both a function and a variable, the customize-set-variables form refers to the variable. – npostavs Aug 2 '16 at 19:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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