unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Subject: defvaralias
Date: Thu, 5 May 2005 20:42:34 -0500 (CDT)	[thread overview]
Message-ID: <200505060142.j461gYF08458@raven.dms.auburn.edu> (raw)

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;
  }
============================================================

             reply	other threads:[~2005-05-06  1:42 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-06  1:42 Luc Teirlinck [this message]
2005-05-06  2:01 ` defvaralias Luc Teirlinck
2005-05-06  4:30 ` defvaralias Nick Roberts
2005-05-06 14:56   ` defvaralias Luc Teirlinck
2005-05-07  1:19     ` defvaralias Nick Roberts
2005-05-07  1:32       ` defvaralias Luc Teirlinck
2005-05-07 15:11         ` defvaralias Stefan Monnier
2005-05-07 15:33           ` defvaralias Luc Teirlinck
2005-05-07 15:39           ` defvaralias Luc Teirlinck
2005-05-07 18:35       ` defvaralias Richard Stallman
2005-05-06 15:43   ` defvaralias Luc Teirlinck
2005-05-06 18:51 ` defvaralias Richard Stallman
2005-05-06 22:39   ` defvaralias Luc Teirlinck
2005-05-07 18:35     ` defvaralias Richard Stallman
2005-05-07 18:44       ` defvaralias Luc Teirlinck
2005-05-07 19:31         ` defvaralias Luc Teirlinck
2005-05-07 20:09         ` defvaralias Juanma Barranquero
2005-05-07 20:54           ` defvaralias Luc Teirlinck
2005-05-07 20:04       ` defvaralias Juanma Barranquero
2005-05-08 16:11         ` defvaralias Richard Stallman
2005-05-08 16:41           ` defvaralias Luc Teirlinck
2005-05-07  9:26 ` defvaralias Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2003-10-28  1:25 defvaralias Luc Teirlinck
2003-10-28  2:08 ` defvaralias Miles Bader
2003-10-28  2:29   ` defvaralias Luc Teirlinck
2003-10-29 19:02 ` defvaralias Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200505060142.j461gYF08458@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).