all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <bug-gnu-emacs@gnu.org>
Subject: bug#4395: 23.1; byte-compiler loses top-level (put 'x...)
Date: Thu, 10 Sep 2009 17:04:59 -0700	[thread overview]
Message-ID: <E9CD440DCD85477597B1C8A4981B458A@us.oracle.com> (raw)

1. 
 
emacs -Q
 
Put these sexps somewhere at the top level of a file foo.el:
 
(require 'bar)
...
(put 'thevar 'variable-documentation "The new doc string")
...
(provide 'foo)
 
Put these sexps in file bar.el:
 
(defvar thevar 42 "Original doc string.")
...
(provide 'bar)
 
Byte-compile the files.
 
emacs -Q
 
Load library foo.
 
C-h v the-var
 
The doc shown is the original doc string. The top-level `put' had no
effect.
 
Doing the same thing using the *.el instead of *.elc works - no
problem.
 
It also works, with the byte-compiled files, if you wrap the `put'
sexp in `when':
 
(when t (put 'foovar 'variable-documentation "The new doc string"))
 
(Actually, I tried with (require 'XXX) instead of t.)
 

2. It also works with the byte-compiled files, if you add a vacuous
defvar to foo.el:
 
(defvar thevar)
(put 'thevar 'variable-documentation "The new doc string")
 
That is the approach used in library cc-vars.el. If this is a
recommended cliche, or is the only good way to change the doc string
of a var, then it needs to be documented in the Elisp manual.
 

3. Feature request: Have something similar to defadvice for a
variable, at least to be able to add to its doc string.
 
 
 

In GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600)
 of 2009-07-29 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.4)'
 







             reply	other threads:[~2009-09-11  0:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11  0:04 Drew Adams [this message]
2009-09-11  2:22 ` bug#4395: 23.1; byte-compiler loses top-level (put 'x...) Stefan Monnier
2009-09-11 14:23   ` Drew Adams
2009-09-11 18:59     ` Stefan Monnier
2009-09-11 20:31       ` Drew Adams

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

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

  git send-email \
    --in-reply-to=E9CD440DCD85477597B1C8A4981B458A@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=4395@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.