Mercurial > hg > xemacs-beta
comparison src/eval.c @ 4952:19a72041c5ed
Mule-izing, various fixes related to char * arguments
-------------------- ChangeLog entries follow: --------------------
modules/ChangeLog addition:
2010-01-26 Ben Wing <ben@xemacs.org>
* postgresql/postgresql.c:
* postgresql/postgresql.c (CHECK_LIVE_CONNECTION):
* postgresql/postgresql.c (print_pgresult):
* postgresql/postgresql.c (Fpq_conn_defaults):
* postgresql/postgresql.c (Fpq_connectdb):
* postgresql/postgresql.c (Fpq_connect_start):
* postgresql/postgresql.c (Fpq_result_status):
* postgresql/postgresql.c (Fpq_res_status):
Mule-ize large parts of it.
2010-01-26 Ben Wing <ben@xemacs.org>
* ldap/eldap.c (print_ldap):
* ldap/eldap.c (allocate_ldap):
Use write_ascstring().
src/ChangeLog addition:
2010-01-26 Ben Wing <ben@xemacs.org>
* alloc.c:
* alloc.c (build_ascstring):
* alloc.c (build_msg_cistring):
* alloc.c (staticpro_1):
* alloc.c (staticpro_name):
* alloc.c (staticpro_nodump_1):
* alloc.c (staticpro_nodump_name):
* alloc.c (unstaticpro_nodump_1):
* alloc.c (mcpro_1):
* alloc.c (mcpro_name):
* alloc.c (object_memory_usage_stats):
* alloc.c (common_init_alloc_early):
* alloc.c (init_alloc_once_early):
* buffer.c (print_buffer):
* buffer.c (vars_of_buffer):
* buffer.c (common_init_complex_vars_of_buffer):
* buffer.c (init_initial_directory):
* bytecode.c (invalid_byte_code):
* bytecode.c (print_compiled_function):
* bytecode.c (mark_compiled_function):
* chartab.c (print_table_entry):
* chartab.c (print_char_table):
* config.h.in:
* console-gtk.c:
* console-gtk.c (gtk_device_to_console_connection):
* console-gtk.c (gtk_semi_canonicalize_console_connection):
* console-gtk.c (gtk_canonicalize_console_connection):
* console-gtk.c (gtk_semi_canonicalize_device_connection):
* console-gtk.c (gtk_canonicalize_device_connection):
* console-stream.c (stream_init_frame_1):
* console-stream.c (vars_of_console_stream):
* console-stream.c (init_console_stream):
* console-x.c (x_semi_canonicalize_console_connection):
* console-x.c (x_semi_canonicalize_device_connection):
* console-x.c (x_canonicalize_device_connection):
* console-x.h:
* data.c (eq_with_ebola_notice):
* data.c (Fsubr_interactive):
* data.c (Fnumber_to_string):
* data.c (digit_to_number):
* device-gtk.c (gtk_init_device):
* device-msw.c (print_devmode):
* device-x.c (x_event_name):
* dialog-msw.c (handle_directory_dialog_box):
* dialog-msw.c (handle_file_dialog_box):
* dialog-msw.c (vars_of_dialog_mswindows):
* doc.c (weird_doc):
* doc.c (Fsnarf_documentation):
* doc.c (vars_of_doc):
* dumper.c (pdump):
* dynarr.c:
* dynarr.c (Dynarr_realloc):
* editfns.c (Fuser_real_login_name):
* editfns.c (get_home_directory):
* elhash.c (print_hash_table_data):
* elhash.c (print_hash_table):
* emacs.c (main_1):
* emacs.c (vars_of_emacs):
* emodules.c:
* emodules.c (_emodules_list):
* emodules.c (Fload_module):
* emodules.c (Funload_module):
* emodules.c (Flist_modules):
* emodules.c (find_make_module):
* emodules.c (attempt_module_delete):
* emodules.c (emodules_load):
* emodules.c (emodules_doc_subr):
* emodules.c (emodules_doc_sym):
* emodules.c (syms_of_module):
* emodules.c (vars_of_module):
* emodules.h:
* eval.c (print_subr):
* eval.c (signal_call_debugger):
* eval.c (build_error_data):
* eval.c (signal_error):
* eval.c (maybe_signal_error):
* eval.c (signal_continuable_error):
* eval.c (maybe_signal_continuable_error):
* eval.c (signal_error_2):
* eval.c (maybe_signal_error_2):
* eval.c (signal_continuable_error_2):
* eval.c (maybe_signal_continuable_error_2):
* eval.c (signal_ferror):
* eval.c (maybe_signal_ferror):
* eval.c (signal_continuable_ferror):
* eval.c (maybe_signal_continuable_ferror):
* eval.c (signal_ferror_with_frob):
* eval.c (maybe_signal_ferror_with_frob):
* eval.c (signal_continuable_ferror_with_frob):
* eval.c (maybe_signal_continuable_ferror_with_frob):
* eval.c (syntax_error):
* eval.c (syntax_error_2):
* eval.c (maybe_syntax_error):
* eval.c (sferror):
* eval.c (sferror_2):
* eval.c (maybe_sferror):
* eval.c (invalid_argument):
* eval.c (invalid_argument_2):
* eval.c (maybe_invalid_argument):
* eval.c (invalid_constant):
* eval.c (invalid_constant_2):
* eval.c (maybe_invalid_constant):
* eval.c (invalid_operation):
* eval.c (invalid_operation_2):
* eval.c (maybe_invalid_operation):
* eval.c (invalid_change):
* eval.c (invalid_change_2):
* eval.c (maybe_invalid_change):
* eval.c (invalid_state):
* eval.c (invalid_state_2):
* eval.c (maybe_invalid_state):
* eval.c (wtaerror):
* eval.c (stack_overflow):
* eval.c (out_of_memory):
* eval.c (print_multiple_value):
* eval.c (issue_call_trapping_problems_warning):
* eval.c (backtrace_specials):
* eval.c (backtrace_unevalled_args):
* eval.c (Fbacktrace):
* eval.c (warn_when_safe):
* event-Xt.c (modwarn):
* event-Xt.c (modbarf):
* event-Xt.c (check_modifier):
* event-Xt.c (store_modifier):
* event-Xt.c (emacs_Xt_format_magic_event):
* event-Xt.c (describe_event):
* event-gtk.c (dragndrop_data_received):
* event-gtk.c (store_modifier):
* event-gtk.c (gtk_reset_modifier_mapping):
* event-msw.c (dde_eval_string):
* event-msw.c (Fdde_alloc_advise_item):
* event-msw.c (mswindows_dde_callback):
* event-msw.c (FROB):
* event-msw.c (emacs_mswindows_format_magic_event):
* event-stream.c (external_debugging_print_event):
* event-stream.c (execute_help_form):
* event-stream.c (vars_of_event_stream):
* events.c (print_event_1):
* events.c (print_event):
* events.c (event_equal):
* extents.c (print_extent_1):
* extents.c (print_extent):
* extents.c (vars_of_extents):
* faces.c (print_face):
* faces.c (complex_vars_of_faces):
* file-coding.c:
* file-coding.c (print_coding_system):
* file-coding.c (print_coding_system_in_print_method):
* file-coding.c (default_query_method):
* file-coding.c (find_coding_system):
* file-coding.c (make_coding_system_1):
* file-coding.c (chain_print):
* file-coding.c (undecided_print):
* file-coding.c (gzip_print):
* file-coding.c (vars_of_file_coding):
* file-coding.c (complex_vars_of_file_coding):
* fileio.c:
* fileio.c (report_file_type_error):
* fileio.c (report_error_with_errno):
* fileio.c (report_file_error):
* fileio.c (barf_or_query_if_file_exists):
* fileio.c (vars_of_fileio):
* floatfns.c (matherr):
* fns.c (print_bit_vector):
* fns.c (Fmapconcat):
* fns.c (add_suffix_to_symbol):
* fns.c (add_prefix_to_symbol):
* frame-gtk.c:
* frame-gtk.c (Fgtk_window_id):
* frame-x.c (def):
* frame-x.c (x_cde_transfer_callback):
* frame.c:
* frame.c (Fmake_frame):
* gc.c (show_gc_cursor_and_message):
* gc.c (vars_of_gc):
* glyphs-eimage.c (png_instantiate):
* glyphs-eimage.c (tiff_instantiate):
* glyphs-gtk.c (gtk_print_image_instance):
* glyphs-msw.c (mswindows_print_image_instance):
* glyphs-x.c (x_print_image_instance):
* glyphs-x.c (update_widget_face):
* glyphs.c (make_string_from_file):
* glyphs.c (print_image_instance):
* glyphs.c (signal_image_error):
* glyphs.c (signal_image_error_2):
* glyphs.c (signal_double_image_error):
* glyphs.c (signal_double_image_error_2):
* glyphs.c (xbm_mask_file_munging):
* glyphs.c (pixmap_to_lisp_data):
* glyphs.h:
* gui.c (gui_item_display_flush_left):
* hpplay.c (player_error_internal):
* hpplay.c (myHandler):
* intl-win32.c:
* intl-win32.c (langcode_to_lang):
* intl-win32.c (sublangcode_to_lang):
* intl-win32.c (Fmswindows_get_locale_info):
* intl-win32.c (lcid_to_locale_mule_or_no):
* intl-win32.c (mswindows_multibyte_to_unicode_print):
* intl-win32.c (complex_vars_of_intl_win32):
* keymap.c:
* keymap.c (print_keymap):
* keymap.c (ensure_meta_prefix_char_keymapp):
* keymap.c (Fkey_description):
* keymap.c (Ftext_char_description):
* lisp.h:
* lisp.h (struct):
* lisp.h (DECLARE_INLINE_HEADER):
* lread.c (Fload_internal):
* lread.c (locate_file):
* lread.c (read_escape):
* lread.c (read_raw_string):
* lread.c (read1):
* lread.c (read_list):
* lread.c (read_compiled_function):
* lread.c (init_lread):
* lrecord.h:
* marker.c (print_marker):
* marker.c (marker_equal):
* menubar-msw.c (displayable_menu_item):
* menubar-x.c (command_builder_operate_menu_accelerator):
* menubar.c (vars_of_menubar):
* minibuf.c (reinit_complex_vars_of_minibuf):
* minibuf.c (complex_vars_of_minibuf):
* mule-charset.c (Fmake_charset):
* mule-charset.c (complex_vars_of_mule_charset):
* mule-coding.c (iso2022_print):
* mule-coding.c (fixed_width_query):
* number.c (bignum_print):
* number.c (ratio_print):
* number.c (bigfloat_print):
* number.c (bigfloat_finalize):
* objects-msw.c:
* objects-msw.c (mswindows_color_to_string):
* objects-msw.c (mswindows_color_list):
* objects-tty.c:
* objects-tty.c (tty_font_list):
* objects-tty.c (tty_find_charset_font):
* objects-xlike-inc.c (xft_find_charset_font):
* objects-xlike-inc.c (endif):
* print.c:
* print.c (write_istring):
* print.c (write_ascstring):
* print.c (Fterpri):
* print.c (Fprint):
* print.c (print_error_message):
* print.c (print_vector_internal):
* print.c (print_cons):
* print.c (print_string):
* print.c (printing_unreadable_object):
* print.c (print_internal):
* print.c (print_float):
* print.c (print_symbol):
* process-nt.c (mswindows_report_winsock_error):
* process-nt.c (nt_canonicalize_host_name):
* process-unix.c (unix_canonicalize_host_name):
* process.c (print_process):
* process.c (report_process_error):
* process.c (report_network_error):
* process.c (make_process_internal):
* process.c (Fstart_process_internal):
* process.c (status_message):
* process.c (putenv_internal):
* process.c (vars_of_process):
* process.h:
* profile.c (vars_of_profile):
* rangetab.c (print_range_table):
* realpath.c (vars_of_realpath):
* redisplay.c (vars_of_redisplay):
* search.c (wordify):
* search.c (Freplace_match):
* sheap.c (sheap_adjust_h):
* sound.c (report_sound_error):
* sound.c (Fplay_sound_file):
* specifier.c (print_specifier):
* symbols.c (Fsubr_name):
* symbols.c (do_symval_forwarding):
* symbols.c (set_default_buffer_slot_variable):
* symbols.c (set_default_console_slot_variable):
* symbols.c (store_symval_forwarding):
* symbols.c (default_value):
* symbols.c (defsymbol_massage_name_1):
* symbols.c (defsymbol_massage_name_nodump):
* symbols.c (defsymbol_massage_name):
* symbols.c (defsymbol_massage_multiword_predicate_nodump):
* symbols.c (defsymbol_massage_multiword_predicate):
* symbols.c (defsymbol_nodump):
* symbols.c (defsymbol):
* symbols.c (defkeyword):
* symbols.c (defkeyword_massage_name):
* symbols.c (check_module_subr):
* symbols.c (deferror_1):
* symbols.c (deferror):
* symbols.c (deferror_massage_name):
* symbols.c (deferror_massage_name_and_message):
* symbols.c (defvar_magic):
* symeval.h:
* symeval.h (DEFVAR_SYMVAL_FWD):
* sysdep.c:
* sysdep.c (init_system_name):
* sysdll.c:
* sysdll.c (MAYBE_PREPEND_UNDERSCORE):
* sysdll.c (dll_function):
* sysdll.c (dll_variable):
* sysdll.c (dll_error):
* sysdll.c (dll_open):
* sysdll.c (dll_close):
* sysdll.c (image_for_address):
* sysdll.c (my_find_image):
* sysdll.c (search_linked_libs):
* sysdll.h:
* sysfile.h:
* sysfile.h (DEFAULT_DIRECTORY_FALLBACK):
* syswindows.h:
* tests.c (DFC_CHECK_LENGTH):
* tests.c (DFC_CHECK_CONTENT):
* tests.c (Ftest_hash_tables):
* text.c (vars_of_text):
* text.h:
* tooltalk.c (tt_opnum_string):
* tooltalk.c (tt_message_arg_ival_string):
* tooltalk.c (Ftooltalk_default_procid):
* tooltalk.c (Ftooltalk_default_session):
* tooltalk.c (init_tooltalk):
* tooltalk.c (vars_of_tooltalk):
* ui-gtk.c (Fdll_load):
* ui-gtk.c (type_to_marshaller_type):
* ui-gtk.c (Fgtk_import_function_internal):
* ui-gtk.c (emacs_gtk_object_printer):
* ui-gtk.c (emacs_gtk_boxed_printer):
* unicode.c (unicode_to_ichar):
* unicode.c (unicode_print):
* unicode.c (unicode_query):
* unicode.c (vars_of_unicode):
* unicode.c (complex_vars_of_unicode):
* win32.c:
* win32.c (mswindows_report_process_error):
* window.c (print_window):
* xemacs.def.in.in:
BASIC IDEA: Further fixing up uses of char * and CIbyte *
to reflect their actual semantics; Mule-izing some code;
redoing of the not-yet-working code to handle message translation.
Clean up code to handle message-translation (not yet working).
Create separate versions of build_msg_string() for working with
Ibyte *, CIbyte *, and Ascbyte * arguments. Assert that Ascbyte *
arguments are pure-ASCII. Make build_msg_string() be the same
as build_msg_ascstring(). Create same three versions of GETTEXT()
and DEFER_GETTEXT(). Also create build_defer_string() and
variants for the equivalent of DEFER_GETTEXT() when building a
string. Remove old CGETTEXT(). Clean up code where GETTEXT(),
DEFER_GETTEXT(), build_msg_string(), etc. was being called and
introduce some new calls to build_msg_string(), etc. Remove
GETTEXT() from calls to weird_doc() -- we assume that the
message snarfer knows about weird_doc(). Remove uses of
DEFER_GETTEXT() from error messages in sysdep.c and instead use
special comments /* @@@begin-snarf@@@ */ and /* @@@end-snarf@@@ */
that the message snarfer presumably knows about.
Create build_ascstring() and use it in many instances in place
of build_string(). The purpose of having Ascbyte * variants is
to make the code more self-documenting in terms of what sort of
semantics is expected for char * strings. In fact in the process
of looking for uses of build_string(), much improperly Mule-ized
was discovered.
Mule-ize a lot of code as described in previous paragraph,
e.g. in sysdep.c.
Make the error functions take Ascbyte * strings and fix up a
couple of places where non-pure-ASCII strings were being passed in
(file-coding.c, mule-coding.c, unicode.c). (It's debatable whether
we really need to make the error functions work this way. It
helps catch places where code is written in a way that message
translation won't work, but we may well never implement message
translation.)
Make staticpro() and friends take Ascbyte * strings instead of
raw char * strings. Create a const_Ascbyte_ptr dynarr type
to describe what's held by staticpro_names[] and friends,
create pdump descriptions for const_Ascbyte_ptr dynarrs, and
use them in place of specially-crafted staticpro descriptions.
Mule-ize certain other functions (e.g. x_event_name) by correcting
raw use of char * to Ascbyte *, Rawbyte * or another such type,
and raw use of char[] buffers to another type (usually Ascbyte[]).
Change many uses of write_c_string() to write_msg_string(),
write_ascstring(), etc.
Mule-ize emodules.c, emodules.h, sysdll.h.
Fix some un-Mule-ized code in intl-win32.c.
A comment in event-Xt.c and the limitations of the message
snarfer (make-msgfile or whatever) is presumably incorrect --
it should be smart enough to handle function calls spread over
more than one line. Clean up code in event-Xt.c that was
written awkwardly for this reason.
In config.h.in, instead of NEED_ERROR_CHECK_TYPES_INLINES,
create a more general XEMACS_DEFS_NEEDS_INLINE_DECLS to
indicate when inlined functions need to be declared in
xemacs.defs.in.in, and make use of it in xemacs.defs.in.in.
We need to do this because postgresql.c now calls qxestrdup(),
which is an inline function.
Make nconc2() and other such functions MODULE_API and put
them in xemacs.defs.in.in since postgresql.c now uses them.
Clean up indentation in lread.c and a few other places.
In text.h, document ASSERT_ASCTEXT_ASCII() and
ASSERT_ASCTEXT_ASCII_LEN(), group together the stand-in
encodings and add some more for DLL symbols, function and
variable names, etc.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Tue, 26 Jan 2010 23:22:30 -0600 |
parents | a98ca4640147 |
children | e813cf16c015 |
comparison
equal
deleted
inserted
replaced
4951:de60897044f4 | 4952:19a72041c5ed |
---|---|
424 | 424 |
425 static void | 425 static void |
426 print_subr (Lisp_Object obj, Lisp_Object printcharfun, int UNUSED (escapeflag)) | 426 print_subr (Lisp_Object obj, Lisp_Object printcharfun, int UNUSED (escapeflag)) |
427 { | 427 { |
428 Lisp_Subr *subr = XSUBR (obj); | 428 Lisp_Subr *subr = XSUBR (obj); |
429 const CIbyte *header = | 429 const Ascbyte *header = |
430 (subr->max_args == UNEVALLED) ? "#<special-form " : "#<subr "; | 430 (subr->max_args == UNEVALLED) ? "#<special-form " : "#<subr "; |
431 const CIbyte *name = subr_name (subr); | 431 const Ascbyte *name = subr_name (subr); |
432 const CIbyte *trailer = subr->prompt ? " (interactive)>" : ">"; | 432 const Ascbyte *trailer = subr->prompt ? " (interactive)>" : ">"; |
433 | 433 |
434 if (print_readably) | 434 if (print_readably) |
435 printing_unreadable_object ("%s%s%s", header, name, trailer); | 435 printing_unreadable_object ("%s%s%s", header, name, trailer); |
436 | 436 |
437 write_c_string (printcharfun, header); | 437 write_ascstring (printcharfun, header); |
438 write_c_string (printcharfun, name); | 438 write_ascstring (printcharfun, name); |
439 write_c_string (printcharfun, trailer); | 439 write_ascstring (printcharfun, trailer); |
440 } | 440 } |
441 | 441 |
442 static const struct memory_description subr_description[] = { | 442 static const struct memory_description subr_description[] = { |
443 { XD_DOC_STRING, offsetof (Lisp_Subr, doc), 0, { 0 }, XD_FLAG_NO_KKCC }, | 443 { XD_DOC_STRING, offsetof (Lisp_Subr, doc), 0, { 0 }, XD_FLAG_NO_KKCC }, |
444 { XD_END } | 444 { XD_END } |
736 specbind (Qstack_trace_on_error, Qnil); | 736 specbind (Qstack_trace_on_error, Qnil); |
737 specbind (Qdebug_on_signal, Qnil); | 737 specbind (Qdebug_on_signal, Qnil); |
738 specbind (Qstack_trace_on_signal, Qnil); | 738 specbind (Qstack_trace_on_signal, Qnil); |
739 | 739 |
740 if (!noninteractive) | 740 if (!noninteractive) |
741 internal_with_output_to_temp_buffer (build_string ("*Backtrace*"), | 741 internal_with_output_to_temp_buffer (build_ascstring ("*Backtrace*"), |
742 backtrace_259, | 742 backtrace_259, |
743 Qnil, | 743 Qnil, |
744 Qnil); | 744 Qnil); |
745 else /* in batch mode, we want this going to stderr. */ | 745 else /* in batch mode, we want this going to stderr. */ |
746 backtrace_259 (Qnil); | 746 backtrace_259 (Qnil); |
778 specbind (Qstack_trace_on_error, Qnil); | 778 specbind (Qstack_trace_on_error, Qnil); |
779 specbind (Qdebug_on_signal, Qnil); | 779 specbind (Qdebug_on_signal, Qnil); |
780 specbind (Qstack_trace_on_signal, Qnil); | 780 specbind (Qstack_trace_on_signal, Qnil); |
781 | 781 |
782 if (!noninteractive) | 782 if (!noninteractive) |
783 internal_with_output_to_temp_buffer (build_string ("*Backtrace*"), | 783 internal_with_output_to_temp_buffer (build_ascstring ("*Backtrace*"), |
784 backtrace_259, | 784 backtrace_259, |
785 Qnil, | 785 Qnil, |
786 Qnil); | 786 Qnil); |
787 else /* in batch mode, we want this going to stderr. */ | 787 else /* in batch mode, we want this going to stderr. */ |
788 backtrace_259 (Qnil); | 788 backtrace_259 (Qnil); |
2652 | 2652 |
2653 /* Out of REASON and FROB, return a list of elements suitable for passing | 2653 /* Out of REASON and FROB, return a list of elements suitable for passing |
2654 to signal_error_1(). */ | 2654 to signal_error_1(). */ |
2655 | 2655 |
2656 Lisp_Object | 2656 Lisp_Object |
2657 build_error_data (const CIbyte *reason, Lisp_Object frob) | 2657 build_error_data (const Ascbyte *reason, Lisp_Object frob) |
2658 { | 2658 { |
2659 if (EQ (frob, Qunbound)) | 2659 if (EQ (frob, Qunbound)) |
2660 frob = Qnil; | 2660 frob = Qnil; |
2661 else if (CONSP (frob) && EQ (XCAR (frob), Qunbound)) | 2661 else if (CONSP (frob) && EQ (XCAR (frob), Qunbound)) |
2662 frob = XCDR (frob); | 2662 frob = XCDR (frob); |
2667 else | 2667 else |
2668 return Fcons (build_msg_string (reason), frob); | 2668 return Fcons (build_msg_string (reason), frob); |
2669 } | 2669 } |
2670 | 2670 |
2671 DOESNT_RETURN | 2671 DOESNT_RETURN |
2672 signal_error (Lisp_Object type, const CIbyte *reason, Lisp_Object frob) | 2672 signal_error (Lisp_Object type, const Ascbyte *reason, Lisp_Object frob) |
2673 { | 2673 { |
2674 signal_error_1 (type, build_error_data (reason, frob)); | 2674 signal_error_1 (type, build_error_data (reason, frob)); |
2675 } | 2675 } |
2676 | 2676 |
2677 void | 2677 void |
2678 maybe_signal_error (Lisp_Object type, const CIbyte *reason, | 2678 maybe_signal_error (Lisp_Object type, const Ascbyte *reason, |
2679 Lisp_Object frob, Lisp_Object class_, | 2679 Lisp_Object frob, Lisp_Object class_, |
2680 Error_Behavior errb) | 2680 Error_Behavior errb) |
2681 { | 2681 { |
2682 /* Optimization: */ | 2682 /* Optimization: */ |
2683 if (ERRB_EQ (errb, ERROR_ME_NOT)) | 2683 if (ERRB_EQ (errb, ERROR_ME_NOT)) |
2684 return; | 2684 return; |
2685 maybe_signal_error_1 (type, build_error_data (reason, frob), class_, errb); | 2685 maybe_signal_error_1 (type, build_error_data (reason, frob), class_, errb); |
2686 } | 2686 } |
2687 | 2687 |
2688 Lisp_Object | 2688 Lisp_Object |
2689 signal_continuable_error (Lisp_Object type, const CIbyte *reason, | 2689 signal_continuable_error (Lisp_Object type, const Ascbyte *reason, |
2690 Lisp_Object frob) | 2690 Lisp_Object frob) |
2691 { | 2691 { |
2692 return Fsignal (type, build_error_data (reason, frob)); | 2692 return Fsignal (type, build_error_data (reason, frob)); |
2693 } | 2693 } |
2694 | 2694 |
2695 Lisp_Object | 2695 Lisp_Object |
2696 maybe_signal_continuable_error (Lisp_Object type, const CIbyte *reason, | 2696 maybe_signal_continuable_error (Lisp_Object type, const Ascbyte *reason, |
2697 Lisp_Object frob, Lisp_Object class_, | 2697 Lisp_Object frob, Lisp_Object class_, |
2698 Error_Behavior errb) | 2698 Error_Behavior errb) |
2699 { | 2699 { |
2700 /* Optimization: */ | 2700 /* Optimization: */ |
2701 if (ERRB_EQ (errb, ERROR_ME_NOT)) | 2701 if (ERRB_EQ (errb, ERROR_ME_NOT)) |
2713 is three objects, a string and two related Lisp objects. | 2713 is three objects, a string and two related Lisp objects. |
2714 (The equivalent could be accomplished using the class 2 functions, | 2714 (The equivalent could be accomplished using the class 2 functions, |
2715 but these are more convenient in this particular case.) */ | 2715 but these are more convenient in this particular case.) */ |
2716 | 2716 |
2717 DOESNT_RETURN | 2717 DOESNT_RETURN |
2718 signal_error_2 (Lisp_Object type, const CIbyte *reason, | 2718 signal_error_2 (Lisp_Object type, const Ascbyte *reason, |
2719 Lisp_Object frob0, Lisp_Object frob1) | 2719 Lisp_Object frob0, Lisp_Object frob1) |
2720 { | 2720 { |
2721 signal_error_1 (type, list3 (build_msg_string (reason), frob0, | 2721 signal_error_1 (type, list3 (build_msg_string (reason), frob0, |
2722 frob1)); | 2722 frob1)); |
2723 } | 2723 } |
2724 | 2724 |
2725 void | 2725 void |
2726 maybe_signal_error_2 (Lisp_Object type, const CIbyte *reason, | 2726 maybe_signal_error_2 (Lisp_Object type, const Ascbyte *reason, |
2727 Lisp_Object frob0, Lisp_Object frob1, | 2727 Lisp_Object frob0, Lisp_Object frob1, |
2728 Lisp_Object class_, Error_Behavior errb) | 2728 Lisp_Object class_, Error_Behavior errb) |
2729 { | 2729 { |
2730 /* Optimization: */ | 2730 /* Optimization: */ |
2731 if (ERRB_EQ (errb, ERROR_ME_NOT)) | 2731 if (ERRB_EQ (errb, ERROR_ME_NOT)) |
2733 maybe_signal_error_1 (type, list3 (build_msg_string (reason), frob0, | 2733 maybe_signal_error_1 (type, list3 (build_msg_string (reason), frob0, |
2734 frob1), class_, errb); | 2734 frob1), class_, errb); |
2735 } | 2735 } |
2736 | 2736 |
2737 Lisp_Object | 2737 Lisp_Object |
2738 signal_continuable_error_2 (Lisp_Object type, const CIbyte *reason, | 2738 signal_continuable_error_2 (Lisp_Object type, const Ascbyte *reason, |
2739 Lisp_Object frob0, Lisp_Object frob1) | 2739 Lisp_Object frob0, Lisp_Object frob1) |
2740 { | 2740 { |
2741 return Fsignal (type, list3 (build_msg_string (reason), frob0, | 2741 return Fsignal (type, list3 (build_msg_string (reason), frob0, |
2742 frob1)); | 2742 frob1)); |
2743 } | 2743 } |
2744 | 2744 |
2745 Lisp_Object | 2745 Lisp_Object |
2746 maybe_signal_continuable_error_2 (Lisp_Object type, const CIbyte *reason, | 2746 maybe_signal_continuable_error_2 (Lisp_Object type, const Ascbyte *reason, |
2747 Lisp_Object frob0, Lisp_Object frob1, | 2747 Lisp_Object frob0, Lisp_Object frob1, |
2748 Lisp_Object class_, Error_Behavior errb) | 2748 Lisp_Object class_, Error_Behavior errb) |
2749 { | 2749 { |
2750 /* Optimization: */ | 2750 /* Optimization: */ |
2751 if (ERRB_EQ (errb, ERROR_ME_NOT)) | 2751 if (ERRB_EQ (errb, ERROR_ME_NOT)) |
2761 /* Class 4: Printf-like functions that signal an error. | 2761 /* Class 4: Printf-like functions that signal an error. |
2762 These functions signal an error of a specified type, whose data | 2762 These functions signal an error of a specified type, whose data |
2763 is a single string, created using the arguments. */ | 2763 is a single string, created using the arguments. */ |
2764 | 2764 |
2765 DOESNT_RETURN | 2765 DOESNT_RETURN |
2766 signal_ferror (Lisp_Object type, const CIbyte *fmt, ...) | 2766 signal_ferror (Lisp_Object type, const Ascbyte *fmt, ...) |
2767 { | 2767 { |
2768 Lisp_Object obj; | 2768 Lisp_Object obj; |
2769 va_list args; | 2769 va_list args; |
2770 | 2770 |
2771 va_start (args, fmt); | 2771 va_start (args, fmt); |
2772 obj = emacs_vsprintf_string (CGETTEXT (fmt), args); | 2772 obj = emacs_vsprintf_string (GETTEXT (fmt), args); |
2773 va_end (args); | 2773 va_end (args); |
2774 | 2774 |
2775 /* Fsignal GC-protects its args */ | 2775 /* Fsignal GC-protects its args */ |
2776 signal_error (type, 0, obj); | 2776 signal_error (type, 0, obj); |
2777 } | 2777 } |
2778 | 2778 |
2779 void | 2779 void |
2780 maybe_signal_ferror (Lisp_Object type, Lisp_Object class_, Error_Behavior errb, | 2780 maybe_signal_ferror (Lisp_Object type, Lisp_Object class_, Error_Behavior errb, |
2781 const CIbyte *fmt, ...) | 2781 const Ascbyte *fmt, ...) |
2782 { | 2782 { |
2783 Lisp_Object obj; | 2783 Lisp_Object obj; |
2784 va_list args; | 2784 va_list args; |
2785 | 2785 |
2786 /* Optimization: */ | 2786 /* Optimization: */ |
2787 if (ERRB_EQ (errb, ERROR_ME_NOT)) | 2787 if (ERRB_EQ (errb, ERROR_ME_NOT)) |
2788 return; | 2788 return; |
2789 | 2789 |
2790 va_start (args, fmt); | 2790 va_start (args, fmt); |
2791 obj = emacs_vsprintf_string (CGETTEXT (fmt), args); | 2791 obj = emacs_vsprintf_string (GETTEXT (fmt), args); |
2792 va_end (args); | 2792 va_end (args); |
2793 | 2793 |
2794 /* Fsignal GC-protects its args */ | 2794 /* Fsignal GC-protects its args */ |
2795 maybe_signal_error (type, 0, obj, class_, errb); | 2795 maybe_signal_error (type, 0, obj, class_, errb); |
2796 } | 2796 } |
2797 | 2797 |
2798 Lisp_Object | 2798 Lisp_Object |
2799 signal_continuable_ferror (Lisp_Object type, const CIbyte *fmt, ...) | 2799 signal_continuable_ferror (Lisp_Object type, const Ascbyte *fmt, ...) |
2800 { | 2800 { |
2801 Lisp_Object obj; | 2801 Lisp_Object obj; |
2802 va_list args; | 2802 va_list args; |
2803 | 2803 |
2804 va_start (args, fmt); | 2804 va_start (args, fmt); |
2805 obj = emacs_vsprintf_string (CGETTEXT (fmt), args); | 2805 obj = emacs_vsprintf_string (GETTEXT (fmt), args); |
2806 va_end (args); | 2806 va_end (args); |
2807 | 2807 |
2808 /* Fsignal GC-protects its args */ | 2808 /* Fsignal GC-protects its args */ |
2809 return Fsignal (type, list1 (obj)); | 2809 return Fsignal (type, list1 (obj)); |
2810 } | 2810 } |
2811 | 2811 |
2812 Lisp_Object | 2812 Lisp_Object |
2813 maybe_signal_continuable_ferror (Lisp_Object type, Lisp_Object class_, | 2813 maybe_signal_continuable_ferror (Lisp_Object type, Lisp_Object class_, |
2814 Error_Behavior errb, const CIbyte *fmt, ...) | 2814 Error_Behavior errb, const Ascbyte *fmt, ...) |
2815 { | 2815 { |
2816 Lisp_Object obj; | 2816 Lisp_Object obj; |
2817 va_list args; | 2817 va_list args; |
2818 | 2818 |
2819 /* Optimization: */ | 2819 /* Optimization: */ |
2820 if (ERRB_EQ (errb, ERROR_ME_NOT)) | 2820 if (ERRB_EQ (errb, ERROR_ME_NOT)) |
2821 return Qnil; | 2821 return Qnil; |
2822 | 2822 |
2823 va_start (args, fmt); | 2823 va_start (args, fmt); |
2824 obj = emacs_vsprintf_string (CGETTEXT (fmt), args); | 2824 obj = emacs_vsprintf_string (GETTEXT (fmt), args); |
2825 va_end (args); | 2825 va_end (args); |
2826 | 2826 |
2827 /* Fsignal GC-protects its args */ | 2827 /* Fsignal GC-protects its args */ |
2828 return maybe_signal_continuable_error (type, 0, obj, class_, errb); | 2828 return maybe_signal_continuable_error (type, 0, obj, class_, errb); |
2829 } | 2829 } |
2842 elements, the first of which is Qunbound), and these functions are | 2842 elements, the first of which is Qunbound), and these functions are |
2843 not commonly used. | 2843 not commonly used. |
2844 */ | 2844 */ |
2845 | 2845 |
2846 DOESNT_RETURN | 2846 DOESNT_RETURN |
2847 signal_ferror_with_frob (Lisp_Object type, Lisp_Object frob, const CIbyte *fmt, | 2847 signal_ferror_with_frob (Lisp_Object type, Lisp_Object frob, const Ascbyte *fmt, |
2848 ...) | 2848 ...) |
2849 { | 2849 { |
2850 Lisp_Object obj; | 2850 Lisp_Object obj; |
2851 va_list args; | 2851 va_list args; |
2852 | 2852 |
2853 va_start (args, fmt); | 2853 va_start (args, fmt); |
2854 obj = emacs_vsprintf_string (CGETTEXT (fmt), args); | 2854 obj = emacs_vsprintf_string (GETTEXT (fmt), args); |
2855 va_end (args); | 2855 va_end (args); |
2856 | 2856 |
2857 /* Fsignal GC-protects its args */ | 2857 /* Fsignal GC-protects its args */ |
2858 signal_error_1 (type, Fcons (obj, build_error_data (0, frob))); | 2858 signal_error_1 (type, Fcons (obj, build_error_data (0, frob))); |
2859 } | 2859 } |
2860 | 2860 |
2861 void | 2861 void |
2862 maybe_signal_ferror_with_frob (Lisp_Object type, Lisp_Object frob, | 2862 maybe_signal_ferror_with_frob (Lisp_Object type, Lisp_Object frob, |
2863 Lisp_Object class_, Error_Behavior errb, | 2863 Lisp_Object class_, Error_Behavior errb, |
2864 const CIbyte *fmt, ...) | 2864 const Ascbyte *fmt, ...) |
2865 { | 2865 { |
2866 Lisp_Object obj; | 2866 Lisp_Object obj; |
2867 va_list args; | 2867 va_list args; |
2868 | 2868 |
2869 /* Optimization: */ | 2869 /* Optimization: */ |
2870 if (ERRB_EQ (errb, ERROR_ME_NOT)) | 2870 if (ERRB_EQ (errb, ERROR_ME_NOT)) |
2871 return; | 2871 return; |
2872 | 2872 |
2873 va_start (args, fmt); | 2873 va_start (args, fmt); |
2874 obj = emacs_vsprintf_string (CGETTEXT (fmt), args); | 2874 obj = emacs_vsprintf_string (GETTEXT (fmt), args); |
2875 va_end (args); | 2875 va_end (args); |
2876 | 2876 |
2877 /* Fsignal GC-protects its args */ | 2877 /* Fsignal GC-protects its args */ |
2878 maybe_signal_error_1 (type, Fcons (obj, build_error_data (0, frob)), class_, | 2878 maybe_signal_error_1 (type, Fcons (obj, build_error_data (0, frob)), class_, |
2879 errb); | 2879 errb); |
2880 } | 2880 } |
2881 | 2881 |
2882 Lisp_Object | 2882 Lisp_Object |
2883 signal_continuable_ferror_with_frob (Lisp_Object type, Lisp_Object frob, | 2883 signal_continuable_ferror_with_frob (Lisp_Object type, Lisp_Object frob, |
2884 const CIbyte *fmt, ...) | 2884 const Ascbyte *fmt, ...) |
2885 { | 2885 { |
2886 Lisp_Object obj; | 2886 Lisp_Object obj; |
2887 va_list args; | 2887 va_list args; |
2888 | 2888 |
2889 va_start (args, fmt); | 2889 va_start (args, fmt); |
2890 obj = emacs_vsprintf_string (CGETTEXT (fmt), args); | 2890 obj = emacs_vsprintf_string (GETTEXT (fmt), args); |
2891 va_end (args); | 2891 va_end (args); |
2892 | 2892 |
2893 /* Fsignal GC-protects its args */ | 2893 /* Fsignal GC-protects its args */ |
2894 return Fsignal (type, Fcons (obj, build_error_data (0, frob))); | 2894 return Fsignal (type, Fcons (obj, build_error_data (0, frob))); |
2895 } | 2895 } |
2896 | 2896 |
2897 Lisp_Object | 2897 Lisp_Object |
2898 maybe_signal_continuable_ferror_with_frob (Lisp_Object type, Lisp_Object frob, | 2898 maybe_signal_continuable_ferror_with_frob (Lisp_Object type, Lisp_Object frob, |
2899 Lisp_Object class_, | 2899 Lisp_Object class_, |
2900 Error_Behavior errb, | 2900 Error_Behavior errb, |
2901 const CIbyte *fmt, ...) | 2901 const Ascbyte *fmt, ...) |
2902 { | 2902 { |
2903 Lisp_Object obj; | 2903 Lisp_Object obj; |
2904 va_list args; | 2904 va_list args; |
2905 | 2905 |
2906 /* Optimization: */ | 2906 /* Optimization: */ |
2907 if (ERRB_EQ (errb, ERROR_ME_NOT)) | 2907 if (ERRB_EQ (errb, ERROR_ME_NOT)) |
2908 return Qnil; | 2908 return Qnil; |
2909 | 2909 |
2910 va_start (args, fmt); | 2910 va_start (args, fmt); |
2911 obj = emacs_vsprintf_string (CGETTEXT (fmt), args); | 2911 obj = emacs_vsprintf_string (GETTEXT (fmt), args); |
2912 va_end (args); | 2912 va_end (args); |
2913 | 2913 |
2914 /* Fsignal GC-protects its args */ | 2914 /* Fsignal GC-protects its args */ |
2915 return maybe_signal_continuable_error_1 (type, | 2915 return maybe_signal_continuable_error_1 (type, |
2916 Fcons (obj, | 2916 Fcons (obj, |
2985 signal_error (Qcircular_property_list, 0, list); | 2985 signal_error (Qcircular_property_list, 0, list); |
2986 } | 2986 } |
2987 | 2987 |
2988 /* Called from within emacs_doprnt_1, so REASON is not formatted. */ | 2988 /* Called from within emacs_doprnt_1, so REASON is not formatted. */ |
2989 DOESNT_RETURN | 2989 DOESNT_RETURN |
2990 syntax_error (const CIbyte *reason, Lisp_Object frob) | 2990 syntax_error (const Ascbyte *reason, Lisp_Object frob) |
2991 { | 2991 { |
2992 signal_error (Qsyntax_error, reason, frob); | 2992 signal_error (Qsyntax_error, reason, frob); |
2993 } | 2993 } |
2994 | 2994 |
2995 DOESNT_RETURN | 2995 DOESNT_RETURN |
2996 syntax_error_2 (const CIbyte *reason, Lisp_Object frob1, Lisp_Object frob2) | 2996 syntax_error_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2) |
2997 { | 2997 { |
2998 signal_error_2 (Qsyntax_error, reason, frob1, frob2); | 2998 signal_error_2 (Qsyntax_error, reason, frob1, frob2); |
2999 } | 2999 } |
3000 | 3000 |
3001 void | 3001 void |
3002 maybe_syntax_error (const CIbyte *reason, Lisp_Object frob, | 3002 maybe_syntax_error (const Ascbyte *reason, Lisp_Object frob, |
3003 Lisp_Object class_, Error_Behavior errb) | 3003 Lisp_Object class_, Error_Behavior errb) |
3004 { | 3004 { |
3005 maybe_signal_error (Qsyntax_error, reason, frob, class_, errb); | 3005 maybe_signal_error (Qsyntax_error, reason, frob, class_, errb); |
3006 } | 3006 } |
3007 | 3007 |
3008 DOESNT_RETURN | 3008 DOESNT_RETURN |
3009 sferror (const CIbyte *reason, Lisp_Object frob) | 3009 sferror (const Ascbyte *reason, Lisp_Object frob) |
3010 { | 3010 { |
3011 signal_error (Qstructure_formation_error, reason, frob); | 3011 signal_error (Qstructure_formation_error, reason, frob); |
3012 } | 3012 } |
3013 | 3013 |
3014 DOESNT_RETURN | 3014 DOESNT_RETURN |
3015 sferror_2 (const CIbyte *reason, Lisp_Object frob1, Lisp_Object frob2) | 3015 sferror_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2) |
3016 { | 3016 { |
3017 signal_error_2 (Qstructure_formation_error, reason, frob1, frob2); | 3017 signal_error_2 (Qstructure_formation_error, reason, frob1, frob2); |
3018 } | 3018 } |
3019 | 3019 |
3020 void | 3020 void |
3021 maybe_sferror (const CIbyte *reason, Lisp_Object frob, | 3021 maybe_sferror (const Ascbyte *reason, Lisp_Object frob, |
3022 Lisp_Object class_, Error_Behavior errb) | 3022 Lisp_Object class_, Error_Behavior errb) |
3023 { | 3023 { |
3024 maybe_signal_error (Qstructure_formation_error, reason, frob, class_, errb); | 3024 maybe_signal_error (Qstructure_formation_error, reason, frob, class_, errb); |
3025 } | 3025 } |
3026 | 3026 |
3027 DOESNT_RETURN | 3027 DOESNT_RETURN |
3028 invalid_argument (const CIbyte *reason, Lisp_Object frob) | 3028 invalid_argument (const Ascbyte *reason, Lisp_Object frob) |
3029 { | 3029 { |
3030 signal_error (Qinvalid_argument, reason, frob); | 3030 signal_error (Qinvalid_argument, reason, frob); |
3031 } | 3031 } |
3032 | 3032 |
3033 DOESNT_RETURN | 3033 DOESNT_RETURN |
3034 invalid_argument_2 (const CIbyte *reason, Lisp_Object frob1, | 3034 invalid_argument_2 (const Ascbyte *reason, Lisp_Object frob1, |
3035 Lisp_Object frob2) | 3035 Lisp_Object frob2) |
3036 { | 3036 { |
3037 signal_error_2 (Qinvalid_argument, reason, frob1, frob2); | 3037 signal_error_2 (Qinvalid_argument, reason, frob1, frob2); |
3038 } | 3038 } |
3039 | 3039 |
3040 void | 3040 void |
3041 maybe_invalid_argument (const CIbyte *reason, Lisp_Object frob, | 3041 maybe_invalid_argument (const Ascbyte *reason, Lisp_Object frob, |
3042 Lisp_Object class_, Error_Behavior errb) | 3042 Lisp_Object class_, Error_Behavior errb) |
3043 { | 3043 { |
3044 maybe_signal_error (Qinvalid_argument, reason, frob, class_, errb); | 3044 maybe_signal_error (Qinvalid_argument, reason, frob, class_, errb); |
3045 } | 3045 } |
3046 | 3046 |
3047 DOESNT_RETURN | 3047 DOESNT_RETURN |
3048 invalid_constant (const CIbyte *reason, Lisp_Object frob) | 3048 invalid_constant (const Ascbyte *reason, Lisp_Object frob) |
3049 { | 3049 { |
3050 signal_error (Qinvalid_constant, reason, frob); | 3050 signal_error (Qinvalid_constant, reason, frob); |
3051 } | 3051 } |
3052 | 3052 |
3053 DOESNT_RETURN | 3053 DOESNT_RETURN |
3054 invalid_constant_2 (const CIbyte *reason, Lisp_Object frob1, | 3054 invalid_constant_2 (const Ascbyte *reason, Lisp_Object frob1, |
3055 Lisp_Object frob2) | 3055 Lisp_Object frob2) |
3056 { | 3056 { |
3057 signal_error_2 (Qinvalid_constant, reason, frob1, frob2); | 3057 signal_error_2 (Qinvalid_constant, reason, frob1, frob2); |
3058 } | 3058 } |
3059 | 3059 |
3060 void | 3060 void |
3061 maybe_invalid_constant (const CIbyte *reason, Lisp_Object frob, | 3061 maybe_invalid_constant (const Ascbyte *reason, Lisp_Object frob, |
3062 Lisp_Object class_, Error_Behavior errb) | 3062 Lisp_Object class_, Error_Behavior errb) |
3063 { | 3063 { |
3064 maybe_signal_error (Qinvalid_constant, reason, frob, class_, errb); | 3064 maybe_signal_error (Qinvalid_constant, reason, frob, class_, errb); |
3065 } | 3065 } |
3066 | 3066 |
3067 DOESNT_RETURN | 3067 DOESNT_RETURN |
3068 invalid_operation (const CIbyte *reason, Lisp_Object frob) | 3068 invalid_operation (const Ascbyte *reason, Lisp_Object frob) |
3069 { | 3069 { |
3070 signal_error (Qinvalid_operation, reason, frob); | 3070 signal_error (Qinvalid_operation, reason, frob); |
3071 } | 3071 } |
3072 | 3072 |
3073 DOESNT_RETURN | 3073 DOESNT_RETURN |
3074 invalid_operation_2 (const CIbyte *reason, Lisp_Object frob1, | 3074 invalid_operation_2 (const Ascbyte *reason, Lisp_Object frob1, |
3075 Lisp_Object frob2) | 3075 Lisp_Object frob2) |
3076 { | 3076 { |
3077 signal_error_2 (Qinvalid_operation, reason, frob1, frob2); | 3077 signal_error_2 (Qinvalid_operation, reason, frob1, frob2); |
3078 } | 3078 } |
3079 | 3079 |
3080 void | 3080 void |
3081 maybe_invalid_operation (const CIbyte *reason, Lisp_Object frob, | 3081 maybe_invalid_operation (const Ascbyte *reason, Lisp_Object frob, |
3082 Lisp_Object class_, Error_Behavior errb) | 3082 Lisp_Object class_, Error_Behavior errb) |
3083 { | 3083 { |
3084 maybe_signal_error (Qinvalid_operation, reason, frob, class_, errb); | 3084 maybe_signal_error (Qinvalid_operation, reason, frob, class_, errb); |
3085 } | 3085 } |
3086 | 3086 |
3087 DOESNT_RETURN | 3087 DOESNT_RETURN |
3088 invalid_change (const CIbyte *reason, Lisp_Object frob) | 3088 invalid_change (const Ascbyte *reason, Lisp_Object frob) |
3089 { | 3089 { |
3090 signal_error (Qinvalid_change, reason, frob); | 3090 signal_error (Qinvalid_change, reason, frob); |
3091 } | 3091 } |
3092 | 3092 |
3093 DOESNT_RETURN | 3093 DOESNT_RETURN |
3094 invalid_change_2 (const CIbyte *reason, Lisp_Object frob1, Lisp_Object frob2) | 3094 invalid_change_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2) |
3095 { | 3095 { |
3096 signal_error_2 (Qinvalid_change, reason, frob1, frob2); | 3096 signal_error_2 (Qinvalid_change, reason, frob1, frob2); |
3097 } | 3097 } |
3098 | 3098 |
3099 void | 3099 void |
3100 maybe_invalid_change (const CIbyte *reason, Lisp_Object frob, | 3100 maybe_invalid_change (const Ascbyte *reason, Lisp_Object frob, |
3101 Lisp_Object class_, Error_Behavior errb) | 3101 Lisp_Object class_, Error_Behavior errb) |
3102 { | 3102 { |
3103 maybe_signal_error (Qinvalid_change, reason, frob, class_, errb); | 3103 maybe_signal_error (Qinvalid_change, reason, frob, class_, errb); |
3104 } | 3104 } |
3105 | 3105 |
3106 DOESNT_RETURN | 3106 DOESNT_RETURN |
3107 invalid_state (const CIbyte *reason, Lisp_Object frob) | 3107 invalid_state (const Ascbyte *reason, Lisp_Object frob) |
3108 { | 3108 { |
3109 signal_error (Qinvalid_state, reason, frob); | 3109 signal_error (Qinvalid_state, reason, frob); |
3110 } | 3110 } |
3111 | 3111 |
3112 DOESNT_RETURN | 3112 DOESNT_RETURN |
3113 invalid_state_2 (const CIbyte *reason, Lisp_Object frob1, Lisp_Object frob2) | 3113 invalid_state_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2) |
3114 { | 3114 { |
3115 signal_error_2 (Qinvalid_state, reason, frob1, frob2); | 3115 signal_error_2 (Qinvalid_state, reason, frob1, frob2); |
3116 } | 3116 } |
3117 | 3117 |
3118 void | 3118 void |
3119 maybe_invalid_state (const CIbyte *reason, Lisp_Object frob, | 3119 maybe_invalid_state (const Ascbyte *reason, Lisp_Object frob, |
3120 Lisp_Object class_, Error_Behavior errb) | 3120 Lisp_Object class_, Error_Behavior errb) |
3121 { | 3121 { |
3122 maybe_signal_error (Qinvalid_state, reason, frob, class_, errb); | 3122 maybe_signal_error (Qinvalid_state, reason, frob, class_, errb); |
3123 } | 3123 } |
3124 | 3124 |
3125 DOESNT_RETURN | 3125 DOESNT_RETURN |
3126 wtaerror (const CIbyte *reason, Lisp_Object frob) | 3126 wtaerror (const Ascbyte *reason, Lisp_Object frob) |
3127 { | 3127 { |
3128 signal_error (Qwrong_type_argument, reason, frob); | 3128 signal_error (Qwrong_type_argument, reason, frob); |
3129 } | 3129 } |
3130 | 3130 |
3131 DOESNT_RETURN | 3131 DOESNT_RETURN |
3132 stack_overflow (const CIbyte *reason, Lisp_Object frob) | 3132 stack_overflow (const Ascbyte *reason, Lisp_Object frob) |
3133 { | 3133 { |
3134 signal_error (Qstack_overflow, reason, frob); | 3134 signal_error (Qstack_overflow, reason, frob); |
3135 } | 3135 } |
3136 | 3136 |
3137 DOESNT_RETURN | 3137 DOESNT_RETURN |
3138 out_of_memory (const CIbyte *reason, Lisp_Object frob) | 3138 out_of_memory (const Ascbyte *reason, Lisp_Object frob) |
3139 { | 3139 { |
3140 signal_error (Qout_of_memory, reason, frob); | 3140 signal_error (Qout_of_memory, reason, frob); |
3141 } | 3141 } |
3142 | 3142 |
3143 | 3143 |
4570 printing_unreadable_object ("multiple values"); | 4570 printing_unreadable_object ("multiple values"); |
4571 } | 4571 } |
4572 | 4572 |
4573 if (0 == count) | 4573 if (0 == count) |
4574 { | 4574 { |
4575 write_c_string (printcharfun, "#<zero-length multiple value>"); | 4575 write_msg_string (printcharfun, "#<zero-length multiple value>"); |
4576 } | 4576 } |
4577 | 4577 |
4578 for (index = 0; index < count;) | 4578 for (index = 0; index < count;) |
4579 { | 4579 { |
4580 if (index != 0 && | 4580 if (index != 0 && |
4592 | 4592 |
4593 ++index; | 4593 ++index; |
4594 | 4594 |
4595 if (count > 1 && index < count) | 4595 if (count > 1 && index < count) |
4596 { | 4596 { |
4597 write_c_string (printcharfun, " ;\n"); | 4597 write_ascstring (printcharfun, " ;\n"); |
4598 } | 4598 } |
4599 } | 4599 } |
4600 } | 4600 } |
4601 | 4601 |
4602 static Lisp_Object | 4602 static Lisp_Object |
5711 Lisp_Object errstr = | 5711 Lisp_Object errstr = |
5712 emacs_sprintf_string_lisp | 5712 emacs_sprintf_string_lisp |
5713 ("%s: Attempt to throw outside of function:" | 5713 ("%s: Attempt to throw outside of function:" |
5714 "To catch `%s' with value `%s'\n\nBacktrace follows:\n\n%s", | 5714 "To catch `%s' with value `%s'\n\nBacktrace follows:\n\n%s", |
5715 Qnil, 4, | 5715 Qnil, 4, |
5716 build_msg_string (warning_string ? warning_string : "error"), | 5716 build_msg_cistring (warning_string ? warning_string : "error"), |
5717 p->thrown_tag, p->thrown_value, p->backtrace); | 5717 p->thrown_tag, p->thrown_value, p->backtrace); |
5718 warn_when_safe_lispobj (Qerror, current_warning_level (), errstr); | 5718 warn_when_safe_lispobj (Qerror, current_warning_level (), errstr); |
5719 } | 5719 } |
5720 else if (p->caught_error && !EQ (p->error_conditions, Qquit)) | 5720 else if (p->caught_error && !EQ (p->error_conditions, Qquit)) |
5721 { | 5721 { |
5726 but that stuff is all in Lisp currently. */ | 5726 but that stuff is all in Lisp currently. */ |
5727 errstr = | 5727 errstr = |
5728 emacs_sprintf_string_lisp | 5728 emacs_sprintf_string_lisp |
5729 ("%s: (%s %s)\n\nBacktrace follows:\n\n%s", | 5729 ("%s: (%s %s)\n\nBacktrace follows:\n\n%s", |
5730 Qnil, 4, | 5730 Qnil, 4, |
5731 build_msg_string (warning_string ? warning_string : "error"), | 5731 build_msg_cistring (warning_string ? warning_string : "error"), |
5732 p->error_conditions, p->data, p->backtrace); | 5732 p->error_conditions, p->data, p->backtrace); |
5733 | 5733 |
5734 warn_when_safe_lispobj (warning_class, current_warning_level (), | 5734 warn_when_safe_lispobj (warning_class, current_warning_level (), |
5735 errstr); | 5735 errstr); |
5736 } | 5736 } |
6998 { | 6998 { |
6999 if (specpdl[speccount - 1].func == 0 | 6999 if (specpdl[speccount - 1].func == 0 |
7000 || specpdl[speccount - 1].func == specbind_unwind_local | 7000 || specpdl[speccount - 1].func == specbind_unwind_local |
7001 || specpdl[speccount - 1].func == specbind_unwind_wasnt_local) | 7001 || specpdl[speccount - 1].func == specbind_unwind_wasnt_local) |
7002 { | 7002 { |
7003 write_c_string (stream, !printing_bindings ? " # bind (" : " "); | 7003 write_ascstring (stream, !printing_bindings ? " # bind (" : " "); |
7004 Fprin1 (specpdl[speccount - 1].symbol, stream); | 7004 Fprin1 (specpdl[speccount - 1].symbol, stream); |
7005 printing_bindings = 1; | 7005 printing_bindings = 1; |
7006 } | 7006 } |
7007 else | 7007 else |
7008 { | 7008 { |
7009 if (printing_bindings) write_c_string (stream, ")\n"); | 7009 if (printing_bindings) write_ascstring (stream, ")\n"); |
7010 write_c_string (stream, " # (unwind-protect ...)\n"); | 7010 write_ascstring (stream, " # (unwind-protect ...)\n"); |
7011 printing_bindings = 0; | 7011 printing_bindings = 0; |
7012 } | 7012 } |
7013 } | 7013 } |
7014 if (printing_bindings) write_c_string (stream, ")\n"); | 7014 if (printing_bindings) write_ascstring (stream, ")\n"); |
7015 } | 7015 } |
7016 | 7016 |
7017 static Lisp_Object | 7017 static Lisp_Object |
7018 backtrace_unevalled_args (Lisp_Object *args) | 7018 backtrace_unevalled_args (Lisp_Object *args) |
7019 { | 7019 { |
7020 if (args) | 7020 if (args) |
7021 return *args; | 7021 return *args; |
7022 else | 7022 else |
7023 return list1 (build_string ("[internal]")); | 7023 return list1 (build_ascstring ("[internal]")); |
7024 } | 7024 } |
7025 | 7025 |
7026 DEFUN ("backtrace", Fbacktrace, 0, 2, "", /* | 7026 DEFUN ("backtrace", Fbacktrace, 0, 2, "", /* |
7027 Print a trace of Lisp function calls currently active. | 7027 Print a trace of Lisp function calls currently active. |
7028 Optional arg STREAM specifies the output stream to send the backtrace to, | 7028 Optional arg STREAM specifies the output stream to send the backtrace to, |
7076 backtrace_specials (speccount, catchpdl, stream); | 7076 backtrace_specials (speccount, catchpdl, stream); |
7077 | 7077 |
7078 speccount = catches->pdlcount; | 7078 speccount = catches->pdlcount; |
7079 if (catchpdl == speccount) | 7079 if (catchpdl == speccount) |
7080 { | 7080 { |
7081 write_c_string (stream, " # (catch "); | 7081 write_ascstring (stream, " # (catch "); |
7082 Fprin1 (catches->tag, stream); | 7082 Fprin1 (catches->tag, stream); |
7083 write_c_string (stream, " ...)\n"); | 7083 write_ascstring (stream, " ...)\n"); |
7084 } | 7084 } |
7085 else | 7085 else |
7086 { | 7086 { |
7087 write_c_string (stream, " # (condition-case ... . "); | 7087 write_ascstring (stream, " # (condition-case ... . "); |
7088 Fprin1 (Fcdr (Fcar (catches->tag)), stream); | 7088 Fprin1 (Fcdr (Fcar (catches->tag)), stream); |
7089 write_c_string (stream, ")\n"); | 7089 write_ascstring (stream, ")\n"); |
7090 } | 7090 } |
7091 catches = catches->next; | 7091 catches = catches->next; |
7092 } | 7092 } |
7093 else if (!backlist) | 7093 else if (!backlist) |
7094 break; | 7094 break; |
7097 if (!NILP (detailed) && backlist->pdlcount < speccount) | 7097 if (!NILP (detailed) && backlist->pdlcount < speccount) |
7098 { | 7098 { |
7099 backtrace_specials (speccount, backlist->pdlcount, stream); | 7099 backtrace_specials (speccount, backlist->pdlcount, stream); |
7100 speccount = backlist->pdlcount; | 7100 speccount = backlist->pdlcount; |
7101 } | 7101 } |
7102 write_c_string (stream, backlist->debug_on_exit ? "* " : " "); | 7102 write_ascstring (stream, backlist->debug_on_exit ? "* " : " "); |
7103 if (backlist->nargs == UNEVALLED) | 7103 if (backlist->nargs == UNEVALLED) |
7104 { | 7104 { |
7105 Fprin1 (Fcons (*backlist->function, | 7105 Fprin1 (Fcons (*backlist->function, |
7106 backtrace_unevalled_args (backlist->args)), | 7106 backtrace_unevalled_args (backlist->args)), |
7107 stream); | 7107 stream); |
7108 write_c_string (stream, "\n"); /* from FSFmacs 19.30 */ | 7108 write_ascstring (stream, "\n"); /* from FSFmacs 19.30 */ |
7109 } | 7109 } |
7110 else | 7110 else |
7111 { | 7111 { |
7112 Lisp_Object tem = *backlist->function; | 7112 Lisp_Object tem = *backlist->function; |
7113 Fprin1 (tem, stream); /* This can QUIT */ | 7113 Fprin1 (tem, stream); /* This can QUIT */ |
7114 write_c_string (stream, "("); | 7114 write_ascstring (stream, "("); |
7115 if (backlist->nargs == MANY) | 7115 if (backlist->nargs == MANY) |
7116 { | 7116 { |
7117 int i; | 7117 int i; |
7118 Lisp_Object tail = Qnil; | 7118 Lisp_Object tail = Qnil; |
7119 struct gcpro ngcpro1; | 7119 struct gcpro ngcpro1; |
7121 NGCPRO1 (tail); | 7121 NGCPRO1 (tail); |
7122 for (tail = *backlist->args, i = 0; | 7122 for (tail = *backlist->args, i = 0; |
7123 !NILP (tail); | 7123 !NILP (tail); |
7124 tail = Fcdr (tail), i++) | 7124 tail = Fcdr (tail), i++) |
7125 { | 7125 { |
7126 if (i != 0) write_c_string (stream, " "); | 7126 if (i != 0) write_ascstring (stream, " "); |
7127 Fprin1 (Fcar (tail), stream); | 7127 Fprin1 (Fcar (tail), stream); |
7128 } | 7128 } |
7129 NUNGCPRO; | 7129 NUNGCPRO; |
7130 } | 7130 } |
7131 else | 7131 else |
7133 int i; | 7133 int i; |
7134 for (i = 0; i < backlist->nargs; i++) | 7134 for (i = 0; i < backlist->nargs; i++) |
7135 { | 7135 { |
7136 if (!i && EQ (tem, Qbyte_code)) | 7136 if (!i && EQ (tem, Qbyte_code)) |
7137 { | 7137 { |
7138 write_c_string (stream, "\"...\""); | 7138 write_ascstring (stream, "\"...\""); |
7139 continue; | 7139 continue; |
7140 } | 7140 } |
7141 if (i != 0) write_c_string (stream, " "); | 7141 if (i != 0) write_ascstring (stream, " "); |
7142 Fprin1 (backlist->args[i], stream); | 7142 Fprin1 (backlist->args[i], stream); |
7143 } | 7143 } |
7144 } | 7144 } |
7145 write_c_string (stream, ")\n"); | 7145 write_ascstring (stream, ")\n"); |
7146 } | 7146 } |
7147 backlist = backlist->next; | 7147 backlist = backlist->next; |
7148 } | 7148 } |
7149 } | 7149 } |
7150 Vprint_level = old_level; | 7150 Vprint_level = old_level; |
7232 An alternative approach is to just pass some non-string type of | 7232 An alternative approach is to just pass some non-string type of |
7233 Lisp_Object to warn_when_safe_lispobj(); `prin1-to-string' will | 7233 Lisp_Object to warn_when_safe_lispobj(); `prin1-to-string' will |
7234 automatically be called when it is safe to do so. */ | 7234 automatically be called when it is safe to do so. */ |
7235 | 7235 |
7236 void | 7236 void |
7237 warn_when_safe (Lisp_Object class_, Lisp_Object level, const CIbyte *fmt, ...) | 7237 warn_when_safe (Lisp_Object class_, Lisp_Object level, const Ascbyte *fmt, ...) |
7238 { | 7238 { |
7239 Lisp_Object obj; | 7239 Lisp_Object obj; |
7240 va_list args; | 7240 va_list args; |
7241 | 7241 |
7242 if (warning_will_be_discarded (level)) | 7242 if (warning_will_be_discarded (level)) |
7243 return; | 7243 return; |
7244 | 7244 |
7245 va_start (args, fmt); | 7245 va_start (args, fmt); |
7246 obj = emacs_vsprintf_string (CGETTEXT (fmt), args); | 7246 obj = emacs_vsprintf_string (GETTEXT (fmt), args); |
7247 va_end (args); | 7247 va_end (args); |
7248 | 7248 |
7249 warn_when_safe_lispobj (class_, level, obj); | 7249 warn_when_safe_lispobj (class_, level, obj); |
7250 } | 7250 } |
7251 | 7251 |