diff options
-rw-r--r-- | ChangeLog.adoc | 1 | ||||
-rw-r--r-- | doc/de/autogen/plugin_api/completions.adoc | 2 | ||||
-rw-r--r-- | doc/en/autogen/plugin_api/completions.adoc | 2 | ||||
-rw-r--r-- | doc/fr/autogen/plugin_api/completions.adoc | 2 | ||||
-rw-r--r-- | doc/it/autogen/plugin_api/completions.adoc | 2 | ||||
-rw-r--r-- | doc/ja/autogen/plugin_api/completions.adoc | 2 | ||||
-rw-r--r-- | doc/pl/autogen/plugin_api/completions.adoc | 2 | ||||
-rw-r--r-- | po/cs.po | 11 | ||||
-rw-r--r-- | po/de.po | 11 | ||||
-rw-r--r-- | po/es.po | 9 | ||||
-rw-r--r-- | po/fr.po | 13 | ||||
-rw-r--r-- | po/hu.po | 11 | ||||
-rw-r--r-- | po/it.po | 12 | ||||
-rw-r--r-- | po/ja.po | 12 | ||||
-rw-r--r-- | po/pl.po | 12 | ||||
-rw-r--r-- | po/pt.po | 12 | ||||
-rw-r--r-- | po/pt_BR.po | 9 | ||||
-rw-r--r-- | po/ru.po | 11 | ||||
-rw-r--r-- | po/tr.po | 9 | ||||
-rw-r--r-- | po/weechat.pot | 4 | ||||
-rw-r--r-- | src/core/wee-completion.c | 24 |
21 files changed, 124 insertions, 49 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 81cfb912c..b95962ac5 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -22,6 +22,7 @@ New features:: * core: add length of string (number of chars and on screen) in evaluation of expressions with "length:xxx" and "lengthscr:xxx" * core: add calculation of expression in evaluation of expressions with "calc:xxx" (issue #997) + * core: add optional default path (evaluated) in completion "filename" * core: add support of modifiers in evaluation of expressions with "modifier:name,data,string" * api: add modifier "color_encode_ansi" (issue #528) * api: add modifier "eval_path_home" diff --git a/doc/de/autogen/plugin_api/completions.adoc b/doc/de/autogen/plugin_api/completions.adoc index 7e982a15e..d6b3e4d41 100644 --- a/doc/de/autogen/plugin_api/completions.adoc +++ b/doc/de/autogen/plugin_api/completions.adoc @@ -142,7 +142,7 @@ | weechat | env_vars | Umgebungsvariablen -| weechat | filename | Dateinamen +| weechat | filename | filename; optional argument: default path (evaluated, see /help eval) | weechat | filters_names | Liste der Filter diff --git a/doc/en/autogen/plugin_api/completions.adoc b/doc/en/autogen/plugin_api/completions.adoc index 536a714a0..dc92e9306 100644 --- a/doc/en/autogen/plugin_api/completions.adoc +++ b/doc/en/autogen/plugin_api/completions.adoc @@ -142,7 +142,7 @@ | weechat | env_vars | environment variables -| weechat | filename | filename +| weechat | filename | filename; optional argument: default path (evaluated, see /help eval) | weechat | filters_names | names of filters diff --git a/doc/fr/autogen/plugin_api/completions.adoc b/doc/fr/autogen/plugin_api/completions.adoc index 9c18c1318..b9a94c552 100644 --- a/doc/fr/autogen/plugin_api/completions.adoc +++ b/doc/fr/autogen/plugin_api/completions.adoc @@ -142,7 +142,7 @@ | weechat | env_vars | variables d'environnement -| weechat | filename | nom de fichier +| weechat | filename | nom de fichier ; paramètre optionnel : chemin par défaut (évalué, voir /help eval) | weechat | filters_names | noms des filtres diff --git a/doc/it/autogen/plugin_api/completions.adoc b/doc/it/autogen/plugin_api/completions.adoc index 5489f6d38..08818d4d4 100644 --- a/doc/it/autogen/plugin_api/completions.adoc +++ b/doc/it/autogen/plugin_api/completions.adoc @@ -142,7 +142,7 @@ | weechat | env_vars | environment variables -| weechat | filename | nome file +| weechat | filename | filename; optional argument: default path (evaluated, see /help eval) | weechat | filters_names | nomi dei filtri diff --git a/doc/ja/autogen/plugin_api/completions.adoc b/doc/ja/autogen/plugin_api/completions.adoc index 241e42369..3496d0f40 100644 --- a/doc/ja/autogen/plugin_api/completions.adoc +++ b/doc/ja/autogen/plugin_api/completions.adoc @@ -142,7 +142,7 @@ | weechat | env_vars | 環境変数 -| weechat | filename | ファイル名 +| weechat | filename | filename; optional argument: default path (evaluated, see /help eval) | weechat | filters_names | フィルタ名 diff --git a/doc/pl/autogen/plugin_api/completions.adoc b/doc/pl/autogen/plugin_api/completions.adoc index acfc9ddce..844580a92 100644 --- a/doc/pl/autogen/plugin_api/completions.adoc +++ b/doc/pl/autogen/plugin_api/completions.adoc @@ -142,7 +142,7 @@ | weechat | env_vars | zmienne środowiskowe -| weechat | filename | nazwa pliku +| weechat | filename | filename; optional argument: default path (evaluated, see /help eval) | weechat | filters_names | nazwy filtrów @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-10-06 08:58+0200\n" +"POT-Creation-Date: 2019-10-06 09:20+0200\n" "PO-Revision-Date: 2019-05-13 21:31+0200\n" "Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2827,8 +2827,10 @@ msgstr "barvy palety" msgid "configuration files" msgstr "konfigurační soubory" -msgid "filename" -msgstr "jméno souboru" +#, fuzzy +msgid "filename; optional argument: default path (evaluated, see /help eval)" +msgstr "" +"uživatelské jméno pro proxy server(pozn.: obsah je vykonán, viz /help eval)" msgid "names of filters" msgstr "jména filtrů" @@ -12926,6 +12928,9 @@ msgstr "%s%s: vypršel časový limit \"%s\" pro %s" msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s%s: nemohu se připojit\" neočekávaná chyba (%d)" +#~ msgid "filename" +#~ msgstr "jméno souboru" + #, fuzzy #~ msgid "color for backlog lines" #~ msgstr "barva položek, které jsou pryč" @@ -24,7 +24,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-10-06 08:58+0200\n" +"POT-Creation-Date: 2019-10-06 09:20+0200\n" "PO-Revision-Date: 2019-10-03 15:25+0200\n" "Last-Translator: Nils Görs <weechatter@arcor.de>\n" "Language-Team: German <kde-i18n-de@kde.org>\n" @@ -3412,8 +3412,10 @@ msgstr "Farbpalette" msgid "configuration files" msgstr "Konfigurationsdateien" -msgid "filename" -msgstr "Dateinamen" +#, fuzzy +msgid "filename; optional argument: default path (evaluated, see /help eval)" +msgstr "" +"Username für Proxy Server (Hinweis: Inhalt wird evaluiert, siehe /help eval)" msgid "names of filters" msgstr "Liste der Filter" @@ -15109,5 +15111,8 @@ msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "" "%s%s: Verbindung konnte nicht hergestellt werden: unerwarteter Fehler (%d)" +#~ msgid "filename" +#~ msgstr "Dateinamen" + #~ msgid "color for backlog lines" #~ msgstr "Textfarbe in der der Verlaufsspeicher dargestellt werden soll" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-10-06 08:58+0200\n" +"POT-Creation-Date: 2019-10-06 09:20+0200\n" "PO-Revision-Date: 2019-05-13 21:31+0200\n" "Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2942,8 +2942,8 @@ msgstr "paleta de colores" msgid "configuration files" msgstr "archivos de configuración" -msgid "filename" -msgstr "nombre de archivo" +msgid "filename; optional argument: default path (evaluated, see /help eval)" +msgstr "" msgid "names of filters" msgstr "nombre de los filtros" @@ -13210,5 +13210,8 @@ msgstr "%s%s: tiempo de espera máximo para \"%s\" con %s" msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s%s: no es posible conectarse al transmisor" +#~ msgid "filename" +#~ msgstr "nombre de archivo" + #~ msgid "color for backlog lines" #~ msgstr "color para las líneas del último registro" @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-10-06 08:58+0200\n" -"PO-Revision-Date: 2019-10-06 08:59+0200\n" +"POT-Creation-Date: 2019-10-06 09:20+0200\n" +"PO-Revision-Date: 2019-10-06 09:22+0200\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: fr\n" @@ -3324,8 +3324,10 @@ msgstr "couleurs de la palette" msgid "configuration files" msgstr "fichiers de configuration" -msgid "filename" -msgstr "nom de fichier" +msgid "filename; optional argument: default path (evaluated, see /help eval)" +msgstr "" +"nom de fichier ; paramètre optionnel : chemin par défaut (évalué, voir /help " +"eval)" msgid "names of filters" msgstr "noms des filtres" @@ -14805,5 +14807,8 @@ msgstr "%s%s : délai d'attente dépassé pour \"%s\" avec %s" msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s%s : impossible de se connecter : erreur inattendue (%d)" +#~ msgid "filename" +#~ msgstr "nom de fichier" + #~ msgid "color for backlog lines" #~ msgstr "couleur pour les lignes de l'historique" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-10-06 08:58+0200\n" +"POT-Creation-Date: 2019-10-06 09:20+0200\n" "PO-Revision-Date: 2019-05-13 21:31+0200\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2461,9 +2461,8 @@ msgstr "Alapértelmezett billentyűparancsok visszaállítva\n" msgid "configuration files" msgstr "szerver konfigurációs fájljának újraolvastatása" -#, fuzzy -msgid "filename" -msgstr "a felhasználók le lettek tiltva" +msgid "filename; optional argument: default path (evaluated, see /help eval)" +msgstr "" #, fuzzy msgid "names of filters" @@ -12182,5 +12181,9 @@ msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s DCC: nem sikerült kapcsolódni a küldőhöz\n" #, fuzzy +#~ msgid "filename" +#~ msgstr "a felhasználók le lettek tiltva" + +#, fuzzy #~ msgid "color for backlog lines" #~ msgstr "távollevő felhasználók nevének színe" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-10-06 08:58+0200\n" +"POT-Creation-Date: 2019-10-06 09:20+0200\n" "PO-Revision-Date: 2019-05-13 21:31+0200\n" "Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -3031,8 +3031,11 @@ msgstr "Tavolozza dei colori" msgid "configuration files" msgstr "file di configurazione" -msgid "filename" -msgstr "nome file" +#, fuzzy +msgid "filename; optional argument: default path (evaluated, see /help eval)" +msgstr "" +"nome utente per il server proxy (nota: il contenuto viene valutato, " +"consultare /help eval)" msgid "names of filters" msgstr "nomi dei filtri" @@ -13430,5 +13433,8 @@ msgstr "%s%s: timeout per \"%s\" con %s" msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s%s: impossibile connettersi al mittente" +#~ msgid "filename" +#~ msgstr "nome file" + #~ msgid "color for backlog lines" #~ msgstr "colore per la cronologia" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-10-06 08:58+0200\n" +"POT-Creation-Date: 2019-10-06 09:20+0200\n" "PO-Revision-Date: 2019-09-22 18:54+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Language-Team: Japanese <https://github.com/l/weechat/tree/master/" @@ -3223,8 +3223,11 @@ msgstr "パレット色" msgid "configuration files" msgstr "設定ファイル" -msgid "filename" -msgstr "ファイル名" +#, fuzzy +msgid "filename; optional argument: default path (evaluated, see /help eval)" +msgstr "" +"プロキシサーバのユーザ名 (注意: 値は評価されます、/help eval を参照してくださ" +"い)" msgid "names of filters" msgstr "フィルタ名" @@ -14218,5 +14221,8 @@ msgstr "%s%s: \"%s\" のタイムアウト %s" msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s%s: 接続できません: 未定義のエラー (%d)" +#~ msgid "filename" +#~ msgstr "ファイル名" + #~ msgid "color for backlog lines" #~ msgstr "バックログ行の色" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-10-06 08:58+0200\n" +"POT-Creation-Date: 2019-10-06 09:20+0200\n" "PO-Revision-Date: 2019-09-22 18:54+0200\n" "Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n" "Language-Team: Polish <kde-i18n-doc@kde.org>\n" @@ -3277,8 +3277,11 @@ msgstr "paleta kolorów" msgid "configuration files" msgstr "pliki konfiguracyjne" -msgid "filename" -msgstr "nazwa pliku" +#, fuzzy +msgid "filename; optional argument: default path (evaluated, see /help eval)" +msgstr "" +"nazwa użytkownika dla serwera proxy (zawartość jest przetwarzana, zobacz /" +"help eval)" msgid "names of filters" msgstr "nazwy filtrów" @@ -14452,5 +14455,8 @@ msgstr "%s%s: przekroczono czas na \"%s\" z %s" msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s%s: nie można połączyć: niespodziewany błąd (%d)" +#~ msgid "filename" +#~ msgstr "nazwa pliku" + #~ msgid "color for backlog lines" #~ msgstr "kolor linii backloga" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-10-06 08:58+0200\n" +"POT-Creation-Date: 2019-10-06 09:20+0200\n" "PO-Revision-Date: 2019-09-22 18:54+0200\n" "Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n" "Language-Team: Portuguese <>\n" @@ -3220,8 +3220,11 @@ msgstr "paleta de cores" msgid "configuration files" msgstr "ficheiros de configuração" -msgid "filename" -msgstr "nome do ficheiro" +#, fuzzy +msgid "filename; optional argument: default path (evaluated, see /help eval)" +msgstr "" +"nome do utilizador do servidor proxy (nota: o conteúdo é avaliado, ver /help " +"eval)" msgid "names of filters" msgstr "nomes dos filtros" @@ -14089,5 +14092,8 @@ msgstr "%s%s: tempo limite de \"%s\" com %s" msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s%s: não foi possível conectar: erro inesperado (%d)" +#~ msgid "filename" +#~ msgstr "nome do ficheiro" + #~ msgid "color for backlog lines" #~ msgstr "cor das linhas do registo recente" diff --git a/po/pt_BR.po b/po/pt_BR.po index 22d592695..9d92eb611 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-10-06 08:58+0200\n" +"POT-Creation-Date: 2019-10-06 09:20+0200\n" "PO-Revision-Date: 2019-05-13 21:32+0200\n" "Last-Translator: Eduardo Elias <camponez@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2997,8 +2997,8 @@ msgstr "cores da palheta" msgid "configuration files" msgstr "arquivos de configuração" -msgid "filename" -msgstr "nome de arquivo" +msgid "filename; optional argument: default path (evaluated, see /help eval)" +msgstr "" msgid "names of filters" msgstr "nomes dos filtros" @@ -12658,6 +12658,9 @@ msgstr "%s%s: tempo esgotado para \"%s\" com %s" msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s%s: não foi possível conectar ao remetente" +#~ msgid "filename" +#~ msgstr "nome de arquivo" + #, fuzzy #~ msgid "color for backlog lines" #~ msgstr "cor de texto para valores" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-10-06 08:58+0200\n" +"POT-Creation-Date: 2019-10-06 09:20+0200\n" "PO-Revision-Date: 2019-05-13 21:32+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2484,9 +2484,8 @@ msgstr "Комбинации клавиш по умолчанию восстан msgid "configuration files" msgstr "перезагрузить конфигурационный файл сервера" -#, fuzzy -msgid "filename" -msgstr "команда users отключена" +msgid "filename; optional argument: default path (evaluated, see /help eval)" +msgstr "" #, fuzzy msgid "names of filters" @@ -12214,5 +12213,9 @@ msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s DCC: не могу соединиться с отправителем\n" #, fuzzy +#~ msgid "filename" +#~ msgstr "команда users отключена" + +#, fuzzy #~ msgid "color for backlog lines" #~ msgstr "цвет отошедших ников" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-10-06 08:58+0200\n" +"POT-Creation-Date: 2019-10-06 09:20+0200\n" "PO-Revision-Date: 2019-05-13 21:32+0200\n" "Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2238,8 +2238,8 @@ msgstr "" msgid "configuration files" msgstr "yapılandırma dosyaları" -msgid "filename" -msgstr "dosyaadı" +msgid "filename; optional argument: default path (evaluated, see /help eval)" +msgstr "" msgid "names of filters" msgstr "filtrelerin isimleri" @@ -11153,3 +11153,6 @@ msgstr "" #, c-format msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "" + +#~ msgid "filename" +#~ msgstr "dosyaadı" diff --git a/po/weechat.pot b/po/weechat.pot index 655695824..2dacbbae0 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-10-06 08:58+0200\n" +"POT-Creation-Date: 2019-10-06 09:20+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2234,7 +2234,7 @@ msgstr "" msgid "configuration files" msgstr "" -msgid "filename" +msgid "filename; optional argument: default path (evaluated, see /help eval)" msgstr "" msgid "names of filters" diff --git a/src/core/wee-completion.c b/src/core/wee-completion.c index e37b6186e..bc52d72ec 100644 --- a/src/core/wee-completion.c +++ b/src/core/wee-completion.c @@ -1,3 +1,4 @@ + /* * wee-completion.c - completion for WeeChat commands * @@ -36,6 +37,7 @@ #include "weechat.h" #include "wee-arraylist.h" #include "wee-config.h" +#include "wee-eval.h" #include "wee-hashtable.h" #include "wee-hook.h" #include "wee-list.h" @@ -435,6 +437,7 @@ completion_list_add_filename_cb (const void *pointer, void *data, char home[3] = { '~', DIR_SEPARATOR_CHAR, '\0' }; char *ptr_home, *pos, buf[PATH_MAX], *real_prefix, *prefix, *path_dir; char *path_base, *dir_name; + const char *pos_args; int length_path_base; DIR *dp; struct dirent *entry; @@ -448,6 +451,10 @@ completion_list_add_filename_cb (const void *pointer, void *data, completion->add_space = 0; + pos_args = strchr (completion_item, ':'); + if (pos_args) + pos_args++; + ptr_home = getenv ("HOME"); real_prefix = NULL; @@ -466,7 +473,18 @@ completion_list_add_filename_cb (const void *pointer, void *data, if (!completion->base_word[0] || completion->base_word[0] != DIR_SEPARATOR_CHAR) { - real_prefix = strdup (weechat_home); + real_prefix = NULL; + if (pos_args && pos_args[0]) + { + real_prefix = eval_expression (pos_args, NULL, NULL, NULL); + if (real_prefix && !real_prefix[0]) + { + free (real_prefix); + real_prefix = NULL; + } + } + if (!real_prefix) + real_prefix = strdup (weechat_home); prefix = strdup (""); } else @@ -1714,7 +1732,9 @@ completion_init () N_("configuration files"), &completion_list_add_config_files_cb, NULL, NULL); hook_completion (NULL, "filename", /* formerly "%f" */ - N_("filename"), + N_("filename; " + "optional argument: default path (evaluated, " + "see /help eval)"), &completion_list_add_filename_cb, NULL, NULL); hook_completion (NULL, "filters_names", /* formerly "%F" */ N_("names of filters"), |