diff options
| author | Stefan Monnier | 2013-11-05 15:47:54 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2013-11-05 15:47:54 -0500 |
| commit | 2e670b957698eefb9f90a907968b497efe8c540b (patch) | |
| tree | 68cccead777d050184e603a9a6f705cea6743a55 /src | |
| parent | 2ea0d614991d2ca8617c898c24a1ddd6e0d09f68 (diff) | |
| download | emacs-2e670b957698eefb9f90a907968b497efe8c540b.tar.gz emacs-2e670b957698eefb9f90a907968b497efe8c540b.zip | |
* src/keyboard.c (Fcommand_error_default_function): Rename from
Fdefault_error_output.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/keyboard.c | 38 |
2 files changed, 24 insertions, 24 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 04eabcb26db..fec1a12de8a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,7 +1,13 @@ | |||
| 1 | 2013-11-05 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * keyboard.c (Fcommand_error_default_function): Rename from | ||
| 4 | Fdefault_error_output. | ||
| 5 | |||
| 1 | 2013-11-05 Jarek Czekalski <jarekczek@poczta.onet.pl> (tiny change) | 6 | 2013-11-05 Jarek Czekalski <jarekczek@poczta.onet.pl> (tiny change) |
| 2 | 7 | ||
| 3 | * keyboard.c: new function default-error-output which becomes | 8 | * keyboard.c (Fdefault_error_output): New function, extracted from |
| 4 | a default value for command-error-function. | 9 | cmd_error_internal. |
| 10 | (syms_of_keyboard): Use it for Vcommand_error_function. | ||
| 5 | 11 | ||
| 6 | 2013-11-05 Stefan Monnier <monnier@iro.umontreal.ca> | 12 | 2013-11-05 Stefan Monnier <monnier@iro.umontreal.ca> |
| 7 | 13 | ||
diff --git a/src/keyboard.c b/src/keyboard.c index dbc0bccd232..574780e2004 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -241,8 +241,6 @@ Lisp_Object Qrecompute_lucid_menubar, Qactivate_menubar_hook; | |||
| 241 | 241 | ||
| 242 | static Lisp_Object Qecho_area_clear_hook; | 242 | static Lisp_Object Qecho_area_clear_hook; |
| 243 | 243 | ||
| 244 | static Lisp_Object Qdefault_error_output; | ||
| 245 | |||
| 246 | /* Hooks to run before and after each command. */ | 244 | /* Hooks to run before and after each command. */ |
| 247 | static Lisp_Object Qpre_command_hook; | 245 | static Lisp_Object Qpre_command_hook; |
| 248 | static Lisp_Object Qpost_command_hook; | 246 | static Lisp_Object Qpost_command_hook; |
| @@ -1074,8 +1072,7 @@ cmd_error_internal (Lisp_Object data, const char *context) | |||
| 1074 | Vquit_flag = Qnil; | 1072 | Vquit_flag = Qnil; |
| 1075 | Vinhibit_quit = Qt; | 1073 | Vinhibit_quit = Qt; |
| 1076 | 1074 | ||
| 1077 | /* Use user's specified output function, | 1075 | /* Use user's specified output function if any. */ |
| 1078 | initially it is our Fdefault_error_output. */ | ||
| 1079 | if (!NILP (Vcommand_error_function)) | 1076 | if (!NILP (Vcommand_error_function)) |
| 1080 | call3 (Vcommand_error_function, data, | 1077 | call3 (Vcommand_error_function, data, |
| 1081 | context ? build_string (context) : empty_unibyte_string, | 1078 | context ? build_string (context) : empty_unibyte_string, |
| @@ -1084,17 +1081,17 @@ cmd_error_internal (Lisp_Object data, const char *context) | |||
| 1084 | Vsignaling_function = Qnil; | 1081 | Vsignaling_function = Qnil; |
| 1085 | } | 1082 | } |
| 1086 | 1083 | ||
| 1087 | DEFUN ("default-error-output", Fdefault_error_output, | 1084 | DEFUN ("command-error-default-function", Fcommand_error_default_function, |
| 1088 | Sdefault_error_output, 3, 3, 0, | 1085 | Scommand_error_default_function, 3, 3, 0, |
| 1089 | doc: /* Produce default output for the error message, | 1086 | doc: /* Produce default output for unhandled error message. |
| 1090 | into the messages buffer and the echo area. */) | 1087 | Default value of `command-error-function'. */) |
| 1091 | (Lisp_Object data, Lisp_Object context, Lisp_Object signal) | 1088 | (Lisp_Object data, Lisp_Object context, Lisp_Object signal) |
| 1092 | { | 1089 | { |
| 1093 | struct frame *sf = SELECTED_FRAME (); | 1090 | struct frame *sf = SELECTED_FRAME (); |
| 1094 | const char *sz_context; | 1091 | const char *sz_context; |
| 1095 | 1092 | ||
| 1096 | CHECK_STRING(context); | 1093 | CHECK_STRING (context); |
| 1097 | sz_context = XSTRING(context)->data; | 1094 | sz_context = XSTRING (context)->data; |
| 1098 | 1095 | ||
| 1099 | /* If the window system or terminal frame hasn't been initialized | 1096 | /* If the window system or terminal frame hasn't been initialized |
| 1100 | yet, or we're not interactive, write the message to stderr and exit. */ | 1097 | yet, or we're not interactive, write the message to stderr and exit. */ |
| @@ -1126,6 +1123,7 @@ into the messages buffer and the echo area. */) | |||
| 1126 | 1123 | ||
| 1127 | print_error_message (data, Qt, sz_context, signal); | 1124 | print_error_message (data, Qt, sz_context, signal); |
| 1128 | } | 1125 | } |
| 1126 | return Qnil; | ||
| 1129 | } | 1127 | } |
| 1130 | 1128 | ||
| 1131 | static Lisp_Object command_loop_2 (Lisp_Object); | 1129 | static Lisp_Object command_loop_2 (Lisp_Object); |
| @@ -11123,7 +11121,7 @@ syms_of_keyboard (void) | |||
| 11123 | defsubr (&Sabort_recursive_edit); | 11121 | defsubr (&Sabort_recursive_edit); |
| 11124 | defsubr (&Sexit_recursive_edit); | 11122 | defsubr (&Sexit_recursive_edit); |
| 11125 | defsubr (&Srecursion_depth); | 11123 | defsubr (&Srecursion_depth); |
| 11126 | defsubr (&Sdefault_error_output); | 11124 | defsubr (&Scommand_error_default_function); |
| 11127 | defsubr (&Stop_level); | 11125 | defsubr (&Stop_level); |
| 11128 | defsubr (&Sdiscard_input); | 11126 | defsubr (&Sdiscard_input); |
| 11129 | defsubr (&Sopen_dribble_file); | 11127 | defsubr (&Sopen_dribble_file); |
| @@ -11602,18 +11600,14 @@ The value of that variable is passed to `quit-flag' and later causes a | |||
| 11602 | peculiar kind of quitting. */); | 11600 | peculiar kind of quitting. */); |
| 11603 | Vthrow_on_input = Qnil; | 11601 | Vthrow_on_input = Qnil; |
| 11604 | 11602 | ||
| 11605 | DEFSYM (Qdefault_error_output, "default-error-output"); | ||
| 11606 | DEFVAR_LISP ("command-error-function", Vcommand_error_function, | 11603 | DEFVAR_LISP ("command-error-function", Vcommand_error_function, |
| 11607 | doc: /* If non-nil, function to output error messages. | 11604 | doc: /* Function to output error messages. |
| 11608 | The arguments are the error data, a list of the form | 11605 | Called with three arguments: |
| 11609 | (SIGNALED-CONDITIONS . SIGNAL-DATA) | 11606 | - the error data, a list of the form (SIGNALED-CONDITION . SIGNAL-DATA) |
| 11610 | such as just as `condition-case' would bind its variable to, | 11607 | such as what `condition-case' would bind its variable to, |
| 11611 | the context (a string which normally goes at the start of the message), | 11608 | - the context (a string which normally goes at the start of the message), |
| 11612 | and the Lisp function within which the error was signaled. | 11609 | - the Lisp function within which the error was signaled. */); |
| 11613 | 11610 | Vcommand_error_function = intern ("command-error-default-function"); | |
| 11614 | This variable is initialized with Emacs default error output function. | ||
| 11615 | It is suggested that user functions are added using add-function. */); | ||
| 11616 | Vcommand_error_function = Qdefault_error_output; | ||
| 11617 | 11611 | ||
| 11618 | DEFVAR_LISP ("enable-disabled-menus-and-buttons", | 11612 | DEFVAR_LISP ("enable-disabled-menus-and-buttons", |
| 11619 | Venable_disabled_menus_and_buttons, | 11613 | Venable_disabled_menus_and_buttons, |