ENC_ACTION(C_WINDOWS_1255)},
{N_("/_Options/Character _encoding/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_Options/Character _encoding/Arabic (ISO-8859-_6)"),
+ ENC_ACTION(C_ISO_8859_6)},
+ {N_("/_Options/Character _encoding/Arabic (Windows-1256)"),
+ ENC_ACTION(C_CP1256)},
+ {N_("/_Options/Character _encoding/---"), NULL, NULL, 0, "<Separator>"},
+
{N_("/_Options/Character _encoding/Turkish (ISO-8859-_9)"),
ENC_ACTION(C_ISO_8859_9)},
{N_("/_Options/Character _encoding/---"), NULL, NULL, 0, "<Separator>"},
gint startq_offset = -1, noq_offset = -1;
gint uri_start = -1, uri_stop = -1;
gint nouri_start = -1, nouri_stop = -1;
+ gint num_blocks = 0;
compose->autowrap = FALSE;
gchar *o_walk = NULL, *walk = NULL, *bp = NULL, *ep = NULL;
gint walk_pos;
- if (!prev_autowrap)
+ if (!prev_autowrap && num_blocks == 0) {
+ num_blocks++;
g_signal_handlers_block_by_func(G_OBJECT(buffer),
G_CALLBACK(text_inserted),
compose);
-
+ }
if (gtk_text_iter_has_tag(&iter, compose->no_wrap_tag) && !force)
goto colorize;
}
colorize:
- if (!prev_autowrap)
+ if (!prev_autowrap) {
g_signal_handlers_unblock_by_func(G_OBJECT(buffer),
G_CALLBACK(text_inserted),
compose);
+ }
end_of_line = iter;
while (!gtk_text_iter_ends_line(&end_of_line)) {
gtk_text_iter_forward_char(&end_of_line);
test_conv_global_out = conv_codeset_strdup(chars, src_codeset, out_codeset);
}
- if (!test_conv_global_out && compose->orig_charset) {
+ if (!test_conv_global_out && compose->orig_charset
+ && strcmp(compose->orig_charset, CS_US_ASCII)) {
out_codeset = compose->orig_charset;
debug_print("failure; trying to convert to %s\n", out_codeset);
test_conv_reply = conv_codeset_strdup(chars, src_codeset, out_codeset);
if (!test_conv_global_out && !test_conv_reply) {
/* we're lost */
out_codeset = CS_INTERNAL;
- debug_print("finally using %s\n", out_codeset);
+ debug_print("failure; finally using %s\n", out_codeset);
}
g_free(test_conv_global_out);
g_free(test_conv_reply);
#if USE_ASPELL
if (event->button == 3) {
GtkTextIter iter;
+ GtkTextIter sel_start, sel_end;
+ gboolean stuff_selected;
gint x, y;
/* move the cursor to allow GtkAspell to check the word
* under the mouse */
&x, &y);
gtk_text_view_get_iter_at_location (GTK_TEXT_VIEW(text),
&iter, x, y);
+ /* get selection */
+ stuff_selected = gtk_text_buffer_get_selection_bounds(
+ GTK_TEXT_VIEW(text)->buffer,
+ &sel_start, &sel_end);
+
gtk_text_buffer_place_cursor (GTK_TEXT_VIEW(text)->buffer, &iter);
+ /* reselect stuff */
+ if (stuff_selected
+ && gtk_text_iter_in_range(&iter, &sel_start, &sel_end)) {
+ gtk_text_buffer_select_range(GTK_TEXT_VIEW(text)->buffer,
+ &sel_start, &sel_end);
+ }
return FALSE; /* pass the event so that the right-click goes through */
}
#endif
#ifdef G_OS_UNIX
static gint compose_exec_ext_editor_real(const gchar *file)
{
- static gchar *def_cmd = "emacs %s";
gchar buf[1024];
gchar *p;
gchar **cmdline;
if (prefs_common.ext_editor_cmd)
g_warning("External editor command line is invalid: '%s'\n",
prefs_common.ext_editor_cmd);
- g_snprintf(buf, sizeof(buf), def_cmd, file);
+ g_snprintf(buf, sizeof(buf), DEFAULT_EDITOR_CMD, file);
}
cmdline = strsplit_with_quote(buf, " ", 1024);
target_locked = MSG_IS_LOCKED(compose->targetinfo->flags);
flag.perm_flags = target_locked?MSG_LOCKED:0;
}
+ flag.tmp_flags = MSG_DRAFT;
folder_item_scan(draft);
if ((msgnum = folder_item_add_msg(draft, tmp, &flag, TRUE)) < 0) {
}
static void compose_attach_drag_received_cb (GtkWidget *widget,
- GdkDragContext *drag_context,
+ GdkDragContext *context,
gint x,
gint y,
GtkSelectionData *data,
GList *list, *tmp;
if (gdk_atom_name(data->type) &&
- !strcmp(gdk_atom_name(data->type), "text/uri-list")) {
+ !strcmp(gdk_atom_name(data->type), "text/uri-list")
+ && gtk_drag_get_source_widget(context) !=
+ mainwindow_get_mainwindow()->summaryview->ctree) {
list = uri_list_extract_filenames((const gchar *)data->data);
for (tmp = list; tmp != NULL; tmp = tmp->next)
compose_attach_append
if (list) compose_changed_cb(NULL, compose);
list_free_strings(list);
g_list_free(list);
- } else if (gdk_atom_name(data->type) &&
- !strcmp(gdk_atom_name(data->type), "text/plain") &&
- data->data && !strcmp(data->data, "Dummy-Summaryview")) {
+ } else if (gtk_drag_get_source_widget(context)
+ == mainwindow_get_mainwindow()->summaryview->ctree) {
/* comes from our summaryview */
SummaryView * summaryview = NULL;
GSList * list = NULL, *cur = NULL;