From 2dc6b27ee7715cc7d50944a5bbde0a4d3e97771a Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 23 Nov 2019 01:09:09 +0100 Subject: input: export input.conf comments ot input-bindings property This is supposed to turn input.conf comments into inline documentation. Whether this will be useful depends on whether there'll be a script using this field. This changes a small aspect of input.conf parsing fundamentally: this attempts to strip comments/whitespace from the command string, which will later be used to generate the command when a key binding is executed. This should not have any negative effects, but there could be unknown bugs. (For some reason, every command is parsed when input.conf is parsed, but it still only stores the string for the command. I guess that saves some minor amount of memory.) --- DOCS/man/input.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'DOCS/man/input.rst') diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst index 3788c4fd61..929f216692 100644 --- a/DOCS/man/input.rst +++ b/DOCS/man/input.rst @@ -2652,8 +2652,8 @@ Property list ``cmd`` The command mapped to the key. (Currently, this is exactly the same - string as specified in the source. It's possible that it will be - normalized in the future.) + string as specified in the source, other than stripping whitespace and + comments. It's possible that it will be normalized in the future.) ``is_weak`` If set to true, any existing and active user bindings will take priority. @@ -2674,6 +2674,11 @@ Property list in some cases. In addition, this value is dynamic and can change around at runtime. + ``comment`` + If available, the comment following the command on the same line. (For + example, the input.conf entry ``f cycle bla # toggle bla`` would + result in an entry with ``comment = "toggle bla", cmd = "cycle bla"``.) + This property is read-only, and change notification is not supported. Currently, there is no mechanism to change key bindings at runtime, other than scripts adding or removing their own bindings. -- cgit v1.2.3