core: add optional default path (evaluated) in completion "filename" (issue #60)

v2.8-utf8proc
Sébastien Helleu 2019-10-06 09:24:10 +02:00
parent 88aa82d672
commit 6e382d26a9
21 changed files with 124 additions and 49 deletions

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -142,7 +142,7 @@
| weechat | env_vars | 環境変数
| weechat | filename | ファイル名
| weechat | filename | filename; optional argument: default path (evaluated, see /help eval)
| weechat | filters_names | フィルタ名

View File

@ -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

View File

@ -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č"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"
@ -12181,6 +12180,10 @@ msgstr "%s hiányzó argumentum a(z) \"%s\" opciónak\n"
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"

View File

@ -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"

View File

@ -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 "バックログ行の色"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"
@ -12213,6 +12212,10 @@ msgstr "%s нет аргумента для параметра \"%s\"\n"
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 "цвет отошедших ников"

View File

@ -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ı"

View File

@ -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"

View File

@ -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"),