From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 7BE6C6DE02CD for ; Sun, 8 Jan 2017 11:49:49 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.754 X-Spam-Level: X-Spam-Status: No, score=-0.754 tagged_above=-999 required=5 tests=[AWL=-0.053, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Gz6t7iCf7eCO for ; Sun, 8 Jan 2017 11:49:47 -0800 (PST) Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by arlo.cworth.org (Postfix) with ESMTPS id 894826DE01CE for ; Sun, 8 Jan 2017 11:49:46 -0800 (PST) Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 1591220B57 for ; Sun, 8 Jan 2017 20:49:40 +0100 (CET) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 3txTQ96yvmzytm; Sun, 8 Jan 2017 20:49:37 +0100 (CET) Received: from tomas by debian with local (Exim 4.84_2) (envelope-from ) id 1cQJVd-00020f-UE; Sun, 08 Jan 2017 20:52:05 +0100 From: Tomas Nordin To: Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: show: stop display of appliaction/* parts In-Reply-To: References: <1483824305-5755-1-git-send-email-markwalters1009@gmail.com> Date: Sun, 08 Jan 2017 20:52:05 +0100 Message-ID: <877f65qqhm.fsf@debian.tompa.tv> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 19:49:49 -0000 Hello Tomi Tomi Ollila writes: > I tried to test the above in emacs *scratch* buffer, but cannot get > either of the formats work when variable is non-nil. > example tries > > (defcustom a '(a b) "a") > (defcustom b (list "a" "b") "b") > (defcustom c (cons 1 nil) "c") > > then > > (equal a (car (get 'a 'standard-value))) C-j > nil > > (equal (list a) (get 'a 'standard-value)) C-j > nil > > same with b & c > > with (defcustom n nil "n") the above work > > According to defcustom documentation the expression of STANDARD > is also stored -- when evaluating (get 'var 'standard-value) the > output looks like it: for example (get 'c 'standard-value) > ((cons 1 nil)) > > If the same happens when using the patch, then we need to look alternative > -- there might be something good, as customize knows when variable is > modified... 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 va= riable-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, =E2=80=98defcustom=E2=80=99 uses the symbol property =E2=80= =98standard-value=E2=80=99 to record the expression for the standard value, =E2=80=98saved-value=E2=80=99= to record the value saved by the user with the customization buffer, and =E2=80=98customized-value=E2=80=99 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? Best regards -- Tomas