diff options
| author | Richard M. Stallman | 1997-06-20 08:45:37 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-06-20 08:45:37 +0000 |
| commit | 0872e11f1595845e7f3ba2c0d8e53ec7fc0f49e3 (patch) | |
| tree | 21745bf057dcfa2fa6f1bd0903d2725afde1077a | |
| parent | 75c8c59233cde6b0dedac7bd5ec33529a7ec1f56 (diff) | |
| download | emacs-0872e11f1595845e7f3ba2c0d8e53ec7fc0f49e3.tar.gz emacs-0872e11f1595845e7f3ba2c0d8e53ec7fc0f49e3.zip | |
(Ferror_message_string): Optimize (error STRING) case.
| -rw-r--r-- | src/print.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/print.c b/src/print.c index 933544467ca..6ac2b25745d 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -727,6 +727,15 @@ DEFUN ("error-message-string", Ferror_message_string, Serror_message_string, | |||
| 727 | Lisp_Object original, printcharfun, value; | 727 | Lisp_Object original, printcharfun, value; |
| 728 | struct gcpro gcpro1; | 728 | struct gcpro gcpro1; |
| 729 | 729 | ||
| 730 | /* If OBJ is (error STRING), just return STRING. | ||
| 731 | That is not only faster, it also avoids the need to allocate | ||
| 732 | space here when the error is due to memory full. */ | ||
| 733 | if (CONSP (obj) && EQ (XCONS (obj)->car, Qerror) | ||
| 734 | && CONSP (XCONS (obj)->cdr) | ||
| 735 | && STRINGP (XCONS (XCONS (obj)->cdr)->car) | ||
| 736 | && NILP (XCONS (XCONS (obj)->cdr)->cdr)) | ||
| 737 | return XCONS (XCONS (obj)->cdr)->car; | ||
| 738 | |||
| 730 | print_error_message (obj, Vprin1_to_string_buffer, NULL); | 739 | print_error_message (obj, Vprin1_to_string_buffer, NULL); |
| 731 | 740 | ||
| 732 | set_buffer_internal (XBUFFER (Vprin1_to_string_buffer)); | 741 | set_buffer_internal (XBUFFER (Vprin1_to_string_buffer)); |