diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a73a06ab..f1a62fb9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,8 +88,6 @@ option(ENABLE_NLS "Enable Native Language Support" ON) option(ENABLE_GNUTLS "Enable SSLv3/TLS support" ON) option(ENABLE_LARGEFILE "Enable Large File Support" ON) option(ENABLE_ALIAS "Enable Alias plugin" ON) -option(ENABLE_ASPELL "Enable Aspell plugin" ON) -option(ENABLE_ENCHANT "Enable Enchant lib for Aspell plugin" OFF) option(ENABLE_BUFLIST "Enable Buflist plugin" ON) option(ENABLE_CHARSET "Enable Charset plugin" ON) option(ENABLE_EXEC "Enable Exec plugin" ON) @@ -109,6 +107,8 @@ option(ENABLE_TCL "Enable Tcl scripting language" ON) option(ENABLE_GUILE "Enable Scheme (guile) scripting language" ON) option(ENABLE_JAVASCRIPT "Enable JavaScript scripting language" ON) option(ENABLE_PHP "Enable PHP scripting language" ON) +option(ENABLE_SPELL "Enable Spell checker plugin" ON) +option(ENABLE_ENCHANT "Enable Enchant lib for Spell checker plugin" OFF) option(ENABLE_TRIGGER "Enable Trigger plugin" ON) option(ENABLE_XFER "Enable Xfer plugin" ON) option(ENABLE_MAN "Enable build of man page" OFF) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index f6f4da2b2..10cf002cd 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -18,9 +18,13 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] [[v2.5]] == Version 2.5 (under dev) +New features:: + + * spell: rename aspell plugin to spell (issue #1299) + Bug fixes:: - * aspell: fix detection of nick followed by the nick completer (issue #1306, issue #1307) + * spell: fix detection of nick followed by the nick completer (issue #1306, issue #1307) Build:: diff --git a/README.adoc b/README.adoc index 600b12329..9a67f513f 100644 --- a/README.adoc +++ b/README.adoc @@ -50,7 +50,7 @@ Following packages are optional: * for i18n: gettext * for SSL: gnutls, ca-certificates -* for spell checking: aspell +* for spell checking: aspell or enchant * for scripting: python, perl, ruby, lua, tcl, guile, libv8 (javascript), php * for building doc and man page: asciidoctor * for building tests: C++ compiler, CppUTest diff --git a/ReleaseNotes.adoc b/ReleaseNotes.adoc index 9e151ccf0..767202f0c 100644 --- a/ReleaseNotes.adoc +++ b/ReleaseNotes.adoc @@ -17,6 +17,23 @@ https://weechat.org/files/changelog/ChangeLog-devel.html[ChangeLog] (file _ChangeLog.adoc_ in sources). +[[v2.5]] +== Version 2.5 (under dev) + +[[v2.5_aspell_plugin_renamed]] +=== Aspell plugin renamed to Spell + +The "aspell" plugin has been renamed to "spell". + +Consequently, the following things have been renamed as well: + +* file _aspell.conf_ renamed to _spell.conf_; the content of the + file has not changed, so you can just rename the file to keep your changes +* options _aspell.*_ have been renamed to _spell.*_ +* bar item _aspell_dict_ renamed to _spell_dict_ +* bar item _aspell_suggest_ renamed to _spell_suggest_ +* info _aspell_dict_ renamed to _spell_dict_ + [[v2.4]] == Version 2.4 (2019-02-17) diff --git a/configure.ac b/configure.ac index ec308b8ef..435929326 100644 --- a/configure.ac +++ b/configure.ac @@ -108,7 +108,6 @@ AH_VERBATIM([HAVE_ASPELL_VERSION_STRING], [#undef HAVE_ASPELL_VERSION_STRING]) AH_VERBATIM([HAVE_ENCHANT_GET_VERSION], [#undef HAVE_ENCHANT_GET_VERSION]) AH_VERBATIM([HAVE_GUILE_GMP_MEMORY_FUNCTIONS], [#undef HAVE_GUILE_GMP_MEMORY_FUNCTIONS]) AH_VERBATIM([PLUGIN_ALIAS], [#undef PLUGIN_ALIAS]) -AH_VERBATIM([PLUGIN_ASPELL], [#undef PLUGIN_ASPELL]) AH_VERBATIM([PLUGIN_BUFLIST], [#undef PLUGIN_BUFLIST]) AH_VERBATIM([PLUGIN_CHARSET], [#undef PLUGIN_CHARSET]) AH_VERBATIM([PLUGIN_EXEC], [#undef PLUGIN_EXEC]) @@ -126,6 +125,7 @@ AH_VERBATIM([PLUGIN_PHP], [#undef PLUGIN_PHP]) AH_VERBATIM([PLUGIN_TCL], [#undef PLUGIN_TCL]) AH_VERBATIM([PLUGIN_GUILE], [#undef PLUGIN_GUILE]) AH_VERBATIM([PLUGIN_JAVASCRIPT], [#undef PLUGIN_JAVASCRIPT]) +AH_VERBATIM([PLUGIN_SPELL], [#undef PLUGIN_SPELL]) AH_VERBATIM([PLUGIN_TRIGGER], [#undef PLUGIN_TRIGGER]) AH_VERBATIM([PLUGIN_XFER], [#undef PLUGIN_XFER]) AH_VERBATIM([TESTS], [#undef TESTS]) @@ -141,8 +141,6 @@ AC_ARG_ENABLE(headless, [ --disable-headless turn off headless binary AC_ARG_ENABLE(gnutls, [ --disable-gnutls turn off gnutls support (default=compiled if found)],enable_gnutls=$enableval,enable_gnutls=yes) AC_ARG_ENABLE(largefile, [ --disable-largefile turn off Large File Support (default=on)],enable_largefile=$enableval,enable_largefile=yes) AC_ARG_ENABLE(alias, [ --disable-alias turn off Alias plugin (default=compiled)],enable_alias=$enableval,enable_alias=yes) -AC_ARG_ENABLE(aspell, [ --disable-aspell turn off Aspell plugin (default=compiled)],enable_aspell=$enableval,enable_aspell=yes) -AC_ARG_ENABLE(enchant, [ --enable-enchant turn on Enchant lib for Aspell plugin (default=off)],enable_enchant=$enableval,enable_enchant=no) AC_ARG_ENABLE(buflist, [ --disable-buflist turn off Buflist plugin (default=compiled)],enable_buflist=$enableval,enable_buflist=yes) AC_ARG_ENABLE(charset, [ --disable-charset turn off Charset plugin (default=compiled)],enable_charset=$enableval,enable_charset=yes) AC_ARG_ENABLE(exec, [ --disable-exec turn off Exec plugin (default=compiled)],enable_exec=$enableval,enable_exec=yes) @@ -162,6 +160,8 @@ AC_ARG_ENABLE(tcl, [ --disable-tcl turn off Tcl script plugi AC_ARG_ENABLE(guile, [ --disable-guile turn off Guile (scheme) script plugin (default=compiled if found)],enable_guile=$enableval,enable_guile=yes) AC_ARG_ENABLE(javascript, [ --disable-javascript turn off JavaScript script plugin (default=compiled if found)],enable_javascript=$enableval,enable_javascript=yes) AC_ARG_ENABLE(php, [ --disable-php turn off PHP script plugin (default=compiled if found)],enable_php=$enableval,enable_php=yes) +AC_ARG_ENABLE(spell, [ --disable-spell turn off Spell checker plugin (default=compiled)],enable_spell=$enableval,enable_spell=yes) +AC_ARG_ENABLE(enchant, [ --enable-enchant turn on Enchant lib for Spell checker plugin (default=off)],enable_enchant=$enableval,enable_enchant=no) AC_ARG_ENABLE(trigger, [ --disable-trigger turn off Trigger plugin (default=compiled)],enable_trigger=$enableval,enable_trigger=yes) AC_ARG_ENABLE(xfer, [ --disable-xfer turn off Xfer (file transfer) plugin (default=compiled)],enable_xfer=$enableval,enable_xfer=yes) AC_ARG_WITH(tclconfig, [ --with-tclconfig=DIR directory containing tcl configuration (tclConfig.sh)],tclconfig=$withval,tclconfig='') @@ -322,79 +322,6 @@ else not_asked="$not_asked alias" fi -# ---------------------------------- aspell ------------------------------------ - -if test "x$enable_aspell" = "xyes" ; then - ac_found_enchant_lib="no" - if test "x$enable_enchant" = "xyes" ; then - PKG_CHECK_MODULES(ENCHANT, [enchant], ac_found_enchant_lib="yes", ac_found_enchant_lib="no") - fi - if test "x$ac_found_enchant_lib" = "xyes" ; then - CFLAGS="$CFLAGS -DUSE_ENCHANT" - ASPELL_LIB_USED="enchant" - - # check if function enchant_get_version() exists - ac_save_CFLAGS="$CFLAGS" - ac_save_LDFLAGS="$LDFLAGS" - CFLAGS="$CFLAGS $ENCHANT_CFLAGS" - LDFLAGS="$LDFLAGS $ENCHANT_LIBS" - AC_CACHE_CHECK([for enchant_get_version() support], ac_cv_have_enchant_get_version, [ - AC_LINK_IFELSE([AC_LANG_PROGRAM( - [[ #include ]], - [[ const char *version = enchant_get_version(); ]])], - [ ac_have_enchant_get_version="yes" ], - [ ac_have_enchant_get_version="no" ])]) - CFLAGS="$ac_save_CFLAGS" - LDFLAGS="$ac_save_LDFLAGS" - if test "x$ac_have_enchant_get_version" = "xyes"; then - AC_DEFINE(HAVE_ENCHANT_GET_VERSION) - fi - else - ASPELL_CFLAGS="" - ASPELL_LFLAGS="" - - AC_CHECK_HEADER(aspell.h,ac_found_aspell_header="yes",ac_found_aspell_header="no") - AC_CHECK_LIB(aspell,new_aspell_speller,ac_found_aspell_lib="yes",ac_found_aspell_lib="no") - - AC_MSG_CHECKING(for aspell headers and libraries) - if test "x$ac_found_aspell_header" = "xno" -o "x$ac_found_aspell_lib" = "xno" ; then - AC_MSG_RESULT(no) - AC_MSG_WARN([ -*** Aspell headers and/or libraries couldn't be found on your system. -*** Try to install them with your software package manager. -*** WeeChat will be built without Aspell support.]) - enable_aspell="no" - not_found="$not_found aspell" - else - AC_MSG_RESULT(yes) - ASPELL_LFLAGS="$ASPELL_LFLAGS -laspell" - ASPELL_LIB_USED="aspell" - - # check if function aspell_version_string() exists - ac_save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $ASPELL_LFLAGS" - AC_CACHE_CHECK([for aspell_version_string() support], ac_cv_have_aspell_version_string, [ - AC_LINK_IFELSE([AC_LANG_PROGRAM( - [[ #include ]], - [[ const char *version = aspell_version_string(); ]])], - [ ac_have_aspell_version_string="yes" ], - [ ac_have_aspell_version_string="no" ])]) - LDFLAGS="$ac_save_LDFLAGS" - if test "x$ac_have_aspell_version_string" = "xyes"; then - AC_DEFINE(HAVE_ASPELL_VERSION_STRING) - fi - fi - fi -else - not_asked="$not_asked aspell" -fi - -if test "x$enable_aspell" = "xyes" ; then - AC_SUBST(ASPELL_CFLAGS) - AC_SUBST(ASPELL_LFLAGS) - AC_DEFINE(PLUGIN_ASPELL) -fi - # --------------------------------- buflist ------------------------------------ if test "x$enable_buflist" = "xyes" ; then @@ -1053,6 +980,79 @@ if test "x$enable_php" = "xyes" ; then AC_DEFINE(PLUGIN_PHP) fi +# ----------------------------------- spell ------------------------------------ + +if test "x$enable_spell" = "xyes" ; then + ac_found_enchant_lib="no" + if test "x$enable_enchant" = "xyes" ; then + PKG_CHECK_MODULES(ENCHANT, [enchant], ac_found_enchant_lib="yes", ac_found_enchant_lib="no") + fi + if test "x$ac_found_enchant_lib" = "xyes" ; then + CFLAGS="$CFLAGS -DUSE_ENCHANT" + SPELL_LIB_USED="enchant" + + # check if function enchant_get_version() exists + ac_save_CFLAGS="$CFLAGS" + ac_save_LDFLAGS="$LDFLAGS" + CFLAGS="$CFLAGS $ENCHANT_CFLAGS" + LDFLAGS="$LDFLAGS $ENCHANT_LIBS" + AC_CACHE_CHECK([for enchant_get_version() support], ac_cv_have_enchant_get_version, [ + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [[ #include ]], + [[ const char *version = enchant_get_version(); ]])], + [ ac_have_enchant_get_version="yes" ], + [ ac_have_enchant_get_version="no" ])]) + CFLAGS="$ac_save_CFLAGS" + LDFLAGS="$ac_save_LDFLAGS" + if test "x$ac_have_enchant_get_version" = "xyes"; then + AC_DEFINE(HAVE_ENCHANT_GET_VERSION) + fi + else + ASPELL_CFLAGS="" + ASPELL_LFLAGS="" + + AC_CHECK_HEADER(aspell.h,ac_found_aspell_header="yes",ac_found_aspell_header="no") + AC_CHECK_LIB(aspell,new_aspell_speller,ac_found_aspell_lib="yes",ac_found_aspell_lib="no") + + AC_MSG_CHECKING(for aspell headers and libraries) + if test "x$ac_found_aspell_header" = "xno" -o "x$ac_found_aspell_lib" = "xno" ; then + AC_MSG_RESULT(no) + AC_MSG_WARN([ +*** Aspell headers and/or libraries couldn't be found on your system. +*** Try to install them with your software package manager. +*** WeeChat will be built without Aspell support.]) + enable_spell="no" + not_found="$not_found spell" + else + AC_MSG_RESULT(yes) + ASPELL_LFLAGS="$ASPELL_LFLAGS -laspell" + SPELL_LIB_USED="aspell" + + # check if function aspell_version_string() exists + ac_save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $ASPELL_LFLAGS" + AC_CACHE_CHECK([for aspell_version_string() support], ac_cv_have_aspell_version_string, [ + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [[ #include ]], + [[ const char *version = aspell_version_string(); ]])], + [ ac_have_aspell_version_string="yes" ], + [ ac_have_aspell_version_string="no" ])]) + LDFLAGS="$ac_save_LDFLAGS" + if test "x$ac_have_aspell_version_string" = "xyes"; then + AC_DEFINE(HAVE_ASPELL_VERSION_STRING) + fi + fi + fi +else + not_asked="$not_asked spell" +fi + +if test "x$enable_spell" = "xyes" ; then + AC_SUBST(ASPELL_CFLAGS) + AC_SUBST(ASPELL_LFLAGS) + AC_DEFINE(PLUGIN_SPELL) +fi + # --------------------------------- trigger ------------------------------------ if test "x$enable_trigger" = "xyes" ; then @@ -1390,7 +1390,6 @@ AM_CONDITIONAL(HAVE_EAT_NEWLINE_GLITCH, test "$enable_eatnewlineglitch" = "yes") AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes") AM_CONDITIONAL(HEADLESS, test "$enable_headless" = "yes") AM_CONDITIONAL(PLUGIN_ALIAS, test "$enable_alias" = "yes") -AM_CONDITIONAL(PLUGIN_ASPELL, test "$enable_aspell" = "yes") AM_CONDITIONAL(PLUGIN_BUFLIST, test "$enable_buflist" = "yes") AM_CONDITIONAL(PLUGIN_CHARSET, test "$enable_charset" = "yes") AM_CONDITIONAL(PLUGIN_EXEC, test "$enable_exec" = "yes") @@ -1408,6 +1407,7 @@ AM_CONDITIONAL(PLUGIN_TCL, test "$enable_tcl" = "yes") AM_CONDITIONAL(PLUGIN_GUILE, test "$enable_guile" = "yes") AM_CONDITIONAL(PLUGIN_JAVASCRIPT, test "$enable_javascript" = "yes") AM_CONDITIONAL(PLUGIN_PHP, test "$enable_php" = "yes") +AM_CONDITIONAL(PLUGIN_SPELL, test "$enable_spell" = "yes") AM_CONDITIONAL(PLUGIN_TRIGGER, test "$enable_trigger" = "yes") AM_CONDITIONAL(PLUGIN_XFER, test "$enable_xfer" = "yes") AM_CONDITIONAL(TESTS, test "$enable_tests" = "yes") @@ -1429,7 +1429,6 @@ AC_OUTPUT([Makefile src/core/Makefile src/plugins/Makefile src/plugins/alias/Makefile - src/plugins/aspell/Makefile src/plugins/buflist/Makefile src/plugins/charset/Makefile src/plugins/exec/Makefile @@ -1447,6 +1446,7 @@ AC_OUTPUT([Makefile src/plugins/guile/Makefile src/plugins/javascript/Makefile src/plugins/php/Makefile + src/plugins/spell/Makefile src/plugins/trigger/Makefile src/plugins/xfer/Makefile src/gui/Makefile @@ -1479,9 +1479,6 @@ listplugins="" if test "x$enable_alias" = "xyes"; then listplugins="$listplugins alias" fi -if test "x$enable_aspell" = "xyes"; then - listplugins="$listplugins aspell($ASPELL_LIB_USED)" -fi if test "x$enable_buflist" = "xyes"; then listplugins="$listplugins buflist" fi @@ -1533,6 +1530,9 @@ fi if test "x$enable_php" = "xyes"; then listplugins="$listplugins php($PHP_VERSION)" fi +if test "x$enable_spell" = "xyes"; then + listplugins="$listplugins spell($SPELL_LIB_USED)" +fi if test "x$enable_trigger" = "xyes"; then listplugins="$listplugins trigger" fi diff --git a/debian-stable/copyright b/debian-stable/copyright index 4a08717ac..042585574 100644 --- a/debian-stable/copyright +++ b/debian-stable/copyright @@ -35,11 +35,11 @@ Files: src/core/wee-completion.c src/core/wee-log.c src/core/wee-utf8.c src/core/weechat.h - src/plugins/aspell/weechat-aspell-config.c - src/plugins/aspell/weechat-aspell-config.h - src/plugins/aspell/weechat-aspell-speller.c - src/plugins/aspell/weechat-aspell-speller.h - src/plugins/aspell/weechat-aspell.h + src/plugins/spell/spell-config.c + src/plugins/spell/spell-config.h + src/plugins/spell/spell-speller.c + src/plugins/spell/spell-speller.h + src/plugins/spell/spell.h src/plugins/irc/irc-command.c src/plugins/irc/irc.h Copyright: 2006, Emmanuel Bouthenot @@ -51,12 +51,12 @@ Copyright: 2005-2010, Emmanuel Bouthenot 2012, Simon Arlott License: GPL-3+ -Files: src/plugins/aspell/weechat-aspell-bar-item.c - src/plugins/aspell/weechat-aspell-bar-item.h +Files: src/plugins/spell/spell-bar-item.c + src/plugins/spell/spell-bar-item.h Copyright: 2012, Nils Görs License: GPL-3+ -Files: src/plugins/aspell/weechat-aspell.c +Files: src/plugins/spell/spell.c Copyright: 2006, Emmanuel Bouthenot 2012, Nils Görs License: GPL-3+ diff --git a/debian-stable/weechat-plugins.install b/debian-stable/weechat-plugins.install index fc4b9fb54..fcda327e7 100644 --- a/debian-stable/weechat-plugins.install +++ b/debian-stable/weechat-plugins.install @@ -1,6 +1,6 @@ -usr/lib/*/weechat/plugins/aspell.so usr/lib/*/weechat/plugins/exec.so usr/lib/*/weechat/plugins/fifo.so usr/lib/*/weechat/plugins/relay.so usr/lib/*/weechat/plugins/script.so +usr/lib/*/weechat/plugins/spell.so usr/lib/*/weechat/plugins/trigger.so diff --git a/doc/cs/man_files.cs.adoc b/doc/cs/man_files.cs.adoc index 889ebc973..43699a3e0 100644 --- a/doc/cs/man_files.cs.adoc +++ b/doc/cs/man_files.cs.adoc @@ -10,9 +10,6 @@ $HOME/.weechat/sec.conf:: $HOME/.weechat/alias.conf:: configurační soubor pro _alias_ plugin -$HOME/.weechat/aspell.conf:: - konfigurační soubor pro _aspell_ plugin - $HOME/.weechat/buflist.conf:: konfigurační soubor pro _buflist_ plugin @@ -61,6 +58,9 @@ $HOME/.weechat/ruby.conf:: $HOME/.weechat/script.conf:: konfigurační soubor pro _script_ plugin +$HOME/.weechat/spell.conf:: + konfigurační soubor pro _spell_ plugin + $HOME/.weechat/tcl.conf:: konfigurační soubor pro _tcl_ plugin diff --git a/doc/de/autogen/plugin_api/completions.adoc b/doc/de/autogen/plugin_api/completions.adoc index a95898baa..32432c0c7 100644 --- a/doc/de/autogen/plugin_api/completions.adoc +++ b/doc/de/autogen/plugin_api/completions.adoc @@ -10,10 +10,6 @@ | alias | alias_value | Wert von Alias -| aspell | aspell_dicts | Auflistung der installierten Wörterbücher - -| aspell | aspell_langs | Liste aller Sprachen die durch Aspell unterstützt werden - | exec | exec_commands_ids | IDs (Nummern und Namen) von ausgeführten Befehlen | fset | fset_options | Konfigurationsdateien, Sektionen, Optionen und Worte von Optionen @@ -86,6 +82,10 @@ | script | script_tags | Schlagwortliste für Skripten im Repositorium +| spell | spell_dicts | list of installed dictionaries + +| spell | spell_langs | list of all languages supported + | tcl | tcl_script | Liste der Skripten | trigger | trigger_hook_arguments | Standardargumente für einen Hook diff --git a/doc/de/autogen/plugin_api/infos.adoc b/doc/de/autogen/plugin_api/infos.adoc index 2bd643d37..9587e33ac 100644 --- a/doc/de/autogen/plugin_api/infos.adoc +++ b/doc/de/autogen/plugin_api/infos.adoc @@ -6,8 +6,6 @@ |=== | Erweiterung | Name | Beschreibung | Argumente -| aspell | aspell_dict | durch Kommata getrennte Liste von Wörterbüchern, die in diesem Buffer genutzt werden sollen | Buffer-Pointer ("0x12345678") oder der vollständige Buffername ("irc.freenode.#weechat") - | fifo | fifo_filename | Name der FIFO-Pipe | - | guile | guile_eval | Evaluierung des Quelltextes | Quelltext welcher ausgeführt werden soll @@ -74,6 +72,8 @@ | ruby | ruby_version | Version des verwendeten Interpreters | - +| spell | spell_dict | durch Kommata getrennte Liste von Wörterbüchern, die in diesem Buffer genutzt werden sollen | Buffer-Pointer ("0x12345678") oder der vollständige Buffername ("irc.freenode.#weechat") + | tcl | tcl_eval | Evaluierung des Quelltextes | Quelltext welcher ausgeführt werden soll | tcl | tcl_interpreter | Name des verwendeten Interpreters | - diff --git a/doc/de/autogen/plugin_api/plugins_priority.adoc b/doc/de/autogen/plugin_api/plugins_priority.adoc index 0adb939c7..f28c95b92 100644 --- a/doc/de/autogen/plugin_api/plugins_priority.adoc +++ b/doc/de/autogen/plugin_api/plugins_priority.adoc @@ -6,7 +6,7 @@ . logger (14000) . exec (13000) . trigger (12000) -. aspell (11000) +. spell (11000) . alias (10000) . buflist (9000) . fifo (8000) diff --git a/doc/de/autogen/user/aspell_commands.adoc b/doc/de/autogen/user/aspell_commands.adoc deleted file mode 100644 index 6a57903c9..000000000 --- a/doc/de/autogen/user/aspell_commands.adoc +++ /dev/null @@ -1,32 +0,0 @@ -// -// This file is auto-generated by script docgen.py. -// DO NOT EDIT BY HAND! -// -[[command_aspell_aspell]] -* `+aspell+`: Konfiguration für Aspell-Erweiterung - ----- -/aspell enable|disable|toggle - listdict - setdict [,...] - deldict - addword [] - - enable: Aspell wird aktiviert - disable: Aspell wird deaktiviert - toggle: Aspell Funktionalität umschalten -listdict: die, auf dem System, installierten Wörterbücher werden aufgelistet - setdict: Wörterbuch für den aktuellen Buffer einstellen (mehrere Wörterbücher müssen durch Kommata getrennt werden) - deldict: Wörterbuch für den aktuellen Buffer entfernen - addword: fügt ein Wort in das persönliche Wörterbuch von Aspell hinzu - -Eingaben die mit '/' beginnen werden nicht überprüft, davon ausgenommen sind einige Befehle (siehe /set aspell.check.commands). - -Um sich eine Liste von Vorschlägen in einer Bar anzeigen zu lassen nutzt man das Item "aspell_suggest". - -Um Aspell auf alle Buffer anzuwenden sollte die Einstellung "default_dict" genutzt und Aspell aktiviert werden: - /set aspell.check.default_dict "de_DE-neu" - /aspell enable - -Die Standardtastaturbelegung zum Umschalten der Aspell Funktionalität lautet alt-s. ----- diff --git a/doc/de/autogen/user/spell_commands.adoc b/doc/de/autogen/user/spell_commands.adoc new file mode 100644 index 000000000..02d003fc1 --- /dev/null +++ b/doc/de/autogen/user/spell_commands.adoc @@ -0,0 +1,32 @@ +// +// This file is auto-generated by script docgen.py. +// DO NOT EDIT BY HAND! +// +[[command_spell_spell]] +* `+spell+`: spell plugin configuration + +---- +/spell enable|disable|toggle + listdict + setdict [,...] + deldict + addword [] + + enable: enable spell checker + disable: disable spell checker + toggle: toggle spell checker +listdict: show installed dictionaries + setdict: set dictionary for current buffer (multiple dictionaries can be separated by a comma) + deldict: delete dictionary used on current buffer + addword: add a word in personal dictionary + +Input line beginning with a '/' is not checked, except for some commands (see /set spell.check.commands). + +To enable spell checker on all buffers, use option "default_dict", then enable spell checker, for example: + /set spell.check.default_dict "en" + /spell enable + +To display a list of suggestions in a bar, use item "spell_suggest". + +Default key to toggle spell checker is alt-s. +---- diff --git a/doc/de/autogen/user/aspell_options.adoc b/doc/de/autogen/user/spell_options.adoc similarity index 59% rename from doc/de/autogen/user/aspell_options.adoc rename to doc/de/autogen/user/spell_options.adoc index f20401634..7f344d5de 100644 --- a/doc/de/autogen/user/aspell_options.adoc +++ b/doc/de/autogen/user/spell_options.adoc @@ -2,80 +2,80 @@ // This file is auto-generated by script docgen.py. // DO NOT EDIT BY HAND! // -* [[option_aspell.check.commands]] *aspell.check.commands* +* [[option_spell.check.commands]] *spell.check.commands* ** Beschreibung: pass:none[durch Kommata getrennte Liste der Befehle, für die eine Rechtschreibprüfung gelten soll (Rechtschreibprüfung ist für andere Befehle deaktiviert)] ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette ** Standardwert: `+"ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query,quit,topic"+` -* [[option_aspell.check.default_dict]] *aspell.check.default_dict* -** Beschreibung: pass:none[Voreingestelltes Wörterbuch (oder durch Kommata getrennte Liste der Wörterbücher) welche(s) genutzt werden soll, sofern kein Wörterbuch für einen Buffer definiert wurde. Wird kein Wörterbuch angegeben dann ist Aspell in allen Buffer deaktiviert, außer es wird für einen Buffer explizit ein Wörterbuch angegeben] +* [[option_spell.check.default_dict]] *spell.check.default_dict* +** Beschreibung: pass:none[default dictionary (or comma separated list of dictionaries) to use when buffer has no dictionary defined (leave blank to disable spell checker on buffers for which you didn't explicitly enabled it)] ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette ** Standardwert: `+""+` -* [[option_aspell.check.during_search]] *aspell.check.during_search* +* [[option_spell.check.during_search]] *spell.check.during_search* ** Beschreibung: pass:none[Überprüfe Wörter während im Buffer nach einem Text gesucht wird] ** Typ: boolesch ** Werte: on, off ** Standardwert: `+off+` -* [[option_aspell.check.enabled]] *aspell.check.enabled* -** Beschreibung: pass:none[Aspell wird für die Eingabezeile aktiviert] +* [[option_spell.check.enabled]] *spell.check.enabled* +** Beschreibung: pass:none[enable spell checker for command line] ** Typ: boolesch ** Werte: on, off ** Standardwert: `+off+` -* [[option_aspell.check.real_time]] *aspell.check.real_time* +* [[option_spell.check.real_time]] *spell.check.real_time* ** Beschreibung: pass:none[Eine Korrektur findet während der Texteingabe statt (da dies langsamer ist, ist diese Funktion standardmäßig deaktiviert. Wörter werden erst überprüft sobald ein Leerzeichen dem vorangegangenen Wort folgt)] ** Typ: boolesch ** Werte: on, off ** Standardwert: `+off+` -* [[option_aspell.check.suggestions]] *aspell.check.suggestions* -** Beschreibung: pass:none[legt die Anzahl an Vorschlägen, für ein falsch geschriebenes Wort, fest. Die Vorschläge werden mittels der Bar-Item "aspell_suggest", für die jeweilige(n) Sprache(n), die für den Buffer augewählt wurden, angezeigt (-1 = deaktiviert die Funktion, 0 = zeigt alle verfügbaren Vorschläge, für alle ausgewählten Sprachen, an)] +* [[option_spell.check.suggestions]] *spell.check.suggestions* +** Beschreibung: pass:none[number of suggestions to display in bar item "spell_suggest" for each dictionary set in buffer (-1 = disable suggestions, 0 = display all possible suggestions in all languages)] ** Typ: integer ** Werte: -1 .. 2147483647 ** Standardwert: `+-1+` -* [[option_aspell.check.word_min_length]] *aspell.check.word_min_length* +* [[option_spell.check.word_min_length]] *spell.check.word_min_length* ** Beschreibung: pass:none[Mindestlänge für ein Wort, welches auf Rechtschreibung überprüft werden soll (bei 0 werden alle Wörter überprüft)] ** Typ: integer ** Werte: 0 .. 2147483647 ** Standardwert: `+2+` -* [[option_aspell.color.misspelled]] *aspell.color.misspelled* +* [[option_spell.color.misspelled]] *spell.color.misspelled* ** Beschreibung: pass:none[Farbe in der ein Wort mit einem Rechtschreibfehler hervorgehoben werden soll (Eingabezeile)] ** Typ: Farbe ** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "/" für kursiv, "_" für unterstrichen ** Standardwert: `+lightred+` -* [[option_aspell.color.suggestion]] *aspell.color.suggestion* -** Beschreibung: pass:none[Textfarbe für die Vorschläge der Rechtsschreibkorrektur in der Bar-Item "aspell_suggest"] +* [[option_spell.color.suggestion]] *spell.color.suggestion* +** Beschreibung: pass:none[text color for suggestion on a misspelled word in bar item "spell_suggest"] ** Typ: Farbe ** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "/" für kursiv, "_" für unterstrichen ** Standardwert: `+default+` -* [[option_aspell.color.suggestion_delimiter_dict]] *aspell.color.suggestion_delimiter_dict* -** Beschreibung: pass:none[Textfarbe für das Trennzeichen, im Bar-Item "aspell_suggest", welches zwischen zwei Wörterbücher dargestellt wird] +* [[option_spell.color.suggestion_delimiter_dict]] *spell.color.suggestion_delimiter_dict* +** Beschreibung: pass:none[text color for delimiters displayed between two dictionaries in bar item "spell_suggest"] ** Typ: Farbe ** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "/" für kursiv, "_" für unterstrichen ** Standardwert: `+cyan+` -* [[option_aspell.color.suggestion_delimiter_word]] *aspell.color.suggestion_delimiter_word* -** Beschreibung: pass:none[Textfarbe für das Trennzeichen zwischen zwei Wörtern in der Bar-Item "aspell_suggest"] +* [[option_spell.color.suggestion_delimiter_word]] *spell.color.suggestion_delimiter_word* +** Beschreibung: pass:none[text color for delimiters displayed between two words in bar item "spell_suggest"] ** Typ: Farbe ** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "/" für kursiv, "_" für unterstrichen ** Standardwert: `+cyan+` -* [[option_aspell.look.suggestion_delimiter_dict]] *aspell.look.suggestion_delimiter_dict* -** Beschreibung: pass:none[Trennzeichen, im Bar-Item "aspell_suggest", welches zwischen zwei Wörterbücher dargestellt wird] +* [[option_spell.look.suggestion_delimiter_dict]] *spell.look.suggestion_delimiter_dict* +** Beschreibung: pass:none[delimiter displayed between two dictionaries in bar item "spell_suggest"] ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette ** Standardwert: `+" / "+` -* [[option_aspell.look.suggestion_delimiter_word]] *aspell.look.suggestion_delimiter_word* -** Beschreibung: pass:none[Trennzeichen, im Bar-Item "aspell_suggest", welches zwischen zwei Wörtern dargestellt wird] +* [[option_spell.look.suggestion_delimiter_word]] *spell.look.suggestion_delimiter_word* +** Beschreibung: pass:none[delimiter displayed between two words in bar item "spell_suggest"] ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette ** Standardwert: `+","+` diff --git a/doc/de/man_files.de.adoc b/doc/de/man_files.de.adoc index 7dba0c893..cdabbc226 100644 --- a/doc/de/man_files.de.adoc +++ b/doc/de/man_files.de.adoc @@ -10,9 +10,6 @@ $HOME/.weechat/sec.conf:: $HOME/.weechat/alias.conf:: Konfigurationsdatei für _alias_ Erweiterung -$HOME/.weechat/aspell.conf:: - Konfigurationsdatei für _aspell_ Erweiterung - $HOME/.weechat/buflist.conf:: Konfigurationsdatei für _buflist_ Erweiterung @@ -61,6 +58,9 @@ $HOME/.weechat/ruby.conf:: $HOME/.weechat/script.conf:: Konfigurationsdatei für _script_ Erweiterung +$HOME/.weechat/spell.conf:: + Konfigurationsdatei für _spell_ Erweiterung + $HOME/.weechat/tcl.conf:: Konfigurationsdatei für _tcl_ Erweiterung diff --git a/doc/de/weechat_faq.de.adoc b/doc/de/weechat_faq.de.adoc index 76d988e52..0eb08e9c0 100644 --- a/doc/de/weechat_faq.de.adoc +++ b/doc/de/weechat_faq.de.adoc @@ -1005,15 +1005,20 @@ $ cd ~/.weechat/script $ curl -O https://weechat.org/files/plugins.xml.gz ---- -[[aspell_dictionaries]] +[[spell_dictionaries]] === Ich habe aspell Wörterbücher auf mein System installiert. Wie kann ich diese nutzen, ohne WeeChat neu starten zu müssen? -Du braucht lediglich die aspell Erweiterung neu zu laden: +Du braucht lediglich die spell Erweiterung neu zu laden: ---- -/plugin reload aspell +/plugin reload spell ---- +// TRANSLATION MISSING +[NOTE] +With WeeChat ≤ 2.3, the "spell" plugin was named "aspell", so the command is: +`/plugin reload aspell`. + [[settings]] == Einstellungen @@ -1045,9 +1050,9 @@ Damit WeeChat weniger Speicher benötigt, solltest Du folgende Tipps umsetzen: * nutze die aktuelle Version (man kann davon ausgehen das eine aktuelle Version weniger Speicherlecks besitzt, als eine vorherige Version) -* lade keine Erweiterungen die Du nicht benötigst. Zum Beispiel: ASpell, Buflist, - Fifo, Logger, Perl, Python, Ruby, Lua, Tcl, Guile, JavaScript, PHP, Xfer (wird für - DCC benötigst), siehe `/help weechat.plugin.autoload`. +* lade keine Erweiterungen die Du nicht benötigst. Zum Beispiel: Buflist, + Fifo, Logger, Perl, Python, Ruby, Lua, Tcl, Guile, JavaScript, PHP, Spell, Xfer + (wird für DCC benötigst), siehe `/help weechat.plugin.autoload`. * installiere ausschließlich Skripten die Du auch nutzt * falls man SSL *NICHT* nutzt, sollte kein Zertifikat geladen werden. In diesem Fall, einfach den Eintrag in folgender Option leer lassen: @@ -1067,7 +1072,7 @@ und zusätzlich diese Tipps beherzigen: * die Sekundenanzeigen in der Statusbar sollte deaktiviert werden: `/set weechat.look.item_time_format "%H:%M"` (dies ist die Standardeinstellung) * die Echtzeit Rechtschreibkorrektur sollte deaktiviert werden (falls sie aktiviert wurde): - `/set aspell.check.real_time off` + `/set spell.check.real_time off` * die Umgebungsvariable _TZ_ sollte gesetzt sein (zum Beispiel: `export TZ="Europe/Berlin"`). Dadurch wird verhindert, dass auf die Datei _/etc/localtime_ häufig zugegriffen wird. diff --git a/doc/de/weechat_user.de.adoc b/doc/de/weechat_user.de.adoc index b2e2beb70..6f564fa76 100644 --- a/doc/de/weechat_user.de.adoc +++ b/doc/de/weechat_user.de.adoc @@ -114,7 +114,7 @@ zu kompilieren und welche Pakete optional genutzt werden können. | gettext | | | Internationalisierung (Übersetzung der Mitteilungen; Hauptsprache ist englisch). | ca-certificates | | | Zertifikate für SSL Verbindungen. | libaspell-dev - ∥ libenchant-dev | | | Aspell Erweiterung. + ∥ libenchant-dev | | | Spell Erweiterung. | python-dev | ≥ 2.6 ^(4)^ | | Python Erweiterung. | libperl-dev | | | Perl Erweiterung. | ruby2.5, ruby2.5-dev | ≥ 1.8 | | Ruby Erweiterung. @@ -200,9 +200,6 @@ Liste von häufig verwendeten Optionen: | ENABLE_ALIAS | `ON`, `OFF` | ON | kompiliert <>. -| ENABLE_ASPELL | `ON`, `OFF` | ON | - kompiliert <>. - | ENABLE_BUFLIST | `ON`, `OFF` | ON | kompiliert <>. @@ -218,7 +215,7 @@ Liste von häufig verwendeten Optionen: Dokumentation nicht auf der Homepage abrufen kann). | ENABLE_ENCHANT | `ON`, `OFF` | OFF | - kompiliert <> mittels Enchant. + kompiliert <> mittels Enchant. | ENABLE_EXEC | `ON`, `OFF` | ON | kompiliert <>. @@ -282,6 +279,9 @@ Liste von häufig verwendeten Optionen: kompiliert <> (Python, Perl, Ruby, Lua, Tcl, Guile, JavaScript, PHP). +| ENABLE_SPELL | `ON`, `OFF` | ON | + kompiliert <>. + | ENABLE_TCL | `ON`, `OFF` | ON | kompiliert <>. @@ -572,7 +572,6 @@ Folgende Dateien befinden sich im WeeChat-Heimatverzeichnis: | sec.conf | Konfigurationsdatei mit sensiblen Daten | *Ja, hoch sensibel*: diese Datei sollte niemals weitergegeben werden. | plugins.conf | Konfigurationsdatei für Erweiterungen | möglich, hängt von der Erweiterung/Skript ab. | alias.conf | Konfigurationsdatei: Alias-Erweiterung | möglich, hängt von den Aliases ab. -| aspell.conf | Konfiguration für _aspell_-Erweiterung | Nein. | buflist.conf | Konfiguration für _buflist_-Erweiterung | Nein. | charset.conf | Konfiguration für _charset_-Erweiterung | Nein. | exec.conf | Konfiguration für _exec_-Erweiterung | Nein. @@ -589,6 +588,7 @@ Folgende Dateien befinden sich im WeeChat-Heimatverzeichnis: | relay.conf | Konfiguration für _relay_-Erweiterung | Nein. | ruby.conf | Konfiguration für _ruby_-Erweiterung | Nein. | script.conf | Konfiguration für _script_-Erweiterung | Nein. +| spell.conf | Konfiguration für _spell_-Erweiterung | Nein. | tcl.conf | Konfiguration für _tcl_-Erweiterung | Nein. | trigger.conf | Konfiguration für _trigger_-Erweiterung | möglich, hängt von den Triggern ab. | xfer.conf | Konfiguration für _xfer_-Erweiterung | Nein. @@ -710,8 +710,8 @@ andere Items die man nutzen kann (die aber nicht standardmäßig in einer Bar ak [width="100%",cols="^3,^4,10",options="header"] |=== | Item | Beispiel | Beschreibung -| aspell_dict | `de,en` | zeigt an welche Wörterbücher für die Rechtschreibung im aktuellen Buffer genutzt werden. -| aspell_suggest | `Glück,Glocke,Block`| Vorschläge für ein falsch geschriebenes Wort. +| spell_dict | `de,en` | zeigt an welche Wörterbücher für die Rechtschreibung im aktuellen Buffer genutzt werden. +| spell_suggest | `Glück,Glocke,Block`| Vorschläge für ein falsch geschriebenes Wort. | buffer_count | `10` | absolute Anzahl an geöffneten Buffern. | buffer_short_name | `#test` | Kurzname des aktuellen Buffers. | irc_channel | `#test` | aktueller IRC Channelname. @@ -1652,7 +1652,8 @@ und um eine Hilfe zu erhalten wie man es nutzt: `/help buffer_autoset`. | kbd:[Alt+d] | löscht das Wort rechts vom Cursor (die Zeichenkette wird dabei in die interne Zwischenablage kopiert). | `/input delete_next_word` | kbd:[Alt+k] | zeigt den Tastencode, einschließlich des eingebundenen Befehls, einer Tastenkombination an und fügt diesen in die Befehlszeile ein. | `/input grab_key_command` | kbd:[Alt+r] | komplette Eingabezeile lösche.n| `/input delete_line` -| kbd:[Alt+s] | schaltet die Aspell Funktion an/aus. | `/mute aspell toggle` +// TRANSLATION MISSING +| kbd:[Alt+s] | Toggle spell checker. | `/mute spell toggle` |=== [[key_bindings_buffers_windows]] @@ -2135,7 +2136,6 @@ Standarderweiterungen: |=== | Erweiterung | Beschreibung | alias | definiert Alias für Befehle. -| aspell | Rechtschreibprüfung für Befehlszeile. | buflist | Bar-Item mit der Liste aller Buffern. | charset | Zeichensatz (de)-kodierung in Buffern. | exec | ausführen von externen Befehlen aus WeeChat heraus. @@ -2153,6 +2153,7 @@ Standarderweiterungen: | guile | Guile(scheme)-Skript API. | javascript | JavaScript-Skript API. | php | PHP-Skript API. +| spell | Rechtschreibprüfung für Befehlszeile. | trigger | Veränderung von Text und Ausführen von Befehlen bei einem Ereignis, welche durch WeeChat oder eine Erweiterung ausgelöst werden. | xfer | Datentransfer und Direktchat. |=== @@ -2193,16 +2194,16 @@ Sektionen in Datei _alias.conf_: /set alias.completion.* | Vervollständigung für Alias. |=== -[[aspell_plugin]] -=== Aspell +[[spell_plugin]] +=== Spell -Mit der ASpell Erweiterung findet eine Rechtschreibprüfung Einzug in WeeChat. +Mit der Spell Erweiterung findet eine Rechtschreibprüfung Einzug in WeeChat. Dabei ist es möglich mehrere Wörterbücher für einen Buffer zu nutzen. Die Rechtschreibprüfung ist standardmäßig deaktiviert und kann mittels dem Tastenbefehl [Alt+s] umgeschaltet werden. -[[aspell_dictionaries]] +[[spell_dictionaries]] ==== Wörterbücher Um die Rechtschreibprüfung nutzen zu können muss vorab ein Wörterbuch definiert werden, @@ -2214,26 +2215,26 @@ die Wörter mit allen Wörterbüchern ab, Um zum Beispiel Englisch und Deutsch zu nutzen: ---- -/set aspell.check.default_dict "en,de" +/set spell.check.default_dict "en,de" ---- Es ist möglich ein anderes Wörterbuch für einen speziellen Buffer zu verwenden, zum Beispiel in einem französischen Channel: ---- -/aspell setdict fr +/spell setdict fr ---- Um einer Gruppe von Buffern das selbe Wörterbuch zuzuordnen, zum Beispiel das deutsche Wörterbuch für alle Channels auf dem freenode IRC Server: ---- -/set aspell.dict.irc.freenode de +/set spell.dict.irc.freenode de ---- -Für weitere Informationen, siehe den Befehl <>. +Für weitere Informationen, siehe den Befehl <>. -[[aspell_speller_options]] +[[spell_speller_options]] ==== Optionen für Rechtschreibprüfung Optionen für die Rechtschreibprüfung können definiert werden indem man die entsprechende @@ -2249,18 +2250,18 @@ $ aspell config Um zum Beispiel die Option "ignore-case" einzuschalten: ---- -/set aspell.option.ignore-case "true" +/set spell.option.ignore-case "true" ---- -[[aspell_suggestions]] +[[spell_suggestions]] ==== Rechtschreibkorrektur -Eine Rechtschreibkorrektur wird in der Bar-Item "aspell_suggest" angezeigt. +Eine Rechtschreibkorrektur wird in der Bar-Item "spell_suggest" angezeigt. Die Anzahl an Vorschlägen, für die Rechtschreibkorrektur, kann mit der Option -_aspell.check.suggestions_ bestimmt werden. +_spell.check.suggestions_ bestimmt werden. -Um die Rechtschreibkorrektur zu aktivieren, muss für die Option _aspell.check.suggestions_ -ein Wert ≥ 0 eingestellt werden und das Bar-Item "aspell_suggest" zu einer Bar, zum +Um die Rechtschreibkorrektur zu aktivieren, muss für die Option _spell.check.suggestions_ +ein Wert ≥ 0 eingestellt werden und das Bar-Item "spell_suggest" zu einer Bar, zum Beispiel _status_, hinzufügt werden. Beispiel der Rechtschreibkorrektur, mit einem deutschen Wörterbuch (`de`): @@ -2279,30 +2280,30 @@ Beispiel der Rechtschreibkorrektur, mit zwei Wörterbüchern (`en,de`): └─────────────────────────────────────────────────────────────────────────────────┘ .... -[[aspell_commands]] +[[spell_commands]] ==== Befehle -include::autogen/user/aspell_commands.adoc[] +include::autogen/user/spell_commands.adoc[] -[[aspell_options]] +[[spell_options]] ==== Optionen -Sektionen in Datei _aspell.conf_: +Sektionen in Datei _spell.conf_: [width="100%",cols="3m,6m,16",options="header"] |=== -| Sektion | Steuerbefehl | Beschreibung -| color | /set aspell.color.* | Farben. -| check | /set aspell.check.* | Optionen um Einstellungen an der Rechtschreibprüfung vorzunehmen. -| dict | <> + - /set aspell.dict.* | Wörterbücher für Buffer (Optionen können in Sektion hinzugefügt/entfernt werden). -| look | /set aspell.look.* | Erscheinungsbild. -| option | /set aspell.option.* | <> (Optionen können in Sektion hinzugefügt/entfernt werden). +| Sektion | Steuerbefehl | Beschreibung +| color | /set spell.color.* | Farben. +| check | /set spell.check.* | Optionen um Einstellungen an der Rechtschreibprüfung vorzunehmen. +| dict | <> + + /set spell.dict.* | Wörterbücher für Buffer (Optionen können in Sektion hinzugefügt/entfernt werden). +| look | /set spell.look.* | Erscheinungsbild. +| option | /set spell.option.* | <> (Optionen können in Sektion hinzugefügt/entfernt werden). |=== Optionen: -include::autogen/user/aspell_options.adoc[] +include::autogen/user/spell_options.adoc[] [[buflist_plugin]] === Buflist diff --git a/doc/docgen.py b/doc/docgen.py index 2096ad244..75910326e 100644 --- a/doc/docgen.py +++ b/doc/docgen.py @@ -90,7 +90,6 @@ PLUGIN_LIST = { 'sec': 'o', 'weechat': 'co', 'alias': '', - 'aspell': 'o', 'buflist': 'co', 'charset': 'o', 'exec': 'o', @@ -108,14 +107,13 @@ PLUGIN_LIST = { 'guile': 'o', 'javascript': 'o', 'php': 'o', + 'spell': 'o', 'trigger': 'o', 'xfer': 'co', } # options to ignore IGNORE_OPTIONS = ( - r'aspell\.dict\..*', - r'aspell\.option\..*', r'charset\.decode\..*', r'charset\.encode\..*', r'irc\.msgbuffer\..*', @@ -126,6 +124,8 @@ IGNORE_OPTIONS = ( r'logger\.level\..*', r'logger\.mask\..*', r'relay\.port\..*', + r'spell\.dict\..*', + r'spell\.option\..*', r'trigger\.trigger\..*', r'weechat\.palette\..*', r'weechat\.proxy\..*', diff --git a/doc/en/autogen/plugin_api/completions.adoc b/doc/en/autogen/plugin_api/completions.adoc index 0547f4281..536a714a0 100644 --- a/doc/en/autogen/plugin_api/completions.adoc +++ b/doc/en/autogen/plugin_api/completions.adoc @@ -10,10 +10,6 @@ | alias | alias_value | value of alias -| aspell | aspell_dicts | list of aspell installed dictionaries - -| aspell | aspell_langs | list of all languages supported by aspell - | exec | exec_commands_ids | ids (numbers and names) of executed commands | fset | fset_options | configuration files, sections, options and words of options @@ -86,6 +82,10 @@ | script | script_tags | tags of scripts in repository +| spell | spell_dicts | list of installed dictionaries + +| spell | spell_langs | list of all languages supported + | tcl | tcl_script | list of scripts | trigger | trigger_hook_arguments | default arguments for a hook diff --git a/doc/en/autogen/plugin_api/infos.adoc b/doc/en/autogen/plugin_api/infos.adoc index 07180b39b..eeec4d01f 100644 --- a/doc/en/autogen/plugin_api/infos.adoc +++ b/doc/en/autogen/plugin_api/infos.adoc @@ -6,8 +6,6 @@ |=== | Plugin | Name | Description | Arguments -| aspell | aspell_dict | comma-separated list of dictionaries used in buffer | buffer pointer ("0x12345678") or buffer full name ("irc.freenode.#weechat") - | fifo | fifo_filename | name of FIFO pipe | - | guile | guile_eval | evaluation of source code | source code to execute @@ -74,6 +72,8 @@ | ruby | ruby_version | version of the interpreter used | - +| spell | spell_dict | comma-separated list of dictionaries used in buffer | buffer pointer ("0x12345678") or buffer full name ("irc.freenode.#weechat") + | tcl | tcl_eval | evaluation of source code | source code to execute | tcl | tcl_interpreter | name of the interpreter used | - diff --git a/doc/en/autogen/plugin_api/plugins_priority.adoc b/doc/en/autogen/plugin_api/plugins_priority.adoc index 0adb939c7..f28c95b92 100644 --- a/doc/en/autogen/plugin_api/plugins_priority.adoc +++ b/doc/en/autogen/plugin_api/plugins_priority.adoc @@ -6,7 +6,7 @@ . logger (14000) . exec (13000) . trigger (12000) -. aspell (11000) +. spell (11000) . alias (10000) . buflist (9000) . fifo (8000) diff --git a/doc/en/autogen/user/aspell_commands.adoc b/doc/en/autogen/user/aspell_commands.adoc deleted file mode 100644 index 9ff3f7af2..000000000 --- a/doc/en/autogen/user/aspell_commands.adoc +++ /dev/null @@ -1,32 +0,0 @@ -// -// This file is auto-generated by script docgen.py. -// DO NOT EDIT BY HAND! -// -[[command_aspell_aspell]] -* `+aspell+`: aspell plugin configuration - ----- -/aspell enable|disable|toggle - listdict - setdict [,...] - deldict - addword [] - - enable: enable aspell - disable: disable aspell - toggle: toggle aspell -listdict: show installed dictionaries - setdict: set dictionary for current buffer (multiple dictionaries can be separated by a comma) - deldict: delete dictionary used on current buffer - addword: add a word in personal aspell dictionary - -Input line beginning with a '/' is not checked, except for some commands (see /set aspell.check.commands). - -To enable aspell on all buffers, use option "default_dict", then enable aspell, for example: - /set aspell.check.default_dict "en" - /aspell enable - -To display a list of suggestions in a bar, use item "aspell_suggest". - -Default key to toggle aspell is alt-s. ----- diff --git a/doc/en/autogen/user/spell_commands.adoc b/doc/en/autogen/user/spell_commands.adoc new file mode 100644 index 000000000..02d003fc1 --- /dev/null +++ b/doc/en/autogen/user/spell_commands.adoc @@ -0,0 +1,32 @@ +// +// This file is auto-generated by script docgen.py. +// DO NOT EDIT BY HAND! +// +[[command_spell_spell]] +* `+spell+`: spell plugin configuration + +---- +/spell enable|disable|toggle + listdict + setdict [,...] + deldict + addword [] + + enable: enable spell checker + disable: disable spell checker + toggle: toggle spell checker +listdict: show installed dictionaries + setdict: set dictionary for current buffer (multiple dictionaries can be separated by a comma) + deldict: delete dictionary used on current buffer + addword: add a word in personal dictionary + +Input line beginning with a '/' is not checked, except for some commands (see /set spell.check.commands). + +To enable spell checker on all buffers, use option "default_dict", then enable spell checker, for example: + /set spell.check.default_dict "en" + /spell enable + +To display a list of suggestions in a bar, use item "spell_suggest". + +Default key to toggle spell checker is alt-s. +---- diff --git a/doc/en/autogen/user/aspell_options.adoc b/doc/en/autogen/user/spell_options.adoc similarity index 70% rename from doc/en/autogen/user/aspell_options.adoc rename to doc/en/autogen/user/spell_options.adoc index de55ffc42..53c2343b6 100644 --- a/doc/en/autogen/user/aspell_options.adoc +++ b/doc/en/autogen/user/spell_options.adoc @@ -2,80 +2,80 @@ // This file is auto-generated by script docgen.py. // DO NOT EDIT BY HAND! // -* [[option_aspell.check.commands]] *aspell.check.commands* +* [[option_spell.check.commands]] *spell.check.commands* ** description: pass:none[comma separated list of commands for which spell checking is enabled (spell checking is disabled for all other commands)] ** type: string ** values: any string ** default value: `+"ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query,quit,topic"+` -* [[option_aspell.check.default_dict]] *aspell.check.default_dict* -** description: pass:none[default dictionary (or comma separated list of dictionaries) to use when buffer has no dictionary defined (leave blank to disable aspell on buffers for which you didn't explicitly enabled it)] +* [[option_spell.check.default_dict]] *spell.check.default_dict* +** description: pass:none[default dictionary (or comma separated list of dictionaries) to use when buffer has no dictionary defined (leave blank to disable spell checker on buffers for which you didn't explicitly enabled it)] ** type: string ** values: any string ** default value: `+""+` -* [[option_aspell.check.during_search]] *aspell.check.during_search* +* [[option_spell.check.during_search]] *spell.check.during_search* ** description: pass:none[check words during text search in buffer] ** type: boolean ** values: on, off ** default value: `+off+` -* [[option_aspell.check.enabled]] *aspell.check.enabled* -** description: pass:none[enable aspell check for command line] +* [[option_spell.check.enabled]] *spell.check.enabled* +** description: pass:none[enable spell checker for command line] ** type: boolean ** values: on, off ** default value: `+off+` -* [[option_aspell.check.real_time]] *aspell.check.real_time* +* [[option_spell.check.real_time]] *spell.check.real_time* ** description: pass:none[real-time spell checking of words (slower, disabled by default: words are checked only if there's delimiter after)] ** type: boolean ** values: on, off ** default value: `+off+` -* [[option_aspell.check.suggestions]] *aspell.check.suggestions* -** description: pass:none[number of suggestions to display in bar item "aspell_suggest" for each dictionary set in buffer (-1 = disable suggestions, 0 = display all possible suggestions in all languages)] +* [[option_spell.check.suggestions]] *spell.check.suggestions* +** description: pass:none[number of suggestions to display in bar item "spell_suggest" for each dictionary set in buffer (-1 = disable suggestions, 0 = display all possible suggestions in all languages)] ** type: integer ** values: -1 .. 2147483647 ** default value: `+-1+` -* [[option_aspell.check.word_min_length]] *aspell.check.word_min_length* +* [[option_spell.check.word_min_length]] *spell.check.word_min_length* ** description: pass:none[minimum length for a word to be spell checked (use 0 to check all words)] ** type: integer ** values: 0 .. 2147483647 ** default value: `+2+` -* [[option_aspell.color.misspelled]] *aspell.color.misspelled* +* [[option_spell.color.misspelled]] *spell.color.misspelled* ** description: pass:none[text color for misspelled words (input bar)] ** type: color ** values: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "/" for italic, "_" for underline ** default value: `+lightred+` -* [[option_aspell.color.suggestion]] *aspell.color.suggestion* -** description: pass:none[text color for suggestion on a misspelled word in bar item "aspell_suggest"] +* [[option_spell.color.suggestion]] *spell.color.suggestion* +** description: pass:none[text color for suggestion on a misspelled word in bar item "spell_suggest"] ** type: color ** values: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "/" for italic, "_" for underline ** default value: `+default+` -* [[option_aspell.color.suggestion_delimiter_dict]] *aspell.color.suggestion_delimiter_dict* -** description: pass:none[text color for delimiters displayed between two dictionaries in bar item "aspell_suggest"] +* [[option_spell.color.suggestion_delimiter_dict]] *spell.color.suggestion_delimiter_dict* +** description: pass:none[text color for delimiters displayed between two dictionaries in bar item "spell_suggest"] ** type: color ** values: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "/" for italic, "_" for underline ** default value: `+cyan+` -* [[option_aspell.color.suggestion_delimiter_word]] *aspell.color.suggestion_delimiter_word* -** description: pass:none[text color for delimiters displayed between two words in bar item "aspell_suggest"] +* [[option_spell.color.suggestion_delimiter_word]] *spell.color.suggestion_delimiter_word* +** description: pass:none[text color for delimiters displayed between two words in bar item "spell_suggest"] ** type: color ** values: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "/" for italic, "_" for underline ** default value: `+cyan+` -* [[option_aspell.look.suggestion_delimiter_dict]] *aspell.look.suggestion_delimiter_dict* -** description: pass:none[delimiter displayed between two dictionaries in bar item "aspell_suggest"] +* [[option_spell.look.suggestion_delimiter_dict]] *spell.look.suggestion_delimiter_dict* +** description: pass:none[delimiter displayed between two dictionaries in bar item "spell_suggest"] ** type: string ** values: any string ** default value: `+" / "+` -* [[option_aspell.look.suggestion_delimiter_word]] *aspell.look.suggestion_delimiter_word* -** description: pass:none[delimiter displayed between two words in bar item "aspell_suggest"] +* [[option_spell.look.suggestion_delimiter_word]] *spell.look.suggestion_delimiter_word* +** description: pass:none[delimiter displayed between two words in bar item "spell_suggest"] ** type: string ** values: any string ** default value: `+","+` diff --git a/doc/en/man_files.en.adoc b/doc/en/man_files.en.adoc index 071cffdfc..c8722550d 100644 --- a/doc/en/man_files.en.adoc +++ b/doc/en/man_files.en.adoc @@ -10,9 +10,6 @@ $HOME/.weechat/sec.conf:: $HOME/.weechat/alias.conf:: configuration file for _alias_ plugin -$HOME/.weechat/aspell.conf:: - configuration file for _aspell_ plugin - $HOME/.weechat/buflist.conf:: configuration file for _buflist_ plugin @@ -61,6 +58,9 @@ $HOME/.weechat/ruby.conf:: $HOME/.weechat/script.conf:: configuration file for _script_ plugin +$HOME/.weechat/spell.conf:: + configuration file for _spell_ plugin + $HOME/.weechat/tcl.conf:: configuration file for _tcl_ plugin diff --git a/doc/en/weechat_dev.en.adoc b/doc/en/weechat_dev.en.adoc index 975d84cca..0132e4876 100644 --- a/doc/en/weechat_dev.en.adoc +++ b/doc/en/weechat_dev.en.adoc @@ -70,7 +70,6 @@ The main WeeChat directories are: |          normal/ | Curses interface. |    plugins/ | Plugin and scripting API. |       alias/ | Alias plugin. -|       aspell/ | Aspell plugin. |       buflist/ | Buflist plugin. |       charset/ | Charset plugin. |       exec/ | Exec plugin. @@ -87,6 +86,7 @@ The main WeeChat directories are: |       relay/ | Relay plugin (irc proxy + relay for remote interfaces). |       ruby/ | Ruby scripting API. |       script/ | Script manager. +|       spell/ | Spell plugin. |       tcl/ | Tcl scripting API. |       trigger/ | Trigger plugin. |       xfer/ | Xfer plugin (IRC DCC file/chat). @@ -223,14 +223,14 @@ WeeChat "core" is located in following directories: |       alias-completion.c | Alias completions. |       alias-config.c | Alias config options (file alias.conf). |       alias-info.c | Alias info/infolists/hdata. -|    aspell/ | Aspell plugin. -|       weechat-aspell.c | Main aspell functions. -|       weechat-aspell-bar-item.c | Aspell bar items. -|       weechat-aspell-command.c | Aspell commands. -|       weechat-aspell-completion.c | Aspell completions. -|       weechat-aspell-config.c | Aspell config options (file aspell.conf). -|       weechat-aspell-info.c | Aspell info/infolists/hdata. -|       weechat-aspell-speller.c | Spellers management. +|    spell/ | Spell checker plugin. +|       spell.c | Main spell checker functions. +|       spell-bar-item.c | Spell checker bar items. +|       spell-command.c | Spell checker commands. +|       spell-completion.c | Spell checker completions. +|       spell-config.c | Spell checker config options (file spell.conf). +|       spell-info.c | Spell checker info/infolists/hdata. +|       spell-speller.c | Spellers management. |    buflist/ | Buflist plugin. |       buflist.c | Main buflist functions. |       buflist-bar-item.c | Buflist bar items. diff --git a/doc/en/weechat_faq.en.adoc b/doc/en/weechat_faq.en.adoc index 4a392dcd1..7e9cd3bcb 100644 --- a/doc/en/weechat_faq.en.adoc +++ b/doc/en/weechat_faq.en.adoc @@ -960,15 +960,19 @@ $ cd ~/.weechat/script $ curl -O https://weechat.org/files/plugins.xml.gz ---- -[[aspell_dictionaries]] +[[spell_dictionaries]] === I installed aspell dictionaries on my system, how can I use them without restarting WeeChat? -You have to reload the aspell plugin: +You have to reload the spell plugin: ---- -/plugin reload aspell +/plugin reload spell ---- +[NOTE] +With WeeChat ≤ 2.3, the "spell" plugin was named "aspell", so the command is: +`/plugin reload aspell`. + [[settings]] == Settings @@ -998,8 +1002,8 @@ You can try following tips to consume less memory: * Use the latest stable version (it is supposed to have less memory leaks than older versions). -* Do not load some plugins if you don't use them, for example: aspell, buflist, - fifo, logger, perl, python, ruby, lua, tcl, guile, javascript, php, +* Do not load some plugins if you don't use them, for example: buflist, + fifo, logger, perl, python, ruby, lua, tcl, guile, javascript, php, spell, xfer (used for DCC). See `/help weechat.plugin.autoload`. * Load only scripts that you really need. * Do not load certificates if SSL is *NOT* used: set empty string in option @@ -1017,7 +1021,7 @@ You can follow same tips as for <>, and these ones: * Remove display of seconds in status bar time: `/set weechat.look.item_time_format "%H:%M"` (this is the default value). * Disable real time check of misspelled words in command line (if you enabled it): - `/set aspell.check.real_time off`. + `/set spell.check.real_time off`. * Set the _TZ_ variable (for example: `export TZ="Europe/Paris"`), to prevent frequent access to file _/etc/localtime_. diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc index be5042492..af87c375e 100644 --- a/doc/en/weechat_plugin_api.en.adoc +++ b/doc/en/weechat_plugin_api.en.adoc @@ -9570,11 +9570,6 @@ List of signals sent by WeeChat and plugins: |=== | Plugin | Signal | Arguments | Description -| aspell | aspell_suggest + - _(WeeChat ≥ 0.4.0)_ | - Pointer: buffer. | - New suggestions for a misspelled word. - | guile | guile_script_loaded + _(WeeChat ≥ 0.3.9)_ | String: path to script. | @@ -9874,6 +9869,11 @@ List of signals sent by WeeChat and plugins: String: comma-separated list of scripts removed. | Ruby script(s) removed. +| spell | spell_suggest + + _(WeeChat ≥ 2.4)_ | + Pointer: buffer. | + New suggestions for a misspelled word. + | tcl | tcl_script_loaded + _(WeeChat ≥ 0.3.9)_ | String: path to script. | diff --git a/doc/en/weechat_user.en.adoc b/doc/en/weechat_user.en.adoc index c9b97e004..24d94faa4 100644 --- a/doc/en/weechat_user.en.adoc +++ b/doc/en/weechat_user.en.adoc @@ -108,7 +108,7 @@ compile WeeChat. | gettext | | | Internationalization (translation of messages; base language is English). | ca-certificates | | | Certificates for SSL connections. | libaspell-dev - ∥ libenchant-dev | | | Aspell plugin. + ∥ libenchant-dev | | | Spell plugin. | python-dev | ≥ 2.6 ^(4)^ | | Python plugin. | libperl-dev | | | Perl plugin. | ruby2.5, ruby2.5-dev | ≥ 1.8 | | Ruby plugin. @@ -192,9 +192,6 @@ List of commonly used options: | ENABLE_ALIAS | `ON`, `OFF` | ON | Compile <>. -| ENABLE_ASPELL | `ON`, `OFF` | ON | - Compile <>. - | ENABLE_BUFLIST | `ON`, `OFF` | ON | Compile <>. @@ -210,7 +207,7 @@ List of commonly used options: online). | ENABLE_ENCHANT | `ON`, `OFF` | OFF | - Compile <> with Enchant. + Compile <> with Enchant. | ENABLE_EXEC | `ON`, `OFF` | ON | Compile <>. @@ -274,6 +271,9 @@ List of commonly used options: Compile <> (Python, Perl, Ruby, Lua, Tcl, Guile, JavaScript, PHP). +| ENABLE_SPELL | `ON`, `OFF` | ON | + Compile <>. + | ENABLE_TCL | `ON`, `OFF` | ON | Compile <>. @@ -563,7 +563,6 @@ The files in the WeeChat home directory are: | sec.conf | Configuration file with secured data | *Yes, highly sensitive*: this file must never be shared with anyone. | plugins.conf | Plugins configuration file | Possible, depends on plugins/scripts. | alias.conf | Configuration file for _alias_ plugin | Possible, depends on aliases. -| aspell.conf | Configuration file for _aspell_ plugin | No. | buflist.conf | Configuration file for _buflist_ plugin | No. | charset.conf | Configuration file for _charset_ plugin | No. | exec.conf | Configuration file for _exec_ plugin | No. @@ -581,6 +580,7 @@ The files in the WeeChat home directory are: | ruby.conf | Configuration file for _ruby_ plugin | No. | script.conf | Configuration file for _script_ plugin | No. | tcl.conf | Configuration file for _tcl_ plugin | No. +| spell.conf | Configuration file for _spell_ plugin | No. | trigger.conf | Configuration file for _trigger_ plugin | Possible, depends on triggers. | xfer.conf | Configuration file for _xfer_ plugin | No. | weechat.log | WeeChat log file | No. @@ -704,8 +704,8 @@ Other items available (not used in bars by default): [width="100%",cols="^3,^4,10",options="header"] |=== | Item | Example | Description -| aspell_dict | `fr,en` | Spelling dictionaries used on current buffer. -| aspell_suggest | `print,prone,prune` | Spelling suggestions for word under cursor (if misspelled). +| spell_dict | `fr,en` | Spelling dictionaries used on current buffer. +| spell_suggest | `print,prone,prune` | Spelling suggestions for word under cursor (if misspelled). | buffer_count | `10` | Total number of buffers opened. | buffer_short_name | `#test` | Current buffer short name. | irc_channel | `#test` | Current IRC channel name. @@ -1617,7 +1617,7 @@ with `/script install buffer_autoset.py` and get help with `/help buffer_autoset | kbd:[Alt+d] | Delete next word in command line (deleted string is copied to the internal clipboard). | `/input delete_next_word` | kbd:[Alt+k] | Grab a key and insert its code (and command bound if key exists) in command line. | `/input grab_key_command` | kbd:[Alt+r] | Delete entire command line. | `/input delete_line` -| kbd:[Alt+s] | Toggle aspell. | `/mute aspell toggle` +| kbd:[Alt+s] | Toggle spell checker. | `/mute spell toggle` |=== [[key_bindings_buffers_windows]] @@ -2088,7 +2088,6 @@ Default plugins are: |=== | Plugin | Description | alias | Define alias for commands. -| aspell | Spell checking for command line. | buflist | Bar item with list of buffers. | charset | Charset decoding/encoding for buffers. | exec | Execution of external commands in WeeChat. @@ -2106,6 +2105,7 @@ Default plugins are: | guile | Guile (scheme) scripting API. | javascript | JavaScript scripting API. | php | PHP scripting API. +| spell | Spell checking for command line. | trigger | Text replacement and command execution on events triggered by WeeChat/plugins. | xfer | File transfer and direct chat. |=== @@ -2147,15 +2147,15 @@ Sections in file _alias.conf_: /set alias.completion.* | Completions for aliases. |=== -[[aspell_plugin]] -=== Aspell +[[spell_plugin]] +=== Spell -Aspell plugin lets you check spelling in command line. It is possible to use +Spell plugin lets you check spelling in command line. It is possible to use many languages by buffer. Spell checking is disabled by default and can be toggled with key kbd:[Alt+s]. -[[aspell_dictionaries]] +[[spell_dictionaries]] ==== Dictionaries Before using spell checking, dictionaries must be defined, either globally or @@ -2167,26 +2167,26 @@ dictionaries. For example to use English and French: ---- -/set aspell.check.default_dict "en,fr" +/set spell.check.default_dict "en,fr" ---- It is possible to use a different dictionary on a specific buffer, for example on a German channel: ---- -/aspell setdict de +/spell setdict de ---- You can also specify a dictionary for a group of buffers, for example English for all channels on freenode IRC server: ---- -/set aspell.dict.irc.freenode en +/set spell.dict.irc.freenode en ---- -For more information, see the command <>. +For more information, see the command <>. -[[aspell_speller_options]] +[[spell_speller_options]] ==== Speller options Speller options can be defined by adding options in section "option" of aspell @@ -2202,17 +2202,17 @@ $ aspell config For example, to enable option "ignore-case": ---- -/set aspell.option.ignore-case "true" +/set spell.option.ignore-case "true" ---- -[[aspell_suggestions]] +[[spell_suggestions]] ==== Suggestions -Suggestions are displayed in a bar item called "aspell_suggest". The number of -suggestions is set in option _aspell.check.suggestions_. +Suggestions are displayed in a bar item called "spell_suggest". The number of +suggestions is set in option _spell.check.suggestions_. -To enable suggestions you must set option _aspell.check.suggestions_ to an -integer ≥ 0 and add the bar item "aspell_suggest" to a bar, like _status_. +To enable suggestions you must set option _spell.check.suggestions_ to an +integer ≥ 0 and add the bar item "spell_suggest" to a bar, like _status_. Example of suggestions with English dictionary (`en`): @@ -2230,30 +2230,30 @@ Example of suggestions with English and French dictionaries (`en,fr`): └─────────────────────────────────────────────────────────────────────────────────┘ .... -[[aspell_commands]] +[[spell_commands]] ==== Commands -include::autogen/user/aspell_commands.adoc[] +include::autogen/user/spell_commands.adoc[] -[[aspell_options]] +[[spell_options]] ==== Options -Sections in file _aspell.conf_: +Sections in file _spell.conf_: [width="100%",cols="3m,6m,16",options="header"] |=== -| Section | Control command | Description -| color | /set aspell.color.* | Colors. -| check | /set aspell.check.* | Options to control spell checking. -| dict | <> + - /set aspell.dict.* | Dictionaries used by buffer (options can be added/removed in section). -| look | /set aspell.look.* | Look and feel. -| option | /set aspell.option.* | <> (options can be added/removed in section). +| Section | Control command | Description +| color | /set spell.color.* | Colors. +| check | /set spell.check.* | Options to control spell checking. +| dict | <> + + /set spell.dict.* | Dictionaries used by buffer (options can be added/removed in section). +| look | /set spell.look.* | Look and feel. +| option | /set spell.option.* | <> (options can be added/removed in section). |=== Options: -include::autogen/user/aspell_options.adoc[] +include::autogen/user/spell_options.adoc[] [[buflist_plugin]] === Buflist diff --git a/doc/fr/autogen/plugin_api/completions.adoc b/doc/fr/autogen/plugin_api/completions.adoc index f380751ad..f0bf4cead 100644 --- a/doc/fr/autogen/plugin_api/completions.adoc +++ b/doc/fr/autogen/plugin_api/completions.adoc @@ -10,10 +10,6 @@ | alias | alias_value | valeur de l'alias -| aspell | aspell_dicts | liste des dictionnaires aspell installés - -| aspell | aspell_langs | liste de toutes les langues supportées par aspell - | exec | exec_commands_ids | ids (nombres et noms) des commandes exécutées | fset | fset_options | fichiers de configuration, section, options et mots des options @@ -86,6 +82,10 @@ | script | script_tags | étiquettes des scripts dans le dépôt +| spell | spell_dicts | list of installed dictionaries + +| spell | spell_langs | list of all languages supported + | tcl | tcl_script | liste des scripts | trigger | trigger_hook_arguments | paramètres par défaut pour un hook diff --git a/doc/fr/autogen/plugin_api/infos.adoc b/doc/fr/autogen/plugin_api/infos.adoc index a97df4dbc..3d97d41c5 100644 --- a/doc/fr/autogen/plugin_api/infos.adoc +++ b/doc/fr/autogen/plugin_api/infos.adoc @@ -6,8 +6,6 @@ |=== | Extension | Nom | Description | Paramètres -| aspell | aspell_dict | liste de dictionnaires (séparés par des virgules) utilisés sur le tampon | pointeur vers un tampon ("0x12345678") ou nom complet de tampon ("irc.freenode.#weechat") - | fifo | fifo_filename | nom du tube FIFO | - | guile | guile_eval | évaluation de code source | code source à exécuter @@ -74,6 +72,8 @@ | ruby | ruby_version | version de l'interpréteur utilisé | - +| spell | spell_dict | liste de dictionnaires (séparés par des virgules) utilisés sur le tampon | pointeur vers un tampon ("0x12345678") ou nom complet de tampon ("irc.freenode.#weechat") + | tcl | tcl_eval | évaluation de code source | code source à exécuter | tcl | tcl_interpreter | nom de l'interpréteur utilisé | - diff --git a/doc/fr/autogen/plugin_api/plugins_priority.adoc b/doc/fr/autogen/plugin_api/plugins_priority.adoc index 0adb939c7..f28c95b92 100644 --- a/doc/fr/autogen/plugin_api/plugins_priority.adoc +++ b/doc/fr/autogen/plugin_api/plugins_priority.adoc @@ -6,7 +6,7 @@ . logger (14000) . exec (13000) . trigger (12000) -. aspell (11000) +. spell (11000) . alias (10000) . buflist (9000) . fifo (8000) diff --git a/doc/fr/autogen/user/aspell_commands.adoc b/doc/fr/autogen/user/aspell_commands.adoc deleted file mode 100644 index 330f0c76f..000000000 --- a/doc/fr/autogen/user/aspell_commands.adoc +++ /dev/null @@ -1,32 +0,0 @@ -// -// This file is auto-generated by script docgen.py. -// DO NOT EDIT BY HAND! -// -[[command_aspell_aspell]] -* `+aspell+`: configuration de l'extension aspell - ----- -/aspell enable|disable|toggle - listdict - setdict [,...] - deldict - addword [] - - enable : activer aspell - disable : désactiver aspell - toggle : activer/désactiver aspell -listdict : afficher les dictionnaires installés - setdict : définir le dictionnaire pour le tampon courant (plusieurs dictionnaires peuvent être séparés par une virgule) - deldict : supprimer le dictionnaire utilisé sur le tampon courant - addword : ajouter un mot dans le dictionnaire personnel aspell - -Les lignes d'entrée commençant par '/' ne sont pas vérifiées, sauf pour certaines commandes (voir /set aspell.check.commands). - -Pour activer aspell sur tous les tampons, utilisez l'option "default_dict", par exemple : - /set aspell.check.default_dict "en" - /aspell enable - -Pour afficher une liste des suggestions dans une barre, utilisez l'objet "aspell_suggest". - -La touche par défaut pour activer/désactiver aspell est alt-s. ----- diff --git a/doc/fr/autogen/user/spell_commands.adoc b/doc/fr/autogen/user/spell_commands.adoc new file mode 100644 index 000000000..dbc474c5c --- /dev/null +++ b/doc/fr/autogen/user/spell_commands.adoc @@ -0,0 +1,32 @@ +// +// This file is auto-generated by script docgen.py. +// DO NOT EDIT BY HAND! +// +[[command_spell_spell]] +* `+spell+`: spell plugin configuration + +---- +/spell enable|disable|toggle + listdict + setdict [,...] + deldict + addword [] + + enable: enable spell checker + disable: disable spell checker + toggle: toggle spell checker +listdict: show installed dictionaries + setdict: set dictionary for current buffer (multiple dictionaries can be separated by a comma) + deldict: delete dictionary used on current buffer + addword: add a word in personal dictionary + +Input line beginning with a '/' is not checked, except for some commands (see /set spell.check.commands). + +To enable spell checker on all buffers, use option "default_dict", then enable spell checker, for example: + /set spell.check.default_dict "en" + /spell enable + +To display a list of suggestions in a bar, use item "spell_suggest". + +Default key to toggle spell checker is alt-s. +---- diff --git a/doc/fr/autogen/user/aspell_options.adoc b/doc/fr/autogen/user/spell_options.adoc similarity index 61% rename from doc/fr/autogen/user/aspell_options.adoc rename to doc/fr/autogen/user/spell_options.adoc index d634e4e30..363737f35 100644 --- a/doc/fr/autogen/user/aspell_options.adoc +++ b/doc/fr/autogen/user/spell_options.adoc @@ -2,80 +2,80 @@ // This file is auto-generated by script docgen.py. // DO NOT EDIT BY HAND! // -* [[option_aspell.check.commands]] *aspell.check.commands* +* [[option_spell.check.commands]] *spell.check.commands* ** description: pass:none[liste de commandes (séparées par des virgules) pour lesquelles la vérification orthographique est activée (la vérification est désactivée pour toutes les autres commandes)] ** type: chaîne ** valeurs: toute chaîne ** valeur par défaut: `+"ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query,quit,topic"+` -* [[option_aspell.check.default_dict]] *aspell.check.default_dict* -** description: pass:none[dictionnaire par défaut (ou liste de dictionnaires séparés par une virgule) à utiliser quand le tampon courant n'a pas de dictionnaire défini (laissez blanc pour désactiver aspell sur les tampons pour lesquels vous ne l'avez pas explicitement activé)] +* [[option_spell.check.default_dict]] *spell.check.default_dict* +** description: pass:none[default dictionary (or comma separated list of dictionaries) to use when buffer has no dictionary defined (leave blank to disable spell checker on buffers for which you didn't explicitly enabled it)] ** type: chaîne ** valeurs: toute chaîne ** valeur par défaut: `+""+` -* [[option_aspell.check.during_search]] *aspell.check.during_search* +* [[option_spell.check.during_search]] *spell.check.during_search* ** description: pass:none[vérifier les mots pendant la recherche de texte dans le tampon] ** type: booléen ** valeurs: on, off ** valeur par défaut: `+off+` -* [[option_aspell.check.enabled]] *aspell.check.enabled* -** description: pass:none[activer la vérification aspell pour la ligne de commande] +* [[option_spell.check.enabled]] *spell.check.enabled* +** description: pass:none[enable spell checker for command line] ** type: booléen ** valeurs: on, off ** valeur par défaut: `+off+` -* [[option_aspell.check.real_time]] *aspell.check.real_time* +* [[option_spell.check.real_time]] *spell.check.real_time* ** description: pass:none[vérification orthographique des mots en temps réel (plus lent, désactivé par défaut : les mots sont vérifiés seulement s'il y a un délimiteur après)] ** type: booléen ** valeurs: on, off ** valeur par défaut: `+off+` -* [[option_aspell.check.suggestions]] *aspell.check.suggestions* -** description: pass:none[nombre de suggestions à afficher dans l'objet de barre "aspell_suggest" pour chaque dictionnaire du tampon (-1 = désactiver les suggestions, 0 = afficher toutes les suggestions possibles dans toutes les langues)] +* [[option_spell.check.suggestions]] *spell.check.suggestions* +** description: pass:none[number of suggestions to display in bar item "spell_suggest" for each dictionary set in buffer (-1 = disable suggestions, 0 = display all possible suggestions in all languages)] ** type: entier ** valeurs: -1 .. 2147483647 ** valeur par défaut: `+-1+` -* [[option_aspell.check.word_min_length]] *aspell.check.word_min_length* +* [[option_spell.check.word_min_length]] *spell.check.word_min_length* ** description: pass:none[longueur minimum d'un mot pour que l'orthographe soit vérifiée (utilisez 0 pour vérifier tous les mots)] ** type: entier ** valeurs: 0 .. 2147483647 ** valeur par défaut: `+2+` -* [[option_aspell.color.misspelled]] *aspell.color.misspelled* +* [[option_spell.color.misspelled]] *spell.color.misspelled* ** description: pass:none[couleur du texte pour les mots mal orthographiés (barre de saisie)] ** type: couleur ** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias ; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour le gras, "!" pour la vidéo inverse, "/" pour l'italique, "_" pour le souligné ** valeur par défaut: `+lightred+` -* [[option_aspell.color.suggestion]] *aspell.color.suggestion* -** description: pass:none[couleur du texte pour la suggestion sur un mot mal orthographié dans l'objet de barre "aspell_suggest"] +* [[option_spell.color.suggestion]] *spell.color.suggestion* +** description: pass:none[text color for suggestion on a misspelled word in bar item "spell_suggest"] ** type: couleur ** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias ; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour le gras, "!" pour la vidéo inverse, "/" pour l'italique, "_" pour le souligné ** valeur par défaut: `+default+` -* [[option_aspell.color.suggestion_delimiter_dict]] *aspell.color.suggestion_delimiter_dict* -** description: pass:none[couleur du texte pour les séparateurs affichés entre deux dictionnaires dans l'objet de barre "aspell_suggest"] +* [[option_spell.color.suggestion_delimiter_dict]] *spell.color.suggestion_delimiter_dict* +** description: pass:none[text color for delimiters displayed between two dictionaries in bar item "spell_suggest"] ** type: couleur ** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias ; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour le gras, "!" pour la vidéo inverse, "/" pour l'italique, "_" pour le souligné ** valeur par défaut: `+cyan+` -* [[option_aspell.color.suggestion_delimiter_word]] *aspell.color.suggestion_delimiter_word* -** description: pass:none[couleur du texte pour les séparateurs affichés entre deux mots dans l'objet de barre "aspell_suggest"] +* [[option_spell.color.suggestion_delimiter_word]] *spell.color.suggestion_delimiter_word* +** description: pass:none[text color for delimiters displayed between two words in bar item "spell_suggest"] ** type: couleur ** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias ; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour le gras, "!" pour la vidéo inverse, "/" pour l'italique, "_" pour le souligné ** valeur par défaut: `+cyan+` -* [[option_aspell.look.suggestion_delimiter_dict]] *aspell.look.suggestion_delimiter_dict* -** description: pass:none[séparateur affiché entre deux dictionnaires dans l'objet de barre "aspell_suggest"] +* [[option_spell.look.suggestion_delimiter_dict]] *spell.look.suggestion_delimiter_dict* +** description: pass:none[delimiter displayed between two dictionaries in bar item "spell_suggest"] ** type: chaîne ** valeurs: toute chaîne ** valeur par défaut: `+" / "+` -* [[option_aspell.look.suggestion_delimiter_word]] *aspell.look.suggestion_delimiter_word* -** description: pass:none[séparateur affiché entre deux mots dans l'objet de barre "aspell_suggest"] +* [[option_spell.look.suggestion_delimiter_word]] *spell.look.suggestion_delimiter_word* +** description: pass:none[delimiter displayed between two words in bar item "spell_suggest"] ** type: chaîne ** valeurs: toute chaîne ** valeur par défaut: `+","+` diff --git a/doc/fr/man_files.fr.adoc b/doc/fr/man_files.fr.adoc index 87a120e3b..7043d8aa0 100644 --- a/doc/fr/man_files.fr.adoc +++ b/doc/fr/man_files.fr.adoc @@ -10,9 +10,6 @@ $HOME/.weechat/sec.conf:: $HOME/.weechat/alias.conf:: fichier de configuration pour l'extension _alias_ -$HOME/.weechat/aspell.conf:: - fichier de configuration pour l'extension _aspell_ - $HOME/.weechat/buflist.conf:: fichier de configuration pour l'extension _buflist_ @@ -61,6 +58,9 @@ $HOME/.weechat/ruby.conf:: $HOME/.weechat/script.conf:: fichier de configuration pour l'extension _script_ +$HOME/.weechat/spell.conf:: + fichier de configuration pour l'extension _spell_ + $HOME/.weechat/tcl.conf:: fichier de configuration pour l'extension _tcl_ diff --git a/doc/fr/weechat_dev.fr.adoc b/doc/fr/weechat_dev.fr.adoc index 6f95a12b5..81f857bad 100644 --- a/doc/fr/weechat_dev.fr.adoc +++ b/doc/fr/weechat_dev.fr.adoc @@ -72,7 +72,6 @@ Les répertoires principaux de WeeChat sont : |          normal/ | Interface Curses. |    plugins/ | API extension/script. |       alias/ | Extension Alias. -|       aspell/ | Extension Aspell. |       buflist/ | Extension Buflist. |       charset/ | Extension Charset. |       exec/ | Extension Exec. @@ -89,6 +88,7 @@ Les répertoires principaux de WeeChat sont : |       relay/ | Extension Relay (proxy IRC + relai pour interfaces distantes). |       ruby/ | API script Ruby. |       script/ | Gestionnaire de scripts. +|       spell/ | Extension Spell. |       tcl/ | API script Tcl. |       trigger/ | Extension Trigger. |       xfer/ | Extension Xfer (IRC DCC fichier/discussion). @@ -225,14 +225,14 @@ Le cœur de WeeChat est situé dans les répertoires suivants : |       alias-completion.c | Complétions pour Alias. |       alias-config.c | Options de configuration des alias (fichier alias.conf). |       alias-info.c | Info/infolists/hdata pour les alias. -|    aspell/ | Extension Aspell. -|       weechat-aspell.c | Fonctions principales pour Aspell. -|       weechat-aspell-bar-item.c | Objets de barre Aspell. -|       weechat-aspell-command.c | Commandes Aspell. -|       weechat-aspell-completion.c | Complétions pour Aspell. -|       weechat-aspell-config.c | Options de configuration pour Aspell (fichier aspell.conf). -|       weechat-aspell-info.c | Info/infolists/hdata pour Aspell. -|       weechat-aspell-speller.c | Gestion des correcteurs orthographiques. +|    spell/ | Extension Spell. +|       spell.c | Fonctions principales pour Spell. +|       spell-bar-item.c | Objets de barre Spell. +|       spell-command.c | Commandes Spell. +|       spell-completion.c | Complétions pour Spell. +|       spell-config.c | Options de configuration pour Spell (fichier spell.conf). +|       spell-info.c | Info/infolists/hdata pour Spell. +|       spell-speller.c | Gestion des correcteurs orthographiques. |    buflist/ | Extension Buflist. |       buflist.c | Fonctions principales de Buflist. |       buflist-bar-item.c | Objets de barre Buflist. diff --git a/doc/fr/weechat_faq.fr.adoc b/doc/fr/weechat_faq.fr.adoc index 047204d68..063530f98 100644 --- a/doc/fr/weechat_faq.fr.adoc +++ b/doc/fr/weechat_faq.fr.adoc @@ -1000,15 +1000,19 @@ $ cd ~/.weechat/script $ curl -O https://weechat.org/files/plugins.xml.gz ---- -[[aspell_dictionaries]] +[[spell_dictionaries]] === J'ai installé des dictionnaires aspell sur mon système, comment les utiliser sans redémarrer WeeChat ? -Vous devez recharger l'extension aspell : +Vous devez recharger l'extension spell : ---- -/plugin reload aspell +/plugin reload spell ---- +[NOTE] +Avec WeeChat ≤ 2.3, l'extension "spell" s'appelait "aspell", donc la commande est : +`/plugin reload aspell`. + [[settings]] == Réglages @@ -1042,8 +1046,8 @@ Vous pouvez essayer les astuces suivantes pour consommer moins de mémoire : * Utiliser la dernière version stable (elle est supposée avoir moins de fuites de mémoire que les versions plus anciennes). * Ne pas charger les extensions si vous ne les utilisez pas, par exemple : - aspell, buflist, fifo, logger, perl, python, ruby, lua, tcl, guile, - javascript, php, xfer (utilisé pour les DCC). + buflist, fifo, logger, perl, python, ruby, lua, tcl, guile, javascript, php, + spell, xfer (utilisé pour les DCC). Voir `/help weechat.plugin.autoload`. * Charger uniquement les scripts dont vous avez vraiment besoin. * Ne pas charger les certificats si SSL n'est *PAS* utilisé : affecter une @@ -1062,7 +1066,7 @@ celles-ci : * Supprimer l'affichage des secondes dans l'heure de la barre de statut : `/set weechat.look.item_time_format "%H:%M"` (ceci est la valeur par défaut). * Désactiver la vérification en temps réel des mots mal orthographiés dans la - ligne de commande (si vous l'avez activée) : `/set aspell.check.real_time off`. + ligne de commande (si vous l'avez activée) : `/set spell.check.real_time off`. * Définir la variable _TZ_ (par exemple : `export TZ="Europe/Paris"`), pour éviter un accès fréquent au fichier _/etc/localtime_. diff --git a/doc/fr/weechat_plugin_api.fr.adoc b/doc/fr/weechat_plugin_api.fr.adoc index df8b94e23..45d77e815 100644 --- a/doc/fr/weechat_plugin_api.fr.adoc +++ b/doc/fr/weechat_plugin_api.fr.adoc @@ -9768,11 +9768,6 @@ Liste des signaux envoyés par WeeChat et les extensions : |=== | Extension | Signal | Paramètres | Description -| aspell | aspell_suggest + - _(WeeChat ≥ 0.4.0)_ | - Pointeur : tampon. | - Nouvelles suggestions pour un mot mal orthographié. - | guile | guile_script_loaded + _(WeeChat ≥ 0.3.9)_ | Chaîne : chemin vers le script. | @@ -10078,6 +10073,11 @@ Liste des signaux envoyés par WeeChat et les extensions : Chaîne : liste de scripts supprimés (séparés par des virgules). | Script(s) ruby supprimé(s). +| spell | spell_suggest + + _(WeeChat ≥ 2.4)_ | + Pointeur : tampon. | + Nouvelles suggestions pour un mot mal orthographié. + | tcl | tcl_script_loaded + _(WeeChat ≥ 0.3.9)_ | Chaîne : chemin vers le script. | diff --git a/doc/fr/weechat_user.fr.adoc b/doc/fr/weechat_user.fr.adoc index 48221255c..120eb7a55 100644 --- a/doc/fr/weechat_user.fr.adoc +++ b/doc/fr/weechat_user.fr.adoc @@ -111,7 +111,7 @@ compiler WeeChat. | gettext | | | Internationalisation (traduction des messages; la langue de base est l'anglais). | ca-certificates | | | Certificats pour les connexions SSL. | libaspell-dev - ∥ libenchant-dev | | | Extension aspell. + ∥ libenchant-dev | | | Extension spell. | python-dev | ≥ 2.6 ^(4)^ | | Extension python. | libperl-dev | | | Extension perl. | ruby2.5, ruby2.5-dev | ≥ 1.8 | | Extension ruby. @@ -196,9 +196,6 @@ Liste des options couramment utilisées : | ENABLE_ALIAS | `ON`, `OFF` | ON | Compiler <>. -| ENABLE_ASPELL | `ON`, `OFF` | ON | - Compiler <>. - | ENABLE_BUFLIST | `ON`, `OFF` | ON | Compiler <>. @@ -214,7 +211,7 @@ Liste des options couramment utilisées : si vous ne pouvez pas consulter la documentation en ligne). | ENABLE_ENCHANT | `ON`, `OFF` | OFF | - Compiler <> avec Enchant. + Compiler <> avec Enchant. | ENABLE_EXEC | `ON`, `OFF` | ON | Compiler <>. @@ -278,6 +275,9 @@ Liste des options couramment utilisées : Compiler <> (Python, Perl, Ruby, Lua, Tcl, Guile, JavaScript, PHP). +| ENABLE_SPELL | `ON`, `OFF` | ON | + Compiler <>. + | ENABLE_TCL | `ON`, `OFF` | ON | Compiler <>. @@ -576,7 +576,6 @@ Les fichiers dans le répertoire principal de WeeChat sont : | sec.conf | Fichier de configuration avec les données sécurisées | *Oui, très sensibles*: ce fichier ne doit jamais être partagé avec quiconque. | plugins.conf | Fichier de configuration des extensions | Possible, cela dépend des extensions/scripts. | alias.conf | Fichier de configuration de l'extension _alias_ | Possible, cela dépend des alias. -| aspell.conf | Fichier de configuration de l'extension _aspell_ | Non. | buflist.conf | Fichier de configuration de l'extension _buflist_ | Non. | charset.conf | Fichier de configuration de l'extension _charset_ | Non. | exec.conf | Fichier de configuration de l'extension _exec_ | Non. @@ -594,6 +593,7 @@ Les fichiers dans le répertoire principal de WeeChat sont : | ruby.conf | Fichier de configuration de l'extension _ruby_ | Non. | script.conf | Fichier de configuration de l'extension _script_ | Non. | tcl.conf | Fichier de configuration de l'extension _tcl_ | Non. +| spell.conf | Fichier de configuration de l'extension _spell_ | Non. | trigger.conf | Fichier de configuration de l'extension _trigger_ | Possible, cela dépend des triggers. | xfer.conf | Fichier de configuration de l'extension _xfer_ | Non. | weechat.log | Fichier de log WeeChat | Non. @@ -718,8 +718,8 @@ Autres objets (non utilisés dans des barres par défaut) : [width="100%",cols="^3,^4,10",options="header"] |=== | Objet (item) | Exemple | Description -| aspell_dict | `fr,en` | Dictionnaires utilisés pour la vérification de l'orthographe sur le tampon courant. -| aspell_suggest | `print,prone,prune` | Suggestions pour le mot sous le curseur (si mal orthographié). +| spell_dict | `fr,en` | Dictionnaires utilisés pour la vérification de l'orthographe sur le tampon courant. +| spell_suggest | `print,prone,prune` | Suggestions pour le mot sous le curseur (si mal orthographié). | buffer_count | `10` | Nombre total de tampons ouverts. | buffer_short_name | `#test` | Nom court du tampon courant. | irc_channel | `#test` | Nom de canal IRC courant. @@ -1670,7 +1670,7 @@ avec `/help buffer_autoset`. | kbd:[Alt+d] | Effacer le mot suivant (la chaîne supprimée est copiée dans le presse-papiers interne). | `/input delete_next_word` | kbd:[Alt+k] | Capturer une touche et insérer son code (et la commande associée si la commande existe) sur la ligne de commande. | `/input grab_key_command` | kbd:[Alt+r] | Effacer entièrement la ligne de commande. | `/input delete_line` -| kbd:[Alt+s] | Activer/désactiver aspell. | `/mute aspell toggle` +| kbd:[Alt+s] | Activer/désactiver la vérification de l'orthographe. | `/mute spell toggle` |=== [[key_bindings_buffers_windows]] @@ -2159,7 +2159,6 @@ Les extensions par défaut sont : |=== | Extension | Description | alias | Définition d'alias pour les commandes. -| aspell | Vérification orthographique de la ligne de commande. | buflist | Objet de barre avec la liste des tampons. | charset | Encodage/encodage avec jeu de caractère sur les tampons. | exec | Exécution de commandes externes dans WeeChat. @@ -2177,6 +2176,7 @@ Les extensions par défaut sont : | guile | Interface (API) pour scripts Guile (scheme). | javascript | Interface (API) pour scripts JavaScript. | php | Interface (API) pour scripts PHP. +| spell | Vérification orthographique de la ligne de commande. | trigger | Remplacement de texte et exécution de commande sur des évènements de WeeChat ou des extensions. | xfer | Transfert de fichier et discussion directe. |=== @@ -2219,16 +2219,16 @@ Sections dans le fichier _alias.conf_ : /set alias.completion.* | Complétions pour les alias. |=== -[[aspell_plugin]] -=== Aspell +[[spell_plugin]] +=== Spell -L'extension Aspell permet de vérifier l'orthographe de la ligne de commande. +L'extension Spell permet de vérifier l'orthographe de la ligne de commande. Il est possible d'utiliser plusieurs langages par tampon. La vérification de l'orthographe est désactivée par défaut et peut être activée/désactivée avec la touche kbd:[Alt+s]. -[[aspell_dictionaries]] +[[spell_dictionaries]] ==== Dictionnaires Avant d'utiliser la vérification de l'orthographe, les dictionnaires doivent @@ -2240,26 +2240,26 @@ les mots dans tous les dictionnaires. Par exemple pour utiliser l'anglais et le français : ---- -/set aspell.check.default_dict "en,fr" +/set spell.check.default_dict "en,fr" ---- Il est possible d'utiliser un dictionnaire différent sur un tampon spécifique, par exemple sur un canal allemand : ---- -/aspell setdict de +/spell setdict de ---- Vous pouvez aussi spécifier un dictionnaire pour un groupe de tampons, par exemple l'anglais pour tous les canaux du serveur IRC freenode : ---- -/set aspell.dict.irc.freenode en +/set spell.dict.irc.freenode en ---- -Pour plus d'informations, voir la commande <>. +Pour plus d'informations, voir la commande <>. -[[aspell_speller_options]] +[[spell_speller_options]] ==== Options du vérificateur d'orthographe Les options du vérificateur d'orthographe peuvent être définies en ajoutant des @@ -2275,18 +2275,18 @@ $ aspell config Par exemple, pour activer l'option "ignore-case" : ---- -/set aspell.option.ignore-case "true" +/set spell.option.ignore-case "true" ---- -[[aspell_suggestions]] +[[spell_suggestions]] ==== Suggestions -Les suggestions sont affichées dans un objet de barre appelé "aspell_suggest". -Le nombre de suggestions est défini dans l'option _aspell.check.suggestions_. +Les suggestions sont affichées dans un objet de barre appelé "spell_suggest". +Le nombre de suggestions est défini dans l'option _spell.check.suggestions_. Pour activer les suggestions, vous devez modifier l'option -_aspell.check.suggestions_ avec un entier ≥ 0 et ajouter l'objet de barre -"aspell_suggest" à une barre, par exemple _status_. +_spell.check.suggestions_ avec un entier ≥ 0 et ajouter l'objet de barre +"spell_suggest" à une barre, par exemple _status_. Exemple de suggestions avec un dictionnaire anglais (`en`) : @@ -2304,30 +2304,30 @@ Exemple de suggestions avec des dictionnaires anglais et français (`en,fr`) : └─────────────────────────────────────────────────────────────────────────────────┘ .... -[[aspell_commands]] +[[spell_commands]] ==== Commandes -include::autogen/user/aspell_commands.adoc[] +include::autogen/user/spell_commands.adoc[] -[[aspell_options]] +[[spell_options]] ==== Options -Sections dans le fichier _aspell.conf_ : +Sections dans le fichier _spell.conf_ : [width="100%",cols="3m,6m,16",options="header"] |=== -| Section | Commande de contrôle | Description -| color | /set aspell.color.* | Couleurs. -| check | /set aspell.check.* | Options pour contrôler la vérification orthographique. -| dict | <> + - /set aspell.dict.* | Dictionnaires utilisés par tampon (les options peuvent être ajoutées/supprimées dans la section). -| look | /set aspell.look.* | Aspect/présentation. -| option | /set aspell.option.* | <> (les options peuvent être ajoutées/supprimées dans la section). +| Section | Commande de contrôle | Description +| color | /set spell.color.* | Couleurs. +| check | /set spell.check.* | Options pour contrôler la vérification orthographique. +| dict | <> + + /set spell.dict.* | Dictionnaires utilisés par tampon (les options peuvent être ajoutées/supprimées dans la section). +| look | /set spell.look.* | Aspect/présentation. +| option | /set spell.option.* | <> (les options peuvent être ajoutées/supprimées dans la section). |=== Options : -include::autogen/user/aspell_options.adoc[] +include::autogen/user/spell_options.adoc[] [[buflist_plugin]] === Buflist diff --git a/doc/it/autogen/plugin_api/completions.adoc b/doc/it/autogen/plugin_api/completions.adoc index 3fe17a4a5..5489f6d38 100644 --- a/doc/it/autogen/plugin_api/completions.adoc +++ b/doc/it/autogen/plugin_api/completions.adoc @@ -10,10 +10,6 @@ | alias | alias_value | valore dell'alias -| aspell | aspell_dicts | elenco dei dizionari aspell installati - -| aspell | aspell_langs | elenco di tutte lingue supportate da aspell - | exec | exec_commands_ids | ids (numbers and names) of executed commands | fset | fset_options | configuration files, sections, options and words of options @@ -86,6 +82,10 @@ | script | script_tags | tag degli script nel repository +| spell | spell_dicts | list of installed dictionaries + +| spell | spell_langs | list of all languages supported + | tcl | tcl_script | elenco degli script | trigger | trigger_hook_arguments | default arguments for a hook diff --git a/doc/it/autogen/plugin_api/infos.adoc b/doc/it/autogen/plugin_api/infos.adoc index 1f77d30fc..0a01f09f6 100644 --- a/doc/it/autogen/plugin_api/infos.adoc +++ b/doc/it/autogen/plugin_api/infos.adoc @@ -6,8 +6,6 @@ |=== | Plugin | Nome | Descrizione | Argomenti -| aspell | aspell_dict | elenco separato da virgole di dizionari usati nel buffer | puntatore al buffer ("0x12345678") o buffer con il nome completo ("irc.freenode.weechat") - | fifo | fifo_filename | nome della pipe FIFO | - | guile | guile_eval | evaluation of source code | source code to execute @@ -74,6 +72,8 @@ | ruby | ruby_version | version of the interpreter used | - +| spell | spell_dict | elenco separato da virgole di dizionari usati nel buffer | puntatore al buffer ("0x12345678") o buffer con il nome completo ("irc.freenode.weechat") + | tcl | tcl_eval | evaluation of source code | source code to execute | tcl | tcl_interpreter | name of the interpreter used | - diff --git a/doc/it/autogen/plugin_api/plugins_priority.adoc b/doc/it/autogen/plugin_api/plugins_priority.adoc index 0adb939c7..f28c95b92 100644 --- a/doc/it/autogen/plugin_api/plugins_priority.adoc +++ b/doc/it/autogen/plugin_api/plugins_priority.adoc @@ -6,7 +6,7 @@ . logger (14000) . exec (13000) . trigger (12000) -. aspell (11000) +. spell (11000) . alias (10000) . buflist (9000) . fifo (8000) diff --git a/doc/it/autogen/user/aspell_commands.adoc b/doc/it/autogen/user/aspell_commands.adoc deleted file mode 100644 index 4e897f82c..000000000 --- a/doc/it/autogen/user/aspell_commands.adoc +++ /dev/null @@ -1,32 +0,0 @@ -// -// This file is auto-generated by script docgen.py. -// DO NOT EDIT BY HAND! -// -[[command_aspell_aspell]] -* `+aspell+`: configurazione del plugin aspell - ----- -/aspell enable|disable|toggle - listdict - setdict [,...] - deldict - addword [] - - enable: enable aspell - disable: disable aspell - toggle: toggle aspell -listdict: show installed dictionaries - setdict: set dictionary for current buffer (multiple dictionaries can be separated by a comma) - deldict: delete dictionary used on current buffer - addword: add a word in personal aspell dictionary - -Input line beginning with a '/' is not checked, except for some commands (see /set aspell.check.commands). - -To enable aspell on all buffers, use option "default_dict", then enable aspell, for example: - /set aspell.check.default_dict "en" - /aspell enable - -To display a list of suggestions in a bar, use item "aspell_suggest". - -Default key to toggle aspell is alt-s. ----- diff --git a/doc/it/autogen/user/spell_commands.adoc b/doc/it/autogen/user/spell_commands.adoc new file mode 100644 index 000000000..eb7e70b11 --- /dev/null +++ b/doc/it/autogen/user/spell_commands.adoc @@ -0,0 +1,32 @@ +// +// This file is auto-generated by script docgen.py. +// DO NOT EDIT BY HAND! +// +[[command_spell_spell]] +* `+spell+`: spell plugin configuration + +---- +/spell enable|disable|toggle + listdict + setdict [,...] + deldict + addword [] + + enable: enable spell checker + disable: disable spell checker + toggle: toggle spell checker +listdict: show installed dictionaries + setdict: set dictionary for current buffer (multiple dictionaries can be separated by a comma) + deldict: delete dictionary used on current buffer + addword: add a word in personal dictionary + +Input line beginning with a '/' is not checked, except for some commands (see /set spell.check.commands). + +To enable spell checker on all buffers, use option "default_dict", then enable spell checker, for example: + /set spell.check.default_dict "en" + /spell enable + +To display a list of suggestions in a bar, use item "spell_suggest". + +Default key to toggle spell checker is alt-s. +---- diff --git a/doc/it/autogen/user/aspell_options.adoc b/doc/it/autogen/user/spell_options.adoc similarity index 66% rename from doc/it/autogen/user/aspell_options.adoc rename to doc/it/autogen/user/spell_options.adoc index 35f1361c1..1fcb51a63 100644 --- a/doc/it/autogen/user/aspell_options.adoc +++ b/doc/it/autogen/user/spell_options.adoc @@ -2,80 +2,80 @@ // This file is auto-generated by script docgen.py. // DO NOT EDIT BY HAND! // -* [[option_aspell.check.commands]] *aspell.check.commands* +* [[option_spell.check.commands]] *spell.check.commands* ** descrizione: pass:none[elenco separato da virgole di comandi per cui il controllo ortografico è abilitato (il controllo ortografico è disabilitato per tutti gli altri comandi)] ** tipo: stringa ** valori: qualsiasi stringa ** valore predefinito: `+"ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query,quit,topic"+` -* [[option_aspell.check.default_dict]] *aspell.check.default_dict* -** descrizione: pass:none[dizionario predefinito (o elenco separato da virgole di dizionari) da usare quando il buffer non ha alcun dizionario definito (vuoto per disabilitare il controllo ortografico sui buffer in cui non è stato esplicitamente abilitato)] +* [[option_spell.check.default_dict]] *spell.check.default_dict* +** descrizione: pass:none[default dictionary (or comma separated list of dictionaries) to use when buffer has no dictionary defined (leave blank to disable spell checker on buffers for which you didn't explicitly enabled it)] ** tipo: stringa ** valori: qualsiasi stringa ** valore predefinito: `+""+` -* [[option_aspell.check.during_search]] *aspell.check.during_search* +* [[option_spell.check.during_search]] *spell.check.during_search* ** descrizione: pass:none[controlla le parole durante la ricerca del testo nel buffer] ** tipo: bool ** valori: on, off ** valore predefinito: `+off+` -* [[option_aspell.check.enabled]] *aspell.check.enabled* -** descrizione: pass:none[abilita il controllo aspell per la riga di comando] +* [[option_spell.check.enabled]] *spell.check.enabled* +** descrizione: pass:none[enable spell checker for command line] ** tipo: bool ** valori: on, off ** valore predefinito: `+off+` -* [[option_aspell.check.real_time]] *aspell.check.real_time* +* [[option_spell.check.real_time]] *spell.check.real_time* ** descrizione: pass:none[controllo ortografico in tempo reale (più lento, disabilitato per default: le parole vengono controllate solo se seguite da un delimitatore)] ** tipo: bool ** valori: on, off ** valore predefinito: `+off+` -* [[option_aspell.check.suggestions]] *aspell.check.suggestions* -** descrizione: pass:none[numero di suggerimenti da mostrare nell'elemento barra "aspell_suggest" per ogni dizionario impostato nel buffer (-1 = disattiva suggerimenti, 0 = mostra tutti i possibili suggerimenti in tutte le lingue)] +* [[option_spell.check.suggestions]] *spell.check.suggestions* +** descrizione: pass:none[number of suggestions to display in bar item "spell_suggest" for each dictionary set in buffer (-1 = disable suggestions, 0 = display all possible suggestions in all languages)] ** tipo: intero ** valori: -1 .. 2147483647 ** valore predefinito: `+-1+` -* [[option_aspell.check.word_min_length]] *aspell.check.word_min_length* +* [[option_spell.check.word_min_length]] *spell.check.word_min_length* ** descrizione: pass:none[lunghezza minima per una parola da controllare (0 per controllarle tutte)] ** tipo: intero ** valori: 0 .. 2147483647 ** valore predefinito: `+2+` -* [[option_aspell.color.misspelled]] *aspell.color.misspelled* +* [[option_spell.color.misspelled]] *spell.color.misspelled* ** descrizione: pass:none[text color for misspelled words (input bar)] ** tipo: colore ** valori: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "/" for italic, "_" for underline ** valore predefinito: `+lightred+` -* [[option_aspell.color.suggestion]] *aspell.color.suggestion* -** descrizione: pass:none[text color for suggestion on a misspelled word in bar item "aspell_suggest"] +* [[option_spell.color.suggestion]] *spell.color.suggestion* +** descrizione: pass:none[text color for suggestion on a misspelled word in bar item "spell_suggest"] ** tipo: colore ** valori: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "/" for italic, "_" for underline ** valore predefinito: `+default+` -* [[option_aspell.color.suggestion_delimiter_dict]] *aspell.color.suggestion_delimiter_dict* -** descrizione: pass:none[text color for delimiters displayed between two dictionaries in bar item "aspell_suggest"] +* [[option_spell.color.suggestion_delimiter_dict]] *spell.color.suggestion_delimiter_dict* +** descrizione: pass:none[text color for delimiters displayed between two dictionaries in bar item "spell_suggest"] ** tipo: colore ** valori: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "/" for italic, "_" for underline ** valore predefinito: `+cyan+` -* [[option_aspell.color.suggestion_delimiter_word]] *aspell.color.suggestion_delimiter_word* -** descrizione: pass:none[text color for delimiters displayed between two words in bar item "aspell_suggest"] +* [[option_spell.color.suggestion_delimiter_word]] *spell.color.suggestion_delimiter_word* +** descrizione: pass:none[text color for delimiters displayed between two words in bar item "spell_suggest"] ** tipo: colore ** valori: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "/" for italic, "_" for underline ** valore predefinito: `+cyan+` -* [[option_aspell.look.suggestion_delimiter_dict]] *aspell.look.suggestion_delimiter_dict* -** descrizione: pass:none[delimiter displayed between two dictionaries in bar item "aspell_suggest"] +* [[option_spell.look.suggestion_delimiter_dict]] *spell.look.suggestion_delimiter_dict* +** descrizione: pass:none[delimiter displayed between two dictionaries in bar item "spell_suggest"] ** tipo: stringa ** valori: qualsiasi stringa ** valore predefinito: `+" / "+` -* [[option_aspell.look.suggestion_delimiter_word]] *aspell.look.suggestion_delimiter_word* -** descrizione: pass:none[delimiter displayed between two words in bar item "aspell_suggest"] +* [[option_spell.look.suggestion_delimiter_word]] *spell.look.suggestion_delimiter_word* +** descrizione: pass:none[delimiter displayed between two words in bar item "spell_suggest"] ** tipo: stringa ** valori: qualsiasi stringa ** valore predefinito: `+","+` diff --git a/doc/it/man_files.it.adoc b/doc/it/man_files.it.adoc index 3c9450591..390f9abd3 100644 --- a/doc/it/man_files.it.adoc +++ b/doc/it/man_files.it.adoc @@ -11,9 +11,6 @@ $HOME/.weechat/sec.conf:: $HOME/.weechat/alias.conf:: configuration file for _alias_ plugin -$HOME/.weechat/aspell.conf:: - configuration file for _aspell_ plugin - $HOME/.weechat/buflist.conf:: configuration file for _buflist_ plugin @@ -62,6 +59,9 @@ $HOME/.weechat/ruby.conf:: $HOME/.weechat/script.conf:: configuration file for _script_ plugin +$HOME/.weechat/spell.conf:: + configuration file for _spell_ plugin + $HOME/.weechat/tcl.conf:: configuration file for _tcl_ plugin diff --git a/doc/it/weechat_faq.it.adoc b/doc/it/weechat_faq.it.adoc index 707a96e08..08b9070db 100644 --- a/doc/it/weechat_faq.it.adoc +++ b/doc/it/weechat_faq.it.adoc @@ -1041,16 +1041,21 @@ $ curl -O https://weechat.org/files/plugins.xml.gz ---- // TRANSLATION MISSING -[[aspell_dictionaries]] +[[spell_dictionaries]] === I installed aspell dictionaries on my system, how can I use them without restarting WeeChat? // TRANSLATION MISSING -You have to reload the aspell plugin: +You have to reload the spell plugin: ---- -/plugin reload aspell +/plugin reload spell ---- +// TRANSLATION MISSING +[NOTE] +With WeeChat ≤ 2.3, the "spell" plugin was named "aspell", so the command is: +`/plugin reload aspell`. + [[settings]] == Impostazioni @@ -1083,8 +1088,8 @@ Esistono diversi trucchi per ottimizzare l'uso della memoria: * utilizzare l'ultima versione stabile (si suppone che abbia meno falle di memoria rispetto le versioni precedenti) // TRANSLATION MISSING -* non caricare alcuni plugin se non vengono utilizzati, ad esempio: aspell, buflist, - fifo, logger, perl, python, ruby, lua, tcl, guile, javascript, php, xfer (usato per DCC). +* non caricare alcuni plugin se non vengono utilizzati, ad esempio: buflist, + fifo, logger, perl, python, ruby, lua, tcl, guile, javascript, php, spell, xfer (usato per DCC). See `/help weechat.plugin.autoload`. * caricare solo gli script veramente necessari * non caricare i certificati se SSL *NON* viene usato: usare una stringa vuota nell'opzione @@ -1105,7 +1110,7 @@ You can follow same tips as for <>, and these ones: `/set weechat.look.item_time_format "%H:%M"` (this is the default value) // TRANSLATION MISSING * disable real time check of misspelled words in command line (if you enabled it): - `/set aspell.check.real_time off` + `/set spell.check.real_time off` * set the _TZ_ variable (for example: `export TZ="Europe/Paris"`), to prevent frequent access to file _/etc/localtime_ diff --git a/doc/it/weechat_plugin_api.it.adoc b/doc/it/weechat_plugin_api.it.adoc index 7482f72d9..ee7846361 100644 --- a/doc/it/weechat_plugin_api.it.adoc +++ b/doc/it/weechat_plugin_api.it.adoc @@ -9884,12 +9884,6 @@ List of signals sent by WeeChat and plugins: |=== | Plugin | Segnale | Argomenti | Descrizione -// TRANSLATION MISSING -| aspell | aspell_suggest + - _(WeeChat ≥ 0.4.0)_ | - Pointer: buffer. | - New suggestions for a misspelled word. - // TRANSLATION MISSING | guile | guile_script_loaded + _(WeeChat ≥ 0.3.9)_ | @@ -10234,6 +10228,12 @@ List of signals sent by WeeChat and plugins: String: comma-separated list of scripts removed. | Ruby script(s) removed. +// TRANSLATION MISSING +| spell | spell_suggest + + _(WeeChat ≥ 2.4)_ | + Pointer: buffer. | + New suggestions for a misspelled word. + // TRANSLATION MISSING | tcl | tcl_script_loaded + _(WeeChat ≥ 0.3.9)_ | diff --git a/doc/it/weechat_user.it.adoc b/doc/it/weechat_user.it.adoc index e7e06c14d..d0a80f7b5 100644 --- a/doc/it/weechat_user.it.adoc +++ b/doc/it/weechat_user.it.adoc @@ -130,7 +130,7 @@ compilare WeeChat. | gettext | | | Internazionalizzazione (traduzione dei messaggi; la lingua base è l'inglese). | ca-certificates | | | Certificati per le connessioni SSL. | libaspell-dev - ∥ libenchant-dev | | | Plugin aspell. + ∥ libenchant-dev | | | Plugin spell. | python-dev | ≥ 2.6 ^(4)^ | | Plugin python. | libperl-dev | | | Plugin perl. | ruby2.5, ruby2.5-dev | ≥ 1.8 | | Plugin ruby. @@ -226,9 +226,6 @@ List of commonly used options: | ENABLE_ALIAS | `ON`, `OFF` | ON | Compile <>. -| ENABLE_ASPELL | `ON`, `OFF` | ON | - Compile <>. - | ENABLE_BUFLIST | `ON`, `OFF` | ON | Compile <>. @@ -244,7 +241,7 @@ List of commonly used options: online). | ENABLE_ENCHANT | `ON`, `OFF` | OFF | - Compile <> with Enchant. + Compile <> with Enchant. | ENABLE_EXEC | `ON`, `OFF` | ON | Compile <>. @@ -308,6 +305,9 @@ List of commonly used options: Compile <> (Python, Perl, Ruby, Lua, Tcl, Guile, JavaScript, PHP). +| ENABLE_SPELL | `ON`, `OFF` | ON | + Compile <>. + | ENABLE_TCL | `ON`, `OFF` | ON | Compile <>. @@ -611,7 +611,6 @@ The files in the WeeChat home directory are: | sec.conf | Configuration file with secured data | *Yes, highly sensitive*: this file must never be shared with anyone. | plugins.conf | Plugins configuration file | Possible, depends on plugins/scripts. | alias.conf | Configuration file for _alias_ plugin | Possible, depends on aliases. -| aspell.conf | Configuration file for _aspell_ plugin | No. | buflist.conf | Configuration file for _buflist_ plugin | No. | charset.conf | Configuration file for _charset_ plugin | No. | exec.conf | Configuration file for _exec_ plugin | No. @@ -628,6 +627,7 @@ The files in the WeeChat home directory are: | relay.conf | Configuration file for _relay_ plugin | No. | ruby.conf | Configuration file for _ruby_ plugin | No. | script.conf | Configuration file for _script_ plugin | No. +| spell.conf | Configuration file for _spell_ plugin | No. | tcl.conf | Configuration file for _tcl_ plugin | No. | trigger.conf | Configuration file for _trigger_ plugin | Possible, depends on triggers. | xfer.conf | Configuration file for _xfer_ plugin | No. @@ -763,8 +763,8 @@ Other items available (not used in bars by default): [width="100%",cols="^3,^4,10",options="header"] |=== | Item | Example | Description -| aspell_dict | `fr,en` | Spelling dictionaries used on current buffer. -| aspell_suggest | `print,prone,prune` | Spelling suggestions for word under cursor (if misspelled). +| spell_dict | `fr,en` | Spelling dictionaries used on current buffer. +| spell_suggest | `print,prone,prune` | Spelling suggestions for word under cursor (if misspelled). | buffer_count | `10` | Total number of buffers opened. | buffer_short_name | `#test` | Current buffer short name. | irc_channel | `#test` | Current IRC channel name. @@ -1711,7 +1711,8 @@ with `/script install buffer_autoset.py` and get help with `/help buffer_autoset | kbd:[Alt+d] | Elimina la parola successiva nella riga di comando (deleted string is copied to the internal clipboard). | `/input delete_next_word` | kbd:[Alt+k] | Cattura un tasto ed inserisce il suo codice (e il comando associato se il tasto esiste) nella riga di comando. | `/input grab_key_command` | kbd:[Alt+r] | Elimina l'intera riga di comando. | `/input delete_line` -| kbd:[Alt+s] | Abilita/disabilita aspell. | `/mute aspell toggle` +// TRANSLATION MISSING +| kbd:[Alt+s] | Toggle spell checker. | `/mute spell toggle` |=== [[key_bindings_buffers_windows]] @@ -2217,7 +2218,6 @@ I plugin predefiniti sono: |=== | Plugin | Descrizione | alias | Definisce gli alias per i comandi. -| aspell | Controllo ortografico per la riga di comando. // TRANSLATION MISSING | buflist | Bar item with list of buffers. | charset | Set di caratteri per la codifica/decodifica nei buffer. @@ -2238,6 +2238,7 @@ I plugin predefiniti sono: | guile | API per lo scripting in Guile (scheme). | javascript | API per lo scripting in JavaScript. | php | API per lo scripting in PHP. +| spell | Controllo ortografico per la riga di comando. // TRANSLATION MISSING | trigger | Text replacement and command execution on events triggered by WeeChat/plugins. | xfer | Trasferimento file e chat diretta. @@ -2284,17 +2285,17 @@ Sections in file _alias.conf_: /set alias.completion.* | Completions for aliases. |=== -[[aspell_plugin]] -=== Aspell +[[spell_plugin]] +=== Spell -Il plugin Aspell consente di verificare l'ortografia nella riga di comando. +Il plugin Spell consente di verificare l'ortografia nella riga di comando. È possibile utilizzare più lingue per buffer. // TRANSLATION MISSING Spell checking is disabled by default and can be toggled with key kbd:[Alt+s]. // TRANSLATION MISSING -[[aspell_dictionaries]] +[[spell_dictionaries]] ==== Dictionaries Before using spell checking, dictionaries must be defined, either globally or @@ -2306,14 +2307,14 @@ dictionaries. For example to use English and French: ---- -/set aspell.check.default_dict "en,fr" +/set spell.check.default_dict "en,fr" ---- It is possible to use a different dictionary on a specific buffer, for example on a German channel: ---- -/aspell setdict de +/spell setdict de ---- // TRANSLATION MISSING @@ -2321,12 +2322,12 @@ You can also specify a dictionary for a group of buffers, for example English for all channels on freenode IRC server: ---- -/set aspell.dict.irc.freenode en +/set spell.dict.irc.freenode en ---- -For more information, see the command <>. +For more information, see the command <>. -[[aspell_speller_options]] +[[spell_speller_options]] ==== Opzioni ortografiche Le opzioni ortografiche possono essere definite aggiungendo opzioni nella @@ -2342,18 +2343,18 @@ $ aspell config Ad esempio, per abilitare l'opzione "ignore-case": ---- -/set aspell.option.ignore-case "true" +/set spell.option.ignore-case "true" ---- // TRANSLATION MISSING -[[aspell_suggestions]] +[[spell_suggestions]] ==== Suggestions -Suggestions are displayed in a bar item called "aspell_suggest". The number of -suggestions is set in option _aspell.check.suggestions_. +Suggestions are displayed in a bar item called "spell_suggest". The number of +suggestions is set in option _spell.check.suggestions_. -To enable suggestions you must set option _aspell.check.suggestions_ to an -integer ≥ 0 and add the bar item "aspell_suggest" to a bar, like _status_. +To enable suggestions you must set option _spell.check.suggestions_ to an +integer ≥ 0 and add the bar item "spell_suggest" to a bar, like _status_. Example of suggestions with English dictionary (`en`): @@ -2371,33 +2372,33 @@ Example of suggestions with English and French dictionaries (`en,fr`): └─────────────────────────────────────────────────────────────────────────────────┘ .... -[[aspell_commands]] +[[spell_commands]] ==== Comandi -include::autogen/user/aspell_commands.adoc[] +include::autogen/user/spell_commands.adoc[] -[[aspell_options]] +[[spell_options]] ==== Opzioni // TRANSLATION MISSING -Sections in file _aspell.conf_: +Sections in file _spell.conf_: // TRANSLATION MISSING [width="100%",cols="3m,6m,16",options="header"] |=== -| Section | Control command | Description -| color | /set aspell.color.* | Colors. -| check | /set aspell.check.* | Options to control spell checking. -| dict | <> + - /set aspell.dict.* | Dictionaries used by buffer (options can be added/removed in section). -| look | /set aspell.look.* | Look and feel. -| option | /set aspell.option.* | <> (options can be added/removed in section). +| Section | Control command | Description +| color | /set spell.color.* | Colors. +| check | /set spell.check.* | Options to control spell checking. +| dict | <> + + /set spell.dict.* | Dictionaries used by buffer (options can be added/removed in section). +| look | /set spell.look.* | Look and feel. +| option | /set spell.option.* | <> (options can be added/removed in section). |=== // TRANSLATION MISSING Options: -include::autogen/user/aspell_options.adoc[] +include::autogen/user/spell_options.adoc[] [[buflist_plugin]] === Buflist diff --git a/doc/ja/autogen/plugin_api/completions.adoc b/doc/ja/autogen/plugin_api/completions.adoc index 23f3699f2..e25f46b32 100644 --- a/doc/ja/autogen/plugin_api/completions.adoc +++ b/doc/ja/autogen/plugin_api/completions.adoc @@ -10,10 +10,6 @@ | alias | alias_value | 別名の値 -| aspell | aspell_dicts | aspell のインストール済み辞書のリスト - -| aspell | aspell_langs | aspell でサポートされる全ての言語のリスト - | exec | exec_commands_ids | 実行されたコマンドの識別子 (番号と名前) | fset | fset_options | 設定ファイル、セクション、オプションの名前、オプションの値 @@ -86,6 +82,10 @@ | script | script_tags | リポジトリに存在するスクリプトに対するタグのリスト +| spell | spell_dicts | list of installed dictionaries + +| spell | spell_langs | list of all languages supported + | tcl | tcl_script | スクリプトのリスト | trigger | trigger_hook_arguments | フックに対するデフォルト引数 diff --git a/doc/ja/autogen/plugin_api/infos.adoc b/doc/ja/autogen/plugin_api/infos.adoc index aac96fd94..9e7972d3e 100644 --- a/doc/ja/autogen/plugin_api/infos.adoc +++ b/doc/ja/autogen/plugin_api/infos.adoc @@ -6,8 +6,6 @@ |=== | プラグイン | 名前 | 説明 | 引数 -| aspell | aspell_dict | バッファで使用中の辞書のコンマ区切りリスト | バッファポインタ ("0x12345678") またはバッファのフルネーム ("irc.freenode.#weechat") - | fifo | fifo_filename | FIFO パイプの名前 | - | guile | guile_eval | ソースコードの評価 | 実行するソースコード @@ -74,6 +72,8 @@ | ruby | ruby_version | 使用中のインタプリタのバージョン | - +| spell | spell_dict | バッファで使用中の辞書のコンマ区切りリスト | バッファポインタ ("0x12345678") またはバッファのフルネーム ("irc.freenode.#weechat") + | tcl | tcl_eval | ソースコードの評価 | 実行するソースコード | tcl | tcl_interpreter | 使用中のインタプリタの名前 | - diff --git a/doc/ja/autogen/plugin_api/plugins_priority.adoc b/doc/ja/autogen/plugin_api/plugins_priority.adoc index 0adb939c7..f28c95b92 100644 --- a/doc/ja/autogen/plugin_api/plugins_priority.adoc +++ b/doc/ja/autogen/plugin_api/plugins_priority.adoc @@ -6,7 +6,7 @@ . logger (14000) . exec (13000) . trigger (12000) -. aspell (11000) +. spell (11000) . alias (10000) . buflist (9000) . fifo (8000) diff --git a/doc/ja/autogen/user/aspell_commands.adoc b/doc/ja/autogen/user/aspell_commands.adoc deleted file mode 100644 index f6e038540..000000000 --- a/doc/ja/autogen/user/aspell_commands.adoc +++ /dev/null @@ -1,32 +0,0 @@ -// -// This file is auto-generated by script docgen.py. -// DO NOT EDIT BY HAND! -// -[[command_aspell_aspell]] -* `+aspell+`: aspell プラグイン設定 - ----- -/aspell enable|disable|toggle - listdict - setdict [,...] - deldict - addword [] - - enable: aspell の有効化 - disable: aspell の無効化 - toggle: aspell の有効無効を切り替え -listdict: インストール済み辞書を表示 - setdict: 現在のバッファ用の辞書を設定 (コンマで区切れば複数の辞書を指定可能) - deldict: 現在のバッファ用の辞書を削除 - addword: aspell の個人辞書に単語を追加 - -いくつかのコマンドを除いて '/' で始まる入力行はチェックされません (/set aspell.check.commands を参照してください)。 - -全てのバッファで aspell を有効化するには、"default_dict" オプションを設定した後に、aspell を有効化してください。例: - /set aspell.check.default_dict "en" - /aspell enable - -バーの中に提案のリストを表示するには、"aspell_suggest" 要素を使ってください。 - -aspell の有効無効を切り替えるデフォルトのキーは alt-s です。 ----- diff --git a/doc/ja/autogen/user/spell_commands.adoc b/doc/ja/autogen/user/spell_commands.adoc new file mode 100644 index 000000000..02d003fc1 --- /dev/null +++ b/doc/ja/autogen/user/spell_commands.adoc @@ -0,0 +1,32 @@ +// +// This file is auto-generated by script docgen.py. +// DO NOT EDIT BY HAND! +// +[[command_spell_spell]] +* `+spell+`: spell plugin configuration + +---- +/spell enable|disable|toggle + listdict + setdict [,...] + deldict + addword [] + + enable: enable spell checker + disable: disable spell checker + toggle: toggle spell checker +listdict: show installed dictionaries + setdict: set dictionary for current buffer (multiple dictionaries can be separated by a comma) + deldict: delete dictionary used on current buffer + addword: add a word in personal dictionary + +Input line beginning with a '/' is not checked, except for some commands (see /set spell.check.commands). + +To enable spell checker on all buffers, use option "default_dict", then enable spell checker, for example: + /set spell.check.default_dict "en" + /spell enable + +To display a list of suggestions in a bar, use item "spell_suggest". + +Default key to toggle spell checker is alt-s. +---- diff --git a/doc/ja/autogen/user/aspell_options.adoc b/doc/ja/autogen/user/spell_options.adoc similarity index 61% rename from doc/ja/autogen/user/aspell_options.adoc rename to doc/ja/autogen/user/spell_options.adoc index 4e5eab9cc..ad3eeb513 100644 --- a/doc/ja/autogen/user/aspell_options.adoc +++ b/doc/ja/autogen/user/spell_options.adoc @@ -2,80 +2,80 @@ // This file is auto-generated by script docgen.py. // DO NOT EDIT BY HAND! // -* [[option_aspell.check.commands]] *aspell.check.commands* +* [[option_spell.check.commands]] *spell.check.commands* ** 説明: pass:none[スペルチェックを有効化するコマンドのコンマ区切りリスト (これ以外のコマンドではスペルチェックは無効)] ** タイプ: 文字列 ** 値: 未制約文字列 ** デフォルト値: `+"ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query,quit,topic"+` -* [[option_aspell.check.default_dict]] *aspell.check.default_dict* -** 説明: pass:none[バッファに辞書が定義されていない場合に使用されるデフォルト辞書 (または辞書のコンマ区切りリスト) (空のままであれば明示的に有効化されたバッファを除いて aspell を利用しない)] +* [[option_spell.check.default_dict]] *spell.check.default_dict* +** 説明: pass:none[default dictionary (or comma separated list of dictionaries) to use when buffer has no dictionary defined (leave blank to disable spell checker on buffers for which you didn't explicitly enabled it)] ** タイプ: 文字列 ** 値: 未制約文字列 ** デフォルト値: `+""+` -* [[option_aspell.check.during_search]] *aspell.check.during_search* +* [[option_spell.check.during_search]] *spell.check.during_search* ** 説明: pass:none[バッファ内のテキスト検索中に単語チェックを行う] ** タイプ: ブール ** 値: on, off ** デフォルト値: `+off+` -* [[option_aspell.check.enabled]] *aspell.check.enabled* -** 説明: pass:none[コマンドラインで aspell を利用する] +* [[option_spell.check.enabled]] *spell.check.enabled* +** 説明: pass:none[enable spell checker for command line] ** タイプ: ブール ** 値: on, off ** デフォルト値: `+off+` -* [[option_aspell.check.real_time]] *aspell.check.real_time* +* [[option_spell.check.real_time]] *spell.check.real_time* ** 説明: pass:none[単語のリアルタイムスペルチェック (遅い、デフォルトでは無効: 単語は区切りの後にだけチェックされる)] ** タイプ: ブール ** 値: on, off ** デフォルト値: `+off+` -* [[option_aspell.check.suggestions]] *aspell.check.suggestions* -** 説明: pass:none[バッファ内の各辞書セットに対してバー要素 "aspell_suggest" に表示する提案の数 (-1 = サジェスト機能を無効、0 = 全ての言語を使って全てのサジェスト結果を表示)] +* [[option_spell.check.suggestions]] *spell.check.suggestions* +** 説明: pass:none[number of suggestions to display in bar item "spell_suggest" for each dictionary set in buffer (-1 = disable suggestions, 0 = display all possible suggestions in all languages)] ** タイプ: 整数 ** 値: -1 .. 2147483647 ** デフォルト値: `+-1+` -* [[option_aspell.check.word_min_length]] *aspell.check.word_min_length* +* [[option_spell.check.word_min_length]] *spell.check.word_min_length* ** 説明: pass:none[スペルチェックを行う単語長の最小値 (0 の場合は全ての単語をチェック)] ** タイプ: 整数 ** 値: 0 .. 2147483647 ** デフォルト値: `+2+` -* [[option_aspell.color.misspelled]] *aspell.color.misspelled* +* [[option_spell.color.misspelled]] *spell.color.misspelled* ** 説明: pass:none[スペルミスのある単語に付ける色 (入力バー)] ** タイプ: 色 ** 値: WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、brown、yellow、(light)blue、(light)magenta、(light)cyan) 、端末色番号またはその別名; 色の前に属性を置くことができます (テキスト前景色のみ、背景色は出来ません): 太字は "*"、反転は "!"、イタリックは "/"、下線は "_" ** デフォルト値: `+lightred+` -* [[option_aspell.color.suggestion]] *aspell.color.suggestion* -** 説明: pass:none[バー要素 "aspell_suggest" 内のスペルミスのある単語に対する修正候補に付ける色] +* [[option_spell.color.suggestion]] *spell.color.suggestion* +** 説明: pass:none[text color for suggestion on a misspelled word in bar item "spell_suggest"] ** タイプ: 色 ** 値: WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、brown、yellow、(light)blue、(light)magenta、(light)cyan) 、端末色番号またはその別名; 色の前に属性を置くことができます (テキスト前景色のみ、背景色は出来ません): 太字は "*"、反転は "!"、イタリックは "/"、下線は "_" ** デフォルト値: `+default+` -* [[option_aspell.color.suggestion_delimiter_dict]] *aspell.color.suggestion_delimiter_dict* -** 説明: pass:none[バー要素 "aspell_suggest" 内の 2 つの辞書間の区切り文字に付ける色] +* [[option_spell.color.suggestion_delimiter_dict]] *spell.color.suggestion_delimiter_dict* +** 説明: pass:none[text color for delimiters displayed between two dictionaries in bar item "spell_suggest"] ** タイプ: 色 ** 値: WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、brown、yellow、(light)blue、(light)magenta、(light)cyan) 、端末色番号またはその別名; 色の前に属性を置くことができます (テキスト前景色のみ、背景色は出来ません): 太字は "*"、反転は "!"、イタリックは "/"、下線は "_" ** デフォルト値: `+cyan+` -* [[option_aspell.color.suggestion_delimiter_word]] *aspell.color.suggestion_delimiter_word* -** 説明: pass:none[バー要素 "aspell_suggest" 内の 2 つの単語間の区切り文字に付ける色] +* [[option_spell.color.suggestion_delimiter_word]] *spell.color.suggestion_delimiter_word* +** 説明: pass:none[text color for delimiters displayed between two words in bar item "spell_suggest"] ** タイプ: 色 ** 値: WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、brown、yellow、(light)blue、(light)magenta、(light)cyan) 、端末色番号またはその別名; 色の前に属性を置くことができます (テキスト前景色のみ、背景色は出来ません): 太字は "*"、反転は "!"、イタリックは "/"、下線は "_" ** デフォルト値: `+cyan+` -* [[option_aspell.look.suggestion_delimiter_dict]] *aspell.look.suggestion_delimiter_dict* -** 説明: pass:none[バー要素 "aspell_suggest" 内の 2 つの辞書間の区切り文字] +* [[option_spell.look.suggestion_delimiter_dict]] *spell.look.suggestion_delimiter_dict* +** 説明: pass:none[delimiter displayed between two dictionaries in bar item "spell_suggest"] ** タイプ: 文字列 ** 値: 未制約文字列 ** デフォルト値: `+" / "+` -* [[option_aspell.look.suggestion_delimiter_word]] *aspell.look.suggestion_delimiter_word* -** 説明: pass:none[バー要素 "aspell_suggest" 内の 2 つの単語間の区切り文字] +* [[option_spell.look.suggestion_delimiter_word]] *spell.look.suggestion_delimiter_word* +** 説明: pass:none[delimiter displayed between two words in bar item "spell_suggest"] ** タイプ: 文字列 ** 値: 未制約文字列 ** デフォルト値: `+","+` diff --git a/doc/ja/man_files.ja.adoc b/doc/ja/man_files.ja.adoc index d33311079..50c268377 100644 --- a/doc/ja/man_files.ja.adoc +++ b/doc/ja/man_files.ja.adoc @@ -10,9 +10,6 @@ $HOME/.weechat/sec.conf:: $HOME/.weechat/alias.conf:: _alias_ プラグイン用の設定ファイル -$HOME/.weechat/aspell.conf:: - _aspell_ プラグイン用の設定ファイル - $HOME/.weechat/buflist.conf:: _buflist_ プラグイン用の設定ファイル @@ -61,6 +58,9 @@ $HOME/.weechat/ruby.conf:: $HOME/.weechat/script.conf:: _script_ プラグイン用の設定ファイル +$HOME/.weechat/spell.conf:: + _spell_ プラグイン用の設定ファイル + $HOME/.weechat/tcl.conf:: _tcl_ プラグイン用の設定ファイル diff --git a/doc/ja/weechat_dev.ja.adoc b/doc/ja/weechat_dev.ja.adoc index 9a4462942..2bae6bf3e 100644 --- a/doc/ja/weechat_dev.ja.adoc +++ b/doc/ja/weechat_dev.ja.adoc @@ -76,7 +76,6 @@ qweechat:: |          normal/ | curses インターフェース |    plugins/ | プラグインとスクリプト向け API |       alias/ | alias プラグイン -|       aspell/ | aspell プラグイン |       buflist/ | buflist プラグイン |       charset/ | charset プラグイン |       exec/ | exec プラグイン @@ -93,6 +92,7 @@ qweechat:: |       relay/ | relay プラグイン (irc プロキシ + リモートインターフェース用の中継) |       ruby/ | ruby スクリプト用 API |       script/ | スクリプトマネージャ +|       spell/ | spell プラグイン |       tcl/ | tcl スクリプト用 API |       trigger/ | trigger プラグイン |       xfer/ | xfer (IRC DCC ファイル/チャット) @@ -229,14 +229,22 @@ WeeChat "core" は以下のディレクトリに配置されています: |       alias-completion.c | alias 補完 |       alias-config.c | alias 設定オプション (alias.conf ファイル) |       alias-info.c | alias の情報/インフォリスト/hdata -|    aspell/ | aspell プラグイン -|       weechat-aspell.c | aspell の主要関数 -|       weechat-aspell-bar-item.c | aspell バー要素 -|       weechat-aspell-command.c | aspell コマンド -|       weechat-aspell-completion.c | aspell 補完 -|       weechat-aspell-config.c | aspell 設定オプション (aspell.conf ファイル) -|       weechat-aspell-info.c | aspell の情報/インフォリスト/hdata -|       weechat-aspell-speller.c | スペルチェッカ管理 +// TRANSLATION MISSING +|    spell/ | Spell checker plugin. +// TRANSLATION MISSING +|       spell.c | Main spell checker functions. +// TRANSLATION MISSING +|       spell-bar-item.c | Spell checker bar items. +// TRANSLATION MISSING +|       spell-command.c | Spell checker commands. +// TRANSLATION MISSING +|       spell-completion.c | Spell checker completions. +// TRANSLATION MISSING +|       spell-config.c | Spell checker config options (file spell.conf). +// TRANSLATION MISSING +|       spell-info.c | Spell checker info/infolists/hdata. +// TRANSLATION MISSING +|       spell-speller.c | Spellers management. |    buflist/ | buflist プラグイン |       buflist.c | buflist の主要関数 |       buflist-bar-item.c | buflist バー要素 diff --git a/doc/ja/weechat_faq.ja.adoc b/doc/ja/weechat_faq.ja.adoc index c034f482c..e944b73b8 100644 --- a/doc/ja/weechat_faq.ja.adoc +++ b/doc/ja/weechat_faq.ja.adoc @@ -953,15 +953,20 @@ $ cd ~/.weechat/script $ curl -O https://weechat.org/files/plugins.xml.gz ---- -[[aspell_dictionaries]] +[[spell_dictionaries]] === システムに aspell 辞書をインストールした後、WeeChat を再起動せずにそれを使う方法を教えてください。 -aspell プラグインをリロードしてください: +spell プラグインをリロードしてください: ---- -/plugin reload aspell +/plugin reload spell ---- +// TRANSLATION MISSING +[NOTE] +With WeeChat ≤ 2.3, the "spell" plugin was named "aspell", so the command is: +`/plugin reload aspell`. + [[settings]] == 設定 @@ -992,7 +997,7 @@ aspell プラグインをリロードしてください: * 最新の安定版を使う (古いバージョンよりもメモリリークの可能性が減ると思われます) * 使わないプラグインのロードを禁止する、例えば: - aspell、buflist、fifo、logger、perl、python、ruby、lua、tcl、guile、javascript、php、xfer (DCC で使用)。 + buflist、fifo、logger、perl、python、ruby、lua、tcl、guile、javascript、php、spell、xfer (DCC で使用)。 `/help weechat.plugin.autoload` を参照してください。 * 本当に必要なスクリプトだけをロード * SSL を *使わない* なら、証明書を読み込まないでください: オプション @@ -1010,7 +1015,7 @@ aspell プラグインをリロードしてください: * ステータスバー時間に秒の表示を止める: `/set weechat.look.item_time_format "%H:%M"` (これはデフォルト値です) * コマンドライン内の単語スペルミスのリアルタイムチェックを無効にする (有効にしていた場合): - `/set aspell.check.real_time off` + `/set spell.check.real_time off` * _TZ_ 変数を設定する (例: `export TZ="Europe/Paris"`)、こうすることで _/etc/localtime_ ファイルへ頻繁にアクセスしないようになります。 diff --git a/doc/ja/weechat_plugin_api.ja.adoc b/doc/ja/weechat_plugin_api.ja.adoc index 436583c19..e26b99325 100644 --- a/doc/ja/weechat_plugin_api.ja.adoc +++ b/doc/ja/weechat_plugin_api.ja.adoc @@ -9530,11 +9530,6 @@ WeeChat とプラグインが送信するシグナルのリスト: |=== | プラグイン | シグナル | 引数 | 説明 -| aspell | aspell_suggest + - _(WeeChat バージョン 0.4.0 以上で利用可)_ | - Pointer: バッファ | - スペルの間違っている単語に対する新しい修正候補 - | guile | guile_script_loaded + _(WeeChat バージョン 0.3.9 以上で利用可)_ | String: スクリプトへのパス | @@ -9834,6 +9829,11 @@ WeeChat とプラグインが送信するシグナルのリスト: String: 削除されたスクリプトへのパスのコンマ区切りリスト | Ruby スクリプトを削除 +| spell | spell_suggest + + _(WeeChat バージョン 2.4 以上で利用可)_ | + Pointer: バッファ | + スペルの間違っている単語に対する新しい修正候補 + | tcl | tcl_script_loaded + _(WeeChat バージョン 0.3.9 以上で利用可)_ | String: スクリプトへのパス | diff --git a/doc/ja/weechat_user.ja.adoc b/doc/ja/weechat_user.ja.adoc index 868fce075..f59ddbdd3 100644 --- a/doc/ja/weechat_user.ja.adoc +++ b/doc/ja/weechat_user.ja.adoc @@ -113,7 +113,7 @@ macOS では https://brew.sh/[Homebrew] を使ってください: | gettext | | | 国際化 (メッセージの翻訳; ベース言語は英語です) | ca-certificates | | | SSL 接続に必要な証明書、relay プラグインで SSL サポート | libaspell-dev - ∥ libenchant-dev | | | aspell プラグイン + ∥ libenchant-dev | | | spell プラグイン | python-dev | 2.6 以上 ^(4)^ | | python プラグイン | libperl-dev | | | perl プラグイン | ruby2.5, ruby2.5-dev | 1.8 以上 | | ruby プラグイン @@ -197,9 +197,6 @@ cmake に対するオプションを指定するには、以下の書式を使 | ENABLE_ALIAS | `ON`, `OFF` | ON | <>のコンパイル。 -| ENABLE_ASPELL | `ON`, `OFF` | ON | - <>のコンパイル。 - | ENABLE_BUFLIST | `ON`, `OFF` | ON | <>のコンパイル。 @@ -214,7 +211,7 @@ cmake に対するオプションを指定するには、以下の書式を使 (コンパイルには時間がかかります。文書を含めたバイナリパッケージをビルドする場合、オンラインで文書を見ることができない場合だけに推奨します)。 | ENABLE_ENCHANT | `ON`, `OFF` | OFF | - Enchant と含めた <>のコンパイル。 + Enchant と含めた <>のコンパイル。 | ENABLE_EXEC | `ON`, `OFF` | ON | <>のコンパイル。 @@ -278,6 +275,9 @@ cmake に対するオプションを指定するには、以下の書式を使 すべての<> (Python、Perl、Ruby、Lua、Tcl、Guile、JavaScript、PHP) のコンパイル。 +| ENABLE_SPELL | `ON`, `OFF` | ON | + <>のコンパイル。 + | ENABLE_TCL | `ON`, `OFF` | ON | <>のコンパイル。 @@ -566,7 +566,6 @@ WeeChat ホームディレクトリには以下のファイルが含まれます | sec.conf | 機密データを含む設定ファイル | *保護されます、機密性の高いデータ*: このファイルを誰かと共有してはいけません | plugins.conf | プラグイン設定ファイル | 保護される場合もあります、プラグインおよびスクリプトに依存します | alias.conf | _alias_ プラグイン用の設定ファイル | 保護される場合もあります、エイリアスに依存します -| aspell.conf | _aspell_ プラグイン用の設定ファイル | 保護されません | buflist.conf | _buflist_ プラグイン用の設定ファイル | 保護されません | charset.conf | _charset_ プラグイン用の設定ファイル | 保護されません | exec.conf | _exec_ プラグイン用の設定ファイル | 保護されません @@ -583,6 +582,7 @@ WeeChat ホームディレクトリには以下のファイルが含まれます | relay.conf | _relay_ プラグイン用の設定ファイル | 保護されません | ruby.conf | _ruby_ プラグイン用の設定ファイル | 保護されません | script.conf | _script_ プラグイン用の設定ファイル | 保護されません +| spell.conf | _spell_ プラグイン用の設定ファイル | 保護されません | tcl.conf | _tcl_ プラグイン用の設定ファイル | 保護されません | trigger.conf | _trigger_ プラグイン用の設定ファイル | 保護される場合もあります、トリガに依存します | xfer.conf | _xfer_ プラグイン用の設定ファイル | 保護されません @@ -707,8 +707,8 @@ WeeChat を起動した端末の例: [width="100%",cols="^3,^4,10",options="header"] |=== | 要素 | 例 | 説明 -| aspell_dict | `fr,en` | 現在のバッファにおけるスペリング辞書 -| aspell_suggest | `print,prone,prune` | カーソル下の単語に対するスペリング候補 (スペルが間違っている場合) +| spell_dict | `fr,en` | 現在のバッファにおけるスペリング辞書 +| spell_suggest | `print,prone,prune` | カーソル下の単語に対するスペリング候補 (スペルが間違っている場合) | buffer_count | `10` | 開いているバッファの総数 | buffer_short_name | `#test` | 現在のバッファの短い名前 | irc_channel | `#test` | 現在の IRC チャンネル名 @@ -1619,7 +1619,8 @@ irc サーバ "freenode" に含まれる全てのバッファに対して設定 | kbd:[Alt+d] | コマンドラインで次の単語を削除 (削除された文字列は WeeChat 専用の内部クリップボードに保存) | `/input delete_next_word` | kbd:[Alt+k] | キー入力を奪って、コマンドラインにコード (キーが割り当てられていればコマンド) を入力 | `/input grab_key_command` | kbd:[Alt+r] | コマンドラインへの入力をすべて削除 | `/input delete_line` -| kbd:[Alt+s] | aspell の有効無効を切り替え | `/mute aspell toggle` +// TRANSLATION MISSING +| kbd:[Alt+s] | Toggle spell checker. | `/mute spell toggle` |=== [[key_bindings_buffers_windows]] @@ -2087,7 +2088,6 @@ _スクリプト_ とは `/python` 等のコマンドで _python_ |=== | プラグイン | 説明 | alias | コマンドの別名を定義 -| aspell | コマンドラインのスペルチェック | buflist | バッファリストを表示するためのバー要素 | charset | バッファの文字コードに従ってデコード/エンコード | exec | WeeChat 内部から外部コマンドを実行 @@ -2105,6 +2105,7 @@ _スクリプト_ とは `/python` 等のコマンドで _python_ | guile | Guile (scheme) スクリプト API | javascript | JavaScript スクリプト API | php | PHP スクリプト API +| spell | コマンドラインのスペルチェック | trigger | WeeChat およびプラグインが発生させたイベントに対するテキスト置換とコマンド実行 | xfer | ファイル転送とダイレクトチャット |=== @@ -2147,15 +2148,15 @@ _alias.conf_ ファイル内のセクション: /set alias.completion.* | 別名に割り当てた補完 |=== -[[aspell_plugin]] -=== Aspell +[[spell_plugin]] +=== Spell -Aspell +Spell プラグインを使うことで、コマンドラインに入力した文字列のスペルチェックができます。バッファごとに異なる言語に対するスペルチェックを実行できます。 スペルチェック機能はデフォルトで無効化されています。kbd:[Alt+s] で有効無効を切り替える事が可能です。 -[[aspell_dictionaries]] +[[spell_dictionaries]] ==== 辞書 スペルチェック機能を使う前に、すべてのバッファまたは特定のバッファに対して辞書を定義しなければいけません。 @@ -2166,25 +2167,25 @@ WeeChat はすべての辞書を使って単語をチェックします。 英語とフランス語の辞書を使う例: ---- -/set aspell.check.default_dict "en,fr" +/set spell.check.default_dict "en,fr" ---- 特定のバッファで使用する辞書を定義することも可能です。ドイツ語のチャンネルでドイツ語の辞書を使う例: ---- -/aspell setdict de +/spell setdict de ---- バッファグループに対して特定の辞書を指定することも可能です。freenode IRC サーバに対して英語の辞書を使う例: ---- -/set aspell.dict.irc.freenode en +/set spell.dict.irc.freenode en ---- -詳しい情報はコマンド <> を参照してください。 +詳しい情報はコマンド <> を参照してください。 -[[aspell_speller_options]] +[[spell_speller_options]] ==== Speller オプション Speller オプションは aspell 設定の "option" @@ -2200,17 +2201,17 @@ $ aspell config 例えば、"ignore-case" オプションを有効化するには: ---- -/set aspell.option.ignore-case "true" +/set spell.option.ignore-case "true" ---- -[[aspell_suggestions]] +[[spell_suggestions]] ==== 修正候補 -"aspell_suggest" バー要素内に修正候補が表示されます。修正候補の数は -_aspell.check.suggestions_ オプションで設定します。 +"spell_suggest" バー要素内に修正候補が表示されます。修正候補の数は +_spell.check.suggestions_ オプションで設定します。 -修正候補を利用するには、_aspell.check.suggestions_ オプションをゼロ以上の整数に設定し、_status_ -バーなどに "aspell_suggest" バー要素を追加してください。 +修正候補を利用するには、_spell.check.suggestions_ オプションをゼロ以上の整数に設定し、_status_ +バーなどに "spell_suggest" バー要素を追加してください。 英語辞書 (`en`) を用いた修正候補の例: @@ -2228,30 +2229,30 @@ _aspell.check.suggestions_ オプションで設定します。 └─────────────────────────────────────────────────────────────────────────────────┘ .... -[[aspell_commands]] +[[spell_commands]] ==== コマンド -include::autogen/user/aspell_commands.adoc[] +include::autogen/user/spell_commands.adoc[] -[[aspell_options]] +[[spell_options]] ==== オプション -_aspell.conf_ ファイル内のセクション: +_spell.conf_ ファイル内のセクション: [width="100%",cols="3m,6m,16",options="header"] |=== -| セクション | 操作コマンド | 説明 -| color | /set aspell.color.* | 色 -| check | /set aspell.check.* | スペルチェックの操作コマンド -| dict | <> + - /set aspell.dict.* | バッファが利用するディレクトリ (オプションをセクションに追加/削除出来ます) -| look | /set aspell.look.* | 外観 -| option | /set aspell.option.* | <> (オプションをセクションに追加/削除出来ます) +| セクション | 操作コマンド | 説明 +| color | /set spell.color.* | 色 +| check | /set spell.check.* | スペルチェックの操作コマンド +| dict | <> + + /set spell.dict.* | バッファが利用するディレクトリ (オプションをセクションに追加/削除出来ます) +| look | /set spell.look.* | 外観 +| option | /set spell.option.* | <> (オプションをセクションに追加/削除出来ます) |=== オプション: -include::autogen/user/aspell_options.adoc[] +include::autogen/user/spell_options.adoc[] [[buflist_plugin]] === Buflist diff --git a/doc/pl/autogen/plugin_api/completions.adoc b/doc/pl/autogen/plugin_api/completions.adoc index a138896d1..6e1e0ba8e 100644 --- a/doc/pl/autogen/plugin_api/completions.adoc +++ b/doc/pl/autogen/plugin_api/completions.adoc @@ -10,10 +10,6 @@ | alias | alias_value | wartość aliasu -| aspell | aspell_dicts | lista zainstalowanych słowników aspell - -| aspell | aspell_langs | lista wszystkich języków wspieranych przez aspell - | exec | exec_commands_ids | id (numery i nazwy) wykonywanych komend | fset | fset_options | pliki konfiguracyjne, sekcje, opcje i slowa w opcjach @@ -86,6 +82,10 @@ | script | script_tags | tagi skryptów w repozytorium +| spell | spell_dicts | list of installed dictionaries + +| spell | spell_langs | list of all languages supported + | tcl | tcl_script | lista skryptów | trigger | trigger_hook_arguments | domyślne argumenty dla hooka diff --git a/doc/pl/autogen/plugin_api/infos.adoc b/doc/pl/autogen/plugin_api/infos.adoc index b81e6c671..d48fa5d0d 100644 --- a/doc/pl/autogen/plugin_api/infos.adoc +++ b/doc/pl/autogen/plugin_api/infos.adoc @@ -6,8 +6,6 @@ |=== | Wtyczka | Nazwa | Opis | Argumenty -| aspell | aspell_dict | oddzielona przecinkami lista słowników używanych w buforze | wskaźnik na bufor ("0x12345678") lub jego pełna nazwa ("irc.freenode.#weechat") - | fifo | fifo_filename | nazwa strumienia FIFO | - | guile | guile_eval | wykonywanie kodu źródłowego | kod źródłowy do wykonania @@ -74,6 +72,8 @@ | ruby | ruby_version | wersja użytego interpretera | - +| spell | spell_dict | oddzielona przecinkami lista słowników używanych w buforze | wskaźnik na bufor ("0x12345678") lub jego pełna nazwa ("irc.freenode.#weechat") + | tcl | tcl_eval | wykonywanie kodu źródłowego | kod źródłowy do wykonania | tcl | tcl_interpreter | nazwa użytego interpretera | - diff --git a/doc/pl/autogen/plugin_api/plugins_priority.adoc b/doc/pl/autogen/plugin_api/plugins_priority.adoc index 0adb939c7..f28c95b92 100644 --- a/doc/pl/autogen/plugin_api/plugins_priority.adoc +++ b/doc/pl/autogen/plugin_api/plugins_priority.adoc @@ -6,7 +6,7 @@ . logger (14000) . exec (13000) . trigger (12000) -. aspell (11000) +. spell (11000) . alias (10000) . buflist (9000) . fifo (8000) diff --git a/doc/pl/autogen/user/aspell_commands.adoc b/doc/pl/autogen/user/aspell_commands.adoc deleted file mode 100644 index 8f0c8c1af..000000000 --- a/doc/pl/autogen/user/aspell_commands.adoc +++ /dev/null @@ -1,32 +0,0 @@ -// -// This file is auto-generated by script docgen.py. -// DO NOT EDIT BY HAND! -// -[[command_aspell_aspell]] -* `+aspell+`: konfiguracja wtyczki aspell - ----- -/aspell enable|disable|toggle - listdict - setdict [,...] - deldict - addword [] - - enable: włącza aspell - disable: wyłącza aspell - toggle: przełącza aspell -listdict: pokazuje zainstalowane słowniki - setdict: ustawia słownik dla obecnego buforu (kilka słowników może być podanych po przecinku) - deldict: usuwa słownik używany w obecnym buforze - addword: dodaje słowo do osobistego słownika aspell - -Jeśli wprowadzany tekst zaczyna się od '/' nie będzie on sprawdzany, za wyjątkiem kilku komend (zobacz /set aspell.check.commands). - -W celu włączenia aspell dla wszystkich buforów, należy użyć opcji "default_dict", następnie włączyć aspell, na przykład: - /set aspell.check.default_dict "en" - /aspell enable - -W celu wyświetlenia listy sugestii na pasku, użyj elementu "aspell_suggest". - -Domyślny skrót klawiszowy przełączający aspell to alt-s. ----- diff --git a/doc/pl/autogen/user/spell_commands.adoc b/doc/pl/autogen/user/spell_commands.adoc new file mode 100644 index 000000000..fc78bac14 --- /dev/null +++ b/doc/pl/autogen/user/spell_commands.adoc @@ -0,0 +1,32 @@ +// +// This file is auto-generated by script docgen.py. +// DO NOT EDIT BY HAND! +// +[[command_spell_spell]] +* `+spell+`: spell plugin configuration + +---- +/spell enable|disable|toggle + listdict + setdict [,...] + deldict + addword [] + + enable: enable spell checker + disable: disable spell checker + toggle: toggle spell checker +listdict: show installed dictionaries + setdict: set dictionary for current buffer (multiple dictionaries can be separated by a comma) + deldict: delete dictionary used on current buffer + addword: add a word in personal dictionary + +Input line beginning with a '/' is not checked, except for some commands (see /set spell.check.commands). + +To enable spell checker on all buffers, use option "default_dict", then enable spell checker, for example: + /set spell.check.default_dict "en" + /spell enable + +To display a list of suggestions in a bar, use item "spell_suggest". + +Default key to toggle spell checker is alt-s. +---- diff --git a/doc/pl/autogen/user/aspell_options.adoc b/doc/pl/autogen/user/spell_options.adoc similarity index 59% rename from doc/pl/autogen/user/aspell_options.adoc rename to doc/pl/autogen/user/spell_options.adoc index a275564dc..0d36cb1d1 100644 --- a/doc/pl/autogen/user/aspell_options.adoc +++ b/doc/pl/autogen/user/spell_options.adoc @@ -2,80 +2,80 @@ // This file is auto-generated by script docgen.py. // DO NOT EDIT BY HAND! // -* [[option_aspell.check.commands]] *aspell.check.commands* +* [[option_spell.check.commands]] *spell.check.commands* ** opis: pass:none[oddzielona przecinkiem lista komend, dla których sprawdzana jest poprawna pisownia (sprawdzanie pisowni jest wyłączone dla pozostałych komend)] ** typ: ciąg ** wartości: dowolny ciąg ** domyślna wartość: `+"ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query,quit,topic"+` -* [[option_aspell.check.default_dict]] *aspell.check.default_dict* -** opis: pass:none[domyślny słownik (lub oddzielona przecinkami lista słowników) używany, kiedy bufor nie ma zdefiniowanego słownika (zostaw puste, aby wyłączyć słownik w buforach, które nie posiadają konkretnie przypisanego słownika aspell)] +* [[option_spell.check.default_dict]] *spell.check.default_dict* +** opis: pass:none[default dictionary (or comma separated list of dictionaries) to use when buffer has no dictionary defined (leave blank to disable spell checker on buffers for which you didn't explicitly enabled it)] ** typ: ciąg ** wartości: dowolny ciąg ** domyślna wartość: `+""+` -* [[option_aspell.check.during_search]] *aspell.check.during_search* +* [[option_spell.check.during_search]] *spell.check.during_search* ** opis: pass:none[sprawdzaj słowa podczas wyszukiwania tekstu w buforze] ** typ: bool ** wartości: on, off ** domyślna wartość: `+off+` -* [[option_aspell.check.enabled]] *aspell.check.enabled* -** opis: pass:none[włącza sprawdzanie aspell dla linii komend] +* [[option_spell.check.enabled]] *spell.check.enabled* +** opis: pass:none[enable spell checker for command line] ** typ: bool ** wartości: on, off ** domyślna wartość: `+off+` -* [[option_aspell.check.real_time]] *aspell.check.real_time* +* [[option_spell.check.real_time]] *spell.check.real_time* ** opis: pass:none[sprawdzanie pisowni w czasie rzeczywistym (wolniejsze, wyłączone domyślnie: słowa są sprawdzane tylko jeśli za nimi znajduje się separator)] ** typ: bool ** wartości: on, off ** domyślna wartość: `+off+` -* [[option_aspell.check.suggestions]] *aspell.check.suggestions* -** opis: pass:none[numer podpowiedzi wyświetlanych w elemencie paska "aspell_suggest" dla każdego słownika ustawionego w buforze (-1 = wyłącza podpowiedzi, 0 = wyświetla wszystkie możliwe podpowiedzi dla każdego języka)] +* [[option_spell.check.suggestions]] *spell.check.suggestions* +** opis: pass:none[number of suggestions to display in bar item "spell_suggest" for each dictionary set in buffer (-1 = disable suggestions, 0 = display all possible suggestions in all languages)] ** typ: liczba ** wartości: -1 .. 2147483647 ** domyślna wartość: `+-1+` -* [[option_aspell.check.word_min_length]] *aspell.check.word_min_length* +* [[option_spell.check.word_min_length]] *spell.check.word_min_length* ** opis: pass:none[minimalna długość słowa do sprawdzenia ( 0 - sprawdzaj wszystkie słowa)] ** typ: liczba ** wartości: 0 .. 2147483647 ** domyślna wartość: `+2+` -* [[option_aspell.color.misspelled]] *aspell.color.misspelled* +* [[option_spell.color.misspelled]] *spell.color.misspelled* ** opis: pass:none[kolor używany dla błędnie zapisanych słów (pasek wprowadzania)] ** typ: kolor ** wartości: nazwa koloru WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), numer koloru terminala albo alias; atrybuty dozwolone przed kolorem (tylko dla kolorów testu, nie tła): "*" pogrubienie, "!" odwrócenie, "/" pochylenie, "_" podkreślenie ** domyślna wartość: `+lightred+` -* [[option_aspell.color.suggestion]] *aspell.color.suggestion* -** opis: pass:none[kolor tekstu sugestii dla błędnie wprowadzonego słowa w elemencie paska "aspell_suggest"] +* [[option_spell.color.suggestion]] *spell.color.suggestion* +** opis: pass:none[text color for suggestion on a misspelled word in bar item "spell_suggest"] ** typ: kolor ** wartości: nazwa koloru WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), numer koloru terminala albo alias; atrybuty dozwolone przed kolorem (tylko dla kolorów testu, nie tła): "*" pogrubienie, "!" odwrócenie, "/" pochylenie, "_" podkreślenie ** domyślna wartość: `+default+` -* [[option_aspell.color.suggestion_delimiter_dict]] *aspell.color.suggestion_delimiter_dict* -** opis: pass:none[kolor tekstu separatorów wyświetlanych pomiędzy dwoma słownikami w elemenci paska "aspell_suggest"] +* [[option_spell.color.suggestion_delimiter_dict]] *spell.color.suggestion_delimiter_dict* +** opis: pass:none[text color for delimiters displayed between two dictionaries in bar item "spell_suggest"] ** typ: kolor ** wartości: nazwa koloru WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), numer koloru terminala albo alias; atrybuty dozwolone przed kolorem (tylko dla kolorów testu, nie tła): "*" pogrubienie, "!" odwrócenie, "/" pochylenie, "_" podkreślenie ** domyślna wartość: `+cyan+` -* [[option_aspell.color.suggestion_delimiter_word]] *aspell.color.suggestion_delimiter_word* -** opis: pass:none[kolor tekstu dla separatorów wyświetlanych pomiędzy dwoma słowami w elemencie paska "aspell_suggest"] +* [[option_spell.color.suggestion_delimiter_word]] *spell.color.suggestion_delimiter_word* +** opis: pass:none[text color for delimiters displayed between two words in bar item "spell_suggest"] ** typ: kolor ** wartości: nazwa koloru WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), numer koloru terminala albo alias; atrybuty dozwolone przed kolorem (tylko dla kolorów testu, nie tła): "*" pogrubienie, "!" odwrócenie, "/" pochylenie, "_" podkreślenie ** domyślna wartość: `+cyan+` -* [[option_aspell.look.suggestion_delimiter_dict]] *aspell.look.suggestion_delimiter_dict* -** opis: pass:none[separator wyświetlany pomiędzy dwoma słownikami w elemencie paska "aspell_suggest"] +* [[option_spell.look.suggestion_delimiter_dict]] *spell.look.suggestion_delimiter_dict* +** opis: pass:none[delimiter displayed between two dictionaries in bar item "spell_suggest"] ** typ: ciąg ** wartości: dowolny ciąg ** domyślna wartość: `+" / "+` -* [[option_aspell.look.suggestion_delimiter_word]] *aspell.look.suggestion_delimiter_word* -** opis: pass:none[separator wyświetlany pomiędzy dwoma słowami w elemencie paska "aspell_suggest"] +* [[option_spell.look.suggestion_delimiter_word]] *spell.look.suggestion_delimiter_word* +** opis: pass:none[delimiter displayed between two words in bar item "spell_suggest"] ** typ: ciąg ** wartości: dowolny ciąg ** domyślna wartość: `+","+` diff --git a/doc/pl/man_files.pl.adoc b/doc/pl/man_files.pl.adoc index aefda52a7..1fd8c8cdf 100644 --- a/doc/pl/man_files.pl.adoc +++ b/doc/pl/man_files.pl.adoc @@ -10,9 +10,6 @@ $HOME/.weechat/sec.conf:: $HOME/.weechat/alias.conf:: plik konfiguracyjny wtyczki _alias_ -$HOME/.weechat/aspell.conf:: - plik konfiguracyjny wtyczki _aspell_ - $HOME/.weechat/buflist.conf:: plik konfiguracyjny wtyczki _buflist_ @@ -61,6 +58,9 @@ $HOME/.weechat/ruby.conf:: $HOME/.weechat/script.conf:: plik konfiguracyjny wtyczki _script_ +$HOME/.weechat/spell.conf:: + plik konfiguracyjny wtyczki _spell_ + $HOME/.weechat/tcl.conf:: plik konfiguracyjny wtyczki _tcl_ diff --git a/doc/pl/weechat_faq.pl.adoc b/doc/pl/weechat_faq.pl.adoc index 852c4ea06..ed0f70c81 100644 --- a/doc/pl/weechat_faq.pl.adoc +++ b/doc/pl/weechat_faq.pl.adoc @@ -963,15 +963,20 @@ $ cd ~/.weechat/script $ curl -O https://weechat.org/files/plugins.xml.gz ---- -[[aspell_dictionaries]] +[[spell_dictionaries]] === Zainstalowałem słowniki aspell w systemie, jak mogę ich użyć bez restartowania WeeChat? -Musisz przeładować wtyczkę aspell: +Musisz przeładować wtyczkę spell: ---- -/plugin reload aspell +/plugin reload spell ---- +// TRANSLATION MISSING +[NOTE] +With WeeChat ≤ 2.3, the "spell" plugin was named "aspell", so the command is: +`/plugin reload aspell`. + [[settings]] == Ustawienia @@ -1002,8 +1007,8 @@ W celu zmniejszenia używanej pamięci możesz zastosować się do poniższych r * używać najnowsze stabilnej wersji (powinna mieć mniej wycieków pamięci niż starsze wersje) -* nie ładuj nieużywanych pluginów, np: aspell, buflist, fifo, logger, perl, - python, ruby, lua, tcl, guile, javascript, php, xfer (używana do DCC). +* nie ładuj nieużywanych pluginów, np: buflist, fifo, logger, perl, python, + ruby, lua, tcl, guile, javascript, php, spell, xfer (używana do DCC). Zobacz `/help weechat.plugin.autoload`. * ładować tylko naprawdę używane skrypty * nie ładuj certyfikatów jeśli SSL *NIE* jest używany: ustaw pusty ciąg w opcji @@ -1021,7 +1026,7 @@ Możesz skorzystać z tych samych porad jak dla <>, oraz t * usuń wyświetlanie sekund w czasie na pasku statusu: `/set weechat.look.item_time_format "%H:%M"` (domyślna wartość) * wyłącz automatyczne sprawdzanie poprawności wpisywanych słów w linii poleceń (o ile je włączyłeś): - `/set aspell.check.real_time off` + `/set spell.check.real_time off` * ustaw zmienną _TZ_ (na przykład: `export TZ="Europe/Warsaw"`), w celu zmniejszenia częstotliwości czytania pliku _/etc/localtime_ diff --git a/doc/pl/weechat_user.pl.adoc b/doc/pl/weechat_user.pl.adoc index f4278fc56..05aff40de 100644 --- a/doc/pl/weechat_user.pl.adoc +++ b/doc/pl/weechat_user.pl.adoc @@ -114,7 +114,7 @@ WeeChat. | gettext | | | Internacjonalizacja (tłumaczenie wiadomości; język bazowy to Angielski). | ca-certificates | | | Certyfikaty dla połączeń SSL. | libaspell-dev - ∥ libenchant-dev | | | Wtyczka aspell. + ∥ libenchant-dev | | | Wtyczka spell. | python-dev | ≥ 2.6 ^(4)^ | | Wtyczka python. | libperl-dev | | | Wtyczka perl. | ruby2.5, ruby2.5-dev | ≥ 1.8 | | Wtyczka ruby. @@ -198,9 +198,6 @@ Lista popularnych opcji: | ENABLE_ALIAS | `ON`, `OFF` | ON | Kompilacja <>. -| ENABLE_ASPELL | `ON`, `OFF` | ON | - Kompilacja <>. - | ENABLE_BUFLIST | `ON`, `OFF` | ON | Kompilacja <>. @@ -216,7 +213,7 @@ Lista popularnych opcji: dokumentacji online). | ENABLE_ENCHANT | `ON`, `OFF` | OFF | - Kompilacja <> z Enchant. + Kompilacja <> z Enchant. | ENABLE_EXEC | `ON`, `OFF` | ON | Kompilacja <>. @@ -280,6 +277,9 @@ Lista popularnych opcji: Kompilacja <> (Python, Perl, Ruby, Lua, Tcl, Guile, JavaScript, PHP). +| ENABLE_SPELL | `ON`, `OFF` | ON | + Kompilacja <>. + | ENABLE_TCL | `ON`, `OFF` | ON | Kompilacja <>. @@ -570,7 +570,6 @@ Pliki tworzone w katalogu domowym WeeChat: | sec.conf | Plik konfiguracyjny z zabezpieczonymi danymi | *Tak, bardzo prażliwe*: Tym plikiem nie powinno się z nikim dzielić. | plugins.conf | Plik konfiguracyjny wtyczek | Możliwe, zależy od wtyczki/skryptu. | alias.conf | Plik konfiguracyjny wtyczki _alias_ | Możliwe, zależy od aliasu. -| aspell.conf | Plik konfiguracyjny wtyczki _aspell_ | Nie. | buflist.conf | Plik konfiguracyjny wtyczki _buflist_ | Nie. | charset.conf | Plik konfiguracyjny wtyczki _charset_ | Nie. | exec.conf | Plik konfiguracyjny wtyczki _exec_ | Nie. @@ -587,6 +586,7 @@ Pliki tworzone w katalogu domowym WeeChat: | relay.conf | Plik konfiguracyjny wtyczki _relay_ | Nie. | ruby.conf | Plik konfiguracyjny wtyczki _ruby_ | Nie. | script.conf | Plik konfiguracyjny wtyczki _script_ | Nie. +| spell.conf | Plik konfiguracyjny wtyczki _spell_ | Nie. | tcl.conf | Plik konfiguracyjny wtyczki _tcl_ | Nie. | trigger.conf | Plik konfiguracyjny wtyczki _trigger_ | Możliwe, zależy od triggerów. | xfer.conf | Plik konfiguracyjny wtyczki _xfer_ | Nie. @@ -710,8 +710,8 @@ Inne dostępne elementy (nie używane domyślnie w paskach): [width="100%",cols="^3,^4,10",options="header"] |=== | Element | Przykład | Opis -| aspell_dict | `fr,en` | Słowniki używane w obecnym buforze. -| aspell_suggest | `print,prone,prune` | Sugestie dla słowa pod kursorem (jeśli zawiera błąd). +| spell_dict | `fr,en` | Słowniki używane w obecnym buforze. +| spell_suggest | `print,prone,prune` | Sugestie dla słowa pod kursorem (jeśli zawiera błąd). | buffer_count | `10` | Liczba otwartych buforów. | buffer_short_name | `#test` | Skrócona nazwa obecnego buforu. | irc_channel | `#test` | Nazwa bieżącego kanału IRC. @@ -1628,7 +1628,8 @@ Można ją zapisać za pomocą skryptu _buffer_autoset.py_: można go zaintalowa | kbd:[Alt+d] | Usuń następne słowo w linii poleceń (usuwany ciąg jest kopiowany do wewnętrznego schowka). | `/input delete_next_word` | kbd:[Alt+k] | Przechwyć wciśnięte klawisze i zwróć ich kod (i przypisaną komendę, jeśli istnieje) w linii poleceń. | `/input grab_key_command` | kbd:[Alt+r] | Usuń całą zawartość linii poleceń. | `/input delete_line` -| kbd:[Alt+s] | Przełącz aspell. | `/mute aspell toggle` +// TRANSLATION MISSING +| kbd:[Alt+s] | Toggle spell checker. | `/mute spell toggle` |=== [[key_bindings_buffers_windows]] @@ -2102,7 +2103,6 @@ Domyślne wtyczki: |=== | Wtyczka | Opis | alias | Definiuje aliasy dla komend. -| aspell | Sprawdzanie pisowni w linii poleceń. | buflist | Element paska z listą buforów. | charset | Ustawianie kodowania dla buforów. | exec | Wykonuje zewnętrzną komendę z poziomu WeeChat. @@ -2120,6 +2120,7 @@ Domyślne wtyczki: | guile | Wsparcie dla skryptów napisanych w Guile (scheme). | javascript | Wsparcie dla skryptów napisanych w JavaScript. | php | Wsparcie dla skryptów napisanych w PHP. +| spell | Sprawdzanie pisowni w linii poleceń. | trigger | Zamiana tekstu i wykonywanie komend dla zdarzeń wywołanych przez WeeChat/wtyczki. | xfer | Przesyłanie plików i bezpośredni chat. |=== @@ -2160,15 +2161,15 @@ Ssekcje w pliku _alias.conf_: /set alias.completion.* | Completions for aliases. |=== -[[aspell_plugin]] -=== Aspell +[[spell_plugin]] +=== Spell -Wtyczka aspell pozwala na sprawdzanie pisowni w linii poleceń. Możliwe jest +Wtyczka spell pozwala na sprawdzanie pisowni w linii poleceń. Możliwe jest ustawienie wielu języków dla bufora. Sprawdzenie pisowni jest domyślnie wyłączone i możę być przełączone za pomocą kbd:[Alt+s]. -[[aspell_dictionaries]] +[[spell_dictionaries]] ==== Słowniki Przed użyciem sprawdzania pisowni należy zdefiniować słowniki można to zrobić @@ -2180,26 +2181,26 @@ słownikach. Na przykład dla angielskiego i francuskiego: ---- -/set aspell.check.default_dict "en,fr" +/set spell.check.default_dict "en,fr" ---- Możliwe jest użycie innego słownika dla konkretnego buforu, na przykład na kanale niemieckojęzycnzym: ---- -/aspell setdict de +/spell setdict de ---- Możesz również ustawić słownik dla grupy buforów, na przykład angielski dla wsystkich kanałów na serwerze IRC freenode: ---- -/set aspell.dict.irc.freenode en +/set spell.dict.irc.freenode en ---- -Więcej informacji można znaleźć w opisie komendy <>. +Więcej informacji można znaleźć w opisie komendy <>. -[[aspell_speller_options]] +[[spell_speller_options]] ==== Opcje słowników Opcje słowników mogą zostać zdefiniowane poprzez dodanie opcji w sekcji "option" @@ -2215,17 +2216,17 @@ $ aspell config Na przykład, aby włączyć opcję "ignore-case": ---- -/set aspell.option.ignore-case "true" +/set spell.option.ignore-case "true" ---- -[[aspell_suggestions]] +[[spell_suggestions]] ==== Sugestie -Sugestie są wyświetlane w elemencie paska "aspell_suggest". Ilość wyświetlanych -sugestii można ustawić za pomocą opcji _aspell.check.suggestions_. +Sugestie są wyświetlane w elemencie paska "spell_suggest". Ilość wyświetlanych +sugestii można ustawić za pomocą opcji _spell.check.suggestions_. -Aby włączyć sugestie trzeba ustawić opcję _aspell.check.suggestions_ na liczbę -≥ 0 i dodać element "aspell_suggest" do jakiegoś paska, jak _status_. +Aby włączyć sugestie trzeba ustawić opcję _spell.check.suggestions_ na liczbę +≥ 0 i dodać element "spell_suggest" do jakiegoś paska, jak _status_. Przykład sugestii z angielskim słownikiem (`en`): @@ -2243,30 +2244,30 @@ Przykład sugestii ze słownikami angielskim i francuskim (`en,fr`): └─────────────────────────────────────────────────────────────────────────────────┘ .... -[[aspell_commands]] +[[spell_commands]] ==== Komendy -include::autogen/user/aspell_commands.adoc[] +include::autogen/user/spell_commands.adoc[] -[[aspell_options]] +[[spell_options]] ==== Opcje -Sekcje w pliku _aspell.conf_: +Sekcje w pliku _spell.conf_: [width="100%",cols="3m,6m,16",options="header"] |=== -| Sekcja | Komenda | Opis -| color | /set aspell.color.* | Kolory. -| check | /set aspell.check.* | Opcje do kontrolowania sprawdzania pisowni. -| dict | <> + - /set aspell.dict.* | Słowniki używane w buforze (opcje w tej sekcji mogą być dodawane/usuwane). -| look | /set aspell.look.* | Wygląd. -| option | /set aspell.option.* | <> (opcje w tej sekcji mogą być dodawane/usuwane). +| Sekcja | Komenda | Opis +| color | /set spell.color.* | Kolory. +| check | /set spell.check.* | Opcje do kontrolowania sprawdzania pisowni. +| dict | <> + + /set spell.dict.* | Słowniki używane w buforze (opcje w tej sekcji mogą być dodawane/usuwane). +| look | /set spell.look.* | Wygląd. +| option | /set spell.option.* | <> (opcje w tej sekcji mogą być dodawane/usuwane). |=== Opcje: -include::autogen/user/aspell_options.adoc[] +include::autogen/user/spell_options.adoc[] [[buflist_plugin]] === Buflist diff --git a/doc/ru/man_files.ru.adoc b/doc/ru/man_files.ru.adoc index 7e44b383f..78613684b 100644 --- a/doc/ru/man_files.ru.adoc +++ b/doc/ru/man_files.ru.adoc @@ -10,9 +10,6 @@ $HOME/.weechat/sec.conf:: $HOME/.weechat/alias.conf:: файл конфигурации для плагина _alias_ -$HOME/.weechat/aspell.conf:: - файл конфигурации для плагина _aspell_ - $HOME/.weechat/buflist.conf:: файл конфигурации для плагина _buflist_ @@ -61,6 +58,9 @@ $HOME/.weechat/ruby.conf:: $HOME/.weechat/script.conf:: файл конфигурации для плагина _script_ +$HOME/.weechat/spell.conf:: + файл конфигурации для плагина _spell_ + $HOME/.weechat/tcl.conf:: файл конфигурации для плагина _tcl_ diff --git a/po/POTFILES.in b/po/POTFILES.in index 1dc42ed85..a5bac2574 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -148,20 +148,6 @@ ./src/plugins/alias/alias.h ./src/plugins/alias/alias-info.c ./src/plugins/alias/alias-info.h -./src/plugins/aspell/weechat-aspell-bar-item.c -./src/plugins/aspell/weechat-aspell-bar-item.h -./src/plugins/aspell/weechat-aspell.c -./src/plugins/aspell/weechat-aspell-command.c -./src/plugins/aspell/weechat-aspell-command.h -./src/plugins/aspell/weechat-aspell-completion.c -./src/plugins/aspell/weechat-aspell-completion.h -./src/plugins/aspell/weechat-aspell-config.c -./src/plugins/aspell/weechat-aspell-config.h -./src/plugins/aspell/weechat-aspell.h -./src/plugins/aspell/weechat-aspell-info.c -./src/plugins/aspell/weechat-aspell-info.h -./src/plugins/aspell/weechat-aspell-speller.c -./src/plugins/aspell/weechat-aspell-speller.h ./src/plugins/buflist/buflist-bar-item.c ./src/plugins/buflist/buflist-bar-item.h ./src/plugins/buflist/buflist.c @@ -365,6 +351,20 @@ ./src/plugins/script/script-mouse.h ./src/plugins/script/script-repo.c ./src/plugins/script/script-repo.h +./src/plugins/spell/spell-bar-item.c +./src/plugins/spell/spell-bar-item.h +./src/plugins/spell/spell.c +./src/plugins/spell/spell-command.c +./src/plugins/spell/spell-command.h +./src/plugins/spell/spell-completion.c +./src/plugins/spell/spell-completion.h +./src/plugins/spell/spell-config.c +./src/plugins/spell/spell-config.h +./src/plugins/spell/spell.h +./src/plugins/spell/spell-info.c +./src/plugins/spell/spell-info.h +./src/plugins/spell/spell-speller.c +./src/plugins/spell/spell-speller.h ./src/plugins/tcl/weechat-tcl-api.c ./src/plugins/tcl/weechat-tcl-api.h ./src/plugins/tcl/weechat-tcl.c diff --git a/po/srcfiles.cmake b/po/srcfiles.cmake index 2b55aad6a..82cb32395 100644 --- a/po/srcfiles.cmake +++ b/po/srcfiles.cmake @@ -149,20 +149,6 @@ SET(WEECHAT_SOURCES ./src/plugins/alias/alias.h ./src/plugins/alias/alias-info.c ./src/plugins/alias/alias-info.h -./src/plugins/aspell/weechat-aspell-bar-item.c -./src/plugins/aspell/weechat-aspell-bar-item.h -./src/plugins/aspell/weechat-aspell.c -./src/plugins/aspell/weechat-aspell-command.c -./src/plugins/aspell/weechat-aspell-command.h -./src/plugins/aspell/weechat-aspell-completion.c -./src/plugins/aspell/weechat-aspell-completion.h -./src/plugins/aspell/weechat-aspell-config.c -./src/plugins/aspell/weechat-aspell-config.h -./src/plugins/aspell/weechat-aspell.h -./src/plugins/aspell/weechat-aspell-info.c -./src/plugins/aspell/weechat-aspell-info.h -./src/plugins/aspell/weechat-aspell-speller.c -./src/plugins/aspell/weechat-aspell-speller.h ./src/plugins/buflist/buflist-bar-item.c ./src/plugins/buflist/buflist-bar-item.h ./src/plugins/buflist/buflist.c @@ -366,6 +352,20 @@ SET(WEECHAT_SOURCES ./src/plugins/script/script-mouse.h ./src/plugins/script/script-repo.c ./src/plugins/script/script-repo.h +./src/plugins/spell/spell-bar-item.c +./src/plugins/spell/spell-bar-item.h +./src/plugins/spell/spell.c +./src/plugins/spell/spell-command.c +./src/plugins/spell/spell-command.h +./src/plugins/spell/spell-completion.c +./src/plugins/spell/spell-completion.h +./src/plugins/spell/spell-config.c +./src/plugins/spell/spell-config.h +./src/plugins/spell/spell.h +./src/plugins/spell/spell-info.c +./src/plugins/spell/spell-info.h +./src/plugins/spell/spell-speller.c +./src/plugins/spell/spell-speller.h ./src/plugins/tcl/weechat-tcl-api.c ./src/plugins/tcl/weechat-tcl-api.h ./src/plugins/tcl/weechat-tcl.c diff --git a/src/gui/curses/gui-curses-key.c b/src/gui/curses/gui-curses-key.c index 383064c7b..33d8e23ac 100644 --- a/src/gui/curses/gui-curses-key.c +++ b/src/gui/curses/gui-curses-key.c @@ -138,7 +138,7 @@ gui_key_default_bindings (int context) BIND(/* m-j,m-s */ "meta-jmeta-s", "/server jump"); BIND(/* m-h */ "meta-h", "/input hotlist_clear"); BIND(/* m-k */ "meta-k", "/input grab_key_command"); - BIND(/* m-s */ "meta-s", "/mute aspell toggle"); + BIND(/* m-s */ "meta-s", "/mute spell toggle"); BIND(/* m-u */ "meta-u", "/window scroll_unread"); BIND(/* ^S^U */ "ctrl-Sctrl-U", "/input set_unread"); BIND(/* ^Cb */ "ctrl-Cb", "/input insert \\x02"); diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 526b206c3..609a55eaf 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -49,28 +49,6 @@ if(ENABLE_ALIAS) add_subdirectory(alias) endif() -if(ENABLE_ASPELL) - if(ENABLE_ENCHANT) - # Check for enchant libraries - find_package(ENCHANT) - if(ENCHANT_FOUND) - add_subdirectory(aspell) - else() - # Check for aspell libraries - find_package(Aspell) - if(ASPELL_FOUND) - add_subdirectory(aspell) - endif() - endif() - else() - # Check for aspell libraries - find_package(Aspell) - if(ASPELL_FOUND) - add_subdirectory(aspell) - endif() - endif() -endif() - if(ENABLE_BUFLIST) add_subdirectory(buflist) endif() @@ -166,6 +144,28 @@ if(ENABLE_SCRIPTS AND ENABLE_PHP) endif() endif() +if(ENABLE_SPELL) + if(ENABLE_ENCHANT) + # Check for enchant libraries + find_package(ENCHANT) + if(ENCHANT_FOUND) + add_subdirectory(spell) + else() + # Check for aspell libraries + find_package(Aspell) + if(ASPELL_FOUND) + add_subdirectory(spell) + endif() + endif() + else() + # Check for aspell libraries + find_package(Aspell) + if(ASPELL_FOUND) + add_subdirectory(spell) + endif() + endif() +endif() + if(ENABLE_TRIGGER) add_subdirectory(trigger) endif() diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index 24f9395ec..45e304378 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -45,10 +45,6 @@ if PLUGIN_ALIAS alias_dir = alias endif -if PLUGIN_ASPELL -aspell_dir = aspell -endif - if PLUGIN_BUFLIST buflist_dir = buflist endif @@ -117,6 +113,10 @@ if PLUGIN_PHP php_dir = php endif +if PLUGIN_SPELL +spell_dir = spell +endif + if PLUGIN_TRIGGER trigger_dir = trigger endif @@ -127,7 +127,6 @@ endif SUBDIRS = . \ $(alias_dir) \ - $(aspell_dir) \ $(buflist_dir) \ $(charset_dir) \ $(exec_dir) \ @@ -145,6 +144,7 @@ SUBDIRS = . \ $(guile_dir) \ $(javascript_dir) \ $(php_dir) \ + $(spell_dir) \ $(trigger_dir) \ $(xfer_dir) diff --git a/src/plugins/aspell/weechat-aspell-config.c b/src/plugins/aspell/weechat-aspell-config.c deleted file mode 100644 index 1eec7aab5..000000000 --- a/src/plugins/aspell/weechat-aspell-config.c +++ /dev/null @@ -1,678 +0,0 @@ -/* - * weechat-aspell-config.c - aspell configuration options (file aspell.conf) - * - * Copyright (C) 2006 Emmanuel Bouthenot - * Copyright (C) 2006-2019 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 . - */ - -#include -#include -#include - -#include "../weechat-plugin.h" -#include "weechat-aspell.h" -#include "weechat-aspell-config.h" -#include "weechat-aspell-speller.h" - - -struct t_config_file *weechat_aspell_config_file = NULL; -struct t_config_section *weechat_aspell_config_section_dict = NULL; - -int weechat_aspell_config_loading = 0; - -/* aspell config, color section */ - -struct t_config_option *weechat_aspell_config_color_misspelled; -struct t_config_option *weechat_aspell_config_color_suggestion; -struct t_config_option *weechat_aspell_config_color_suggestion_delimiter_dict; -struct t_config_option *weechat_aspell_config_color_suggestion_delimiter_word; - -/* aspell config, check section */ - -struct t_config_option *weechat_aspell_config_check_commands; -struct t_config_option *weechat_aspell_config_check_default_dict; -struct t_config_option *weechat_aspell_config_check_during_search; -struct t_config_option *weechat_aspell_config_check_enabled; -struct t_config_option *weechat_aspell_config_check_real_time; -struct t_config_option *weechat_aspell_config_check_suggestions; -struct t_config_option *weechat_aspell_config_check_word_min_length; - -/* aspell config, look section */ - -struct t_config_option *weechat_aspell_config_look_suggestion_delimiter_dict; -struct t_config_option *weechat_aspell_config_look_suggestion_delimiter_word; - - -char **weechat_aspell_commands_to_check = NULL; -int weechat_aspell_count_commands_to_check = 0; -int *weechat_aspell_length_commands_to_check = NULL; - - -/* - * Callback for changes on option "aspell.check.commands". - */ - -void -weechat_aspell_config_change_commands (const void *pointer, void *data, - struct t_config_option *option) -{ - const char *value; - int i; - - /* make C compiler happy */ - (void) pointer; - (void) data; - - if (weechat_aspell_commands_to_check) - { - weechat_string_free_split (weechat_aspell_commands_to_check); - weechat_aspell_commands_to_check = NULL; - weechat_aspell_count_commands_to_check = 0; - } - - if (weechat_aspell_length_commands_to_check) - { - free (weechat_aspell_length_commands_to_check); - weechat_aspell_length_commands_to_check = NULL; - } - - value = weechat_config_string (option); - if (value && value[0]) - { - weechat_aspell_commands_to_check = weechat_string_split (value, - ",", 0, 0, - &weechat_aspell_count_commands_to_check); - if (weechat_aspell_count_commands_to_check > 0) - { - weechat_aspell_length_commands_to_check = malloc (weechat_aspell_count_commands_to_check * - sizeof (int)); - for (i = 0; i < weechat_aspell_count_commands_to_check; i++) - { - weechat_aspell_length_commands_to_check[i] = strlen (weechat_aspell_commands_to_check[i]); - } - } - } -} - -/* - * Callback for changes on option "aspell.check.default_dict". - */ - -void -weechat_aspell_config_change_default_dict (const void *pointer, void *data, - struct t_config_option *option) -{ - /* make C compiler happy */ - (void) pointer; - (void) data; - (void) option; - - weechat_hashtable_remove_all (weechat_aspell_speller_buffer); - if (!weechat_aspell_config_loading) - weechat_aspell_speller_remove_unused (); -} - -/* - * Callback for changes on option "aspell.check.enabled". - */ - -void -weechat_aspell_config_change_enabled (const void *pointer, void *data, - struct t_config_option *option) -{ - /* make C compiler happy */ - (void) pointer; - (void) data; - - aspell_enabled = weechat_config_boolean (option); - - /* refresh input and aspell suggestions */ - weechat_bar_item_update ("input_text"); - weechat_bar_item_update ("aspell_suggest"); -} - -/* - * Callback for changes on option "aspell.check.suggestions". - */ - -void -weechat_aspell_config_change_suggestions (const void *pointer, void *data, - struct t_config_option *option) -{ - /* make C compiler happy */ - (void) pointer; - (void) data; - (void) option; - - weechat_bar_item_update ("aspell_suggest"); -} - -/* - * Callback for changes on a dictionary. - */ - -void -weechat_aspell_config_dict_change (const void *pointer, void *data, - struct t_config_option *option) -{ - /* make C compiler happy */ - (void) pointer; - (void) data; - (void) option; - - weechat_hashtable_remove_all (weechat_aspell_speller_buffer); - if (!weechat_aspell_config_loading) - weechat_aspell_speller_remove_unused (); -} - -/* - * Callback called when an option is deleted in section "dict". - */ - -int -weechat_aspell_config_dict_delete_option (const void *pointer, void *data, - struct t_config_file *config_file, - struct t_config_section *section, - struct t_config_option *option) -{ - /* make C compiler happy */ - (void) pointer; - (void) data; - (void) config_file; - (void) section; - - weechat_config_option_free (option); - - weechat_hashtable_remove_all (weechat_aspell_speller_buffer); - if (!weechat_aspell_config_loading) - weechat_aspell_speller_remove_unused (); - - return WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED; -} - -/* - * Creates an option in section "dict". - */ - -int -weechat_aspell_config_dict_create_option (const void *pointer, void *data, - struct t_config_file *config_file, - struct t_config_section *section, - const char *option_name, - const char *value) -{ - struct t_config_option *ptr_option; - int rc; - - /* make C compiler happy */ - (void) pointer; - (void) data; - - rc = WEECHAT_CONFIG_OPTION_SET_ERROR; - - if (value && value[0]) - weechat_aspell_speller_check_dictionaries (value); - - if (option_name) - { - ptr_option = weechat_config_search_option (config_file, section, - option_name); - if (ptr_option) - { - if (value && value[0]) - rc = weechat_config_option_set (ptr_option, value, 0); - else - { - weechat_config_option_free (ptr_option); - rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; - } - } - else - { - if (value && value[0]) - { - ptr_option = weechat_config_new_option ( - config_file, section, - option_name, "string", - _("comma separated list of dictionaries to use on this buffer"), - NULL, 0, 0, "", value, 0, - NULL, NULL, NULL, - &weechat_aspell_config_dict_change, NULL, NULL, - NULL, NULL, NULL); - rc = (ptr_option) ? - WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR; - } - else - rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; - } - } - - if (rc == WEECHAT_CONFIG_OPTION_SET_ERROR) - { - weechat_printf (NULL, - _("%s%s: error creating aspell dictionary \"%s\" => \"%s\""), - weechat_prefix ("error"), ASPELL_PLUGIN_NAME, - option_name, value); - } - else - { - weechat_hashtable_remove_all (weechat_aspell_speller_buffer); - if (!weechat_aspell_config_loading) - weechat_aspell_speller_remove_unused (); - } - - return rc; -} - -/* - * Callback for changes on an aspell option. - */ - -void -weechat_aspell_config_option_change (const void *pointer, void *data, - struct t_config_option *option) -{ - /* make C compiler happy */ - (void) pointer; - (void) data; - (void) option; - - weechat_hashtable_remove_all (weechat_aspell_speller_buffer); - if (!weechat_aspell_config_loading) - weechat_aspell_speller_remove_unused (); -} - -/* - * Callback called when an option is deleted in section "option". - */ - -int -weechat_aspell_config_option_delete_option (const void *pointer, void *data, - struct t_config_file *config_file, - struct t_config_section *section, - struct t_config_option *option) -{ - /* make C compiler happy */ - (void) pointer; - (void) data; - (void) config_file; - (void) section; - - weechat_config_option_free (option); - - weechat_hashtable_remove_all (weechat_aspell_speller_buffer); - if (!weechat_aspell_config_loading) - weechat_aspell_speller_remove_unused (); - - return WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED; -} - -/* - * Callback called when an option is created in section "option". - */ - -int -weechat_aspell_config_option_create_option (const void *pointer, void *data, - struct t_config_file *config_file, - struct t_config_section *section, - const char *option_name, - const char *value) -{ - struct t_config_option *ptr_option; - int rc; - - /* make C compiler happy */ - (void) pointer; - (void) data; - - rc = WEECHAT_CONFIG_OPTION_SET_ERROR; - - if (option_name) - { - ptr_option = weechat_config_search_option (config_file, section, - option_name); - if (ptr_option) - { - if (value && value[0]) - rc = weechat_config_option_set (ptr_option, value, 1); - else - { - weechat_config_option_free (ptr_option); - rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; - } - } - else - { - if (value && value[0]) - { - ptr_option = weechat_config_new_option ( - config_file, section, - option_name, "string", - _("option for aspell (for list of available options and " - "format, run command \"aspell config\" in a shell)"), - NULL, 0, 0, "", value, 0, - NULL, NULL, NULL, - &weechat_aspell_config_option_change, NULL, NULL, - NULL, NULL, NULL); - rc = (ptr_option) ? - WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR; - } - else - rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; - } - } - - if (rc == WEECHAT_CONFIG_OPTION_SET_ERROR) - { - weechat_printf (NULL, - _("%s%s: error creating aspell option \"%s\" => \"%s\""), - weechat_prefix ("error"), ASPELL_PLUGIN_NAME, - option_name, value); - } - else - { - weechat_hashtable_remove_all (weechat_aspell_speller_buffer); - if (!weechat_aspell_config_loading) - weechat_aspell_speller_remove_unused (); - } - - return rc; -} - -/* - * Gets a list of dictionaries for a buffer. - */ - -struct t_config_option * -weechat_aspell_config_get_dict (const char *name) -{ - return weechat_config_search_option (weechat_aspell_config_file, - weechat_aspell_config_section_dict, - name); -} - -/* - * Sets a list of dictionaries for a buffer. - */ - -int -weechat_aspell_config_set_dict (const char *name, const char *value) -{ - return weechat_aspell_config_dict_create_option (NULL, NULL, - weechat_aspell_config_file, - weechat_aspell_config_section_dict, - name, - value); -} - -/* - * Initializes aspell configuration file. - * - * Returns: - * 1: OK - * 0: error - */ - -int -weechat_aspell_config_init () -{ - struct t_config_section *ptr_section; - - weechat_aspell_config_file = weechat_config_new (ASPELL_CONFIG_NAME, - NULL, NULL, NULL); - if (!weechat_aspell_config_file) - return 0; - - /* color */ - ptr_section = weechat_config_new_section ( - weechat_aspell_config_file, "color", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (weechat_aspell_config_file); - weechat_aspell_config_file = NULL; - return 0; - } - - weechat_aspell_config_color_misspelled = weechat_config_new_option ( - weechat_aspell_config_file, ptr_section, - "misspelled", "color", - N_("text color for misspelled words (input bar)"), - NULL, 0, 0, "lightred", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - weechat_aspell_config_color_suggestion = weechat_config_new_option ( - weechat_aspell_config_file, ptr_section, - "suggestion", "color", - N_("text color for suggestion on a misspelled word in bar item " - "\"aspell_suggest\""), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - weechat_aspell_config_color_suggestion_delimiter_dict = weechat_config_new_option ( - weechat_aspell_config_file, ptr_section, - "suggestion_delimiter_dict", "color", - N_("text color for delimiters displayed between two dictionaries " - "in bar item \"aspell_suggest\""), - NULL, 0, 0, "cyan", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - weechat_aspell_config_color_suggestion_delimiter_word = weechat_config_new_option ( - weechat_aspell_config_file, ptr_section, - "suggestion_delimiter_word", "color", - N_("text color for delimiters displayed between two words in bar item " - "\"aspell_suggest\""), - NULL, 0, 0, "cyan", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - - /* check */ - ptr_section = weechat_config_new_section ( - weechat_aspell_config_file, "check", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (weechat_aspell_config_file); - weechat_aspell_config_file = NULL; - return 0; - } - - weechat_aspell_config_check_commands = weechat_config_new_option ( - weechat_aspell_config_file, ptr_section, - "commands", "string", - N_("comma separated list of commands for which spell checking is " - "enabled (spell checking is disabled for all other commands)"), - NULL, 0, 0, - "ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query," - "quit,topic", NULL, 0, - NULL, NULL, NULL, - &weechat_aspell_config_change_commands, NULL, NULL, - NULL, NULL, NULL); - weechat_aspell_config_check_default_dict = weechat_config_new_option ( - weechat_aspell_config_file, ptr_section, - "default_dict", "string", - N_("default dictionary (or comma separated list of dictionaries) to " - "use when buffer has no dictionary defined (leave blank to disable " - "aspell on buffers for which you didn't explicitly enabled it)"), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, - &weechat_aspell_config_change_default_dict, NULL, NULL, - NULL, NULL, NULL); - weechat_aspell_config_check_during_search = weechat_config_new_option ( - weechat_aspell_config_file, ptr_section, - "during_search", "boolean", - N_("check words during text search in buffer"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - weechat_aspell_config_check_enabled = weechat_config_new_option ( - weechat_aspell_config_file, ptr_section, - "enabled", "boolean", - N_("enable aspell check for command line"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - &weechat_aspell_config_change_enabled, NULL, NULL, - NULL, NULL, NULL); - weechat_aspell_config_check_real_time = weechat_config_new_option ( - weechat_aspell_config_file, ptr_section, - "real_time", "boolean", - N_("real-time spell checking of words (slower, disabled by default: " - "words are checked only if there's delimiter after)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - weechat_aspell_config_check_suggestions = weechat_config_new_option ( - weechat_aspell_config_file, ptr_section, - "suggestions", "integer", - N_("number of suggestions to display in bar item \"aspell_suggest\" " - "for each dictionary set in buffer (-1 = disable suggestions, " - "0 = display all possible suggestions in all languages)"), - NULL, -1, INT_MAX, "-1", NULL, 0, - NULL, NULL, NULL, - &weechat_aspell_config_change_suggestions, NULL, NULL, - NULL, NULL, NULL); - weechat_aspell_config_check_word_min_length = weechat_config_new_option ( - weechat_aspell_config_file, ptr_section, - "word_min_length", "integer", - N_("minimum length for a word to be spell checked (use 0 to check all " - "words)"), - NULL, 0, INT_MAX, "2", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - - /* dict */ - ptr_section = weechat_config_new_section ( - weechat_aspell_config_file, "dict", - 1, 1, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - &weechat_aspell_config_dict_create_option, NULL, NULL, - &weechat_aspell_config_dict_delete_option, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (weechat_aspell_config_file); - weechat_aspell_config_file = NULL; - return 0; - } - - weechat_aspell_config_section_dict = ptr_section; - - /* look */ - ptr_section = weechat_config_new_section ( - weechat_aspell_config_file, "look", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (weechat_aspell_config_file); - weechat_aspell_config_file = NULL; - return 0; - } - - weechat_aspell_config_look_suggestion_delimiter_dict = weechat_config_new_option ( - weechat_aspell_config_file, ptr_section, - "suggestion_delimiter_dict", "string", - N_("delimiter displayed between two dictionaries in bar item " - "\"aspell_suggest\""), - NULL, 0, 0, " / ", NULL, 0, - NULL, NULL, NULL, - &weechat_aspell_config_change_suggestions, NULL, NULL, - NULL, NULL, NULL); - weechat_aspell_config_look_suggestion_delimiter_word = weechat_config_new_option ( - weechat_aspell_config_file, ptr_section, - "suggestion_delimiter_word", "string", - N_("delimiter displayed between two words in bar item " - "\"aspell_suggest\""), - NULL, 0, 0, ",", NULL, 0, - NULL, NULL, NULL, - &weechat_aspell_config_change_suggestions, NULL, NULL, - NULL, NULL, NULL); - - /* option */ - ptr_section = weechat_config_new_section ( - weechat_aspell_config_file, "option", - 1, 1, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - &weechat_aspell_config_option_create_option, NULL, NULL, - &weechat_aspell_config_option_delete_option, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (weechat_aspell_config_file); - weechat_aspell_config_file = NULL; - return 0; - } - - return 1; -} - -/* - * Reads aspell configuration file. - */ - -int -weechat_aspell_config_read () -{ - int rc; - - weechat_aspell_config_loading = 1; - rc = weechat_config_read (weechat_aspell_config_file); - weechat_aspell_config_loading = 0; - if (rc == WEECHAT_CONFIG_READ_OK) - { - weechat_aspell_config_change_commands ( - NULL, NULL, weechat_aspell_config_check_commands); - } - weechat_aspell_speller_remove_unused (); - - return rc; -} - -/* - * Writes aspell configuration file. - */ - -int -weechat_aspell_config_write () -{ - return weechat_config_write (weechat_aspell_config_file); -} - -/* - * Frees aspell configuration. - */ - -void -weechat_aspell_config_free () -{ - weechat_config_free (weechat_aspell_config_file); - - if (weechat_aspell_commands_to_check) - weechat_string_free_split (weechat_aspell_commands_to_check); - if (weechat_aspell_length_commands_to_check) - free (weechat_aspell_length_commands_to_check); -} diff --git a/src/plugins/aspell/weechat-aspell-config.h b/src/plugins/aspell/weechat-aspell-config.h deleted file mode 100644 index aecc05e55..000000000 --- a/src/plugins/aspell/weechat-aspell-config.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2006 Emmanuel Bouthenot - * Copyright (C) 2006-2019 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 . - */ - -#ifndef WEECHAT_PLUGIN_ASPELL_CONFIG_H -#define WEECHAT_PLUGIN_ASPELL_CONFIG_H - -#define ASPELL_CONFIG_NAME "aspell" - - -extern struct t_config_option *weechat_aspell_config_color_misspelled; -extern struct t_config_option *weechat_aspell_config_color_suggestion; -extern struct t_config_option *weechat_aspell_config_color_suggestion_delimiter_dict; -extern struct t_config_option *weechat_aspell_config_color_suggestion_delimiter_word; - -extern struct t_config_option *weechat_aspell_config_check_commands; -extern struct t_config_option *weechat_aspell_config_check_default_dict; -extern struct t_config_option *weechat_aspell_config_check_during_search; -extern struct t_config_option *weechat_aspell_config_check_enabled; -extern struct t_config_option *weechat_aspell_config_check_real_time; -extern struct t_config_option *weechat_aspell_config_check_suggestions; -extern struct t_config_option *weechat_aspell_config_check_word_min_length; - -extern struct t_config_option *weechat_aspell_config_look_suggestion_delimiter_dict; -extern struct t_config_option *weechat_aspell_config_look_suggestion_delimiter_word; - -extern char **weechat_aspell_commands_to_check; -extern int weechat_aspell_count_commands_to_check; -extern int *weechat_aspell_length_commands_to_check; - -extern struct t_config_option *weechat_aspell_config_get_dict (const char *name); -extern int weechat_aspell_config_set_dict (const char *name, const char *value); -extern int weechat_aspell_config_init (); -extern int weechat_aspell_config_read (); -extern int weechat_aspell_config_write (); -extern void weechat_aspell_config_free (); - -#endif /* WEECHAT_PLUGIN_ASPELL_CONFIG_H */ diff --git a/src/plugins/aspell/CMakeLists.txt b/src/plugins/spell/CMakeLists.txt similarity index 63% rename from src/plugins/aspell/CMakeLists.txt rename to src/plugins/spell/CMakeLists.txt index d897de4e9..0a1c51bb1 100644 --- a/src/plugins/aspell/CMakeLists.txt +++ b/src/plugins/spell/CMakeLists.txt @@ -18,25 +18,25 @@ # along with WeeChat. If not, see . # -add_library(aspell MODULE -weechat-aspell.c weechat-aspell.h -weechat-aspell-bar-item.c weechat-aspell-bar-item.h -weechat-aspell-command.c weechat-aspell-command.h -weechat-aspell-completion.c weechat-aspell-completion.h -weechat-aspell-config.c weechat-aspell-config.h -weechat-aspell-info.c weechat-aspell-info.h -weechat-aspell-speller.c weechat-aspell-speller.h) -set_target_properties(aspell PROPERTIES PREFIX "") +add_library(spell MODULE +spell.c spell.h +spell-bar-item.c spell-bar-item.h +spell-command.c spell-command.h +spell-completion.c spell-completion.h +spell-config.c spell-config.h +spell-info.c spell-info.h +spell-speller.c spell-speller.h) +set_target_properties(spell PROPERTIES PREFIX "") if(ENCHANT_FOUND) include_directories(${ENCHANT_INCLUDE_DIR}) - target_link_libraries(aspell ${ENCHANT_LIBRARIES}) + target_link_libraries(spell ${ENCHANT_LIBRARIES}) add_definitions(-DUSE_ENCHANT) else() if(ASPELL_FOUND) include_directories(${ASPELL_INCLUDE_PATH}) - target_link_libraries(aspell ${ASPELL_LIBRARY}) + target_link_libraries(spell ${ASPELL_LIBRARY}) endif() endif() -install(TARGETS aspell LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS spell LIBRARY DESTINATION ${LIBDIR}/plugins) diff --git a/src/plugins/aspell/Makefile.am b/src/plugins/spell/Makefile.am similarity index 55% rename from src/plugins/aspell/Makefile.am rename to src/plugins/spell/Makefile.am index e0dccd71e..b3313d9f4 100644 --- a/src/plugins/aspell/Makefile.am +++ b/src/plugins/spell/Makefile.am @@ -22,23 +22,23 @@ AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(ASPELL_CFLAGS) $(ENCHANT_CFLAG libdir = ${weechat_libdir}/plugins -lib_LTLIBRARIES = aspell.la +lib_LTLIBRARIES = spell.la -aspell_la_SOURCES = weechat-aspell.c \ - weechat-aspell.h \ - weechat-aspell-bar-item.c \ - weechat-aspell-bar-item.h \ - weechat-aspell-command.c \ - weechat-aspell-command.h \ - weechat-aspell-completion.c \ - weechat-aspell-completion.h \ - weechat-aspell-config.c \ - weechat-aspell-config.h \ - weechat-aspell-info.c \ - weechat-aspell-info.h \ - weechat-aspell-speller.c \ - weechat-aspell-speller.h -aspell_la_LDFLAGS = -module -no-undefined -aspell_la_LIBADD = $(ASPELL_LFLAGS) $(ENCHANT_LIBS) +spell_la_SOURCES = spell.c \ + spell.h \ + spell-bar-item.c \ + spell-bar-item.h \ + spell-command.c \ + spell-command.h \ + spell-completion.c \ + spell-completion.h \ + spell-config.c \ + spell-config.h \ + spell-info.c \ + spell-info.h \ + spell-speller.c \ + spell-speller.h +spell_la_LDFLAGS = -module -no-undefined +spell_la_LIBADD = $(ASPELL_LFLAGS) $(ENCHANT_LIBS) EXTRA_DIST = CMakeLists.txt diff --git a/src/plugins/aspell/weechat-aspell-bar-item.c b/src/plugins/spell/spell-bar-item.c similarity index 66% rename from src/plugins/aspell/weechat-aspell-bar-item.c rename to src/plugins/spell/spell-bar-item.c index 983427925..0b9ef5453 100644 --- a/src/plugins/aspell/weechat-aspell-bar-item.c +++ b/src/plugins/spell/spell-bar-item.c @@ -1,5 +1,5 @@ /* - * weechat-aspell-bar-item.c - bar items for aspell plugin + * spell-bar-item.c - bar items for spell checker plugin * * Copyright (C) 2012 Nils Görs * Copyright (C) 2012-2019 Sébastien Helleu @@ -25,21 +25,21 @@ #include #include "../weechat-plugin.h" -#include "weechat-aspell.h" -#include "weechat-aspell-config.h" +#include "spell.h" +#include "spell-config.h" /* - * Returns content of bar item "aspell_dict": aspell dictionary used on current + * Returns content of bar item "spell_dict": spell dictionary used on current * buffer. */ char * -weechat_aspell_bar_item_dict (const void *pointer, void *data, - struct t_gui_bar_item *item, - struct t_gui_window *window, - struct t_gui_buffer *buffer, - struct t_hashtable *extra_info) +spell_bar_item_dict (const void *pointer, void *data, + struct t_gui_bar_item *item, + struct t_gui_window *window, + struct t_gui_buffer *buffer, + struct t_hashtable *extra_info) { const char *dict_list; @@ -53,21 +53,21 @@ weechat_aspell_bar_item_dict (const void *pointer, void *data, if (!buffer) return NULL; - dict_list = weechat_aspell_get_dict (buffer); + dict_list = spell_get_dict (buffer); return (dict_list) ? strdup (dict_list) : NULL; } /* - * Returns content of bar item "aspell_suggest": aspell suggestions. + * Returns content of bar item "spell_suggest": spell checker suggestions. */ char * -weechat_aspell_bar_item_suggest (const void *pointer, void *data, - struct t_gui_bar_item *item, - struct t_gui_window *window, - struct t_gui_buffer *buffer, - struct t_hashtable *extra_info) +spell_bar_item_suggest (const void *pointer, void *data, + struct t_gui_bar_item *item, + struct t_gui_window *window, + struct t_gui_buffer *buffer, + struct t_hashtable *extra_info) { const char *ptr_suggestions, *pos; char **suggestions, **suggestions2, **str_suggest; @@ -80,14 +80,14 @@ weechat_aspell_bar_item_suggest (const void *pointer, void *data, (void) window; (void) extra_info; - if (!aspell_enabled) + if (!spell_enabled) return NULL; if (!buffer) return NULL; ptr_suggestions = weechat_buffer_get_string (buffer, - "localvar_aspell_suggest"); + "localvar_spell_suggest"); if (!ptr_suggestions) return NULL; @@ -113,11 +113,11 @@ weechat_aspell_bar_item_suggest (const void *pointer, void *data, str_suggest, weechat_color ( weechat_config_string ( - weechat_aspell_config_color_suggestion_delimiter_dict))); + spell_config_color_suggestion_delimiter_dict))); weechat_string_dyn_concat ( str_suggest, weechat_config_string ( - weechat_aspell_config_look_suggestion_delimiter_dict)); + spell_config_look_suggestion_delimiter_dict)); } suggestions2 = weechat_string_split (suggestions[i], ",", 0, 0, &num_suggestions2); @@ -131,17 +131,17 @@ weechat_aspell_bar_item_suggest (const void *pointer, void *data, str_suggest, weechat_color ( weechat_config_string ( - weechat_aspell_config_color_suggestion_delimiter_word))); + spell_config_color_suggestion_delimiter_word))); weechat_string_dyn_concat ( str_suggest, weechat_config_string ( - weechat_aspell_config_look_suggestion_delimiter_word)); + spell_config_look_suggestion_delimiter_word)); } weechat_string_dyn_concat ( str_suggest, weechat_color ( weechat_config_string ( - weechat_aspell_config_color_suggestion))); + spell_config_color_suggestion))); weechat_string_dyn_concat (str_suggest, suggestions2[j]); } weechat_string_free_split (suggestions2); @@ -154,14 +154,14 @@ end: } /* - * Initializes aspell bar items. + * Initializes spell bar items. */ void -weechat_aspell_bar_item_init () +spell_bar_item_init () { - weechat_bar_item_new ("aspell_dict", - &weechat_aspell_bar_item_dict, NULL, NULL); - weechat_bar_item_new ("aspell_suggest", - &weechat_aspell_bar_item_suggest, NULL, NULL); + weechat_bar_item_new ("spell_dict", + &spell_bar_item_dict, NULL, NULL); + weechat_bar_item_new ("spell_suggest", + &spell_bar_item_suggest, NULL, NULL); } diff --git a/src/plugins/aspell/weechat-aspell-bar-item.h b/src/plugins/spell/spell-bar-item.h similarity index 81% rename from src/plugins/aspell/weechat-aspell-bar-item.h rename to src/plugins/spell/spell-bar-item.h index a6f105fdc..84f65681e 100644 --- a/src/plugins/aspell/weechat-aspell-bar-item.h +++ b/src/plugins/spell/spell-bar-item.h @@ -17,9 +17,9 @@ * along with WeeChat. If not, see . */ -#ifndef WEECHAT_PLUGIN_ASPELL_BAR_ITEM_H -#define WEECHAT_PLUGIN_ASPELL_BAR_ITEM_H +#ifndef WEECHAT_PLUGIN_SPELL_BAR_ITEM_H +#define WEECHAT_PLUGIN_SPELL_BAR_ITEM_H -extern void weechat_aspell_bar_item_init (); +extern void spell_bar_item_init (); -#endif /* WEECHAT_PLUGIN_ASPELL_BAR_ITEM_H */ +#endif /* WEECHAT_PLUGIN_SPELL_BAR_ITEM_H */ diff --git a/src/plugins/aspell/weechat-aspell-command.c b/src/plugins/spell/spell-command.c similarity index 65% rename from src/plugins/aspell/weechat-aspell-command.c rename to src/plugins/spell/spell-command.c index f8e80b2bc..5d27aa9d7 100644 --- a/src/plugins/aspell/weechat-aspell-command.c +++ b/src/plugins/spell/spell-command.c @@ -1,5 +1,5 @@ /* - * weechat-aspell-command.c - aspell commands + * spell-command.c - spell checker commands * * Copyright (C) 2013-2019 Sébastien Helleu * @@ -24,26 +24,26 @@ #include #include "../weechat-plugin.h" -#include "weechat-aspell.h" -#include "weechat-aspell-config.h" -#include "weechat-aspell-speller.h" +#include "spell.h" +#include "spell-config.h" +#include "spell-speller.h" /* - * Converts an aspell ISO lang code in its English full name. + * Converts an ISO lang code in its English full name. * * Note: result must be freed after use. */ char * -weechat_aspell_command_iso_to_lang (const char *code) +spell_command_iso_to_lang (const char *code) { int i; - for (i = 0; aspell_langs[i].code; i++) + for (i = 0; spell_langs[i].code; i++) { - if (strcmp (aspell_langs[i].code, code) == 0) - return strdup (aspell_langs[i].name); + if (strcmp (spell_langs[i].code, code) == 0) + return strdup (spell_langs[i].name); } /* lang code not found */ @@ -51,20 +51,20 @@ weechat_aspell_command_iso_to_lang (const char *code) } /* - * Converts an aspell ISO country code in its English full name. + * Converts an ISO country code in its English full name. * * Note: result must be freed after use. */ char * -weechat_aspell_command_iso_to_country (const char *code) +spell_command_iso_to_country (const char *code) { int i; - for (i = 0; aspell_countries[i].code; i++) + for (i = 0; spell_countries[i].code; i++) { - if (strcmp (aspell_countries[i].code, code) == 0) - return strdup (aspell_countries[i].name); + if (strcmp (spell_countries[i].code, code) == 0) + return strdup (spell_countries[i].name); } /* country code not found */ @@ -77,11 +77,11 @@ weechat_aspell_command_iso_to_country (const char *code) #ifdef USE_ENCHANT void -weechat_aspell_enchant_dict_describe_cb (const char *lang_tag, - const char *provider_name, - const char *provider_desc, - const char *provider_file, - void *user_data) +spell_enchant_dict_describe_cb (const char *lang_tag, + const char *provider_name, + const char *provider_desc, + const char *provider_file, + void *user_data) { char *country, *lang, *pos, *iso; char str_dict[256]; @@ -102,13 +102,13 @@ weechat_aspell_enchant_dict_describe_cb (const char *lang_tag, iso = weechat_strndup (lang_tag, pos - lang_tag); if (iso) { - lang = weechat_aspell_command_iso_to_lang (iso); - country = weechat_aspell_command_iso_to_country (pos + 1); + lang = spell_command_iso_to_lang (iso); + country = spell_command_iso_to_country (pos + 1); free (iso); } } else - lang = weechat_aspell_command_iso_to_lang ((char *)lang_tag); + lang = spell_command_iso_to_lang ((char *)lang_tag); if (lang) { @@ -133,11 +133,11 @@ weechat_aspell_enchant_dict_describe_cb (const char *lang_tag, #endif /* USE_ENCHANT */ /* - * Displays list of aspell dictionaries installed on system. + * Displays list of dictionaries installed on system. */ void -weechat_aspell_command_speller_list_dicts () +spell_command_speller_list_dicts () { #ifndef USE_ENCHANT char *country, *lang, *pos, *iso; @@ -150,12 +150,12 @@ weechat_aspell_command_speller_list_dicts () weechat_printf (NULL, ""); weechat_printf (NULL, - /* TRANSLATORS: "%s" is "aspell" */ + /* TRANSLATORS: "%s" is "spell" (name of plugin) */ _( "%s dictionaries list:"), - ASPELL_PLUGIN_NAME); + SPELL_PLUGIN_NAME); #ifdef USE_ENCHANT - enchant_broker_list_dicts (broker, weechat_aspell_enchant_dict_describe_cb, + enchant_broker_list_dicts (broker, spell_enchant_dict_describe_cb, NULL); #else config = new_aspell_config (); @@ -173,13 +173,13 @@ weechat_aspell_command_speller_list_dicts () iso = weechat_strndup (dict->code, pos - dict->code); if (iso) { - lang = weechat_aspell_command_iso_to_lang (iso); - country = weechat_aspell_command_iso_to_country (pos + 1); + lang = spell_command_iso_to_lang (iso); + country = spell_command_iso_to_country (pos + 1); free (iso); } } else - lang = weechat_aspell_command_iso_to_lang ((char*)dict->code); + lang = spell_command_iso_to_lang ((char*)dict->code); str_country[0] = '\0'; if (country || dict->jargon[0]) @@ -213,22 +213,22 @@ weechat_aspell_command_speller_list_dicts () */ void -weechat_aspell_command_set_dict (struct t_gui_buffer *buffer, const char *value) +spell_command_set_dict (struct t_gui_buffer *buffer, const char *value) { char *name; - name = weechat_aspell_build_option_name (buffer); + name = spell_build_option_name (buffer); if (!name) return; - if (weechat_aspell_config_set_dict (name, value) > 0) + if (spell_config_set_dict (name, value) > 0) { if (value && value[0]) weechat_printf (NULL, "%s: \"%s\" => %s", - ASPELL_PLUGIN_NAME, name, value); + SPELL_PLUGIN_NAME, name, value); else weechat_printf (NULL, _("%s: \"%s\" removed"), - ASPELL_PLUGIN_NAME, name); + SPELL_PLUGIN_NAME, name); } free (name); @@ -239,10 +239,10 @@ weechat_aspell_command_set_dict (struct t_gui_buffer *buffer, const char *value) */ void -weechat_aspell_command_add_word (struct t_gui_buffer *buffer, const char *dict, +spell_command_add_word (struct t_gui_buffer *buffer, const char *dict, const char *word) { - struct t_aspell_speller_buffer *ptr_speller_buffer; + struct t_spell_speller_buffer *ptr_speller_buffer; #ifdef USE_ENCHANT EnchantDict *new_speller, *ptr_speller; #else @@ -253,18 +253,18 @@ weechat_aspell_command_add_word (struct t_gui_buffer *buffer, const char *dict, if (dict) { - ptr_speller = weechat_hashtable_get (weechat_aspell_spellers, dict); + ptr_speller = weechat_hashtable_get (spell_spellers, dict); if (!ptr_speller) { - if (!weechat_aspell_speller_dict_supported (dict)) + if (!spell_speller_dict_supported (dict)) { weechat_printf (NULL, _("%s: error: dictionary \"%s\" is not " "available on your system"), - ASPELL_PLUGIN_NAME, dict); + SPELL_PLUGIN_NAME, dict); return; } - new_speller = weechat_aspell_speller_new (dict); + new_speller = spell_speller_new (dict); if (!new_speller) return; ptr_speller = new_speller; @@ -272,10 +272,10 @@ weechat_aspell_command_add_word (struct t_gui_buffer *buffer, const char *dict, } else { - ptr_speller_buffer = weechat_hashtable_get (weechat_aspell_speller_buffer, + ptr_speller_buffer = weechat_hashtable_get (spell_speller_buffer, buffer); if (!ptr_speller_buffer) - ptr_speller_buffer = weechat_aspell_speller_buffer_new (buffer); + ptr_speller_buffer = spell_speller_buffer_new (buffer); if (!ptr_speller_buffer) goto error; if (!ptr_speller_buffer->spellers || !ptr_speller_buffer->spellers[0]) @@ -284,7 +284,7 @@ weechat_aspell_command_add_word (struct t_gui_buffer *buffer, const char *dict, _("%s%s: no dictionary on this buffer for " "adding word"), weechat_prefix ("error"), - ASPELL_PLUGIN_NAME); + SPELL_PLUGIN_NAME); return; } else if (ptr_speller_buffer->spellers[1]) @@ -293,7 +293,7 @@ weechat_aspell_command_add_word (struct t_gui_buffer *buffer, const char *dict, _("%s%s: many dictionaries are defined for " "this buffer, please specify dictionary"), weechat_prefix ("error"), - ASPELL_PLUGIN_NAME); + SPELL_PLUGIN_NAME); return; } ptr_speller = ptr_speller_buffer->spellers[0]; @@ -308,7 +308,7 @@ weechat_aspell_command_add_word (struct t_gui_buffer *buffer, const char *dict, { weechat_printf (NULL, _("%s: word \"%s\" added to personal dictionary"), - ASPELL_PLUGIN_NAME, word); + SPELL_PLUGIN_NAME, word); } else goto error; @@ -320,21 +320,21 @@ error: weechat_printf (NULL, _("%s%s: failed to add word to personal " "dictionary"), - weechat_prefix ("error"), ASPELL_PLUGIN_NAME); + weechat_prefix ("error"), SPELL_PLUGIN_NAME); end: if (new_speller) - weechat_hashtable_remove (weechat_aspell_spellers, dict); + weechat_hashtable_remove (spell_spellers, dict); } /* - * Callback for command "/aspell". + * Callback for command "/spell". */ int -weechat_aspell_command_cb (const void *pointer, void *data, - struct t_gui_buffer *buffer, - int argc, char **argv, char **argv_eol) +spell_command_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer, + int argc, char **argv, char **argv_eol) { char *dicts; const char *default_dict; @@ -347,25 +347,25 @@ weechat_aspell_command_cb (const void *pointer, void *data, if (argc == 1) { - /* display aspell status */ + /* display spell status */ weechat_printf (NULL, ""); weechat_printf (NULL, /* TRANSLATORS: second "%s" is "aspell" or "enchant" */ _("%s (using %s)"), - (aspell_enabled) ? _("Spell checking is enabled") : _("Spell checking is disabled"), + (spell_enabled) ? _("Spell checking is enabled") : _("Spell checking is disabled"), #ifdef USE_ENCHANT "enchant" #else "aspell" #endif /* USE_ENCHANT */ ); - default_dict = weechat_config_string (weechat_aspell_config_check_default_dict); + default_dict = weechat_config_string (spell_config_check_default_dict); weechat_printf (NULL, _("Default dictionary: %s"), (default_dict && default_dict[0]) ? default_dict : _("(not set)")); number = 0; - infolist = weechat_infolist_get ("option", NULL, "aspell.dict.*"); + infolist = weechat_infolist_get ("option", NULL, "spell.dict.*"); if (infolist) { while (weechat_infolist_next (infolist)) @@ -382,34 +382,34 @@ weechat_aspell_command_cb (const void *pointer, void *data, return WEECHAT_RC_OK; } - /* enable aspell */ + /* enable spell */ if (weechat_strcasecmp (argv[1], "enable") == 0) { - weechat_config_option_set (weechat_aspell_config_check_enabled, "1", 1); - weechat_printf (NULL, _("Aspell enabled")); + weechat_config_option_set (spell_config_check_enabled, "1", 1); + weechat_printf (NULL, _("Spell checker enabled")); return WEECHAT_RC_OK; } - /* disable aspell */ + /* disable spell */ if (weechat_strcasecmp (argv[1], "disable") == 0) { - weechat_config_option_set (weechat_aspell_config_check_enabled, "0", 1); - weechat_printf (NULL, _("Aspell disabled")); + weechat_config_option_set (spell_config_check_enabled, "0", 1); + weechat_printf (NULL, _("Spell checker disabled")); return WEECHAT_RC_OK; } - /* toggle aspell */ + /* toggle spell */ if (weechat_strcasecmp (argv[1], "toggle") == 0) { - if (aspell_enabled) + if (spell_enabled) { - weechat_config_option_set (weechat_aspell_config_check_enabled, "0", 1); - weechat_printf (NULL, _("Aspell disabled")); + weechat_config_option_set (spell_config_check_enabled, "0", 1); + weechat_printf (NULL, _("Spell checker disabled")); } else { - weechat_config_option_set (weechat_aspell_config_check_enabled, "1", 1); - weechat_printf (NULL, _("Aspell enabled")); + weechat_config_option_set (spell_config_check_enabled, "1", 1); + weechat_printf (NULL, _("Spell checker enabled")); } return WEECHAT_RC_OK; } @@ -417,7 +417,7 @@ weechat_aspell_command_cb (const void *pointer, void *data, /* list of dictionaries */ if (weechat_strcasecmp (argv[1], "listdict") == 0) { - weechat_aspell_command_speller_list_dicts (); + spell_command_speller_list_dicts (); return WEECHAT_RC_OK; } @@ -426,8 +426,8 @@ weechat_aspell_command_cb (const void *pointer, void *data, { WEECHAT_COMMAND_MIN_ARGS(3, "setdict"); dicts = weechat_string_replace (argv_eol[2], " ", ""); - weechat_aspell_command_set_dict (buffer, - (dicts) ? dicts : argv[2]); + spell_command_set_dict (buffer, + (dicts) ? dicts : argv[2]); if (dicts) free (dicts); return WEECHAT_RC_OK; @@ -436,7 +436,7 @@ weechat_aspell_command_cb (const void *pointer, void *data, /* delete dictionary used on current buffer */ if (weechat_strcasecmp (argv[1], "deldict") == 0) { - weechat_aspell_command_set_dict (buffer, NULL); + spell_command_set_dict (buffer, NULL); return WEECHAT_RC_OK; } @@ -447,12 +447,12 @@ weechat_aspell_command_cb (const void *pointer, void *data, if (argc > 3) { /* use a given dict */ - weechat_aspell_command_add_word (buffer, argv[2], argv_eol[3]); + spell_command_add_word (buffer, argv[2], argv_eol[3]); } else { /* use default dict */ - weechat_aspell_command_add_word (buffer, NULL, argv_eol[2]); + spell_command_add_word (buffer, NULL, argv_eol[2]); } return WEECHAT_RC_OK; } @@ -461,47 +461,47 @@ weechat_aspell_command_cb (const void *pointer, void *data, } /* - * Hooks aspell command. + * Hooks spell command. */ void -weechat_aspell_command_init () +spell_command_init () { weechat_hook_command ( - "aspell", - N_("aspell plugin configuration"), + "spell", + N_("spell plugin configuration"), N_("enable|disable|toggle" " || listdict" " || setdict [,...]" " || deldict" " || addword [] "), - N_(" enable: enable aspell\n" - " disable: disable aspell\n" - " toggle: toggle aspell\n" + N_(" enable: enable spell checker\n" + " disable: disable spell checker\n" + " toggle: toggle spell checker\n" "listdict: show installed dictionaries\n" " setdict: set dictionary for current buffer (multiple dictionaries " "can be separated by a comma)\n" " deldict: delete dictionary used on current buffer\n" - " addword: add a word in personal aspell dictionary\n" + " addword: add a word in personal dictionary\n" "\n" "Input line beginning with a '/' is not checked, except for some " - "commands (see /set aspell.check.commands).\n" + "commands (see /set spell.check.commands).\n" "\n" - "To enable aspell on all buffers, use option \"default_dict\", then " - "enable aspell, for example:\n" - " /set aspell.check.default_dict \"en\"\n" - " /aspell enable\n" + "To enable spell checker on all buffers, use option \"default_dict\", " + "then enable spell checker, for example:\n" + " /set spell.check.default_dict \"en\"\n" + " /spell enable\n" "\n" "To display a list of suggestions in a bar, use item " - "\"aspell_suggest\".\n" + "\"spell_suggest\".\n" "\n" - "Default key to toggle aspell is alt-s."), + "Default key to toggle spell checker is alt-s."), "enable" " || disable" " || toggle" " || listdict" - " || setdict %(aspell_dicts)" + " || setdict %(spell_dicts)" " || deldict" " || addword", - &weechat_aspell_command_cb, NULL, NULL); + &spell_command_cb, NULL, NULL); } diff --git a/src/plugins/aspell/weechat-aspell-info.h b/src/plugins/spell/spell-command.h similarity index 83% rename from src/plugins/aspell/weechat-aspell-info.h rename to src/plugins/spell/spell-command.h index ec4aa9d11..822955c0c 100644 --- a/src/plugins/aspell/weechat-aspell-info.h +++ b/src/plugins/spell/spell-command.h @@ -17,9 +17,9 @@ * along with WeeChat. If not, see . */ -#ifndef WEECHAT_PLUGIN_ASPELL_INFO_H -#define WEECHAT_PLUGIN_ASPELL_INFO_H +#ifndef WEECHAT_PLUGIN_SPELL_COMMAND_H +#define WEECHAT_PLUGIN_SPELL_COMMAND_H -extern void weechat_aspell_info_init (); +extern void spell_command_init (); -#endif /* WEECHAT_PLUGIN_ASPELL_INFO_H */ +#endif /* WEECHAT_PLUGIN_SPELL_COMMAND_H */ diff --git a/src/plugins/aspell/weechat-aspell-completion.c b/src/plugins/spell/spell-completion.c similarity index 60% rename from src/plugins/aspell/weechat-aspell-completion.c rename to src/plugins/spell/spell-completion.c index 524a204d5..f80030add 100644 --- a/src/plugins/aspell/weechat-aspell-completion.c +++ b/src/plugins/spell/spell-completion.c @@ -1,5 +1,5 @@ /* - * weechat-aspell-completion.c - completion for aspell commands + * spell-completion.c - completion for spell checker commands * * Copyright (C) 2013-2019 Sébastien Helleu * @@ -24,19 +24,19 @@ #include #include "../weechat-plugin.h" -#include "weechat-aspell.h" +#include "spell.h" /* - * Adds aspell langs (all langs, even for dictionaries not installed) to + * Adds spell langs (all langs, even for dictionaries not installed) to * completion list. */ int -weechat_aspell_completion_langs_cb (const void *pointer, void *data, - const char *completion_item, - struct t_gui_buffer *buffer, - struct t_gui_completion *completion) +spell_completion_langs_cb (const void *pointer, void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { int i; @@ -46,10 +46,10 @@ weechat_aspell_completion_langs_cb (const void *pointer, void *data, (void) completion_item; (void) buffer; - for (i = 0; aspell_langs[i].code; i++) + for (i = 0; spell_langs[i].code; i++) { weechat_hook_completion_list_add (completion, - aspell_langs[i].code, + spell_langs[i].code, 0, WEECHAT_LIST_POS_SORT); } @@ -62,11 +62,11 @@ weechat_aspell_completion_langs_cb (const void *pointer, void *data, #ifdef USE_ENCHANT void -weechat_aspell_completion_enchant_add_dict_cb (const char *lang_tag, - const char *provider_name, - const char *provider_desc, - const char *provider_file, - void *user_data) +spell_completion_enchant_add_dict_cb (const char *lang_tag, + const char *provider_name, + const char *provider_desc, + const char *provider_file, + void *user_data) { /* make C compiler happy */ (void) provider_name; @@ -79,14 +79,14 @@ weechat_aspell_completion_enchant_add_dict_cb (const char *lang_tag, #endif /* USE_ENCHANT */ /* - * Adds aspell dictionaries (only installed dictionaries) to completion list. + * Adds spell dictionaries (only installed dictionaries) to completion list. */ int -weechat_aspell_completion_dicts_cb (const void *pointer, void *data, - const char *completion_item, - struct t_gui_buffer *buffer, - struct t_gui_completion *completion) +spell_completion_dicts_cb (const void *pointer, void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { #ifndef USE_ENCHANT struct AspellConfig *config; @@ -103,7 +103,7 @@ weechat_aspell_completion_dicts_cb (const void *pointer, void *data, #ifdef USE_ENCHANT enchant_broker_list_dicts (broker, - weechat_aspell_completion_enchant_add_dict_cb, + spell_completion_enchant_add_dict_cb, completion); #else config = new_aspell_config (); @@ -128,12 +128,12 @@ weechat_aspell_completion_dicts_cb (const void *pointer, void *data, */ void -weechat_aspell_completion_init () +spell_completion_init () { - weechat_hook_completion ("aspell_langs", - N_("list of all languages supported by aspell"), - &weechat_aspell_completion_langs_cb, NULL, NULL); - weechat_hook_completion ("aspell_dicts", - N_("list of aspell installed dictionaries"), - &weechat_aspell_completion_dicts_cb, NULL, NULL); + weechat_hook_completion ("spell_langs", + N_("list of all languages supported"), + &spell_completion_langs_cb, NULL, NULL); + weechat_hook_completion ("spell_dicts", + N_("list of installed dictionaries"), + &spell_completion_dicts_cb, NULL, NULL); } diff --git a/src/plugins/aspell/weechat-aspell-command.h b/src/plugins/spell/spell-completion.h similarity index 82% rename from src/plugins/aspell/weechat-aspell-command.h rename to src/plugins/spell/spell-completion.h index aa314bad2..4c3ad6097 100644 --- a/src/plugins/aspell/weechat-aspell-command.h +++ b/src/plugins/spell/spell-completion.h @@ -17,9 +17,9 @@ * along with WeeChat. If not, see . */ -#ifndef WEECHAT_PLUGIN_ASPELL_COMMAND_H -#define WEECHAT_PLUGIN_ASPELL_COMMAND_H +#ifndef WEECHAT_PLUGIN_SPELL_COMPLETION_H +#define WEECHAT_PLUGIN_SPELL_COMPLETION_H -extern void weechat_aspell_command_init (); +extern void spell_completion_init (); -#endif /* WEECHAT_PLUGIN_ASPELL_COMMAND_H */ +#endif /* WEECHAT_PLUGIN_SPELL_COMPLETION_H */ diff --git a/src/plugins/spell/spell-config.c b/src/plugins/spell/spell-config.c new file mode 100644 index 000000000..cc24efc35 --- /dev/null +++ b/src/plugins/spell/spell-config.c @@ -0,0 +1,676 @@ +/* + * spell-config.c - spell checker configuration options (file spell.conf) + * + * Copyright (C) 2006 Emmanuel Bouthenot + * Copyright (C) 2006-2019 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 . + */ + +#include +#include +#include + +#include "../weechat-plugin.h" +#include "spell.h" +#include "spell-config.h" +#include "spell-speller.h" + + +struct t_config_file *spell_config_file = NULL; +struct t_config_section *spell_config_section_dict = NULL; + +int spell_config_loading = 0; + +/* spell config, color section */ + +struct t_config_option *spell_config_color_misspelled; +struct t_config_option *spell_config_color_suggestion; +struct t_config_option *spell_config_color_suggestion_delimiter_dict; +struct t_config_option *spell_config_color_suggestion_delimiter_word; + +/* spell config, check section */ + +struct t_config_option *spell_config_check_commands; +struct t_config_option *spell_config_check_default_dict; +struct t_config_option *spell_config_check_during_search; +struct t_config_option *spell_config_check_enabled; +struct t_config_option *spell_config_check_real_time; +struct t_config_option *spell_config_check_suggestions; +struct t_config_option *spell_config_check_word_min_length; + +/* spell config, look section */ + +struct t_config_option *spell_config_look_suggestion_delimiter_dict; +struct t_config_option *spell_config_look_suggestion_delimiter_word; + + +char **spell_commands_to_check = NULL; +int spell_count_commands_to_check = 0; +int *spell_length_commands_to_check = NULL; + + +/* + * Callback for changes on option "spell.check.commands". + */ + +void +spell_config_change_commands (const void *pointer, void *data, + struct t_config_option *option) +{ + const char *value; + int i; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + if (spell_commands_to_check) + { + weechat_string_free_split (spell_commands_to_check); + spell_commands_to_check = NULL; + spell_count_commands_to_check = 0; + } + + if (spell_length_commands_to_check) + { + free (spell_length_commands_to_check); + spell_length_commands_to_check = NULL; + } + + value = weechat_config_string (option); + if (value && value[0]) + { + spell_commands_to_check = weechat_string_split (value, + ",", 0, 0, + &spell_count_commands_to_check); + if (spell_count_commands_to_check > 0) + { + spell_length_commands_to_check = malloc (spell_count_commands_to_check * + sizeof (int)); + for (i = 0; i < spell_count_commands_to_check; i++) + { + spell_length_commands_to_check[i] = strlen (spell_commands_to_check[i]); + } + } + } +} + +/* + * Callback for changes on option "spell.check.default_dict". + */ + +void +spell_config_change_default_dict (const void *pointer, void *data, + struct t_config_option *option) +{ + /* make C compiler happy */ + (void) pointer; + (void) data; + (void) option; + + weechat_hashtable_remove_all (spell_speller_buffer); + if (!spell_config_loading) + spell_speller_remove_unused (); +} + +/* + * Callback for changes on option "spell.check.enabled". + */ + +void +spell_config_change_enabled (const void *pointer, void *data, + struct t_config_option *option) +{ + /* make C compiler happy */ + (void) pointer; + (void) data; + + spell_enabled = weechat_config_boolean (option); + + /* refresh input and spell suggestions */ + weechat_bar_item_update ("input_text"); + weechat_bar_item_update ("spell_suggest"); +} + +/* + * Callback for changes on option "spell.check.suggestions". + */ + +void +spell_config_change_suggestions (const void *pointer, void *data, + struct t_config_option *option) +{ + /* make C compiler happy */ + (void) pointer; + (void) data; + (void) option; + + weechat_bar_item_update ("spell_suggest"); +} + +/* + * Callback for changes on a dictionary. + */ + +void +spell_config_dict_change (const void *pointer, void *data, + struct t_config_option *option) +{ + /* make C compiler happy */ + (void) pointer; + (void) data; + (void) option; + + weechat_hashtable_remove_all (spell_speller_buffer); + if (!spell_config_loading) + spell_speller_remove_unused (); +} + +/* + * Callback called when an option is deleted in section "dict". + */ + +int +spell_config_dict_delete_option (const void *pointer, void *data, + struct t_config_file *config_file, + struct t_config_section *section, + struct t_config_option *option) +{ + /* make C compiler happy */ + (void) pointer; + (void) data; + (void) config_file; + (void) section; + + weechat_config_option_free (option); + + weechat_hashtable_remove_all (spell_speller_buffer); + if (!spell_config_loading) + spell_speller_remove_unused (); + + return WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED; +} + +/* + * Creates an option in section "dict". + */ + +int +spell_config_dict_create_option (const void *pointer, void *data, + struct t_config_file *config_file, + struct t_config_section *section, + const char *option_name, + const char *value) +{ + struct t_config_option *ptr_option; + int rc; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + rc = WEECHAT_CONFIG_OPTION_SET_ERROR; + + if (value && value[0]) + spell_speller_check_dictionaries (value); + + if (option_name) + { + ptr_option = weechat_config_search_option (config_file, section, + option_name); + if (ptr_option) + { + if (value && value[0]) + rc = weechat_config_option_set (ptr_option, value, 0); + else + { + weechat_config_option_free (ptr_option); + rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; + } + } + else + { + if (value && value[0]) + { + ptr_option = weechat_config_new_option ( + config_file, section, + option_name, "string", + _("comma separated list of dictionaries to use on this buffer"), + NULL, 0, 0, "", value, 0, + NULL, NULL, NULL, + &spell_config_dict_change, NULL, NULL, + NULL, NULL, NULL); + rc = (ptr_option) ? + WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR; + } + else + rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; + } + } + + if (rc == WEECHAT_CONFIG_OPTION_SET_ERROR) + { + weechat_printf (NULL, + _("%s%s: error creating spell dictionary \"%s\" => \"%s\""), + weechat_prefix ("error"), SPELL_PLUGIN_NAME, + option_name, value); + } + else + { + weechat_hashtable_remove_all (spell_speller_buffer); + if (!spell_config_loading) + spell_speller_remove_unused (); + } + + return rc; +} + +/* + * Callback for changes on an spell option. + */ + +void +spell_config_option_change (const void *pointer, void *data, + struct t_config_option *option) +{ + /* make C compiler happy */ + (void) pointer; + (void) data; + (void) option; + + weechat_hashtable_remove_all (spell_speller_buffer); + if (!spell_config_loading) + spell_speller_remove_unused (); +} + +/* + * Callback called when an option is deleted in section "option". + */ + +int +spell_config_option_delete_option (const void *pointer, void *data, + struct t_config_file *config_file, + struct t_config_section *section, + struct t_config_option *option) +{ + /* make C compiler happy */ + (void) pointer; + (void) data; + (void) config_file; + (void) section; + + weechat_config_option_free (option); + + weechat_hashtable_remove_all (spell_speller_buffer); + if (!spell_config_loading) + spell_speller_remove_unused (); + + return WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED; +} + +/* + * Callback called when an option is created in section "option". + */ + +int +spell_config_option_create_option (const void *pointer, void *data, + struct t_config_file *config_file, + struct t_config_section *section, + const char *option_name, + const char *value) +{ + struct t_config_option *ptr_option; + int rc; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + rc = WEECHAT_CONFIG_OPTION_SET_ERROR; + + if (option_name) + { + ptr_option = weechat_config_search_option (config_file, section, + option_name); + if (ptr_option) + { + if (value && value[0]) + rc = weechat_config_option_set (ptr_option, value, 1); + else + { + weechat_config_option_free (ptr_option); + rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; + } + } + else + { + if (value && value[0]) + { + ptr_option = weechat_config_new_option ( + config_file, section, + option_name, "string", + _("option for aspell (for list of available options and " + "format, run command \"aspell config\" in a shell)"), + NULL, 0, 0, "", value, 0, + NULL, NULL, NULL, + &spell_config_option_change, NULL, NULL, + NULL, NULL, NULL); + rc = (ptr_option) ? + WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR; + } + else + rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; + } + } + + if (rc == WEECHAT_CONFIG_OPTION_SET_ERROR) + { + weechat_printf (NULL, + _("%s%s: error creating spell option \"%s\" => \"%s\""), + weechat_prefix ("error"), SPELL_PLUGIN_NAME, + option_name, value); + } + else + { + weechat_hashtable_remove_all (spell_speller_buffer); + if (!spell_config_loading) + spell_speller_remove_unused (); + } + + return rc; +} + +/* + * Gets a list of dictionaries for a buffer. + */ + +struct t_config_option * +spell_config_get_dict (const char *name) +{ + return weechat_config_search_option (spell_config_file, + spell_config_section_dict, + name); +} + +/* + * Sets a list of dictionaries for a buffer. + */ + +int +spell_config_set_dict (const char *name, const char *value) +{ + return spell_config_dict_create_option (NULL, NULL, + spell_config_file, + spell_config_section_dict, + name, + value); +} + +/* + * Initializes spell configuration file. + * + * Returns: + * 1: OK + * 0: error + */ + +int +spell_config_init () +{ + struct t_config_section *ptr_section; + + spell_config_file = weechat_config_new (SPELL_CONFIG_NAME, + NULL, NULL, NULL); + if (!spell_config_file) + return 0; + + /* color */ + ptr_section = weechat_config_new_section ( + spell_config_file, "color", + 0, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + if (!ptr_section) + { + weechat_config_free (spell_config_file); + spell_config_file = NULL; + return 0; + } + + spell_config_color_misspelled = weechat_config_new_option ( + spell_config_file, ptr_section, + "misspelled", "color", + N_("text color for misspelled words (input bar)"), + NULL, 0, 0, "lightred", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + spell_config_color_suggestion = weechat_config_new_option ( + spell_config_file, ptr_section, + "suggestion", "color", + N_("text color for suggestion on a misspelled word in bar item " + "\"spell_suggest\""), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + spell_config_color_suggestion_delimiter_dict = weechat_config_new_option ( + spell_config_file, ptr_section, + "suggestion_delimiter_dict", "color", + N_("text color for delimiters displayed between two dictionaries " + "in bar item \"spell_suggest\""), + NULL, 0, 0, "cyan", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + spell_config_color_suggestion_delimiter_word = weechat_config_new_option ( + spell_config_file, ptr_section, + "suggestion_delimiter_word", "color", + N_("text color for delimiters displayed between two words in bar item " + "\"spell_suggest\""), + NULL, 0, 0, "cyan", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + + /* check */ + ptr_section = weechat_config_new_section ( + spell_config_file, "check", + 0, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + if (!ptr_section) + { + weechat_config_free (spell_config_file); + spell_config_file = NULL; + return 0; + } + + spell_config_check_commands = weechat_config_new_option ( + spell_config_file, ptr_section, + "commands", "string", + N_("comma separated list of commands for which spell checking is " + "enabled (spell checking is disabled for all other commands)"), + NULL, 0, 0, + "ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query," + "quit,topic", NULL, 0, + NULL, NULL, NULL, + &spell_config_change_commands, NULL, NULL, + NULL, NULL, NULL); + spell_config_check_default_dict = weechat_config_new_option ( + spell_config_file, ptr_section, + "default_dict", "string", + N_("default dictionary (or comma separated list of dictionaries) to " + "use when buffer has no dictionary defined (leave blank to disable " + "spell checker on buffers for which you didn't explicitly " + "enabled it)"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &spell_config_change_default_dict, NULL, NULL, + NULL, NULL, NULL); + spell_config_check_during_search = weechat_config_new_option ( + spell_config_file, ptr_section, + "during_search", "boolean", + N_("check words during text search in buffer"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + spell_config_check_enabled = weechat_config_new_option ( + spell_config_file, ptr_section, + "enabled", "boolean", + N_("enable spell checker for command line"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &spell_config_change_enabled, NULL, NULL, + NULL, NULL, NULL); + spell_config_check_real_time = weechat_config_new_option ( + spell_config_file, ptr_section, + "real_time", "boolean", + N_("real-time spell checking of words (slower, disabled by default: " + "words are checked only if there's delimiter after)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + spell_config_check_suggestions = weechat_config_new_option ( + spell_config_file, ptr_section, + "suggestions", "integer", + N_("number of suggestions to display in bar item \"spell_suggest\" " + "for each dictionary set in buffer (-1 = disable suggestions, " + "0 = display all possible suggestions in all languages)"), + NULL, -1, INT_MAX, "-1", NULL, 0, + NULL, NULL, NULL, + &spell_config_change_suggestions, NULL, NULL, + NULL, NULL, NULL); + spell_config_check_word_min_length = weechat_config_new_option ( + spell_config_file, ptr_section, + "word_min_length", "integer", + N_("minimum length for a word to be spell checked (use 0 to check all " + "words)"), + NULL, 0, INT_MAX, "2", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + + /* dict */ + ptr_section = weechat_config_new_section ( + spell_config_file, "dict", + 1, 1, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + &spell_config_dict_create_option, NULL, NULL, + &spell_config_dict_delete_option, NULL, NULL); + if (!ptr_section) + { + weechat_config_free (spell_config_file); + spell_config_file = NULL; + return 0; + } + + spell_config_section_dict = ptr_section; + + /* look */ + ptr_section = weechat_config_new_section ( + spell_config_file, "look", + 0, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + if (!ptr_section) + { + weechat_config_free (spell_config_file); + spell_config_file = NULL; + return 0; + } + + spell_config_look_suggestion_delimiter_dict = weechat_config_new_option ( + spell_config_file, ptr_section, + "suggestion_delimiter_dict", "string", + N_("delimiter displayed between two dictionaries in bar item " + "\"spell_suggest\""), + NULL, 0, 0, " / ", NULL, 0, + NULL, NULL, NULL, + &spell_config_change_suggestions, NULL, NULL, + NULL, NULL, NULL); + spell_config_look_suggestion_delimiter_word = weechat_config_new_option ( + spell_config_file, ptr_section, + "suggestion_delimiter_word", "string", + N_("delimiter displayed between two words in bar item " + "\"spell_suggest\""), + NULL, 0, 0, ",", NULL, 0, + NULL, NULL, NULL, + &spell_config_change_suggestions, NULL, NULL, + NULL, NULL, NULL); + + /* option */ + ptr_section = weechat_config_new_section ( + spell_config_file, "option", + 1, 1, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + &spell_config_option_create_option, NULL, NULL, + &spell_config_option_delete_option, NULL, NULL); + if (!ptr_section) + { + weechat_config_free (spell_config_file); + spell_config_file = NULL; + return 0; + } + + return 1; +} + +/* + * Reads spell configuration file. + */ + +int +spell_config_read () +{ + int rc; + + spell_config_loading = 1; + rc = weechat_config_read (spell_config_file); + spell_config_loading = 0; + if (rc == WEECHAT_CONFIG_READ_OK) + spell_config_change_commands (NULL, NULL, spell_config_check_commands); + spell_speller_remove_unused (); + + return rc; +} + +/* + * Writes spell configuration file. + */ + +int +spell_config_write () +{ + return weechat_config_write (spell_config_file); +} + +/* + * Frees spell configuration. + */ + +void +spell_config_free () +{ + weechat_config_free (spell_config_file); + + if (spell_commands_to_check) + weechat_string_free_split (spell_commands_to_check); + if (spell_length_commands_to_check) + free (spell_length_commands_to_check); +} diff --git a/src/plugins/spell/spell-config.h b/src/plugins/spell/spell-config.h new file mode 100644 index 000000000..2e036e0a2 --- /dev/null +++ b/src/plugins/spell/spell-config.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2006 Emmanuel Bouthenot + * Copyright (C) 2006-2019 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 . + */ + +#ifndef WEECHAT_PLUGIN_SPELL_CONFIG_H +#define WEECHAT_PLUGIN_SPELL_CONFIG_H + +#define SPELL_CONFIG_NAME "spell" + + +extern struct t_config_option *spell_config_color_misspelled; +extern struct t_config_option *spell_config_color_suggestion; +extern struct t_config_option *spell_config_color_suggestion_delimiter_dict; +extern struct t_config_option *spell_config_color_suggestion_delimiter_word; + +extern struct t_config_option *spell_config_check_commands; +extern struct t_config_option *spell_config_check_default_dict; +extern struct t_config_option *spell_config_check_during_search; +extern struct t_config_option *spell_config_check_enabled; +extern struct t_config_option *spell_config_check_real_time; +extern struct t_config_option *spell_config_check_suggestions; +extern struct t_config_option *spell_config_check_word_min_length; + +extern struct t_config_option *spell_config_look_suggestion_delimiter_dict; +extern struct t_config_option *spell_config_look_suggestion_delimiter_word; + +extern char **spell_commands_to_check; +extern int spell_count_commands_to_check; +extern int *spell_length_commands_to_check; + +extern struct t_config_option *spell_config_get_dict (const char *name); +extern int spell_config_set_dict (const char *name, const char *value); +extern int spell_config_init (); +extern int spell_config_read (); +extern int spell_config_write (); +extern void spell_config_free (); + +#endif /* WEECHAT_PLUGIN_SPELL_CONFIG_H */ diff --git a/src/plugins/aspell/weechat-aspell-info.c b/src/plugins/spell/spell-info.c similarity index 77% rename from src/plugins/aspell/weechat-aspell-info.c rename to src/plugins/spell/spell-info.c index 13bc496c1..27024c09a 100644 --- a/src/plugins/aspell/weechat-aspell-info.c +++ b/src/plugins/spell/spell-info.c @@ -1,5 +1,5 @@ /* - * weechat-aspell-info.c - info for aspell plugin + * spell-info.c - info for spell checker plugin * * Copyright (C) 2013-2019 Sébastien Helleu * @@ -24,17 +24,17 @@ #include #include "../weechat-plugin.h" -#include "weechat-aspell.h" +#include "spell.h" /* - * Returns aspell info "aspell_dict". + * Returns spell info "spell_dict". */ const char * -weechat_aspell_info_info_aspell_dict_cb (const void *pointer, void *data, - const char *info_name, - const char *arguments) +spell_info_info_spell_dict_cb (const void *pointer, void *data, + const char *info_name, + const char *arguments) { int rc; unsigned long value; @@ -67,23 +67,23 @@ weechat_aspell_info_info_aspell_dict_cb (const void *pointer, void *data, buffer_full_name = arguments; if (buffer_full_name) - return weechat_aspell_get_dict_with_buffer_name (buffer_full_name); + return spell_get_dict_with_buffer_name (buffer_full_name); return NULL; } /* - * Hooks info for aspell plugin. + * Hooks info for spell plugin. */ void -weechat_aspell_info_init () +spell_info_init () { /* info hooks */ weechat_hook_info ( - "aspell_dict", + "spell_dict", N_("comma-separated list of dictionaries used in buffer"), N_("buffer pointer (\"0x12345678\") or buffer full name " "(\"irc.freenode.#weechat\")"), - &weechat_aspell_info_info_aspell_dict_cb, NULL, NULL); + &spell_info_info_spell_dict_cb, NULL, NULL); } diff --git a/src/plugins/aspell/weechat-aspell-completion.h b/src/plugins/spell/spell-info.h similarity index 81% rename from src/plugins/aspell/weechat-aspell-completion.h rename to src/plugins/spell/spell-info.h index 169573a17..e529236be 100644 --- a/src/plugins/aspell/weechat-aspell-completion.h +++ b/src/plugins/spell/spell-info.h @@ -17,9 +17,9 @@ * along with WeeChat. If not, see . */ -#ifndef WEECHAT_PLUGIN_ASPELL_COMPLETION_H -#define WEECHAT_PLUGIN_ASPELL_COMPLETION_H +#ifndef WEECHAT_PLUGIN_SPELL_INFO_H +#define WEECHAT_PLUGIN_SPELL_INFO_H -extern void weechat_aspell_completion_init (); +extern void spell_info_init (); -#endif /* WEECHAT_PLUGIN_ASPELL_COMPLETION_H */ +#endif /* WEECHAT_PLUGIN_SPELL_INFO_H */ diff --git a/src/plugins/aspell/weechat-aspell-speller.c b/src/plugins/spell/spell-speller.c similarity index 67% rename from src/plugins/aspell/weechat-aspell-speller.c rename to src/plugins/spell/spell-speller.c index 4b5746eff..0b0ac5492 100644 --- a/src/plugins/aspell/weechat-aspell-speller.c +++ b/src/plugins/spell/spell-speller.c @@ -1,5 +1,5 @@ /* - * weechat-aspell-speller.c - speller management for aspell plugin + * spell-speller.c - speller management for spell checker plugin * * Copyright (C) 2006 Emmanuel Bouthenot * Copyright (C) 2006-2019 Sébastien Helleu @@ -24,34 +24,34 @@ #include #include "../weechat-plugin.h" -#include "weechat-aspell.h" -#include "weechat-aspell-speller.h" -#include "weechat-aspell-config.h" +#include "spell.h" +#include "spell-speller.h" +#include "spell-config.h" /* * spellers: one by dictionary (key is name of dictionary (eg: "fr"), value is * pointer on AspellSpeller) */ -struct t_hashtable *weechat_aspell_spellers = NULL; +struct t_hashtable *spell_spellers = NULL; /* * spellers by buffer (key is buffer pointer, value is pointer on - * struct t_aspell_speller_buffer) + * struct t_spell_speller_buffer) */ -struct t_hashtable *weechat_aspell_speller_buffer = NULL; +struct t_hashtable *spell_speller_buffer = NULL; /* - * Checks if an aspell dictionary is supported (installed on system). + * Checks if a spelling dictionary is supported (installed on system). * * Returns: - * 1: aspell dict is supported - * 0: aspell dict is NOT supported + * 1: spell dict is supported + * 0: spell dict is NOT supported */ int -weechat_aspell_speller_dict_supported (const char *lang) +spell_speller_dict_supported (const char *lang) { #ifdef USE_ENCHANT return enchant_broker_dict_exists (broker, lang); @@ -92,7 +92,7 @@ weechat_aspell_speller_dict_supported (const char *lang) */ void -weechat_aspell_speller_check_dictionaries (const char *dict_list) +spell_speller_check_dictionaries (const char *dict_list) { char **argv; int argc, i; @@ -104,12 +104,12 @@ weechat_aspell_speller_check_dictionaries (const char *dict_list) { for (i = 0; i < argc; i++) { - if (!weechat_aspell_speller_dict_supported (argv[i])) + if (!spell_speller_dict_supported (argv[i])) { weechat_printf (NULL, _("%s: warning: dictionary \"%s\" is not " "available on your system"), - ASPELL_PLUGIN_NAME, argv[i]); + SPELL_PLUGIN_NAME, argv[i]); } } weechat_string_free_split (argv); @@ -120,7 +120,7 @@ weechat_aspell_speller_check_dictionaries (const char *dict_list) /* * Creates and adds a new speller instance in the hashtable. * - * Returns pointer to new aspell speller, NULL if error. + * Returns pointer to new speller, NULL if error. */ #ifdef USE_ENCHANT @@ -128,7 +128,7 @@ EnchantDict * #else AspellSpeller * #endif /* USE_ENCHANT */ -weechat_aspell_speller_new (const char *lang) +spell_speller_new (const char *lang) { #ifdef USE_ENCHANT EnchantDict *new_speller; @@ -142,11 +142,11 @@ weechat_aspell_speller_new (const char *lang) if (!lang) return NULL; - if (weechat_aspell_plugin->debug) + if (weechat_spell_plugin->debug) { weechat_printf (NULL, "%s: creating new speller for lang \"%s\"", - ASPELL_PLUGIN_NAME, lang); + SPELL_PLUGIN_NAME, lang); } #ifdef USE_ENCHANT @@ -155,7 +155,7 @@ weechat_aspell_speller_new (const char *lang) { weechat_printf (NULL, _("%s%s: error: unable to create speller for lang \"%s\""), - weechat_prefix ("error"), ASPELL_PLUGIN_NAME, + weechat_prefix ("error"), SPELL_PLUGIN_NAME, lang); return NULL; } @@ -166,7 +166,7 @@ weechat_aspell_speller_new (const char *lang) #endif /* USE_ENCHANT */ /* apply all options */ - infolist = weechat_infolist_get ("option", NULL, "aspell.option.*"); + infolist = weechat_infolist_get ("option", NULL, "spell.option.*"); if (infolist) { while (weechat_infolist_next (infolist)) @@ -189,7 +189,7 @@ weechat_aspell_speller_new (const char *lang) { weechat_printf (NULL, "%s%s: error: %s", - weechat_prefix ("error"), ASPELL_PLUGIN_NAME, + weechat_prefix ("error"), SPELL_PLUGIN_NAME, aspell_error_message (ret)); delete_aspell_config (config); delete_aspell_can_have_error (ret); @@ -199,7 +199,7 @@ weechat_aspell_speller_new (const char *lang) new_speller = to_aspell_speller (ret); #endif /* USE_ENCHANT */ - weechat_hashtable_set (weechat_aspell_spellers, lang, new_speller); + weechat_hashtable_set (spell_spellers, lang, new_speller); #ifndef USE_ENCHANT /* free configuration */ @@ -209,9 +209,13 @@ weechat_aspell_speller_new (const char *lang) return new_speller; } +/* + * Creates hashtable entries with a string containing a list of dicts. + */ + void -weechat_aspell_speller_add_dicts_to_hash (struct t_hashtable *hashtable, - const char *dict) +spell_speller_add_dicts_to_hash (struct t_hashtable *hashtable, + const char *dict) { char **dicts; int num_dicts, i; @@ -235,9 +239,9 @@ weechat_aspell_speller_add_dicts_to_hash (struct t_hashtable *hashtable, */ void -weechat_aspell_speller_remove_unused_cb (void *data, - struct t_hashtable *hashtable, - const void *key, const void *value) +spell_speller_remove_unused_cb (void *data, + struct t_hashtable *hashtable, + const void *key, const void *value) { struct t_hashtable *used_spellers; @@ -252,20 +256,20 @@ weechat_aspell_speller_remove_unused_cb (void *data, } /* - * Removes unused spellers from hashtable "weechat_aspell_spellers". + * Removes unused spellers from hashtable "spell_spellers". */ void -weechat_aspell_speller_remove_unused () +spell_speller_remove_unused () { struct t_hashtable *used_spellers; struct t_infolist *infolist; - if (weechat_aspell_plugin->debug) + if (weechat_spell_plugin->debug) { weechat_printf (NULL, "%s: removing unused spellers", - ASPELL_PLUGIN_NAME); + SPELL_PLUGIN_NAME); } /* create a hashtable that will contain all used spellers */ @@ -277,15 +281,15 @@ weechat_aspell_speller_remove_unused () return; /* collect used spellers and store them in hashtable "used_spellers" */ - weechat_aspell_speller_add_dicts_to_hash (used_spellers, - weechat_config_string (weechat_aspell_config_check_default_dict)); - infolist = weechat_infolist_get ("option", NULL, "aspell.dict.*"); + spell_speller_add_dicts_to_hash (used_spellers, + weechat_config_string (spell_config_check_default_dict)); + infolist = weechat_infolist_get ("option", NULL, "spell.dict.*"); if (infolist) { while (weechat_infolist_next (infolist)) { - weechat_aspell_speller_add_dicts_to_hash (used_spellers, - weechat_infolist_string (infolist, "value")); + spell_speller_add_dicts_to_hash (used_spellers, + weechat_infolist_string (infolist, "value")); } weechat_infolist_free (infolist); } @@ -294,19 +298,19 @@ weechat_aspell_speller_remove_unused () * look at current spellers, and remove spellers that are not in hashtable * "used_spellers" */ - weechat_hashtable_map (weechat_aspell_spellers, - &weechat_aspell_speller_remove_unused_cb, + weechat_hashtable_map (spell_spellers, + &spell_speller_remove_unused_cb, used_spellers); weechat_hashtable_free (used_spellers); } /* - * Callback called when a key is removed in hashtable "weechat_aspell_spellers". + * Callback called when a key is removed in hashtable "spell_spellers". */ void -weechat_aspell_speller_free_value_cb (struct t_hashtable *hashtable, +spell_speller_free_value_cb (struct t_hashtable *hashtable, const void *key, void *value) { #ifdef USE_ENCHANT @@ -318,11 +322,11 @@ weechat_aspell_speller_free_value_cb (struct t_hashtable *hashtable, /* make C compiler happy */ (void) hashtable; - if (weechat_aspell_plugin->debug) + if (weechat_spell_plugin->debug) { weechat_printf (NULL, "%s: removing speller for lang \"%s\"", - ASPELL_PLUGIN_NAME, (const char *)key); + SPELL_PLUGIN_NAME, (const char *)key); } /* free speller */ @@ -338,16 +342,16 @@ weechat_aspell_speller_free_value_cb (struct t_hashtable *hashtable, /* * Creates a structure for buffer speller info in hashtable - * "weechat_aspell_buffer_spellers". + * "spell_buffer_spellers". */ -struct t_aspell_speller_buffer * -weechat_aspell_speller_buffer_new (struct t_gui_buffer *buffer) +struct t_spell_speller_buffer * +spell_speller_buffer_new (struct t_gui_buffer *buffer) { const char *buffer_dicts; char **dicts; int num_dicts, i; - struct t_aspell_speller_buffer *new_speller_buffer; + struct t_spell_speller_buffer *new_speller_buffer; #ifdef USE_ENCHANT EnchantDict *ptr_speller; #else @@ -357,7 +361,7 @@ weechat_aspell_speller_buffer_new (struct t_gui_buffer *buffer) if (!buffer) return NULL; - weechat_hashtable_remove (weechat_aspell_speller_buffer, buffer); + weechat_hashtable_remove (spell_speller_buffer, buffer); new_speller_buffer = malloc (sizeof (*new_speller_buffer)); if (!new_speller_buffer) @@ -368,7 +372,7 @@ weechat_aspell_speller_buffer_new (struct t_gui_buffer *buffer) new_speller_buffer->input_pos = -1; new_speller_buffer->modifier_result = NULL; - buffer_dicts = weechat_aspell_get_dict (buffer); + buffer_dicts = spell_get_dict (buffer); if (buffer_dicts) { dicts = weechat_string_split (buffer_dicts, ",", 0, 0, &num_dicts); @@ -384,10 +388,10 @@ weechat_aspell_speller_buffer_new (struct t_gui_buffer *buffer) { for (i = 0; i < num_dicts; i++) { - ptr_speller = weechat_hashtable_get (weechat_aspell_spellers, + ptr_speller = weechat_hashtable_get (spell_spellers, dicts[i]); if (!ptr_speller) - ptr_speller = weechat_aspell_speller_new (dicts[i]); + ptr_speller = spell_speller_new (dicts[i]); new_speller_buffer->spellers[i] = ptr_speller; } new_speller_buffer->spellers[num_dicts] = NULL; @@ -397,31 +401,31 @@ weechat_aspell_speller_buffer_new (struct t_gui_buffer *buffer) weechat_string_free_split (dicts); } - weechat_hashtable_set (weechat_aspell_speller_buffer, + weechat_hashtable_set (spell_speller_buffer, buffer, new_speller_buffer); - weechat_bar_item_update ("aspell_dict"); + weechat_bar_item_update ("spell_dict"); return new_speller_buffer; } /* * Callback called when a key is removed in hashtable - * "weechat_aspell_speller_buffer". + * "spell_speller_buffer". */ void -weechat_aspell_speller_buffer_free_value_cb (struct t_hashtable *hashtable, - const void *key, void *value) +spell_speller_buffer_free_value_cb (struct t_hashtable *hashtable, + const void *key, void *value) { - struct t_aspell_speller_buffer *ptr_speller_buffer; + struct t_spell_speller_buffer *ptr_speller_buffer; /* make C compiler happy */ (void) hashtable; (void) key; - ptr_speller_buffer = (struct t_aspell_speller_buffer *)value; + ptr_speller_buffer = (struct t_spell_speller_buffer *)value; if (ptr_speller_buffer->spellers) free (ptr_speller_buffer->spellers); @@ -442,30 +446,30 @@ weechat_aspell_speller_buffer_free_value_cb (struct t_hashtable *hashtable, */ int -weechat_aspell_speller_init () +spell_speller_init () { - weechat_aspell_spellers = weechat_hashtable_new (32, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_POINTER, - NULL, NULL); - if (!weechat_aspell_spellers) + spell_spellers = weechat_hashtable_new (32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_POINTER, + NULL, NULL); + if (!spell_spellers) return 0; - weechat_hashtable_set_pointer (weechat_aspell_spellers, + weechat_hashtable_set_pointer (spell_spellers, "callback_free_value", - &weechat_aspell_speller_free_value_cb); + &spell_speller_free_value_cb); - weechat_aspell_speller_buffer = weechat_hashtable_new (32, - WEECHAT_HASHTABLE_POINTER, - WEECHAT_HASHTABLE_POINTER, - NULL, NULL); - if (!weechat_aspell_speller_buffer) + spell_speller_buffer = weechat_hashtable_new (32, + WEECHAT_HASHTABLE_POINTER, + WEECHAT_HASHTABLE_POINTER, + NULL, NULL); + if (!spell_speller_buffer) { - weechat_hashtable_free (weechat_aspell_spellers); + weechat_hashtable_free (spell_spellers); return 0; } - weechat_hashtable_set_pointer (weechat_aspell_speller_buffer, + weechat_hashtable_set_pointer (spell_speller_buffer, "callback_free_value", - &weechat_aspell_speller_buffer_free_value_cb); + &spell_speller_buffer_free_value_cb); return 1; } @@ -475,8 +479,8 @@ weechat_aspell_speller_init () */ void -weechat_aspell_speller_end () +spell_speller_end () { - weechat_hashtable_free (weechat_aspell_spellers); - weechat_hashtable_free (weechat_aspell_speller_buffer); + weechat_hashtable_free (spell_spellers); + weechat_hashtable_free (spell_speller_buffer); } diff --git a/src/plugins/aspell/weechat-aspell-speller.h b/src/plugins/spell/spell-speller.h similarity index 62% rename from src/plugins/aspell/weechat-aspell-speller.h rename to src/plugins/spell/spell-speller.h index fd2b79821..2d47d7e24 100644 --- a/src/plugins/aspell/weechat-aspell-speller.h +++ b/src/plugins/spell/spell-speller.h @@ -18,10 +18,10 @@ * along with WeeChat. If not, see . */ -#ifndef WEECHAT_PLUGIN_ASPELL_SPELLER_H -#define WEECHAT_PLUGIN_ASPELL_SPELLER_H +#ifndef WEECHAT_PLUGIN_SPELL_SPELLER_H +#define WEECHAT_PLUGIN_SPELL_SPELLER_H -struct t_aspell_speller_buffer +struct t_spell_speller_buffer { #ifdef USE_ENCHANT EnchantDict **spellers; /* enchant spellers for buffer */ @@ -33,19 +33,19 @@ struct t_aspell_speller_buffer char *modifier_result; /* last modifier result */ }; -extern struct t_hashtable *weechat_aspell_spellers; -extern struct t_hashtable *weechat_aspell_speller_buffer; +extern struct t_hashtable *spell_spellers; +extern struct t_hashtable *spell_speller_buffer; -extern int weechat_aspell_speller_dict_supported (const char *lang); -extern void weechat_aspell_speller_check_dictionaries (const char *dict_list); +extern int spell_speller_dict_supported (const char *lang); +extern void spell_speller_check_dictionaries (const char *dict_list); #ifdef USE_ENCHANT -extern EnchantDict *weechat_aspell_speller_new (const char *lang); +extern EnchantDict *spell_speller_new (const char *lang); #else -extern AspellSpeller *weechat_aspell_speller_new (const char *lang); +extern AspellSpeller *spell_speller_new (const char *lang); #endif /* USE_ENCHANT */ -extern void weechat_aspell_speller_remove_unused (); -extern struct t_aspell_speller_buffer *weechat_aspell_speller_buffer_new (struct t_gui_buffer *buffer); -extern int weechat_aspell_speller_init (); -extern void weechat_aspell_speller_end (); +extern void spell_speller_remove_unused (); +extern struct t_spell_speller_buffer *spell_speller_buffer_new (struct t_gui_buffer *buffer); +extern int spell_speller_init (); +extern void spell_speller_end (); -#endif /* WEECHAT_PLUGIN_ASPELL_SPELLER_H */ +#endif /* WEECHAT_PLUGIN_SPELL_SPELLER_H */ diff --git a/src/plugins/aspell/weechat-aspell.c b/src/plugins/spell/spell.c similarity index 78% rename from src/plugins/aspell/weechat-aspell.c rename to src/plugins/spell/spell.c index 6151f5be7..b39e5ce54 100644 --- a/src/plugins/aspell/weechat-aspell.c +++ b/src/plugins/spell/spell.c @@ -1,5 +1,5 @@ /* - * weechat-aspell.c - aspell plugin for WeeChat: color for misspelled words + * spell.c - spell checker plugin for WeeChat * * Copyright (C) 2006 Emmanuel Bouthenot * Copyright (C) 2006-2019 Sébastien Helleu @@ -32,28 +32,28 @@ #include #include "../weechat-plugin.h" -#include "weechat-aspell.h" -#include "weechat-aspell-bar-item.h" -#include "weechat-aspell-command.h" -#include "weechat-aspell-completion.h" -#include "weechat-aspell-config.h" -#include "weechat-aspell-info.h" -#include "weechat-aspell-speller.h" +#include "spell.h" +#include "spell-bar-item.h" +#include "spell-command.h" +#include "spell-completion.h" +#include "spell-config.h" +#include "spell-info.h" +#include "spell-speller.h" -WEECHAT_PLUGIN_NAME(ASPELL_PLUGIN_NAME); -WEECHAT_PLUGIN_DESCRIPTION(N_("Spell checker for input (with Aspell)")); +WEECHAT_PLUGIN_NAME(SPELL_PLUGIN_NAME); +WEECHAT_PLUGIN_DESCRIPTION(N_("Spell checker for input")); WEECHAT_PLUGIN_AUTHOR("Sébastien Helleu "); WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION); WEECHAT_PLUGIN_LICENSE(WEECHAT_LICENSE); WEECHAT_PLUGIN_PRIORITY(11000); -struct t_weechat_plugin *weechat_aspell_plugin = NULL; +struct t_weechat_plugin *weechat_spell_plugin = NULL; -int aspell_enabled = 0; +int spell_enabled = 0; -char *aspell_nick_completer = NULL; -int aspell_len_nick_completer = 0; +char *spell_nick_completer = NULL; +int spell_len_nick_completer = 0; #ifdef USE_ENCHANT EnchantBroker *broker = NULL; @@ -64,7 +64,7 @@ EnchantBroker *broker = NULL; * URL: ftp://ftp.gnu.org/gnu/aspell/dict/0index.html */ -struct t_aspell_code aspell_langs[] = +struct t_spell_code spell_langs[] = { { "af", "Afrikaans" }, { "am", "Amharic" }, @@ -160,7 +160,7 @@ struct t_aspell_code aspell_langs[] = { NULL, NULL} }; -struct t_aspell_code aspell_countries[] = +struct t_spell_code spell_countries[] = { { "AT", "Austria" }, { "BR", "Brazil" }, @@ -175,7 +175,7 @@ struct t_aspell_code aspell_countries[] = { NULL, NULL} }; -char *aspell_url_prefix[] = +char *spell_url_prefix[] = { "http:", "https:", "ftp:", "tftp:", "ftps:", "ssh:", "fish:", "dict:", "ldap:", "file:", "telnet:", "gopher:", "irc:", "ircs:", "irc6:", "irc6s:", "cvs:", "svn:", "svn+ssh:", "git:", NULL }; @@ -188,7 +188,7 @@ char *aspell_url_prefix[] = */ char * -weechat_aspell_build_option_name (struct t_gui_buffer *buffer) +spell_build_option_name (struct t_gui_buffer *buffer) { const char *plugin_name, *name; char *option_name; @@ -218,7 +218,7 @@ weechat_aspell_build_option_name (struct t_gui_buffer *buffer) */ const char * -weechat_aspell_get_dict_with_buffer_name (const char *name) +spell_get_dict_with_buffer_name (const char *name) { char *option_name, *ptr_end; struct t_config_option *ptr_option; @@ -232,7 +232,7 @@ weechat_aspell_get_dict_with_buffer_name (const char *name) ptr_end = option_name + strlen (option_name); while (ptr_end >= option_name) { - ptr_option = weechat_aspell_config_get_dict (option_name); + ptr_option = spell_config_get_dict (option_name); if (ptr_option) { free (option_name); @@ -246,7 +246,7 @@ weechat_aspell_get_dict_with_buffer_name (const char *name) if ((ptr_end >= option_name) && (ptr_end[0] == '.')) ptr_end[0] = '\0'; } - ptr_option = weechat_aspell_config_get_dict (option_name); + ptr_option = spell_config_get_dict (option_name); free (option_name); @@ -255,10 +255,10 @@ weechat_aspell_get_dict_with_buffer_name (const char *name) } /* nothing found => return default dictionary (if set) */ - if (weechat_config_string (weechat_aspell_config_check_default_dict) - && weechat_config_string (weechat_aspell_config_check_default_dict)[0]) + if (weechat_config_string (spell_config_check_default_dict) + && weechat_config_string (spell_config_check_default_dict)[0]) { - return weechat_config_string (weechat_aspell_config_check_default_dict); + return weechat_config_string (spell_config_check_default_dict); } /* no default dictionary set */ @@ -273,16 +273,16 @@ weechat_aspell_get_dict_with_buffer_name (const char *name) */ const char * -weechat_aspell_get_dict (struct t_gui_buffer *buffer) +spell_get_dict (struct t_gui_buffer *buffer) { char *name; const char *dict; - name = weechat_aspell_build_option_name (buffer); + name = spell_build_option_name (buffer); if (!name) return NULL; - dict = weechat_aspell_get_dict_with_buffer_name (name); + dict = spell_get_dict_with_buffer_name (name); free (name); @@ -298,7 +298,7 @@ weechat_aspell_get_dict (struct t_gui_buffer *buffer) */ int -weechat_aspell_command_authorized (const char *command) +spell_command_authorized (const char *command) { int length_command, i; @@ -307,11 +307,11 @@ weechat_aspell_command_authorized (const char *command) length_command = strlen (command); - for (i = 0; i < weechat_aspell_count_commands_to_check; i++) + for (i = 0; i < spell_count_commands_to_check; i++) { - if ((weechat_aspell_length_commands_to_check[i] == length_command) + if ((spell_length_commands_to_check[i] == length_command) && (weechat_strcasecmp (command, - weechat_aspell_commands_to_check[i]) == 0)) + spell_commands_to_check[i]) == 0)) { /* command is authorized */ return 1; @@ -331,14 +331,14 @@ weechat_aspell_command_authorized (const char *command) */ int -weechat_aspell_string_is_url (const char *word) +spell_string_is_url (const char *word) { int i; - for (i = 0; aspell_url_prefix[i]; i++) + for (i = 0; spell_url_prefix[i]; i++) { - if (weechat_strncasecmp (word, aspell_url_prefix[i], - strlen (aspell_url_prefix[i])) == 0) + if (weechat_strncasecmp (word, spell_url_prefix[i], + strlen (spell_url_prefix[i])) == 0) return 1; } @@ -355,21 +355,21 @@ weechat_aspell_string_is_url (const char *word) */ int -weechat_aspell_string_is_nick (struct t_gui_buffer *buffer, const char *word) +spell_string_is_nick (struct t_gui_buffer *buffer, const char *word) { char *pos, *pos_nick_completer, *pos_space, saved_char; const char *buffer_type, *buffer_nick, *buffer_channel; int rc; - pos_nick_completer = (aspell_nick_completer) ? - strstr (word, aspell_nick_completer) : NULL; + pos_nick_completer = (spell_nick_completer) ? + strstr (word, spell_nick_completer) : NULL; pos_space = strchr (word, ' '); pos = NULL; if (pos_nick_completer && pos_space) { if ((pos_nick_completer < pos_space) - && (pos_nick_completer + aspell_len_nick_completer == pos_space)) + && (pos_nick_completer + spell_len_nick_completer == pos_space)) { pos = pos_nick_completer; } @@ -378,7 +378,8 @@ weechat_aspell_string_is_nick (struct t_gui_buffer *buffer, const char *word) } else { - pos = (pos_nick_completer && !pos_nick_completer[aspell_len_nick_completer]) ? + pos = (pos_nick_completer + && !pos_nick_completer[spell_len_nick_completer]) ? pos_nick_completer : pos_space; } @@ -431,7 +432,7 @@ weechat_aspell_string_is_nick (struct t_gui_buffer *buffer, const char *word) */ int -weechat_aspell_string_is_simili_number (const char *word) +spell_string_is_simili_number (const char *word) { int code_point; @@ -459,18 +460,18 @@ weechat_aspell_string_is_simili_number (const char *word) */ int -weechat_aspell_check_word (struct t_aspell_speller_buffer *speller_buffer, - const char *word) +spell_check_word (struct t_spell_speller_buffer *speller_buffer, + const char *word) { int i; /* word too small? then do not check word */ - if ((weechat_config_integer (weechat_aspell_config_check_word_min_length) > 0) - && ((int)strlen (word) < weechat_config_integer (weechat_aspell_config_check_word_min_length))) + if ((weechat_config_integer (spell_config_check_word_min_length) > 0) + && ((int)strlen (word) < weechat_config_integer (spell_config_check_word_min_length))) return 1; /* word is a number? then do not check word */ - if (weechat_aspell_string_is_simili_number (word)) + if (spell_string_is_simili_number (word)) return 1; /* check word with all spellers (order is important) */ @@ -500,8 +501,8 @@ weechat_aspell_check_word (struct t_aspell_speller_buffer *speller_buffer, */ char * -weechat_aspell_get_suggestions (struct t_aspell_speller_buffer *speller_buffer, - const char *word) +spell_get_suggestions (struct t_spell_speller_buffer *speller_buffer, + const char *word) { int i, size, max_suggestions, num_suggestions; char *suggestions, *suggestions2; @@ -514,7 +515,7 @@ weechat_aspell_get_suggestions (struct t_aspell_speller_buffer *speller_buffer, AspellStringEnumeration *elements; #endif /* USE_ENCHANT */ - max_suggestions = weechat_config_integer (weechat_aspell_config_check_suggestions); + max_suggestions = weechat_config_integer (spell_config_check_suggestions); if (max_suggestions < 0) return NULL; @@ -603,13 +604,13 @@ weechat_aspell_get_suggestions (struct t_aspell_speller_buffer *speller_buffer, */ char * -weechat_aspell_modifier_cb (const void *pointer, void *data, - const char *modifier, - const char *modifier_data, const char *string) +spell_modifier_cb (const void *pointer, void *data, + const char *modifier, + const char *modifier_data, const char *string) { unsigned long value; struct t_gui_buffer *buffer; - struct t_aspell_speller_buffer *ptr_speller_buffer; + struct t_spell_speller_buffer *ptr_speller_buffer; char *result, *ptr_string, *ptr_string_orig, *pos_space; char *ptr_end, *ptr_end_valid, save_end; char *misspelled_word, *old_misspelled_word, *old_suggestions, *suggestions; @@ -625,7 +626,7 @@ weechat_aspell_modifier_cb (const void *pointer, void *data, (void) data; (void) modifier; - if (!aspell_enabled) + if (!spell_enabled) return NULL; if (!string) @@ -639,15 +640,15 @@ weechat_aspell_modifier_cb (const void *pointer, void *data, /* check text during search only if option is enabled */ if (weechat_buffer_get_integer (buffer, "text_search") - && !weechat_config_boolean (weechat_aspell_config_check_during_search)) + && !weechat_config_boolean (spell_config_check_during_search)) return NULL; /* get structure with speller info for buffer */ - ptr_speller_buffer = weechat_hashtable_get (weechat_aspell_speller_buffer, + ptr_speller_buffer = weechat_hashtable_get (spell_speller_buffer, buffer); if (!ptr_speller_buffer) { - ptr_speller_buffer = weechat_aspell_speller_buffer_new (buffer); + ptr_speller_buffer = spell_speller_buffer_new (buffer); if (!ptr_speller_buffer) return NULL; } @@ -661,7 +662,7 @@ weechat_aspell_modifier_cb (const void *pointer, void *data, input_pos = weechat_buffer_get_integer (buffer, "input_pos"); if (ptr_speller_buffer->modifier_string && (strcmp (string, ptr_speller_buffer->modifier_string) == 0) - && ((weechat_config_integer (weechat_aspell_config_check_suggestions) < 0) + && ((weechat_config_integer (spell_config_check_suggestions) < 0) || (input_pos == ptr_speller_buffer->input_pos))) { return (ptr_speller_buffer->modifier_result) ? @@ -688,7 +689,7 @@ weechat_aspell_modifier_cb (const void *pointer, void *data, color_normal = weechat_color ("bar_fg"); length_color_normal = strlen (color_normal); - color_error = weechat_color (weechat_config_string (weechat_aspell_config_color_misspelled)); + color_error = weechat_color (weechat_config_string (spell_config_color_misspelled)); length_color_error = strlen (color_error); length = strlen (string); @@ -720,7 +721,7 @@ weechat_aspell_modifier_cb (const void *pointer, void *data, pos_space[0] = '\0'; /* exit if command is not authorized for spell checking */ - if (!weechat_aspell_command_authorized (ptr_string)) + if (!spell_command_authorized (ptr_string)) { free (result); return NULL; @@ -787,8 +788,8 @@ weechat_aspell_modifier_cb (const void *pointer, void *data, ptr_end = (char *)weechat_utf8_next_char (ptr_end_valid); word_end_pos = word_end_pos_valid; word_ok = 0; - if (weechat_aspell_string_is_url (ptr_string) - || weechat_aspell_string_is_nick (buffer, ptr_string_orig)) + if (spell_string_is_url (ptr_string) + || spell_string_is_nick (buffer, ptr_string_orig)) { /* * word is an URL or a nick, then it is OK: search for next @@ -814,10 +815,10 @@ weechat_aspell_modifier_cb (const void *pointer, void *data, if (!word_ok) { if ((save_end != '\0') - || (weechat_config_integer (weechat_aspell_config_check_real_time))) + || (weechat_config_integer (spell_config_check_real_time))) { - word_ok = weechat_aspell_check_word (ptr_speller_buffer, - ptr_string); + word_ok = spell_check_word (ptr_speller_buffer, + ptr_string); if (!word_ok && (input_pos >= word_start_pos)) { /* @@ -864,7 +865,7 @@ weechat_aspell_modifier_cb (const void *pointer, void *data, /* save old suggestions in buffer */ ptr_suggestions = weechat_buffer_get_string (buffer, - "localvar_aspell_suggest"); + "localvar_spell_suggest"); old_suggestions = (ptr_suggestions) ? strdup (ptr_suggestions) : NULL; /* if there is a misspelled word, get suggestions and set them in buffer */ @@ -872,7 +873,7 @@ weechat_aspell_modifier_cb (const void *pointer, void *data, { /* * get the old misspelled word; we'll get suggestions or clear - * local variable "aspell_suggest" only if the current misspelled + * local variable "spell_suggest" only if the current misspelled * word is different */ old_misspelled_word = NULL; @@ -887,8 +888,8 @@ weechat_aspell_modifier_cb (const void *pointer, void *data, if (!old_misspelled_word || (strcmp (old_misspelled_word, misspelled_word) != 0)) { - suggestions = weechat_aspell_get_suggestions (ptr_speller_buffer, - misspelled_word); + suggestions = spell_get_suggestions (ptr_speller_buffer, + misspelled_word); if (suggestions) { length = strlen (misspelled_word) + 1 /* ":" */ @@ -898,21 +899,21 @@ weechat_aspell_modifier_cb (const void *pointer, void *data, { snprintf (word_and_suggestions, length, "%s:%s", misspelled_word, suggestions); - weechat_buffer_set (buffer, "localvar_set_aspell_suggest", + weechat_buffer_set (buffer, "localvar_set_spell_suggest", word_and_suggestions); free (word_and_suggestions); } else { weechat_buffer_set (buffer, - "localvar_del_aspell_suggest", ""); + "localvar_del_spell_suggest", ""); } free (suggestions); } else { /* set a misspelled word in buffer, also without suggestions */ - weechat_buffer_set (buffer, "localvar_set_aspell_suggest", + weechat_buffer_set (buffer, "localvar_set_spell_suggest", misspelled_word); } } @@ -924,22 +925,22 @@ weechat_aspell_modifier_cb (const void *pointer, void *data, } else { - weechat_buffer_set (buffer, "localvar_del_aspell_suggest", ""); + weechat_buffer_set (buffer, "localvar_del_spell_suggest", ""); } /* * if suggestions have changed, update the bar item - * and send signal "aspell_suggest" + * and send signal "spell_suggest" */ ptr_suggestions = weechat_buffer_get_string (buffer, - "localvar_aspell_suggest"); + "localvar_spell_suggest"); if ((old_suggestions && !ptr_suggestions) || (!old_suggestions && ptr_suggestions) || (old_suggestions && ptr_suggestions && (strcmp (old_suggestions, ptr_suggestions) != 0))) { - weechat_bar_item_update ("aspell_suggest"); - (void) weechat_hook_signal_send ("aspell_suggest", + weechat_bar_item_update ("spell_suggest"); + (void) weechat_hook_signal_send ("spell_suggest", WEECHAT_HOOK_SIGNAL_POINTER, buffer); } if (old_suggestions) @@ -958,9 +959,8 @@ weechat_aspell_modifier_cb (const void *pointer, void *data, */ int -weechat_aspell_buffer_switch_cb (const void *pointer, void *data, - const char *signal, const char *type_data, - void *signal_data) +spell_buffer_switch_cb (const void *pointer, void *data, const char *signal, + const char *type_data, void *signal_data) { /* make C compiler happy */ (void) pointer; @@ -970,8 +970,8 @@ weechat_aspell_buffer_switch_cb (const void *pointer, void *data, (void) signal_data; /* refresh bar items (for root bars) */ - weechat_bar_item_update ("aspell_dict"); - weechat_bar_item_update ("aspell_suggest"); + weechat_bar_item_update ("spell_dict"); + weechat_bar_item_update ("spell_suggest"); return WEECHAT_RC_OK; } @@ -981,9 +981,8 @@ weechat_aspell_buffer_switch_cb (const void *pointer, void *data, */ int -weechat_aspell_window_switch_cb (const void *pointer, void *data, - const char *signal, - const char *type_data, void *signal_data) +spell_window_switch_cb (const void *pointer, void *data, const char *signal, + const char *type_data, void *signal_data) { /* make C compiler happy */ (void) pointer; @@ -993,21 +992,20 @@ weechat_aspell_window_switch_cb (const void *pointer, void *data, (void) signal_data; /* refresh bar items (for root bars) */ - weechat_bar_item_update ("aspell_dict"); - weechat_bar_item_update ("aspell_suggest"); + weechat_bar_item_update ("spell_dict"); + weechat_bar_item_update ("spell_suggest"); return WEECHAT_RC_OK; } /* - * Removes struct for buffer in hashtable "weechat_aspell_speller_buffer" on + * Removes struct for buffer in hashtable "spell_speller_buffer" on * signal "buffer_closed". */ int -weechat_aspell_buffer_closed_cb (const void *pointer, void *data, - const char *signal, - const char *type_data, void *signal_data) +spell_buffer_closed_cb (const void *pointer, void *data, const char *signal, + const char *type_data, void *signal_data) { /* make C compiler happy */ (void) pointer; @@ -1015,7 +1013,7 @@ weechat_aspell_buffer_closed_cb (const void *pointer, void *data, (void) signal; (void) type_data; - weechat_hashtable_remove (weechat_aspell_speller_buffer, signal_data); + weechat_hashtable_remove (spell_speller_buffer, signal_data); return WEECHAT_RC_OK; } @@ -1025,9 +1023,8 @@ weechat_aspell_buffer_closed_cb (const void *pointer, void *data, */ int -weechat_aspell_debug_libs_cb (const void *pointer, void *data, - const char *signal, - const char *type_data, void *signal_data) +spell_debug_libs_cb (const void *pointer, void *data, const char *signal, + const char *type_data, void *signal_data) { /* make C compiler happy */ (void) pointer; @@ -1039,16 +1036,16 @@ weechat_aspell_debug_libs_cb (const void *pointer, void *data, #ifdef USE_ENCHANT #ifdef HAVE_ENCHANT_GET_VERSION weechat_printf (NULL, " %s: enchant %s", - ASPELL_PLUGIN_NAME, enchant_get_version ()); + SPELL_PLUGIN_NAME, enchant_get_version ()); #else - weechat_printf (NULL, " %s: enchant (?)", ASPELL_PLUGIN_NAME); + weechat_printf (NULL, " %s: enchant (?)", SPELL_PLUGIN_NAME); #endif /* HAVE_ENCHANT_GET_VERSION */ #else #ifdef HAVE_ASPELL_VERSION_STRING weechat_printf (NULL, " %s: aspell %s", - ASPELL_PLUGIN_NAME, aspell_version_string ()); + SPELL_PLUGIN_NAME, aspell_version_string ()); #else - weechat_printf (NULL, " %s: aspell (?)", ASPELL_PLUGIN_NAME); + weechat_printf (NULL, " %s: aspell (?)", SPELL_PLUGIN_NAME); #endif /* HAVE_ASPELL_VERSION_STRING */ #endif /* USE_ENCHANT */ @@ -1060,27 +1057,26 @@ weechat_aspell_debug_libs_cb (const void *pointer, void *data, */ int -weechat_aspell_config_change_nick_completer_cb (const void *pointer, void *data, - const char *option, - const char *value) +spell_config_change_nick_completer_cb (const void *pointer, void *data, + const char *option, const char *value) { /* make C compiler happy */ (void) pointer; (void) data; (void) option; - if (aspell_nick_completer) - free (aspell_nick_completer); + if (spell_nick_completer) + free (spell_nick_completer); - aspell_nick_completer = weechat_string_strip (value, 0, 1, " "); - aspell_len_nick_completer = - (aspell_nick_completer) ? strlen (aspell_nick_completer) : 0; + spell_nick_completer = weechat_string_strip (value, 0, 1, " "); + spell_len_nick_completer = + (spell_nick_completer) ? strlen (spell_nick_completer) : 0; return WEECHAT_RC_OK; } /* - * Initializes aspell plugin. + * Initializes spell plugin. */ int @@ -1099,17 +1095,17 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) return WEECHAT_RC_ERROR; #endif /* USE_ENCHANT */ - if (!weechat_aspell_speller_init ()) + if (!spell_speller_init ()) return WEECHAT_RC_ERROR; - if (!weechat_aspell_config_init ()) + if (!spell_config_init ()) return WEECHAT_RC_ERROR; - weechat_aspell_config_read (); + spell_config_read (); - weechat_aspell_command_init (); + spell_command_init (); - weechat_aspell_completion_init (); + spell_completion_init (); /* * callback for spell checking input text @@ -1117,26 +1113,26 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) * (from other plugins) will be called before this one */ weechat_hook_modifier ("500|input_text_display", - &weechat_aspell_modifier_cb, NULL, NULL); + &spell_modifier_cb, NULL, NULL); - weechat_aspell_bar_item_init (); + spell_bar_item_init (); - weechat_aspell_info_init (); + spell_info_init (); weechat_hook_signal ("buffer_switch", - &weechat_aspell_buffer_switch_cb, NULL, NULL); + &spell_buffer_switch_cb, NULL, NULL); weechat_hook_signal ("window_switch", - &weechat_aspell_window_switch_cb, NULL, NULL); + &spell_window_switch_cb, NULL, NULL); weechat_hook_signal ("buffer_closed", - &weechat_aspell_buffer_closed_cb, NULL, NULL); + &spell_buffer_closed_cb, NULL, NULL); weechat_hook_signal ("debug_libs", - &weechat_aspell_debug_libs_cb, NULL, NULL); + &spell_debug_libs_cb, NULL, NULL); weechat_hook_config ("weechat.completion.nick_completer", - &weechat_aspell_config_change_nick_completer_cb, + &spell_config_change_nick_completer_cb, NULL, NULL); /* manually call callback to initialize */ - weechat_aspell_config_change_nick_completer_cb ( + spell_config_change_nick_completer_cb ( NULL, NULL, "weechat.completion.nick_completer", weechat_config_string ( weechat_config_get ("weechat.completion.nick_completer"))); @@ -1145,7 +1141,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) } /* - * Ends aspell plugin. + * Ends spell plugin. */ int @@ -1154,18 +1150,18 @@ weechat_plugin_end (struct t_weechat_plugin *plugin) /* make C compiler happy */ (void) plugin; - weechat_aspell_config_write (); - weechat_aspell_config_free (); + spell_config_write (); + spell_config_free (); - weechat_aspell_speller_end (); + spell_speller_end (); #ifdef USE_ENCHANT /* release enchant broker */ enchant_broker_free (broker); #endif /* USE_ENCHANT */ - if (aspell_nick_completer) - free (aspell_nick_completer); + if (spell_nick_completer) + free (spell_nick_completer); return WEECHAT_RC_OK; } diff --git a/src/plugins/aspell/weechat-aspell.h b/src/plugins/spell/spell.h similarity index 63% rename from src/plugins/aspell/weechat-aspell.h rename to src/plugins/spell/spell.h index e209c0168..8625ea7db 100644 --- a/src/plugins/aspell/weechat-aspell.h +++ b/src/plugins/spell/spell.h @@ -18,8 +18,8 @@ * along with WeeChat. If not, see . */ -#ifndef WEECHAT_PLUGIN_ASPELL_H -#define WEECHAT_PLUGIN_ASPELL_H +#ifndef WEECHAT_PLUGIN_SPELL_H +#define WEECHAT_PLUGIN_SPELL_H #ifdef USE_ENCHANT #include @@ -27,10 +27,10 @@ #include #endif /* USE_ENCHANT */ -#define weechat_plugin weechat_aspell_plugin -#define ASPELL_PLUGIN_NAME "aspell" +#define weechat_plugin weechat_spell_plugin +#define SPELL_PLUGIN_NAME "spell" -struct t_aspell_code +struct t_spell_code { char *code; char *name; @@ -40,13 +40,13 @@ struct t_aspell_code extern EnchantBroker *broker; #endif /* USE_ENCHANT */ -extern struct t_weechat_plugin *weechat_aspell_plugin; -extern int aspell_enabled; -extern struct t_aspell_code aspell_langs[]; -extern struct t_aspell_code aspell_countries[]; +extern struct t_weechat_plugin *weechat_spell_plugin; +extern int spell_enabled; +extern struct t_spell_code spell_langs[]; +extern struct t_spell_code spell_countries[]; -extern char *weechat_aspell_build_option_name (struct t_gui_buffer *buffer); -extern const char *weechat_aspell_get_dict_with_buffer_name (const char *name); -extern const char *weechat_aspell_get_dict (struct t_gui_buffer *buffer); +extern char *spell_build_option_name (struct t_gui_buffer *buffer); +extern const char *spell_get_dict_with_buffer_name (const char *name); +extern const char *spell_get_dict (struct t_gui_buffer *buffer); -#endif /* WEECHAT_PLUGIN_ASPELL_H */ +#endif /* WEECHAT_PLUGIN_SPELL_H */ diff --git a/tests/unit/test-plugins.cpp b/tests/unit/test-plugins.cpp index ef8bf2897..a6c637c2c 100644 --- a/tests/unit/test-plugins.cpp +++ b/tests/unit/test-plugins.cpp @@ -52,7 +52,6 @@ TEST(Plugins, Loaded) /* check that all plugins are properly loaded */ CHECK(hdata_search (hdata, plugins, "${plugin.name} == alias", 1)); - CHECK(hdata_search (hdata, plugins, "${plugin.name} == aspell", 1)); CHECK(hdata_search (hdata, plugins, "${plugin.name} == buflist", 1)); CHECK(hdata_search (hdata, plugins, "${plugin.name} == charset", 1)); CHECK(hdata_search (hdata, plugins, "${plugin.name} == exec", 1)); @@ -69,6 +68,7 @@ TEST(Plugins, Loaded) CHECK(hdata_search (hdata, plugins, "${plugin.name} == relay", 1)); CHECK(hdata_search (hdata, plugins, "${plugin.name} == ruby", 1)); CHECK(hdata_search (hdata, plugins, "${plugin.name} == script", 1)); + CHECK(hdata_search (hdata, plugins, "${plugin.name} == spell", 1)); CHECK(hdata_search (hdata, plugins, "${plugin.name} == tcl", 1)); CHECK(hdata_search (hdata, plugins, "${plugin.name} == trigger", 1)); CHECK(hdata_search (hdata, plugins, "${plugin.name} == xfer", 1)); diff --git a/weechat.cygport.in b/weechat.cygport.in index 6a09aecbf..45fac2c4a 100644 --- a/weechat.cygport.in +++ b/weechat.cygport.in @@ -94,7 +94,6 @@ keyboard, it is customizable and extensible with scripts." weechat_CONTENTS=" usr/bin/ usr/lib/weechat/plugins/alias.dll - usr/lib/weechat/plugins/aspell.dll usr/lib/weechat/plugins/buflist.dll usr/lib/weechat/plugins/charset.dll usr/lib/weechat/plugins/exec.dll @@ -104,6 +103,7 @@ weechat_CONTENTS=" usr/lib/weechat/plugins/logger.dll usr/lib/weechat/plugins/relay.dll usr/lib/weechat/plugins/script.dll + usr/lib/weechat/plugins/spell.dll usr/lib/weechat/plugins/trigger.dll usr/lib/weechat/plugins/xfer.dll usr/share/locale/