[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: doc string of `local-variable-if-set-p'
From: |
Luc Teirlinck |
Subject: |
Re: doc string of `local-variable-if-set-p' |
Date: |
Wed, 13 Oct 2004 13:25:55 -0500 (CDT) |
David Kastrup wrote:
Oh, come on, that is mathematician speak, working with parens. Just
say:
Non-nil if after setting the VARIABLE in buffer BUFFER it will be
local, either because it is already so, or because it is automatic
buffer-local (see `make-variable-buffer-local').
That first line is way too long (needs to be 67 characters or less).
I believe that the new first line I sent is clear.
However, can anybody tell me what the point of the BUFFER argument is?
It makes it hard to find out whether a variable that might already
have a local binding is automatic buffer-local.
I believe you misunderstand the purpose of `local-variable-if-set-p'.
`(local-variable-p var)' tests whether VAR actually _has_ a buffer
local binding in BUFFER.
`(local-variable-if-set-p var)' tests whether VAR would have a
buffer-local binding in buffer if we would bind it right now.
See the ielm run I sent earlier.
Concerning the second paragraph quoted above: you want to check
whether variable is automatically buffer-local when set.
`describe-variable' does this as follows:
(when (and (local-variable-if-set-p variable)
(or (not (local-variable-p variable))
(with-temp-buffer
(local-variable-if-set-p variable))))
(save-excursion
(forward-line -1)
(insert "Automatically becomes buffer-local when set in any fashion.\n")))
I do not know whether there is a better way to do it. If there is a
one, then the above piece of code should be changed to use it.
Sincerely,
Luc.
- doc string of `local-variable-if-set-p', Masatake YAMATO, 2004/10/13
- Re: doc string of `local-variable-if-set-p', Stefan, 2004/10/13
- Re: doc string of `local-variable-if-set-p', Masatake YAMATO, 2004/10/13
- Re: doc string of `local-variable-if-set-p', Andreas Schwab, 2004/10/13
- Re: doc string of `local-variable-if-set-p', Richard Stallman, 2004/10/14
- Re: doc string of `local-variable-if-set-p', Miles Bader, 2004/10/14
- Re: doc string of `local-variable-if-set-p', Luc Teirlinck, 2004/10/14
- Re: doc string of `local-variable-if-set-p', Daniel Brockman, 2004/10/14
- Re: doc string of `local-variable-if-set-p', Luc Teirlinck, 2004/10/14
- Re: doc string of `local-variable-if-set-p', Daniel Brockman, 2004/10/14
- Re: doc string of `local-variable-if-set-p', Luc Teirlinck, 2004/10/15
- Re: doc string of `local-variable-if-set-p', Daniel Brockman, 2004/10/15
- Re: doc string of `local-variable-if-set-p', Luc Teirlinck, 2004/10/15