====== Revised configuration (Future feature) ====== This is a **draft** of how the new configuration might look. It's also out of sync with the on-going naming/type-safe revamp. **Nothing here is definitive,** let me know if you have any suggestions. ===== New syntax ===== Up until now the configuration file syntax is vaguely defined, specially when it comes to variables resolution. A new syntax will be introduced with a clearer definition. ==== Standard options ==== i.e. current syntax: ''OPTION=value'' will be a string assignment so ''OPTION=some $value'' will mean ''OPTION'' value is literally ''some $value'' ==== Literal value ==== In ''OPTION= value # comment'', ''OPTION'' takes the value "value", trimmed of spaces and without comment. In ''OPTION=| value # comment|'', ''OPTION'' takes the value " value # comment" FIXME Support unmatched? (''OPTION=| value # comment'') ==== Inline comments ==== Inline comments will be explicitly allowed, ''#'' can be included in values through the use of Literal assignments (''=|''). FIXME Maybe also through some escape sequence. ==== Variable resolution ==== In ''OPTION=$value'', ''OPTION'' takes the value "$value", literally. In ''OPTION=$value$'', ''OPTION'' takes the value of the variable ''$value''. FIXME Support unmatched? (''OPTION=$value'') ==== Local variables ==== Variables local to a configuration file will be allowed, so that: bg_sign=DarkSlateGray bg_heading=DarkSlateGray bg_title=DarkSlateGray Can be simplified as: mycolor:=DarkSlateGray bg_sign=$mycolor$ bg_heading=$mycolor$ bg_title=$mycolor$ FIXME All other syntax changes use modified ''='' syntax with a postfix, might be more efficient to use them too (i.e. ''=:value'' instead of '':=value'') ==== FIXME Delayed variable resolution ==== (Upon consideration) ''OPTION=>$value$'' will take the same value the variable ''$value'' has **when** OPTION is used (i.e. instead of the value it has when the configuration is parsed). ===== New location ===== Currently per-user configuration is located in ''~/.vcs.conf'', it will probably be moved to a dot-directory (candidates are ''~/.vcs'', ''~/.config/vcs'', or maybe ''~/.local/share/vcs'').\\ Also ''/etc/vcs'' for site-wide config.\\ The switch to directories won't be required until some of the features using extra files (like profiles and plugins) are implemented. Specs for ''~/.local/share'' and ''~/.config'' http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html Notes: * ''~/.config'' appears to be an XDG standard and apparently should be limited to standard-specific uses ((http://lists.freedesktop.org/archives/xdg/2004-October/003620.html))