Compare commits

..

No commits in common. "4ed6693f57fcfb0ad15849d7d4861b7efaf8e11a" and "ca33adeeeee56262b95a6ff1339227bfc90e0a82" have entirely different histories.

5 changed files with 45 additions and 49 deletions

View File

@ -148,7 +148,7 @@ include_directories (${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR})
# Generate IRC replies--we need a custom target because of the multiple outputs # Generate IRC replies--we need a custom target because of the multiple outputs
add_custom_command (OUTPUT xD-replies.c xD.msg add_custom_command (OUTPUT xD-replies.c xD.msg
COMMAND env LC_ALL=C awk -f ${PROJECT_SOURCE_DIR}/xD-gen-replies.awk COMMAND ${PROJECT_SOURCE_DIR}/xD-gen-replies.sh
> xD-replies.c < ${PROJECT_SOURCE_DIR}/xD-replies > xD-replies.c < ${PROJECT_SOURCE_DIR}/xD-replies
DEPENDS ${PROJECT_SOURCE_DIR}/xD-replies DEPENDS ${PROJECT_SOURCE_DIR}/xD-replies
COMMENT "Generating files from the list of server numerics") COMMENT "Generating files from the list of server numerics")

View File

@ -62,10 +62,10 @@ their respective function names:
*M-a*: *goto-activity*:: *M-a*: *goto-activity*::
Go to the first following buffer with unseen activity. Go to the first following buffer with unseen activity.
*PageUp*: *display-backlog*:: *PageUp*: *display-backlog*::
Show the in-memory backlog for this buffer using *general.pager*, Show the in-memory backlog for this buffer in the backlog helper,
which is almost certainly the *less*(1) program. which is almost certainly the *less*(1) program.
*M-h*: *display-full-log*:: *M-h*: *display-full-log*::
Show the log file for this buffer using *general.pager*. Show the log file for this buffer in the backlog helper.
*M-H*: *toggle-unimportant*:: *M-H*: *toggle-unimportant*::
Hide all join, part and quit messages, as well as all channel mode changes Hide all join, part and quit messages, as well as all channel mode changes
that only relate to user channel modes. Intended to reduce noise in that only relate to user channel modes. Intended to reduce noise in

31
xC.c
View File

@ -2879,7 +2879,7 @@ attr_printer_tputs (struct attr_printer *self, const char *attr)
tputs (attr, 1, printer); tputs (attr, 1, printer);
else else
// We shouldn't really do this but we need it to output formatting // We shouldn't really do this but we need it to output formatting
// to the pager--it should be SGR-only // to the backlog helper--it should be SGR-only
attr_printer_filtered_puts (self->stream, attr); attr_printer_filtered_puts (self->stream, attr);
} }
@ -11361,7 +11361,7 @@ handle_command_set_modify
return result; return result;
} }
static bool static void
handle_command_set_assign_item (struct app_context *ctx, handle_command_set_assign_item (struct app_context *ctx,
char *key, struct config_item *new_, bool add, bool remove) char *key, struct config_item *new_, bool add, bool remove)
{ {
@ -11384,14 +11384,14 @@ handle_command_set_assign_item (struct app_context *ctx,
log_global_error (ctx, log_global_error (ctx,
"Failed to set option \"#s\": #s", key, e->message); "Failed to set option \"#s\": #s", key, e->message);
error_free (e); error_free (e);
return false;
} }
else
struct strv tmp = strv_make (); {
dump_matching_options (ctx->config.root, key, &tmp); struct strv tmp = strv_make ();
log_global_status (ctx, "Option changed: #s", tmp.vector[0]); dump_matching_options (ctx->config.root, key, &tmp);
strv_free (&tmp); log_global_status (ctx, "Option changed: #s", tmp.vector[0]);
return true; strv_free (&tmp);
}
} }
static bool static bool
@ -11427,18 +11427,15 @@ handle_command_set_assign
config_item_destroy (new_); config_item_destroy (new_);
return true; return true;
} }
bool changed = false;
for (size_t i = 0; i < all->len; i++) for (size_t i = 0; i < all->len; i++)
{ {
char *key = cstr_cut_until (all->vector[i], " "); char *key = cstr_cut_until (all->vector[i], " ");
if (handle_command_set_assign_item (ctx, key, new_, add, remove)) handle_command_set_assign_item (ctx, key, new_, add, remove);
changed = true;
free (key); free (key);
} }
config_item_destroy (new_); config_item_destroy (new_);
if (changed && get_config_boolean (ctx->config.root, "general.autosave")) if (get_config_boolean (ctx->config.root, "general.autosave"))
save_configuration (ctx); save_configuration (ctx);
return true; return true;
} }
@ -13169,7 +13166,7 @@ toggle_bracketed_paste (bool enable)
static void static void
suspend_terminal (struct app_context *ctx) suspend_terminal (struct app_context *ctx)
{ {
// Terminal can get suspended by both the pager and SIGTSTP handling // Terminal can get suspended by both backlog helper and SIGTSTP handling
if (ctx->terminal_suspended++ > 0) if (ctx->terminal_suspended++ > 0)
return; return;
@ -14174,8 +14171,8 @@ setup_signal_handlers (void)
signal (SIGPIPE, SIG_IGN); signal (SIGPIPE, SIG_IGN);
// So that we can write to the terminal while we're running a pager. // So that we can write to the terminal while we're running a backlog
// This is also inherited by the child so that it doesn't stop // helper. This is also inherited by the child so that it doesn't stop
// when it calls tcsetpgrp(). // when it calls tcsetpgrp().
signal (SIGTTOU, SIG_IGN); signal (SIGTTOU, SIG_IGN);

View File

@ -1,29 +0,0 @@
#!/usr/bin/awk -f
BEGIN {
# The message catalog is a by-product
msg = "xD.msg"
print "$quote \"" > msg;
print "$set 1" > msg;
}
/^[0-9]+ *IRC_(ERR|RPL)_[A-Z]+ *".*"$/ {
match($0, /".*"/);
ids[$1] = $2;
texts[$2] = substr($0, RSTART, RLENGTH);
print $1 " " texts[$2] > msg
}
END {
printf("enum\n{")
for (i in ids) {
if (seen_first)
printf(",")
seen_first = 1
printf("\n\t%s = %s", ids[i], i)
}
print "\n};\n"
print "static const char *g_default_replies[] =\n{"
for (i in ids)
print "\t[" ids[i] "] = " texts[ids[i]] ","
print "};"
}

28
xD-gen-replies.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/sh
LC_ALL=C exec awk '
BEGIN {
# The message catalog is a by-product
msg = "xD.msg"
print "$quote \"" > msg;
print "$set 1" > msg;
}
/^[0-9]+ *IRC_(ERR|RPL)_[A-Z]+ *".*"$/ {
match($0, /".*"/);
ids[$1] = $2;
texts[$2] = substr($0, RSTART, RLENGTH);
print $1 " " texts[$2] > msg
}
END {
printf("enum\n{")
for (i in ids) {
if (seen_first)
printf(",")
seen_first = 1
printf("\n\t%s = %s", ids[i], i)
}
print "\n};\n"
print "static const char *g_default_replies[] =\n{"
for (i in ids)
print "\t[" ids[i] "] = " texts[ids[i]] ","
print "};"
}'