GNU bug report logs - #4395
23.1; byte-compiler loses top-level (put 'x...)

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Fri, 11 Sep 2009 00:15:03 UTC

Severity: normal

Done: Juanma Barranquero <lekktu <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 23.1; byte-compiler loses top-level (put 'x...)
Date: Thu, 10 Sep 2009 17:04:59 -0700
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)'
 





This bug report was last modified 15 years and 275 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.