<p>In <a href="https://github.com/geany/geany-plugins/pull/324#discussion_r49946615">lineoperations/src/lineoperations.c</a>:</p>
<pre style='color:#555'>> +    gtk_menu_shell_append(GTK_MENU_SHELL(submenu), rmemtyln_item);
> +  gtk_menu_shell_append(GTK_MENU_SHELL(submenu), rmwhspln_item);
> +  gtk_menu_shell_append(GTK_MENU_SHELL(submenu), sep2);
> +  gtk_menu_shell_append(GTK_MENU_SHELL(submenu), sortasc_item);
> +  gtk_menu_shell_append(GTK_MENU_SHELL(submenu), sortdesc_item);
> +
> +  gtk_menu_item_set_submenu(GTK_MENU_ITEM(main_menu_item), submenu);
> +
> +  gtk_container_add(GTK_CONTAINER(geany->main_widgets->tools_menu), main_menu_item);
> +
> +
> +  g_signal_connect(rmdupst_item, "activate", G_CALLBACK(action_rmdupst_item), NULL);
> +  g_signal_connect(rmdupln_item, "activate", G_CALLBACK(action_rmdupln_item), NULL);
> +  g_signal_connect(rmunqln_item, "activate", G_CALLBACK(action_rmunqln_item), NULL);
> +  g_signal_connect(rmemtyln_item, "activate", G_CALLBACK(action_rmemtyln_item), NULL);
> +  g_signal_connect(rmwhspln_item, "activate", G_CALLBACK(action_rmwhspln_item), NULL);
</pre>
<p>you could lower duplication of the wrapper callbacks by having a single callback that calls the appropriate function (either passed as parameter [1] or referenced as an ID or something), as they all have they all behave the same (but the sort ones).<br>
You may or may not want this, it's merely a suggestion.  And it's even a bad one if you expect to alter the various functions to receive different parameters in the future.</p>

<p>[1] technically in plain C you're not supposed to convert a function pointer to a data pointer.  However, GTK depends on this and it effectively works on all supported platforms (if not all platforms in general).</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/geany/geany-plugins/pull/324/files#r49946615">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ0HY3TUEQdvZhHYEI4mthRxmKibfks5pa5VMgaJpZM4HBhj7.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany-plugins/pull/324/files#r49946615"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>