The most important reason for progn is described in the first line of the progn documentation (emphasis added):
progn is a special form that causes each of its arguments to be evaluated in sequence and then returns the value of the last one.
Without progn, sequence is not guaranteed, especially if subsequent expressions are dependent on the ...
progn is typically used when dealing with macros. Some macros (use-package is a macro, last I checked) accept only 1 form, where others consume all remaining forms.
progn is used in the former case to turn a sequence of forms into a single form.
In your examples, the first one uses progn and thus there is 1 form after :config. In the second, there are 3 ...
A better way to understand what progn is is by comparing it to the family: prog1 and prog2. The n or 1 or 2 part of the name stands for the statement from the list whose result you are interested in. In other words, progn will return the result of the last statement it contains, whereas prog1 will return the first, and similar for prog2.
Today this ...
See major-mode variable to find out major mode:
Symbol for current buffer’s major mode.
See cond function to do something depending on mode:
Try each clause until one succeeds.
Each clause looks like (CONDITION BODY...). CONDITION is evaluated
and, if the value is non-nil, this clause succeeds:
then the expressions in BODY are evaluated and ...
In your expanded example you set the variable trees to a new value in:
(setq trees '(pine birch))
That is not what happens in the original example. In the original example really the cdr of (nthcdr 2 trees) is set.
If you want to assign the intermediate value to a variable for better understanding you should introduce a new one, e.g., trees-...
It is simple as:
Open your lisp file with fibonachi function
Issue M-x slime
Place you cursor over fibonachi function and press C-c C-c to evaluate/compile it in Slime.
switch to slime window and call (fibonachi 10)
Screenshot example with hello-world function:
See the Elisp manual, node Circular Objects.
A circular list is one way to implement an infinite list.
For example (from the doc), this creates a list in which the first element recurs as the third element:
(setq x '(#1=(a) b #1#))
In your case:
(setq ys '(1 2 3 4))
(setq ll (last ys))
(setcdr ll ys)
C-h v ys:
#1=(1 2 3 4 . #1#)
He's talking about side-effects of calling a function (and whether they can be avoided).
A purely functional language would not allow a call to f(x) to modify the value of the argument being passed to that function; but because nconc is destructive, that's exactly what would happen here if g was the identity function (as then val would refer to the same cons ...
Why is Emacs so weird?
Emacs indents lisp code as if it were Emacs Lisp, where if accepts unlimited else forms; unlike in Common Lisp, where if accepts at most 3 arguments.
What to do?
Tell Emacs to indent Lisp as if it were Common Lisp:
(autoload 'common-lisp-indent-function "...