unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4395: 23.1; byte-compiler loses top-level (put 'x...)
@ 2009-09-11  0:04 Drew Adams
  2009-09-11  2:22 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2009-09-11  0:04 UTC (permalink / raw)
  To: bug-gnu-emacs

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)'
 







^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#4395: 23.1; byte-compiler loses top-level (put 'x...)
  2009-09-11  0:04 bug#4395: 23.1; byte-compiler loses top-level (put 'x...) Drew Adams
@ 2009-09-11  2:22 ` Stefan Monnier
  2009-09-11 14:23   ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2009-09-11  2:22 UTC (permalink / raw)
  To: Drew Adams; +Cc: 4395

> C-h v the-var
 
> The doc shown is the original doc string. The top-level `put' had no
> effect.

I cannot reproduce this.  Neither with Debian's Emacs-23.1, nor with the
CVS trunk.


        Stefan





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#4395: 23.1; byte-compiler loses top-level (put 'x...)
  2009-09-11  2:22 ` Stefan Monnier
@ 2009-09-11 14:23   ` Drew Adams
  2009-09-11 18:59     ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2009-09-11 14:23 UTC (permalink / raw)
  To: 'Stefan Monnier'; +Cc: 4395

> > C-h v the-var
>  
> > The doc shown is the original doc string. The top-level `put' had no
> > effect.
> 
> I cannot reproduce this.  Neither with Debian's Emacs-23.1, 
> nor with the CVS trunk.

Perhaps it is Windows-only, then.

What is the behavior you saw? Did the put take place in the byte-compiled file?
When you used C-h v, did you see the new doc string (from the put), instead of
the original one?






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#4395: 23.1; byte-compiler loses top-level (put 'x...)
  2009-09-11 14:23   ` Drew Adams
@ 2009-09-11 18:59     ` Stefan Monnier
  2009-09-11 20:31       ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2009-09-11 18:59 UTC (permalink / raw)
  To: Drew Adams; +Cc: 4395

>> > C-h v the-var
>> 
>> > The doc shown is the original doc string. The top-level `put' had no
>> > effect.
>> 
>> I cannot reproduce this.  Neither with Debian's Emacs-23.1, 
>> nor with the CVS trunk.

> Perhaps it is Windows-only, then.

Everything's possible, tho it does sound unlikely.

> What is the behavior you saw? Did the put take place in the
> byte-compiled file?  When you used C-h v, did you see the new doc
> string (from the put), instead of the original one?

The "expected" one.  Yes.  Yes.
Maybe if you give a more complete and detailed recipe (showing the
exact file content (I used files containing the code you suggested,
with the "..." stripped out), the commands you use to compile the files,
when you exit Emacs and restart it, ...) we can get to the bottom of it.


        Stefan





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#4395: 23.1; byte-compiler loses top-level (put 'x...)
  2009-09-11 18:59     ` Stefan Monnier
@ 2009-09-11 20:31       ` Drew Adams
  0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2009-09-11 20:31 UTC (permalink / raw)
  To: 'Stefan Monnier'; +Cc: 4395

> > What is the behavior you saw? Did the put take place in the
> > byte-compiled file?  When you used C-h v, did you see the new doc
> > string (from the put), instead of the original one?
> 
> The "expected" one.  Yes.  Yes.
> Maybe if you give a more complete and detailed recipe (showing the
> exact file content (I used files containing the code you suggested,
> with the "..." stripped out), the commands you use to compile 
> the files, when you exit Emacs and restart it, ...) we can get
> to the bottom of it.

I can't reproduce it now either. I'll try to find an old version of the file
that produced the problem. Probably it was user error in some way. Thx.






^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-09-11 20:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-11  0:04 bug#4395: 23.1; byte-compiler loses top-level (put 'x...) Drew Adams
2009-09-11  2:22 ` Stefan Monnier
2009-09-11 14:23   ` Drew Adams
2009-09-11 18:59     ` Stefan Monnier
2009-09-11 20:31       ` Drew Adams

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).