help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

don't understand setq-default


From: Emanuel Berg
Subject: don't understand setq-default
Date: Sun, 18 Apr 2021 13:40:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

I don't understand `setq-default', maybe I never did, unsure.

The docstring isn't good, it only describes how it will
happens which is intuitive at that (well, that's good that
it) but not how and why it is used.

You assign a variable I understand

  ultra-hd = 2160

ikr? ultra-hd is 2160!

but full-hd is assigned the default value 1080

  full-hd d= 1080

what does that mean, except for the obvious that d stands for
"diversion"?

the only thing I can make up, is that if the common-sense
variable is unset, it falls back to 1080?

but then where is this value stored?
( actual . default ) won't work
(or actual default)  cool but also won't work
property?

surely you don't have to look for it explicitly?

built-in in some really clever way (really clever =
everything you don't understand. stupid = everything you
already know. and right in between? number 1)

Here is the docstring, it gives the impression everyone
already knows about it. And, if so, I have to give it to it,
probably it makes a whole lot more sense, reight?

(setq-default [VAR VALUE]...)

  Probably introduced at or before Emacs version 18.

Set the default value of variable VAR to VALUE.
VAR, the variable name, is literal (not evaluated);
VALUE is an expression: it is evaluated and its value returned.
The default value of a variable is seen in buffers
that do not have their own values for the variable.

More generally, you can use multiple variables and values, as in
  (setq-default VAR VALUE VAR VALUE...)
This sets each VAR’s default value to the corresponding VALUE.
The VALUE for the Nth VAR can refer to the new default values
of previous VARs.

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]