From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: defvaralias Date: Thu, 5 May 2005 20:42:34 -0500 (CDT) Message-ID: <200505060142.j461gYF08458@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1115344279 27306 80.91.229.2 (6 May 2005 01:51:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 6 May 2005 01:51:19 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 06 03:51:17 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DTrzh-0003KV-Du for ged-emacs-devel@m.gmane.org; Fri, 06 May 2005 03:51:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DTs7K-0006FG-13 for ged-emacs-devel@m.gmane.org; Thu, 05 May 2005 21:59:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DTrva-0002DH-Hn for emacs-devel@gnu.org; Thu, 05 May 2005 21:46:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DTruK-0000mZ-32 for emacs-devel@gnu.org; Thu, 05 May 2005 21:45:36 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DTrso-0007Za-0y for emacs-devel@gnu.org; Thu, 05 May 2005 21:44:02 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DTrwr-00088R-Qu for emacs-devel@gnu.org; Thu, 05 May 2005 21:48:13 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id j461grog024048 for ; Thu, 5 May 2005 20:42:53 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j461gYF08458; Thu, 5 May 2005 20:42:34 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: emacs-devel@gnu.org 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:36741 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:36741 The old docstrings of define-obsolete-{function,variable}-alias contained statements that if no docstring was provided, that is, `(define-obsolete-{function,variable}-alias 'old 'new)', then OLD would get the docstring of NEW, _unless_ it already had one. This has been replaced with references to the `defalias' and `defvaralias ' docs, which have no such "unless" statements. The "unless" appears to be definitely false in the `function' case. But it is true in the variable case. That is because it is false for defalias, but true for defvaralias. There are two solutions for the variable case. Document the fact in the docstring and Elisp documentation of defvaralias, or make defvaralias behave exactly like defalias and get rid of the "unless" behavior. I prefer the latter. The patch below would implement it. I can install if desired. To be more concrete: After: (defvar var1 "DOC1") (defvar var2 "DOC2") (defvaralias 'var1 'var2) C-h v var1 RET now shows "DOC1", whereas after the patch below it shows "DOC2", which is behavior consistent with defalias. ===File ~/eval.c-diff======================================= *** eval.c 03 May 2005 20:44:24 -0500 1.237 --- eval.c 05 May 2005 19:42:50 -0500 *************** *** 747,752 **** --- 747,754 ---- LOADHIST_ATTACH (symbol); if (!NILP (docstring)) Fput (symbol, Qvariable_documentation, docstring); + else + Fput (symbol, Qvariable_documentation, Qnil); return aliased; } ============================================================