41059Re: Retrieving default values of options from a script
- Nov 19, 2005Nikolai Weibull wrote:
> A. J. Mechelynck wrote:[...]
> [Long and complicated way of getting at the default that doesn't takeRest assured that there was no intention to offend you. There are users
> into acount things such as changes to the default (new operating
> systems, and so on), which only works for the 'fileformat' option.]
> Yes, I know exactly how to do what you describe. Your response actually
> surprises me and I actually feel a bit offended by it. I thought it to
> be obvious that I wasn't asking for a way of simulating the default. I
> was asking for a way to get the _actual_ default, whatever that may be.
> More in the sense of "can we please add a method to do so" than of "I
> haven't read the docs and I don't know what to do", seeing as how I
> described the behavior of the option in question.
> Actually, now that we have hashes in Vim 7, why not provided a hash that
> has the names of options as keys and their values as, well, its values?
> Perhaps also one that has the default values as its values.
of all competence levels on this list; and I was just trying to help
you, showing how I might do it. BTW, it is not so "long and
complicated"; it's just an implementation of what option.txt says as
'fileformat' 'ff' string (MS-DOS, MS-Windows, OS/2 default: "dos",
Unix default: "unix",
Macintosh default: "mac")
The reason it is as long as it is, is that there is no single "has()"
feature name common to all versions of Dos, Windows, and OS/2. If it can
be assumed that all non-Mac non-Unix systems are Dos, Windows or OS/2,
then the third "elseif" can be replaced by "else" and the existing
"else" clause (with its message) deleted altogether.
About "hashes" (do you mean "dictionaries"?), I don't make the policy
decisions for Vim, and I don't write Vim code except in very simple
cases. I suppose that the solution you mention above might be feasible,
but that's for Bram to decide.
- << Previous post in topic