From fe5a01629a482b507c2f481687b96c2ecb46a9c3 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 11 Jul 2001 18:31:41 +0000 Subject: [PATCH] (menubar_selection_callback, w32_menu_show): Initialize `entry' to nil. (w32_dialog_show): Remove unused `save_wv' variable. (name_is_separator): Recognize "--:foo" and "--foo-bar". --- src/ChangeLog | 14 ++++++++++---- src/w32menu.c | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c684a4fcca6..6b4499c7954 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2001-07-11 Stefan Monnier + + * w32menu.c (menubar_selection_callback, w32_menu_show): + Initialize `entry' to nil. + (w32_dialog_show): Remove unused `save_wv' variable. + (name_is_separator): Recognize "--:foo" and "--foo-bar". + 2001-07-11 Gerd Moellmann * xdisp.c (try_cursor_movement): Prevent a warning from GCC 3.0. @@ -5,14 +12,14 @@ * fileio.c (unwind_read): Print a message when discarding inserted text or switching the buffer to unibyte. Change parameter. (Finsert_file_contents): Don't pass VISIT to unwind_read. - + * fileio.c (unwind_read): New function. (Finsert_file_contents): Record it as unwind-function for the case that reading is interrupted by C-g. 2001-07-10 Gerd Moellmann - * dispnew.c (update_window): Don't skip the header-line + * dispnew.c (update_window): Don't skip the header-line update when scrolling_window returns 0. * xfaces.c (unload_color): Do nothing if PIXEL is -1. @@ -60,8 +67,7 @@ (unbind_to): Handle unbinding a frame-local variable. * xdisp.c (compute_line_metrics): On ttys, subtract continuation - glyphs and truncation glyphs at the end of a row from its pixel - width. + glyphs and truncation glyphs at the end of a row from its pixel width. (dump_glyph_row): Print row's continuation_lines_width. (try_window_id): Take the shortcut if ZV is visible in the window, but there are actually no changes at ZV. diff --git a/src/w32menu.c b/src/w32menu.c index 043e6731f0e..ca0ed0b6320 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -964,6 +964,7 @@ menubar_selection_callback (FRAME_PTR f, void * client_data) if (!f) return; + entry = Qnil; subprefix_stack = (Lisp_Object *) alloca (f->menu_bar_items_used * sizeof (Lisp_Object)); vector = f->menu_bar_vector; prefix = Qnil; @@ -1765,7 +1766,7 @@ w32_menu_show (f, x, y, for_click, keymaps, title, error) { Lisp_Object prefix, entry; - prefix = Qnil; + prefix = entry = Qnil; i = 0; while (i < menu_items_used) { @@ -1833,7 +1834,7 @@ w32_dialog_show (f, keymaps, title, error) char dialog_name[6]; int menu_item_selection; - widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0; + widget_value *wv, *first_wv = 0, *prev_wv = 0; /* Number of elements seen so far, before boundary. */ int left_count = 0; @@ -2012,9 +2013,14 @@ static int name_is_separator (name) char *name; { - /* Check if name string consists of only dashes ('-') */ + char *start = name; + + /* Check if name string consists of only dashes ('-'). */ while (*name == '-') name++; - return (*name == '\0'); + /* Separators can also be of the form "--:TripleSuperMegaEtched" + or "--deep-shadow". We don't implement them yet, se we just treat + them like normal separators. */ + return (*name == '\0' || start + 2 == name); } -- 2.39.2