emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible defvar bug


From: Jambunathan K
Subject: Re: Possible defvar bug
Date: Mon, 18 Feb 2013 20:17:35 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

The documentation of `defvar' has the following paragraphs.  I am
certain I don't understand what these paragraphs mean, particularly the
second one.  Just throwing my hat, to see where it lands.

,----  C-h f
| The optional argument INITVALUE is evaluated, and used to set SYMBOL,
| only if SYMBOL's value is void.  If SYMBOL is buffer-local, its
| default value is what is set; buffer-local values are not affected.
| If INITVALUE is missing, SYMBOL's value is not set.
| 
| If SYMBOL has a local binding, then this form affects the local
| binding.  This is usually not what you want.  Thus, if you need to
| load a file defining variables, with this form or with `defconst' or
| `defcustom', you should always load that file _outside_ any bindings
| for these variables.  (`defconst' and `defcustom' behave similarly in
| this respect.)
`----


Tassilo Horn <address@hidden> writes:

> Hi all,
>
> I have a problem in AUCTeX where I get some void-variable error although
> I require the file defining the variable.  After some experimenting,
> I've isolated the problem to this minimal example:
>
>     (let ((crm-separator ","))
>       (require 'crm))
>
> crm.el defines `crm-separator' with some default value.  However, when
> evaluating that snipped, I get:
>
> ,----[ C-h v crm-separator ]
> | crm-separator is a variable defined in `crm.el'.
> | It is void as a variable.
> | 
> | Documentation:
> | Separator regexp used for separating strings in `completing-read-multiple'.
> | It should be a regexp that does not match the list of completion candidates.
> | Modify this value to make `completing-read-multiple' use a separator other
> | than `crm-default-separator'.
> `----
>
> I understand that defvar doesn't override a variable's value if the
> variable is already defined, but is that TRT with dynamic bindings, too?
>
> Bye,
> Tassilo
>
>

-- 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]