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: Mon, 27 Jun 2005 15:04:58 +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 1119877299 29264 80.91.229.2 (27 Jun 2005 13:01:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 27 Jun 2005 13:01:39 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 27 15:01:38 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DmtEZ-0007a0-F8 for ged-emacs-devel@m.gmane.org; Mon, 27 Jun 2005 15:01:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DmtM4-0007sy-U0 for ged-emacs-devel@m.gmane.org; Mon, 27 Jun 2005 09:08:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DmtLL-0007hJ-Sg for emacs-devel@gnu.org; Mon, 27 Jun 2005 09:08:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DmtL9-0007ZR-Uu for emacs-devel@gnu.org; Mon, 27 Jun 2005 09:07:57 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DmtL9-0007XY-Qu for emacs-devel@gnu.org; Mon, 27 Jun 2005 09:07:55 -0400 Original-Received: from [64.233.182.205] (helo=nproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DmtMV-0004IZ-Pc for emacs-devel@gnu.org; Mon, 27 Jun 2005 09:09:20 -0400 Original-Received: by nproxy.gmail.com with SMTP id i2so168750nfe for ; Mon, 27 Jun 2005 06:04:58 -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=sFv4b9BsQoSzS5fNg/3YUPzeMGod+pWwCgQXQb0noY5bL9TtHbca5IY6SxJDldn4o0iGGOR7K131gGjPgNr7eamokRC0qKUWtZBTNxkBlgjHdnM7+aweELmCUHbYGXQl4HykSmO6JbTOpqxgXZytNoh6K3iUUAjjWkPxETisvTY= Original-Received: by 10.48.4.10 with SMTP id 10mr114543nfd; Mon, 27 Jun 2005 06:04:58 -0700 (PDT) Original-Received: by 10.48.250.5 with HTTP; Mon, 27 Jun 2005 06:04:58 -0700 (PDT) Original-To: Juri Linkov In-Reply-To: <87slz6nr3h.fsf@jurta.org> 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:39651 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:39651 On 6/27/05, Juri Linkov wrote: > IMO, `set-variable' should > accept an alias when it is not marked as obsolete. Try this patch, please. It doesn't modify `set-variable' but `user-variable-p', so it returns t for non-obsolete aliases of user variables. (Anyway, is that a new feature or a bug fix?) --=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.245 diff -u -2 -r1.245 eval.c --- src/eval.c=0927 Jun 2005 05:59:23 -0000=091.245 +++ src/eval.c=0927 Jun 2005 13:03:26 -0000 @@ -94,4 +94,5 @@ Lisp_Object Qdebug_on_error; Lisp_Object Qdeclare; +Lisp_Object Qbyte_obsolete_variable; =20 /* This holds either the symbol `run-hooks' or nil. @@ -894,10 +895,12 @@ \(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). = */) +for the variable is `*', the variable is customizable (has a non-nil +value of `standard-value' or of `custom-autoload' on its property list), +or it is a non-obsolete alias for another user variable. */) (variable) Lisp_Object variable; { Lisp_Object documentation; + struct Lisp_Symbol *sym; =20 if (!SYMBOLP (variable)) @@ -920,4 +923,10 @@ || (!NILP (Fget (variable, intern ("custom-autoload"))))) return Qt; + + sym =3D XSYMBOL (variable); + if (sym->indirect_variable + && NILP (Fget (variable, Qbyte_obsolete_variable))) + return Fuser_variable_p (sym->value); + return Qnil; } @@ -3410,4 +3419,7 @@ staticpro (&Qdeclare); =20 + Qbyte_obsolete_variable =3D intern ("byte-obsolete-variable"); + staticpro (&Qbyte_obsolete_variable); + /* Note that the process handling also uses Qexit, but we don't want to staticpro it twice, so we just do it here. */