aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1995-12-21 17:08:30 +0000
committerKarl Heuer1995-12-21 17:08:30 +0000
commit22a513448fdbea14ccfa2cf081b2947a5fd15e0b (patch)
tree62b1213e1c176a53d12b1b2f666b8b12531dd3af /src
parent51931aca6e6e858ae7d9fc16091242a189b120ef (diff)
downloademacs-22a513448fdbea14ccfa2cf081b2947a5fd15e0b.tar.gz
emacs-22a513448fdbea14ccfa2cf081b2947a5fd15e0b.zip
(Fcommand_execute): Allow function + args list as cmd.
(cmd_error_internal): Use print_error_message.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c50
1 files changed, 3 insertions, 47 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 04291a24105..0a6166e64e3 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -900,10 +900,7 @@ cmd_error_internal (data, context)
900 Lisp_Object data; 900 Lisp_Object data;
901 char *context; 901 char *context;
902{ 902{
903 Lisp_Object errmsg, tail, errname, file_error;
904 Lisp_Object stream; 903 Lisp_Object stream;
905 struct gcpro gcpro1;
906 int i;
907 904
908 Vquit_flag = Qnil; 905 Vquit_flag = Qnil;
909 Vinhibit_quit = Qt; 906 Vinhibit_quit = Qt;
@@ -925,49 +922,7 @@ cmd_error_internal (data, context)
925 if (context != 0) 922 if (context != 0)
926 write_string_1 (context, -1, stream); 923 write_string_1 (context, -1, stream);
927 924
928 errname = Fcar (data); 925 print_error_message (data, stream);
929
930 if (EQ (errname, Qerror))
931 {
932 data = Fcdr (data);
933 if (!CONSP (data)) data = Qnil;
934 errmsg = Fcar (data);
935 file_error = Qnil;
936 }
937 else
938 {
939 errmsg = Fget (errname, Qerror_message);
940 file_error = Fmemq (Qfile_error,
941 Fget (errname, Qerror_conditions));
942 }
943
944 /* Print an error message including the data items.
945 This is done by printing it into a scratch buffer
946 and then making a copy of the text in the buffer. */
947
948 if (!CONSP (data)) data = Qnil;
949 tail = Fcdr (data);
950 GCPRO1 (tail);
951
952 /* For file-error, make error message by concatenating
953 all the data items. They are all strings. */
954 if (!NILP (file_error) && !NILP (tail))
955 errmsg = XCONS (tail)->car, tail = XCONS (tail)->cdr;
956
957 if (STRINGP (errmsg))
958 Fprinc (errmsg, stream);
959 else
960 write_string_1 ("peculiar error", -1, stream);
961
962 for (i = 0; CONSP (tail); tail = Fcdr (tail), i++)
963 {
964 write_string_1 (i ? ", " : ": ", 2, stream);
965 if (!NILP (file_error))
966 Fprinc (Fcar (tail), stream);
967 else
968 Fprin1 (Fcar (tail), stream);
969 }
970 UNGCPRO;
971 926
972 /* If the window system or terminal frame hasn't been initialized 927 /* If the window system or terminal frame hasn't been initialized
973 yet, or we're in -batch mode, this error should cause Emacs to exit. */ 928 yet, or we're in -batch mode, this error should cause Emacs to exit. */
@@ -6445,7 +6400,8 @@ when reading the arguments; if it is nil, (this_command_key_count) is used.")
6445 } 6400 }
6446 } 6401 }
6447 6402
6448 while (1) 6403 while (! CONSP (cmd) || EQ (XCONS (cmd)->car, Qlambda)
6404 || EQ (XCONS (cmd)->car, Qautoload))
6449 { 6405 {
6450 final = Findirect_function (cmd); 6406 final = Findirect_function (cmd);
6451 6407