unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: John Paul Wallington <jpw@shootybangbang.com>
Cc: emacs-devel@gnu.org
Subject: Re: mentioning variable aliases in `describe-variable'
Date: Fri, 12 Jul 2002 01:30:03 +0100	[thread overview]
Message-ID: <E17SoJv-0001fs-00@bundalo.shootybangbang.com> (raw)
In-Reply-To: <200207111925.g6BJPuO03928@rum.cs.yale.edu> (monnier+gnu/emacs@rum.cs.yale.edu)

> 
> > I think it would be nice to mention when a variable is an alias in
> > `describe-variable'.  What do people think ?
> 
> Go for it, although I'd personally put the info near the
> first line (as is done for function aliases) rather than near
> the bottom.

I like your suggestion.  How about this:

*** help-fns.el	27 Jun 2002 16:10:23 -0000	1.12
--- help-fns.el	12 Jul 2002 00:10:52 -0000
***************
*** 426,431 ****
--- 426,439 ----
  		(save-excursion
  		  (forward-line -1)
  		  (insert "Automatically becomes buffer-local when set in any fashion.\n"))))
+ 	    ;; mention if it's an alias
+ 	    (let ((alias (condition-case nil
+ 			     (indirect-variable variable)
+ 			   (error variable))))
+ 	      (unless (eq alias variable)
+ 		(princ (format "This variable is an alias for `%s'." alias))
+ 		(terpri)
+ 		(terpri)))
  	    (princ "Documentation:")
  	    (terpri)
  	    (let ((obsolete (get variable 'byte-obsolete-variable)))


It could go underneath the Documentation heading, and it could omit an
alias explictly mentioned in the obsolescence note.  Which is what I
did initially; I was keen on it for twenty minutes or so but rejected
it because alias nature isn't really documentation and
`describe-variable' should spell things out rather than silently omit
information.  I thought I would include it so that someone could
reassure me it is wrong :-)

*** help-fns.el	27 Jun 2002 16:10:23 -0000	1.12
--- help-fns.el	11 Jul 2002 23:34:02 -0000
***************
*** 435,444 ****
  		(princ "; ") (terpri)
  		(princ (if (stringp (car obsolete)) (car obsolete)
  			 (format "use `%s' instead." (car obsolete))))
! 		(terpri)))
  	    (let ((doc (documentation-property variable 'variable-documentation)))
  	      (princ (or doc "Not documented as a variable.")))
! 	  
  	    ;; Make a link to customize if this variable can be customized.
  	    ;; Note, it is not reliable to test only for a custom-type property
  	    ;; because those are only present after the var's definition
--- 435,453 ----
  		(princ "; ") (terpri)
  		(princ (if (stringp (car obsolete)) (car obsolete)
  			 (format "use `%s' instead." (car obsolete))))
! 		(terpri))
! 	      ;; mention if it's an alias, unless the variable it is an alias
! 	      ;; for is already mentioned in the obsolescence note
! 	      (let ((alias (condition-case nil
! 			       (indirect-variable variable)
! 			     (error variable))))
! 		(unless (or (eq alias variable)
! 			    (eq alias (car obsolete)))
! 		  (princ (format "This variable is an alias for `%s'." alias))
! 		  (terpri))))
  	    (let ((doc (documentation-property variable 'variable-documentation)))
  	      (princ (or doc "Not documented as a variable.")))
! 
  	    ;; Make a link to customize if this variable can be customized.
  	    ;; Note, it is not reliable to test only for a custom-type property
  	    ;; because those are only present after the var's definition


-- 
John Paul Wallington

  reply	other threads:[~2002-07-12  0:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-10  9:42 mentioning variable aliases in `describe-variable' John Paul Wallington
2002-07-11 19:25 ` Stefan Monnier
2002-07-12  0:30   ` John Paul Wallington [this message]
2002-07-12 10:17     ` Juanma Barranquero
2002-07-12 15:25       ` Stefan Monnier
2002-07-15 15:40         ` Juanma Barranquero
2002-07-16 11:31         ` Juanma Barranquero
2002-07-17  3:04           ` Richard Stallman
2002-07-17  8:02             ` Juanma Barranquero
2002-07-17 13:06               ` arglist in docstring (was: mentioning variable aliases in `describe-variable' ) Stefan Monnier
2002-07-17 13:51                 ` Juanma Barranquero
2002-07-17 14:33                   ` Stefan Monnier
2002-07-17 15:02                     ` Juanma Barranquero
2002-07-17 14:21                 ` Juanma Barranquero
2002-07-17 14:31                   ` Stefan Monnier
2002-07-17 15:15                     ` Juanma Barranquero
2002-07-18 14:55                   ` Richard Stallman
2002-07-18 15:25                     ` Juanma Barranquero
2002-07-18 21:14                       ` Richard Stallman
2002-07-19  6:28                         ` Juanma Barranquero
2002-07-12  7:18   ` mentioning variable aliases in `describe-variable' Juanma Barranquero
2002-07-12  7:55     ` John Paul Wallington
2002-07-12  8:00       ` Miles Bader
2002-07-12  8:47         ` John Paul Wallington
2002-07-12 10:26           ` Juanma Barranquero
2002-07-12 15:25         ` Stefan Monnier

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=E17SoJv-0001fs-00@bundalo.shootybangbang.com \
    --to=jpw@shootybangbang.com \
    --cc=emacs-devel@gnu.org \
    /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).