diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 8db9cc176..fcc45803d 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -24,6 +24,7 @@ New features:: Improvements:: + * core: add a warning in header of configuration files to not edit by hand (issue #851) * irc: change default value of option irc.network.lag_reconnect to 300 (issue #818) * trigger: do not hide email in command "/msg nickserv register password email" (issue #849) diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c index 7a6f3591f..156e3d4bb 100644 --- a/src/core/wee-config-file.c +++ b/src/core/wee-config-file.c @@ -2459,13 +2459,23 @@ config_file_write_internal (struct t_config_file *config_file, } /* write header with name of config file and WeeChat version */ - if (!string_fprintf (config_file->file, "#\n")) - goto error; - if (!string_fprintf (config_file->file, - "# %s -- %s\n#\n", - version_get_name (), - config_file->filename)) + if (!string_fprintf ( + config_file->file, + "#\n" + "# %s -- %s\n" + "#\n" + "# WARNING: It is NOT recommended to edit this file by hand,\n" + "# especially if WeeChat is running.\n" + "#\n" + "# Use /set or similar command to change settings in WeeChat.\n" + "#\n" + "# For more info, see: https://weechat.org/doc/quickstart\n" + "#\n", + version_get_name (), + config_file->filename)) + { goto error; + } /* write all sections */ for (ptr_section = config_file->sections; ptr_section;