2

When using describe-variable, often the value for a variable is listed as:

Its value is t

What does that mean and why specifically t?

7

To quote the Emacs Lisp Manual,

t is the preferred way to represent the truth value true. When you need to choose a value that represents true, and there is no other basis for choosing, use t. The symbol t always has the value t.

t stands for "True".

This is important because it is used for decision making. It is used in decisions such as "If this condition is true, do this. Otherwise, do that." The statement Its value is t means that the variable you're describing holds the value t. The consequence of the variable being t depends on the variable.

For example,

(setq inhibit-startup-message t)

When the value of inhibit-startup-message is t, Emacs doesn't show the startup screen. To enable the startup screen, you would use a nil value. nil is the opposite of t and means "False".

Generally speaking, the concepts of t and nil are part of what's called Boolean Algebra, a method of logic named after mathematician George Boole.

Boolean Algebra is a topic important to computer programming, and many, many other fields of study. It's also quite fun and interesting. Unfortunately, it's too broad to explain in detail here.

  • 2
    I think it's important to explain the "and there is no other basis for choosing" part of the quote -- in elisp, absolutely every value other than nil is considered true for the purposes of boolean tests. Hence you will see the term "non-nil" used a great deal in elisp documentation, as nil is false, and every non-nil value is true. t is a value which is true, and which has no other meaning. – phils Feb 15 at 4:36

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.