From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: Documentation not clear for the Lisp function set-variable Date: Tue, 28 Jun 2005 11:26:28 +0200 Message-ID: References: <87slz6nr3h.fsf@jurta.org> Reply-To: Juanma Barranquero NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1119951227 30136 80.91.229.2 (28 Jun 2005 09:33:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 28 Jun 2005 09:33:47 +0000 (UTC) Cc: juri@jurta.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 28 11:33:46 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DnCT8-0006Gk-CY for ged-emacs-devel@m.gmane.org; Tue, 28 Jun 2005 11:33:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DnCax-0002sG-0g for ged-emacs-devel@m.gmane.org; Tue, 28 Jun 2005 05:41:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DnCO6-0006zn-01 for emacs-devel@gnu.org; Tue, 28 Jun 2005 05:28:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DnCO3-0006vn-DI for emacs-devel@gnu.org; Tue, 28 Jun 2005 05:28:12 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DnCO2-0006uK-PY for emacs-devel@gnu.org; Tue, 28 Jun 2005 05:28:11 -0400 Original-Received: from [64.233.182.201] (helo=nproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DnCQo-0001uS-8x for emacs-devel@gnu.org; Tue, 28 Jun 2005 05:31:02 -0400 Original-Received: by nproxy.gmail.com with SMTP id i2so206902nfe for ; Tue, 28 Jun 2005 02:26:28 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rfaJl3kmuFgI4Ae1LRqnDwmkvdxh913rwEheIVnPvrYAHI3gi3H3NFMwGwI39uIRb7mNrJf4tvXuT1zsOm+fqLjWL64XRdSqU14AdRgI1D1qBPyWEGFGxkZDr3XEzC7U1N0LIQABevkKe3Wkggxb/fR/T9naGvHRJsAkt1fWDRE= Original-Received: by 10.48.249.6 with SMTP id w6mr140441nfh; Tue, 28 Jun 2005 02:26:28 -0700 (PDT) Original-Received: by 10.48.250.5 with HTTP; Tue, 28 Jun 2005 02:26:28 -0700 (PDT) Original-To: rms@gnu.org In-Reply-To: Content-Disposition: inline X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:39778 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:39778 > The patch below modifies `user-variable-p' [etc, etc.] That would be more convincing if I really attached the patch... (BTW, the patch uses diff -b because most of user-visible-p is now inside a while loop, but otherwise unchanged.) --=20 /L/e/k/t/u Index: src/eval.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/emacs/emacs/src/eval.c,v retrieving revision 1.246 diff -b -c -2 -r1.246 eval.c *** src/eval.c=0928 Jun 2005 02:27:38 -0000=091.246 --- src/eval.c=0928 Jun 2005 08:34:08 -0000 *************** *** 890,899 **** } =20 DEFUN ("user-variable-p", Fuser_variable_p, Suser_variable_p, 1, 1, 0, ! doc: /* Returns t if VARIABLE is intended to be set and modified by users. \(The alternative is a variable used internally in a Lisp program.) ! Determined by whether the first character of the documentation ! for the variable is `*' or if the variable is customizable (has a non-nil ! value of `standard-value' or of `custom-autoload' on its property list). = */) (variable) Lisp_Object variable; --- 890,911 ---- } =20 + /* Error handler used in Fuser_variable_p. */ + static Lisp_Object + user_variable_p_eh (ignore) + Lisp_Object ignore; + { + return Qnil; + } +=20 DEFUN ("user-variable-p", Fuser_variable_p, Suser_variable_p, 1, 1, 0, ! doc: /* Return t if VARIABLE is intended to be set and modified by users. \(The alternative is a variable used internally in a Lisp program.) ! A variable is a user variable if ! \(1) the first character of its documentation is `*', or ! \(2) it is customizable (its property list contains a non-nil value ! of `standard-value' or `custom-autoload'), or ! \(3) it is an alias for another user variable. ! Return nil if VARIABLE is an alias and there is a loop in the ! chain of symbols. */) (variable) Lisp_Object variable; *************** *** 904,907 **** --- 916,927 ---- return Qnil; =20 + /* If indirect and there's an alias loop, don't check anything else. *= / + if (XSYMBOL (variable)->indirect_variable + && NILP (internal_condition_case_1 (indirect_variable, variable, + Qt, user_variable_p_eh))) + return Qnil; +=20 + while (1) + { documentation =3D Fget (variable, Qvariable_documentation); if (INTEGERP (documentation) && XINT (documentation) < 0) *************** *** 920,924 **** --- 940,950 ---- || (!NILP (Fget (variable, intern ("custom-autoload"))))) return Qt; +=20 + if (!XSYMBOL (variable)->indirect_variable) return Qnil; +=20 + /* An indirect variable? Let's follow the chain. */ + variable =3D XSYMBOL (variable)->value; + } } =0C