Elisp: Property List plist
If you evaluate this expression, the number 4 will appear in your echo area. Since + does not have a value bound to it, just the function this reference page definition, the error message reported that the symbol’s value as a variable was void. As a consequence, the Lisp interpreter evaluated the preceding s-expression, which in this case was the + by itself. If you attempt to evaluate a symbol that does not have a value bound to it, you will receive an error message. Notice that there were no parentheses around the word fill-column when we evaluated it to find its value. From the point of view of the Lisp interpreter, a value returned is a value returned.
This is the expected result, because the entire list is quoted and, ipso facto, everything inside of it is not evaluated. You will notice that the variable my-greeting-in-greek is not evaluated. Now I want to experiment with the message function to better understand how evaluation works. There is another case where a list should be selectively evaluated or, more specifically, where it should be treated as data instead of a function call with some elements inside of it still subject to evaluation. You have a list that is either evaluated or taken as-is (Basics of how Lisp works). Now, it so happens that fundamental-mode is called without any arguments, but the code will still work even if fundamental-mode is rewritten to have parameters.
The program defines many other commands, such as ielm-return. If we want to start using that package, we will do it by invoking ielm. Though the programmer must take care to autoload only what is the actual point of entry to the package and not every single symbol that may be called at some point.
The example above with add-text-properties is not how major modes typically do things (What are major and minor modes). There are functions which find the properties at a given buffer position and others which can search forward and backward for a certain property. It runs fundamental-mode, meaning that no special “fontification” is in effect and, thus, my-add-properties will work as intented (What are major and minor modes). There are plenty of functions that return a buffer position, such as point-min, point-max, re-search-forward, and line-beginning-position. When you write (quote some-symbol) this is the same as ‘some-symbol, which is then expected to be evaluated by symbol-value. The programmer can thus better articulate the intent of a given expression, while the byte compiler may internally perform the requisite checks and optimisations.
If DOING-STUFF does not encounter errors, UNDOING-STUFF will be evaluated in sequence and the return value of this entire expression will be what DOING-STUFF returns. With the above example in mind, DOING-STUFF will be evaluated first and then UNDOING-STUFF will follow. The logic is “do some computation with all the desired side effects, then once that transpires do some other computation to undo the side effects of the latter or perform whatever kind you reset you consider necessary”. The idea is to clean up whatever intermediate state you created so that any unwanted—yet temporarily necessary—side effects are undone (Side effect and return value). It maps through a list of elements for side effects only, just like dolist, while doing destructuring (Mapping through a list of elements).
Before this option was added, one could use the lexical-let macro from the (now deprecated) “cl” package to provide effective lexical scope. This package replaces an earlier “cl” package, which would overwrite existing Emacs Lisp function definitions with ones more similar to those found in Common Lisp. The “cl-lib” package implements a fairly large subset of Common Lisp. In XEmacs, runtime loading of such primitives is possible, using the operating system’s support for dynamic linking.
In this case, we do not want either argument evaluated, neither the variable flowers nor the list (rose violet daisy buttercup), so both are quoted. Note also, that when you use set, you need to quote both arguments to set, unless you want them evaluated. Incidentally, if you evaluate ‘flowers, the variable with a quote in front of it, what you will see in the echo area is the symbol itself, flowers. When you evaluate flowers, the list (rose violet daisy buttercup) appears in the echo area. After evaluating the set expression, you can evaluate the symbol flowers and it will return the value you just set. The list (rose violet daisy buttercup) will appear in the echo area.
For functions, the symbol actually is an alias for a given computation, i.e. a lambda expression whose evaluation may produce side effects and return a value (Symbols, balanced expressions, and quoting). For variables, nil returns nil, t returns t, and my-name will return Protesilaos if it is defined thus. A major mode will thus set up the font-lock-defaults variable (minor modes will typically modify the font-lock-keywords).