diff options
| author | Chong Yidong | 2011-04-08 11:37:15 -0400 |
|---|---|---|
| committer | Chong Yidong | 2011-04-08 11:37:15 -0400 |
| commit | cbb59342310c395a04b5dc85454938167793dd96 (patch) | |
| tree | 833ee203c2b09cd9f826cc25081811d38e15a484 /src | |
| parent | e3971c4440fc828326aaeec79d1a53638d67ed0f (diff) | |
| download | emacs-cbb59342310c395a04b5dc85454938167793dd96.tar.gz emacs-cbb59342310c395a04b5dc85454938167793dd96.zip | |
Remove internal_with_output_to_temp_buffer, replacing sole user with Lisp.
* lisp/help.el (help-form-show): New function, to be called from C.
Put help-form output in a buffer named differently than *Help*.
* src/keyboard.c (read_char): Call Lisp function help-form-show,
instead of using internal_with_output_to_temp_buffer.
(Qhelp_form_show): New var.
* src/lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
* src/print.c (internal_with_output_to_temp_buffer): Function deleted.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/keyboard.c | 10 | ||||
| -rw-r--r-- | src/lisp.h | 2 | ||||
| -rw-r--r-- | src/print.c | 23 | ||||
| -rw-r--r-- | src/window.c | 3 |
5 files changed, 16 insertions, 32 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3e4100878c4..e74643be30a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2011-04-08 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * keyboard.c (read_char): Call Lisp function help-form-show, | ||
| 4 | instead of using internal_with_output_to_temp_buffer. | ||
| 5 | (Qhelp_form_show): New var. | ||
| 6 | |||
| 7 | * print.c (internal_with_output_to_temp_buffer): Function deleted. | ||
| 8 | |||
| 9 | * lisp.h (internal_with_output_to_temp_buffer): Remove prototype. | ||
| 10 | |||
| 1 | 2011-04-06 Chong Yidong <cyd@stupidchicken.com> | 11 | 2011-04-06 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 12 | ||
| 3 | * process.c (Flist_processes): Removed to Lisp. | 13 | * process.c (Flist_processes): Removed to Lisp. |
diff --git a/src/keyboard.c b/src/keyboard.c index ae4fddb2c89..70bd47181b1 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -260,6 +260,8 @@ Lisp_Object Qdeferred_action_function; | |||
| 260 | Lisp_Object Qinput_method_exit_on_first_char; | 260 | Lisp_Object Qinput_method_exit_on_first_char; |
| 261 | Lisp_Object Qinput_method_use_echo_area; | 261 | Lisp_Object Qinput_method_use_echo_area; |
| 262 | 262 | ||
| 263 | Lisp_Object Qhelp_form_show; | ||
| 264 | |||
| 263 | /* File in which we write all commands we read. */ | 265 | /* File in which we write all commands we read. */ |
| 264 | FILE *dribble; | 266 | FILE *dribble; |
| 265 | 267 | ||
| @@ -3095,10 +3097,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event | |||
| 3095 | = Fcons (Fcurrent_window_configuration (Qnil), | 3097 | = Fcons (Fcurrent_window_configuration (Qnil), |
| 3096 | help_form_saved_window_configs); | 3098 | help_form_saved_window_configs); |
| 3097 | record_unwind_protect (read_char_help_form_unwind, Qnil); | 3099 | record_unwind_protect (read_char_help_form_unwind, Qnil); |
| 3098 | 3100 | call0 (Qhelp_form_show); | |
| 3099 | tem0 = Feval (Vhelp_form, Qnil); | ||
| 3100 | if (STRINGP (tem0)) | ||
| 3101 | internal_with_output_to_temp_buffer ("*Help*", print_help, tem0); | ||
| 3102 | 3101 | ||
| 3103 | cancel_echoing (); | 3102 | cancel_echoing (); |
| 3104 | do | 3103 | do |
| @@ -11602,6 +11601,9 @@ syms_of_keyboard (void) | |||
| 11602 | Qinput_method_use_echo_area = intern_c_string ("input-method-use-echo-area"); | 11601 | Qinput_method_use_echo_area = intern_c_string ("input-method-use-echo-area"); |
| 11603 | staticpro (&Qinput_method_use_echo_area); | 11602 | staticpro (&Qinput_method_use_echo_area); |
| 11604 | 11603 | ||
| 11604 | Qhelp_form_show = intern_c_string ("help-form-show"); | ||
| 11605 | staticpro (&Qhelp_form_show); | ||
| 11606 | |||
| 11605 | Fset (Qinput_method_exit_on_first_char, Qnil); | 11607 | Fset (Qinput_method_exit_on_first_char, Qnil); |
| 11606 | Fset (Qinput_method_use_echo_area, Qnil); | 11608 | Fset (Qinput_method_use_echo_area, Qnil); |
| 11607 | 11609 | ||
diff --git a/src/lisp.h b/src/lisp.h index f3016d521d1..250c0d807ac 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2775,8 +2775,6 @@ extern Lisp_Object Qprint_escape_newlines; | |||
| 2775 | extern void write_string (const char *, int); | 2775 | extern void write_string (const char *, int); |
| 2776 | extern void print_error_message (Lisp_Object, Lisp_Object, const char *, | 2776 | extern void print_error_message (Lisp_Object, Lisp_Object, const char *, |
| 2777 | Lisp_Object); | 2777 | Lisp_Object); |
| 2778 | extern Lisp_Object internal_with_output_to_temp_buffer | ||
| 2779 | (const char *, Lisp_Object (*) (Lisp_Object), Lisp_Object); | ||
| 2780 | #define FLOAT_TO_STRING_BUFSIZE 350 | 2778 | #define FLOAT_TO_STRING_BUFSIZE 350 |
| 2781 | extern void float_to_string (char *, double); | 2779 | extern void float_to_string (char *, double); |
| 2782 | extern void syms_of_print (void); | 2780 | extern void syms_of_print (void); |
diff --git a/src/print.c b/src/print.c index c076e1ec973..f68f04ac5fa 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -520,29 +520,6 @@ temp_output_buffer_setup (const char *bufname) | |||
| 520 | 520 | ||
| 521 | specbind (Qstandard_output, buf); | 521 | specbind (Qstandard_output, buf); |
| 522 | } | 522 | } |
| 523 | |||
| 524 | /* FIXME: Use Lisp's with-output-to-temp-buffer instead! */ | ||
| 525 | Lisp_Object | ||
| 526 | internal_with_output_to_temp_buffer (const char *bufname, Lisp_Object (*function) (Lisp_Object), Lisp_Object args) | ||
| 527 | { | ||
| 528 | int count = SPECPDL_INDEX (); | ||
| 529 | Lisp_Object buf, val; | ||
| 530 | struct gcpro gcpro1; | ||
| 531 | |||
| 532 | GCPRO1 (args); | ||
| 533 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | ||
| 534 | temp_output_buffer_setup (bufname); | ||
| 535 | buf = Vstandard_output; | ||
| 536 | UNGCPRO; | ||
| 537 | |||
| 538 | val = (*function) (args); | ||
| 539 | |||
| 540 | GCPRO1 (val); | ||
| 541 | temp_output_buffer_show (buf); | ||
| 542 | UNGCPRO; | ||
| 543 | |||
| 544 | return unbind_to (count, val); | ||
| 545 | } | ||
| 546 | 523 | ||
| 547 | static void print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag); | 524 | static void print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag); |
| 548 | static void print_preprocess (Lisp_Object obj); | 525 | static void print_preprocess (Lisp_Object obj); |
diff --git a/src/window.c b/src/window.c index 5ca46dd3316..d023f9a29cd 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -3664,9 +3664,6 @@ temp_output_buffer_show (register Lisp_Object buf) | |||
| 3664 | BEGV = BEG; | 3664 | BEGV = BEG; |
| 3665 | ZV = Z; | 3665 | ZV = Z; |
| 3666 | SET_PT (BEG); | 3666 | SET_PT (BEG); |
| 3667 | #if 0 /* rms: there should be no reason for this. */ | ||
| 3668 | XBUFFER (buf)->prevent_redisplay_optimizations_p = 1; | ||
| 3669 | #endif | ||
| 3670 | set_buffer_internal (old); | 3667 | set_buffer_internal (old); |
| 3671 | 3668 | ||
| 3672 | if (!NILP (Vtemp_buffer_show_function)) | 3669 | if (!NILP (Vtemp_buffer_show_function)) |