1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00
Sébastien Helleu d56e46908f script: track per-script theme contributions and purge on script unload
Make individual scripts the unit of ownership for theme contributions
so that loading a script that calls weechat.theme_register(...) and
later unloading it correctly removes the script's overrides.

Plugin API addition (weechat-plugin.h):

  - new function pointer t_weechat_plugin.theme_unregister_script
    delegates to core's theme_unregister_script.
  - new convenience macro weechat_theme_unregister_script(script).
  - WEECHAT_PLUGIN_API_VERSION bumped to 20260527-02.

Script API additions (plugin-script-api.{c,h}):

  - new plugin_script_api_theme_register (plugin, script, name,
    overrides) forwards to the plugin API with the script pointer
    as the contribution owner, so contributions are tracked
    per-script (not per script-language plugin).

Lifecycle wiring (plugin-script.c):

  - new file-local plugin_script_remove_themes (plugin, script)
    calls weechat_theme_unregister_script.
  - plugin_script_remove now calls it alongside the other
    plugin_script_remove_* helpers, so script-unload tears down
    everything (configs, bar items, themes, hooks).

Eight language bindings updated to call
plugin_script_api_theme_register instead of weechat_theme_register
directly, so they pass the script pointer as owner:

  - python, perl, ruby, lua, tcl, javascript, php, guile.

The behavior change is end-to-end visible only at script unload:
before, an unloaded script's theme overrides lingered in the
registry forever and would be re-applied on the next /theme apply;
after, they vanish when the script unloads. /plugin unload of an
entire script-language plugin already worked via commit 24's hook
in plugin_remove (which drops both plugin-only contributions and
their script-owned children when the language plugin itself goes
away, because the contribution's plugin pointer matches).

No new unit tests in this commit: the underlying theme_unregister_script
function is covered by TEST(CoreTheme, UnregisterByOwner), and the
remaining changes are plumbing.
2026-06-08 09:39:22 +02:00
2026-06-07 21:56:22 +02:00
2026-06-07 21:56:22 +02:00
2026-03-08 10:37:15 +01:00
2026-03-08 10:37:15 +01:00
2026-03-08 10:37:15 +01:00
2026-03-08 10:37:15 +01:00
2026-03-08 10:37:15 +01:00
2026-03-08 10:37:15 +01:00
2026-03-08 10:37:15 +01:00
2026-06-07 11:51:55 +02:00
2026-03-29 18:39:02 +02:00
2026-03-08 10:37:15 +01:00
2021-09-11 00:17:36 +02:00
2026-03-08 10:37:15 +01:00
2026-03-08 10:37:15 +01:00
2026-06-07 11:51:55 +02:00

WeeChat

WeeChat

Mastodon X Devel blog Donate

CI Code coverage REUSE status

WeeChat (Wee Enhanced Environment for Chat) is a free chat client, fast and light, designed for many operating systems.
It is highly customizable and extensible with scripts.

Homepage: https://weechat.org/

Features

  • Modular chat client: WeeChat has a lightweight core and optional plugins. All plugins (including IRC) are independent and can be unloaded.
  • Multi-platform: WeeChat runs on GNU/Linux, *BSD, GNU/Hurd, Haiku, macOS and Windows (WSL and Cygwin).
  • Multi-protocol: WeeChat is designed to support multiple protocols via plugins, like IRC.
  • Standards-compliant: the IRC plugin is compliant with RFCs 1459, 2810, 2811, 2812, 2813 and 7194.
  • Small, fast, and very light: the core is and should stay as light and fast as possible.
  • Customizable and extensible: there are a lot of options to customize WeeChat, and it is extensible with C plugins and scripts (Perl, Python, Ruby, Lua, Tcl, Scheme, JavaScript and PHP).
  • Fully documented: there is comprehensive documentation, which is translated into several languages.
  • Developed from scratch: WeeChat was built from scratch and is not based on any other client.
  • Free software: WeeChat is released under GPLv3.

WeeChat

On WeeChat's website you can find more screenshots.

Installation

WeeChat can be installed using your favorite package manager (recommended) or by compiling it yourself.
For detailed instructions, please check the WeeChat user's guide.

Semantic versioning

WeeChat follows "practical" semantic versioning; see CONTRIBUTING.md.

Copyright © 2003-2026 Sébastien Helleu

This file is part of WeeChat, the extensible chat client.

WeeChat is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

WeeChat is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with WeeChat. If not, see https://www.gnu.org/licenses/.

Languages
C 79.5%
C++ 17.8%
Python 1.6%
CMake 0.8%
Shell 0.2%
Other 0.1%