api: allow value "-1" for property "hotlist" in function buffer_set (to remove a buffer from hotlist)

v2.8-utf8proc
Sébastien Helleu 2014-04-03 13:53:18 +02:00
parent 220682c1bc
commit 55e43e15f8
7 changed files with 21 additions and 8 deletions

View File

@ -70,6 +70,8 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
* core: add signals "key_combo_{default|search|cursor}"
* core: display a warning in case of inconsistency between the options
weechat.look.save_{config|layout}_on_exit
* api: allow value "-1" for property "hotlist" in function buffer_set (to remove
a buffer from hotlist)
* api: add option "buffer_flush" in function hook_process_hashtable
* api: allow negative value for y in function printf_y
* api: add support of case insensitive search and search by buffer full name

View File

@ -10454,7 +10454,8 @@ Properties:
WEECHAT_HOTLIST_PRIVATE, WEECHAT_HOTLIST_HIGHLIGHT |
"+": enable hotlist (global setting, buffer pointer is not used) +
"-": disable hotlist (global setting, buffer pointer is not used) +
priority: add buffer to hotlist with this priority
priority: add buffer to hotlist with this priority +
"-1": remove buffer from hotlist _(WeeChat ≥ 0.4.4)_
| completion_freeze | "0", "1" |
"0": no freeze of completion (default value)

View File

@ -10657,7 +10657,8 @@ Propriétés :
utilisé) +
"-" : désactive la hotlist (option globale, le pointeur vers le tampon n'est
pas utilisé) +
priorité : ajouter ce tampon dans la hotlist avec cette priorité
priorité : ajouter ce tampon dans la hotlist avec cette priorité +
"-1" : supprimer ce tampon de la hotlist _(WeeChat ≥ 0.4.4)_
| completion_freeze | "0", "1" |
"0" : pas de gel de la complétion (valeur par défaut)

View File

@ -10723,13 +10723,15 @@ Properties:
|===
| Nome | Valore | Descrizione
// TRANSLATION MISSING
| hotlist | "+", "-", WEECHAT_HOTLIST_LOW, WEECHAT_HOTLIST_MESSAGE,
WEECHAT_HOTLIST_PRIVATE, WEECHAT_HOTLIST_HIGHLIGHT |
"+": abilita hotlist (impostazione globale , il puntatore al buffer pointer non
è utilizzato) +
"-": disabilita hotlist (impostazione globale, il puntatore al buffer non è
utilizzato) +
priorità: aggiunge il buffer alla hotlist con questa proprietà
priorità: aggiunge il buffer alla hotlist con questa proprietà +
"-1": remove buffer from hotlist _(WeeChat ≥ 0.4.4)_
// TRANSLATION MISSING
| completion_freeze | "0", "1" |

View File

@ -10443,11 +10443,13 @@ void weechat_buffer_set (struct t_gui_buffer *buffer, const char *property,
|===
| 名前 | 値 | 説明
// TRANSLATION MISSING
| hotlist | "+", "-", WEECHAT_HOTLIST_LOW, WEECHAT_HOTLIST_MESSAGE,
WEECHAT_HOTLIST_PRIVATE, WEECHAT_HOTLIST_HIGHLIGHT |
"+": ホットリストを有効化 (グローバル設定、バッファへのポインタは使われない) +
"-": ホットリストを無効化 (グローバル設定、バッファへのポインタは使われない) +
優先度: この優先度でホットリストにバッファを追加
優先度: この優先度でホットリストにバッファを追加 +
"-1": remove buffer from hotlist _(WeeChat ≥ 0.4.4)_
| completion_freeze | "0", "1" |
"0": 補完を止める (デフォルト)

View File

@ -1709,19 +1709,24 @@ gui_buffer_set (struct t_gui_buffer *buffer, const char *property,
if (!property || !value)
return;
/* properties that does NOT need a buffer */
/* properties with optional buffer */
if (string_strcasecmp (property, "hotlist") == 0)
{
if (strcmp (value, "-") == 0)
gui_add_hotlist = 0;
else if (strcmp (value, "+") == 0)
gui_add_hotlist = 1;
else
else if (buffer)
{
error = NULL;
number = strtol (value, &error, 10);
if (error && !error[0])
(void) gui_hotlist_add (buffer, number, NULL);
{
if (number < 0)
gui_hotlist_remove_buffer (buffer);
else
(void) gui_hotlist_add (buffer, number, NULL);
}
}
}
else if (string_strcasecmp (property, "completion_freeze") == 0)

View File

@ -492,7 +492,7 @@ gui_hotlist_remove_buffer (struct t_gui_buffer *buffer)
int hotlist_changed;
struct t_gui_hotlist *ptr_hotlist, *next_hotlist;
if (weechat_upgrading)
if (!buffer || weechat_upgrading)
return;
hotlist_changed = 0;