New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
buffer_autoset.py's functionality should be in WeeChat itself #352
Comments
I agree 100%, I was going to leave the same comment. |
Could this be part of the trigger plugin? |
it should be part of core. |
Hi, This is scheduled for 4.1.0. Question to the users of the script, which properties are you setting in your buffers? I ask because the script uses a timer to delay the set of variables. So if possible, I'll reimplement the feature without using a timer, so the workflow will be like this:
New options are The value of option is evaluated (it was not done by the script). The command Examples:
|
mine are: notify, highlight_words, title, time_for_each_line, short_name, clear, key_bind, localvar_set, hidden |
|
Thanks @pascalpoitras & @0xallie, which local variables are you setting? (just to be sure they can't get overwritten after setting them with these new options) |
@flashcode only custom one not those provided by weechat except if short_name is considered a var. I mean it is display in /buffer listvar but still it is not set using localvar_set. |
@pascalpoitras: OK. |
@flashcode ah my bad it's name not short_name |
Yes |
Will the options for a buffer be renamed if the buffer is renamed?
Should we distinguish between buffer properties and localvars, or should one just use |
I am using this: |
Not planned, and not easy as you can use mask as well (this is not done by the script buffer_autoset.py).
|
You're asking if we should add an option to control the behavior of /buffer set (permanent or not) so we should maybe do this instead
then when we want it to be permanent we use the /buffer_autoset command? |
@pascalpoitras: then it could just be a parameter like |
@flashcode yes, one or another is ok with me |
but /buffer doesn't take name juste a property and value so how to match multiple buffer ? EDIT: I guess we could use /command -buffer |
Or syntax could be different: |
I pushed a branch https://github.com/weechat/weechat/tree/options-buffer-properties for tests. For now it just adds the new options The properties are applied only when the buffers are opened. |
tested, works great |
To stay consistent with other
That means the following parameter is going to be added:
The property will be completed with all properties (like The property is immediately applied in the current buffer, and option The option must be removed with |
Sounds good! |
Done, branch merged to master. Your feedback is welcome, please test with your existing buffer_autoset config and report any issue, thanks! |
Great! I noticed that if you don't provide a value, the option is not considered changed by fset (not colored, doesn't show up when listing diff with I tried using this for changing the key bindings in fset, and it changes the binding when you set the option or use setauto, but if i close and reopen the buffer, the default bindings are back. So maybe the options are applied before the default fset bindings are set? I would also like a way for users to discover what key bindings are set in a buffer, and maybe a more user friendly way of changing them (or at least a documented way). For normal key bindings, all options for them are created and shown in fset, so that's an option. However, this might not be a good approach for these dynamic options, as a lot of them might be created if you have many buffers with custom bindings (e.g. if the irc plugin or wee-slack created key bindings for their normal buffers), which would create a lot of clutter. So not sure what the best solution is here.
Why are localvars only completed for setauto, and not set? Also, would be nice if key_bind_xxx and key_unbind_xxx for the current bindings autocompleted with both as well. |
I'll check how to do that, but not so easy: the default value of these options is empty string, and if you create an option with empty string, it's then considered as not changed on fset buffer.
Yes, I'll change this in fset plugin to define keys during the buffer creation, so user options will always apply after.
Yes to be discussed, not sure using these options is the best approach for this.
Because local variables are manager with
Yes, will add this. |
Hm, okay, I haven't looked into it, so not sure. What's the reason new options with an empty value is not considered changed?
Ah, right, makes sense. Thanks for the other fixes. |
There's no easy way in API to know it's a "new" option, vs an option that exists by default. |
Maybe it's working as intended, but in order to bind
Without,
|
@lacygoill: good catch, this is because now all buffer properties (including "key_bind_xxx") are immediately evaluated, while they were not with buffer_autoset.py. There are multiple possible solutions, I think first one is the best:
|
…in options weechat.buffer.* (issue #352)
Currently,
buffer_autoset.py
is the only way to save buffer settings.The text was updated successfully, but these errors were encountered: