doc: add note about prefix for function weechat_printf in plugin API reference

v2.8-utf8proc
Sebastien Helleu 2011-10-04 17:26:16 +02:00
parent 58c32e4249
commit 67726a9451
3 changed files with 32 additions and 0 deletions

View File

@ -5936,12 +5936,20 @@ Arguments:
* 'buffer': buffer pointer, if NULL, message is displayed on WeeChat buffer
* 'message': message to display
[NOTE]
The first tabulation in message ("\t") is used to separate prefix from message. +
If your message has some tabs and if you don't want prefix, then use a space,
a tab, then message (see example below): this will disable prefix (the space
before tab will not be displayed).
C example:
[source,C]
----------------------------------------
weechat_printf (NULL, "Hello on WeeChat buffer");
weechat_printf (buffer, "Hello on this buffer");
weechat_printf (buffer, "%sThis is an error!", weechat_prefix ("error"));
weechat_printf (buffer, " \tMessage without prefix but with \t some \t tabs");
----------------------------------------
Script (Python):
@ -5954,6 +5962,8 @@ weechat.prnt(buffer, message)
# example
weechat.prnt("", "Hello on WeeChat buffer")
weechat.prnt(buffer, "Hello on this buffer")
weechat.prnt(buffer, "%sThis is an error!" % weechat.prefix("error"))
weechat.prnt(buffer, " \tMessage without prefix but with \t some \t tabs")
----------------------------------------
[NOTE]

View File

@ -6001,12 +6001,21 @@ Paramètres :
tampon WeeChat
* 'message' : message à afficher
[NOTE]
La première tabulation dans le message ("\t") est utilisée pour séparer le
préfixe du message. +
Si votre message contient des tabulations et si vous ne voulez pas de préfixe,
utilisez un espace, une tabulation, puis le message : cela désactivera le
préfixe (l'espace avant la tabulation ne sera pas affiché).
Exemple en C :
[source,C]
----------------------------------------
weechat_printf (NULL, "Bonjour sur le tampon WeeChat");
weechat_printf (buffer, "Bonjour sur ce tampon");
weechat_printf (buffer, "%sCeci est une erreur !", weechat_prefix ("error"));
weechat_printf (buffer, " \tMessage sans préfixe mais avec \t quelques \t tabulations");
----------------------------------------
Script (Python) :
@ -6019,6 +6028,8 @@ weechat.prnt(buffer, message)
# exemple
weechat.prnt("", "Bonjour sur le tampon WeeChat")
weechat.prnt(buffer, "Bonjour sur ce tampon")
weechat.prnt(buffer, "%sCeci est une erreur !" % weechat.prefix("error"))
weechat.prnt(buffer, " \tMessage sans préfixe mais avec \t quelques \t tabulations")
----------------------------------------
[NOTE]

View File

@ -5945,12 +5945,21 @@ Argomenti:
* 'buffer': puntatore al buffer, se NULL il messaggio viene visualizzato sul buffer di WeeChat
* 'message': messaggio da visualizzare
// TRANSLATION MISSING
[NOTE]
The first tabulation in message ("\t") is used to separate prefix from message. +
If your message has some tabs and if you don't want prefix, then use a space,
a tab, then message (see example below): this will disable prefix (the space
before tab will not be displayed).
Esempio in C:
[source,C]
----------------------------------------
weechat_printf (NULL, "Benvenuto sul buffer di WeeChat");
weechat_printf (buffer, "Benvenuto su questo buffer");
weechat_printf (buffer, "%sThis is an error!", weechat_prefix ("error"));
weechat_printf (buffer, " \tMessage without prefix but with \t some \t tabs");
----------------------------------------
Script (Python):
@ -5963,6 +5972,8 @@ weechat.prnt(buffer, message)
# esempio
weechat.prnt("", "Benvenuto sul buffer di WeeChat")
weechat.prnt(buffer, "Benvenuto su questo buffer")
weechat.prnt(buffer, "%sThis is an error!" % weechat.prefix("error"))
weechat.prnt(buffer, " \tMessage without prefix but with \t some \t tabs")
----------------------------------------
[NOTE]