[PATCH] emacs: show: stop display of appliaction/* parts

Tomi Ollila tomi.ollila at iki.fi
Sun Jan 8 13:49:42 PST 2017


On Sun, Jan 08 2017, Tomas Nordin <tomasn at posteo.net> wrote:

> Hello Tomi
>
>
> I played on a bit with your scratch...
>
> (defcustom a '(a b) "a")
> (defcustom b (list "a" "b") "b")
> (defcustom c (cons 1 nil) "c")
> (defcustom T 10 "T")
>
> a -> (a b)
> b -> ("a" "b")
> c -> (1)
> T -> 10
>
> ;;; look at one of the plists
> (symbol-plist 'a) -> (standard-value ((quote (a b))) custom-requests nil variable-documentation "a")
>
> (get 'a 'standard-value) -> ((quote (a b)))
> (car (get 'a 'standard-value)) -> (quote (a b))
> (eval (car (get 'a 'standard-value))) -> (a b)
>
> (get 'b 'standard-value) -> ((list "a" "b"))
> (car (get 'b 'standard-value)) -> (list "a" "b")
> (eval (car (get 'b 'standard-value))) -> ("a" "b")
>
> (get 'c 'standard-value) -> ((cons 1 nil))
> (car (get 'c 'standard-value)) -> (cons 1 nil)
> (eval (car (get 'c 'standard-value))) -> (1)
>
> (get 'T 'standard-value) -> (10)
> (car (get 'T 'standard-value)) -> 10
> (eval (car (get 'T 'standard-value))) -> 10
>
> (equal a (eval (car (get 'a 'standard-value)))) -> t
> (equal b (eval (car (get 'b 'standard-value)))) -> t
> (equal c (eval (car (get 'c 'standard-value)))) -> t
> (equal T (eval (car (get 'T 'standard-value)))) -> t
>
> Could it be that the car need to be evaled before compared to the value
> of the variable? It looks like it with those experiments.
>
> The docs also say something in those lines:
>
>    Internally, ‘defcustom’ uses the symbol property ‘standard-value’ to
> record the expression for the standard value, ‘saved-value’ to record
> the value saved by the user with the customization buffer, and
> ‘customized-value’ to record the value set by the user with the
> customization buffer, but not saved.  *Note Symbol Properties::.  These
> properties are lists, the car of which is an expression that evaluates
> to the value.
>
> ... thinking about the last sentence. But it seems strange if there is
> not a more convenient function to do this.
>
> What do you think?

I looked a bit into custom.el, and it was doing exactly that
(i.e. (eval (car (get symbol 'standard-value)))
like everywhere...

Nice play,

Tomi

>
> Best regards
> --
> Tomas


More information about the notmuch mailing list