comparison src/menubar-msw.c @ 563:183866b06e0b

[xemacs-hg @ 2001-05-24 07:50:48 by ben] Makefile.in.in, abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, casetab.c, chartab.c, cmdloop.c, cmds.c, console-msw.c, console-msw.h, console-stream.c, console-tty.c, console-x.c, console.c, data.c, database.c, debug.c, device-gtk.c, device-msw.c, device-tty.c, device-x.c, device.c, dialog-gtk.c, dialog-msw.c, dialog-x.c, dialog.c, dired-msw.c, dired.c, doc.c, doprnt.c, dragdrop.c, editfns.c, eldap.c, eldap.h, elhash.c, emacs-widget-accessors.c, emacs.c, emodules.c, esd.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, events.c, extents.c, faces.c, file-coding.c, fileio.c, filelock.c, floatfns.c, fns.c, font-lock.c, frame-gtk.c, frame-x.c, frame.c, general-slots.h, glade.c, glyphs-gtk.c, glyphs-msw.c, glyphs-widget.c, glyphs-x.c, glyphs.c, glyphs.h, gpmevent.c, gui-gtk.c, gui-x.c, gui.c, gutter.c, hpplay.c, indent.c, input-method-xlib.c, insdel.c, intl.c, keymap.c, libsst.c, libsst.h, linuxplay.c, lisp.h, lread.c, lstream.c, lstream.h, macros.c, marker.c, md5.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, miscplay.c, miscplay.h, mule-ccl.c, mule-charset.c, mule-wnnfns.c, mule.c, nas.c, ntplay.c, ntproc.c, objects-gtk.c, objects-msw.c, objects-x.c, objects.c, postgresql.c, print.c, process-nt.c, process-unix.c, process.c, ralloc.c, rangetab.c, redisplay.c, scrollbar.c, search.c, select-gtk.c, select-x.c, select.c, sgiplay.c, sheap.c, sound.c, specifier.c, sunplay.c, symbols.c, symeval.h, symsinit.h, syntax.c, sysdep.c, toolbar-msw.c, toolbar.c, tooltalk.c, ui-byhand.c, ui-gtk.c, undo.c, unexaix.c, unexapollo.c, unexconvex.c, unexec.c, widget.c, win32.c, window.c: -- defsymbol -> DEFSYMBOL. -- add an error type to all errors. -- eliminate the error functions in eval.c that let you just use Qerror as the type. -- redo the error API to be more consistent, sensibly named, and easier to use. -- redo the error hierarchy somewhat. create new errors: structure-formation-error, gui-error, invalid-constant, stack-overflow, out-of-memory, process-error, network-error, sound-error, printing-unreadable-object, base64-conversion- error; coding-system-error renamed to text-conversion error; some others. -- fix Mule problems in error strings in emodules.c, tooltalk.c. -- fix error handling in mswin open-network-stream. -- Mule-ize all sound files and clean up the headers. -- nativesound.h -> sound.h and used for all sound files. -- move some shared stuff into glyphs-shared.c: first attempt at eliminating some of the massive GTK code duplication. xemacs.mak: add glyphs-shared.c. xemacs-faq.texi: document how to debug X errors subr.el: fix doc string to reflect reality
author ben
date Thu, 24 May 2001 07:51:33 +0000
parents abe6d1db359e
children 5fd7ba8b56e7
comparison
equal deleted inserted replaced
562:c775bd016b32 563:183866b06e0b
148 /* Escape '&' as '&&' */ 148 /* Escape '&' as '&&' */
149 ptr = item; 149 ptr = item;
150 while ((ptr = (Bufbyte *) memchr (ptr, '&', len - (ptr - item))) != NULL) 150 while ((ptr = (Bufbyte *) memchr (ptr, '&', len - (ptr - item))) != NULL)
151 { 151 {
152 if (len + 2 > maxlen) 152 if (len + 2 > maxlen)
153 syntax_error ("Menu item produces too long displayable string", 153 invalid_argument ("Menu item produces too long displayable string",
154 error_name); 154 error_name);
155 memmove (ptr + 1, ptr, (len - (ptr - item)) + 1); 155 memmove (ptr + 1, ptr, (len - (ptr - item)) + 1);
156 len++; 156 len++;
157 ptr += 2; 157 ptr += 2;
158 } 158 }
192 192
193 if (accel && !*accel) 193 if (accel && !*accel)
194 { 194 {
195 /* Force a default accelerator */ 195 /* Force a default accelerator */
196 if (len + 2 > maxlen) 196 if (len + 2 > maxlen)
197 syntax_error ("Menu item produces too long displayable string", 197 invalid_argument ("Menu item produces too long displayable string",
198 error_name); 198 error_name);
199 ptr = item; 199 ptr = item;
200 memmove (ptr + 1, ptr, len + 1); 200 memmove (ptr + 1, ptr, len + 1);
201 /* #### urk ! We need a reference translation table for 201 /* #### urk ! We need a reference translation table for
202 case changes that aren't buffer-specific. */ 202 case changes that aren't buffer-specific. */
371 GCPRO3 (gui_item, path, *accel_list); 371 GCPRO3 (gui_item, path, *accel_list);
372 372
373 menu_parse_submenu_keywords (item, gui_item); 373 menu_parse_submenu_keywords (item, gui_item);
374 374
375 if (!STRINGP (pgui_item->name)) 375 if (!STRINGP (pgui_item->name))
376 syntax_error ("Menu name (first element) must be a string", 376 invalid_argument ("Menu name (first element) must be a string",
377 item); 377 item);
378 378
379 if (!gui_item_included_p (gui_item, Vmenubar_configuration)) 379 if (!gui_item_included_p (gui_item, Vmenubar_configuration))
380 { 380 {
381 UNGCPRO; 381 UNGCPRO;
477 *accel_list = Fcons (make_char (accel), *accel_list); 477 *accel_list = Fcons (make_char (accel), *accel_list);
478 478
479 UNGCPRO; 479 UNGCPRO;
480 } 480 }
481 else 481 else
482 syntax_error ("Malformed menu item descriptor", item); 482 sferror ("Malformed menu item descriptor", item);
483 483
484 if (flush_right) 484 if (flush_right)
485 item_info.fType |= MFT_RIGHTJUSTIFY; /* can't support in 3.51 */ 485 item_info.fType |= MFT_RIGHTJUSTIFY; /* can't support in 3.51 */
486 486
487 if (xInsertMenuItemA) 487 if (xInsertMenuItemA)
532 /* Fetch keywords prepending the item list */ 532 /* Fetch keywords prepending the item list */
533 desc = menu_parse_submenu_keywords (desc, gui_item); 533 desc = menu_parse_submenu_keywords (desc, gui_item);
534 534
535 /* Check that menu name is specified when expected */ 535 /* Check that menu name is specified when expected */
536 if (NILP (pgui_item->name) && deep_p) 536 if (NILP (pgui_item->name) && deep_p)
537 syntax_error ("Menu must have a name", desc); 537 sferror ("Menu must have a name", desc);
538 538
539 /* Apply filter if specified */ 539 /* Apply filter if specified */
540 if (!NILP (pgui_item->filter)) 540 if (!NILP (pgui_item->filter))
541 desc = call1 (pgui_item->filter, desc); 541 desc = call1 (pgui_item->filter, desc);
542 542
742 path = Fgethash (hmenu_to_lisp_object (menu), current_hash_table, Qunbound); 742 path = Fgethash (hmenu_to_lisp_object (menu), current_hash_table, Qunbound);
743 assert (!UNBOUNDP (path)); 743 assert (!UNBOUNDP (path));
744 #ifdef DEBUG_XEMACS 744 #ifdef DEBUG_XEMACS
745 /* Allow to continue in a debugger after assert - not so fatal */ 745 /* Allow to continue in a debugger after assert - not so fatal */
746 if (UNBOUNDP (path)) 746 if (UNBOUNDP (path))
747 error ("internal menu error"); 747 signal_error (Qinternal_error, "internal menu error", Qunbound);
748 #endif 748 #endif
749 749
750 /* Now find a desc chunk for it. If none, then probably menu open 750 /* Now find a desc chunk for it. If none, then probably menu open
751 hook has played too much games around stuff */ 751 hook has played too much games around stuff */
752 desc = Fmenu_find_real_submenu (current_menudesc, path); 752 desc = Fmenu_find_real_submenu (current_menudesc, path);
753 if (NILP (desc)) 753 if (NILP (desc))
754 signal_simple_error ("This menu does not exist any more", path); 754 invalid_state ("This menu does not exist any more", path);
755 755
756 /* Now, stuff it */ 756 /* Now, stuff it */
757 /* DESC may be generated by filter, so we have to gcpro it */ 757 /* DESC may be generated by filter, so we have to gcpro it */
758 GCPRO1 (desc); 758 GCPRO1 (desc);
759 populate_menu (menu, path, desc, current_hash_table, 0); 759 populate_menu (menu, path, desc, current_hash_table, 0);
954 954
955 /* This is probably the only real reason for failure */ 955 /* This is probably the only real reason for failure */
956 if (!ok) 956 if (!ok)
957 { 957 {
958 menu_cleanup (f); 958 menu_cleanup (f);
959 signal_simple_error ("Cannot track popup menu while in menu", 959 invalid_operation ("Cannot track popup menu while in menu",
960 menu_desc); 960 menu_desc);
961 } 961 }
962 UNGCPRO; 962 UNGCPRO;
963 } 963 }
964 964
965 965