comparison src/energize.c @ 20:859a2309aef8 r19-15b93

Import from CVS: tag r19-15b93
author cvs
date Mon, 13 Aug 2007 08:50:05 +0200
parents 9ee227acff29
children 131b0175ea99
comparison
equal deleted inserted replaced
19:ac1f612d5250 20:859a2309aef8
941 } 941 }
942 942
943 #endif /* !I18N4 */ 943 #endif /* !I18N4 */
944 944
945 945
946 DEFUN ("energize-update-menubar", Fenergize_update_menubar, 946 DEFUN ("energize-update-menubar", Fenergize_update_menubar, 0, 1, 0, /*
947 Senergize_update_menubar, 0, 1, 0 /*
948 obsolete 947 obsolete
949 */ ) 948 */
950 (frame) 949 (frame))
951 Lisp_Object frame;
952 { 950 {
953 return Qnil; 951 return Qnil;
954 } 952 }
955 953
956 954
957 DEFUN ("energize-extent-menu-p", Fenergize_extent_menu_p, 955 DEFUN ("energize-extent-menu-p", Fenergize_extent_menu_p, 1, 1, 0, /*
958 Senergize_extent_menu_p, 1, 1, 0 /*
959 Whether the extent has a set of commands defined by Energize. 956 Whether the extent has a set of commands defined by Energize.
960 */ ) 957 */
961 (extent_obj) 958 (extent_obj))
962 Lisp_Object extent_obj;
963 { 959 {
964 CHECK_EXTENT (extent_obj); 960 CHECK_EXTENT (extent_obj);
965 961
966 if (NILP (Fconnected_to_energize_p ())) 962 if (NILP (Fconnected_to_energize_p ()))
967 return Qnil; 963 return Qnil;
2476 UNGCPRO; 2472 UNGCPRO;
2477 2473
2478 return NILP (only_name) ? item_list : item; 2474 return NILP (only_name) ? item_list : item;
2479 } 2475 }
2480 2476
2481 DEFUN ("energize-list-menu", Fenergize_list_menu, 2477 DEFUN ("energize-list-menu", Fenergize_list_menu, 3, 4, 0, /*
2482 Senergize_list_menu, 3, 4, 0 /*
2483 Request the set of menu options from the Energize server that are 2478 Request the set of menu options from the Energize server that are
2484 appropriate to the buffer and the extent. Extent can be (), in which case 2479 appropriate to the buffer and the extent. Extent can be (), in which case
2485 the options are requested for the whole buffer. Selection-p tells 2480 the options are requested for the whole buffer. Selection-p tells
2486 if the selection is available on the dislpay emacs is using. 2481 if the selection is available on the dislpay emacs is using.
2487 Returns the options as 2482 Returns the options as
2489 in the list can also be passed to energize-execute-menu-item. 2484 in the list can also be passed to energize-execute-menu-item.
2490 The list is (buffer extent or () <item1> ... <itemN>). 2485 The list is (buffer extent or () <item1> ... <itemN>).
2491 where <itemI> is (name id1 id2 flags); idI is (high . low). 2486 where <itemI> is (name id1 id2 flags); idI is (high . low).
2492 If optional argument only-name is provided only the item with name only-name 2487 If optional argument only-name is provided only the item with name only-name
2493 is returned, or () if no such item exists. 2488 is returned, or () if no such item exists.
2494 */ ) 2489 */
2495 (buffer, extent_obj, selection_p, only_name) 2490 (buffer, extent_obj, selection_p, only_name))
2496 Lisp_Object buffer, extent_obj, selection_p, only_name;
2497 { 2491 {
2498 Lisp_Object res; 2492 Lisp_Object res;
2499 CHECK_BUFFER (buffer); 2493 CHECK_BUFFER (buffer);
2500 2494
2501 if (!energize_connection || !energize_connection->conn) return Qnil; 2495 if (!energize_connection || !energize_connection->conn) return Qnil;
2507 only_name); 2501 only_name);
2508 notify_delayed_requests (); 2502 notify_delayed_requests ();
2509 return res; 2503 return res;
2510 } 2504 }
2511 2505
2512 DEFUN ("energize-execute-menu-item", Fenergize_execute_menu_item, 2506 DEFUN ("energize-execute-menu-item", Fenergize_execute_menu_item, 3, 5, 0, /*
2513 Senergize_execute_menu_item, 3, 5, 0 /*
2514 Item is a vector received by energize-list-menu. Sends a request to 2507 Item is a vector received by energize-list-menu. Sends a request to
2515 execute the code associated to this menu inside the Energize server. 2508 execute the code associated to this menu inside the Energize server.
2516 Optional fourth argument is a string or a vector to be used as the selection 2509 Optional fourth argument is a string or a vector to be used as the selection
2517 for entry disabled because they need the selection. 2510 for entry disabled because they need the selection.
2518 Optional fifth argument, if non NIL, tells Energize to not request 2511 Optional fifth argument, if non NIL, tells Energize to not request
2519 confirmation before executing the command. 2512 confirmation before executing the command.
2520 */ ) 2513 */
2521 (buffer, extent_obj, item, selection, no_confirm) 2514 (buffer, extent_obj, item, selection, no_confirm))
2522 Lisp_Object buffer, extent_obj, item, selection, no_confirm;
2523 { 2515 {
2524 struct Lisp_Vector *v; 2516 struct Lisp_Vector *v;
2525 2517
2526 if (!energize_connection || !energize_connection->conn) return Qnil; 2518 if (!energize_connection || !energize_connection->conn) return Qnil;
2527 2519
2541 no_confirm); 2533 no_confirm);
2542 2534
2543 return Qt; 2535 return Qt;
2544 } 2536 }
2545 2537
2546 DEFUN ("energize-execute-command-internal", Fenergize_execute_command_internal, 2538 DEFUN ("energize-execute-command-internal",
2547 Senergize_execute_command_internal, 3, 5, 0 /* 2539 Fenergize_execute_command_internal, 3, 5, 0, /*
2548 Command is a string naming an energize command. Sends a request to 2540 Command is a string naming an energize command. Sends a request to
2549 execute this command inside the Energize server. 2541 execute this command inside the Energize server.
2550 Optional fourth argument is a string or a vector to be used as the selection. 2542 Optional fourth argument is a string or a vector to be used as the selection.
2551 Optional fifth argument, if non NIL, tells Energize to not request 2543 Optional fifth argument, if non NIL, tells Energize to not request
2552 confirmation before executing the command. 2544 confirmation before executing the command.
2553 2545
2554 See also 'energize-list-menu'. 2546 See also 'energize-list-menu'.
2555 */ ) 2547 */
2556 (buffer, extent_obj, command, selection, no_confirm) 2548 (buffer, extent_obj, command, selection, no_confirm))
2557 Lisp_Object buffer, extent_obj, command, selection, no_confirm;
2558 { 2549 {
2559 if (!energize_connection || !energize_connection->conn) return Qnil; 2550 if (!energize_connection || !energize_connection->conn) return Qnil;
2560 2551
2561 CHECK_BUFFER (buffer); 2552 CHECK_BUFFER (buffer);
2562 CHECK_STRING (command); 2553 CHECK_STRING (command);
2568 return Qt; 2559 return Qt;
2569 } 2560 }
2570 2561
2571 /********************************* kill buffer interface ****************/ 2562 /********************************* kill buffer interface ****************/
2572 2563
2573 DEFUN ("energize-buffer-type-internal", 2564 DEFUN ("energize-buffer-type-internal", Fenergize_buffer_type, 1, 1, 0, /*
2574 Fenergize_buffer_type, Senergize_buffer_type,
2575 1, 1, 0 /*
2576 Return a symbol denoting the buffer type if buffer is an Energize 2565 Return a symbol denoting the buffer type if buffer is an Energize
2577 buffer, else it returns NIL. 2566 buffer, else it returns NIL.
2578 */ ) 2567 */
2579 (buffer) 2568 (buffer))
2580 Lisp_Object buffer;
2581 { 2569 {
2582 if (!energize_connection) return Qnil; 2570 if (!energize_connection) return Qnil;
2583 2571
2584 CHECK_BUFFER (buffer); 2572 CHECK_BUFFER (buffer);
2585 return get_buffer_type_for_emacs_buffer (buffer, energize_connection); 2573 return get_buffer_type_for_emacs_buffer (buffer, energize_connection);
2586 } 2574 }
2587 2575
2588 DEFUN ("set-energize-buffer-type-internal", 2576 DEFUN ("set-energize-buffer-type-internal", Fset_energize_buffer_type_internal, 2, 2, 0, /*
2589 Fset_energize_buffer_type_internal,
2590 Sset_energize_buffer_type_internal, 2, 2, 0 /*
2591 Return the type symbol which is the new buffer-type, if the buffer is 2577 Return the type symbol which is the new buffer-type, if the buffer is
2592 an Energize buffer and the type is non-NIL symbol, else it returns NIL. 2578 an Energize buffer and the type is non-NIL symbol, else it returns NIL.
2593 */ ) 2579 */
2594 (buffer, type) 2580 (buffer, type))
2595 Lisp_Object buffer, type;
2596 { 2581 {
2597 BufferInfo *binfo; 2582 BufferInfo *binfo;
2598 2583
2599 if (!energize_connection || (NILP (type))) return Qnil; 2584 if (!energize_connection || (NILP (type))) return Qnil;
2600 2585
2607 else 2592 else
2608 return 2593 return
2609 set_buffer_type_for_emacs_buffer (buffer, energize_connection, type); 2594 set_buffer_type_for_emacs_buffer (buffer, energize_connection, type);
2610 } 2595 }
2611 2596
2612 DEFUN ("energize-buffer-p", Fenergize_buffer_p, Senergize_buffer_p, 1, 1, 0 /* 2597 DEFUN ("energize-buffer-p", Fenergize_buffer_p, 1, 1, 0, /*
2613 Whether buffer is an Energize buffer. 2598 Whether buffer is an Energize buffer.
2614 */ ) 2599 */
2615 (buffer) 2600 (buffer))
2616 Lisp_Object buffer;
2617 { 2601 {
2618 BufferInfo *binfo; 2602 BufferInfo *binfo;
2619 2603
2620 if (!energize_connection) return Qnil; 2604 if (!energize_connection) return Qnil;
2621 2605
2625 return Qnil; 2609 return Qnil;
2626 else 2610 else
2627 return Qt; 2611 return Qt;
2628 } 2612 }
2629 2613
2630 DEFUN ("energize-buffer-id", Fenergize_buffer_id, Senergize_buffer_id, 1, 1, 0 /* 2614 DEFUN ("energize-buffer-id", Fenergize_buffer_id, 1, 1, 0, /*
2631 Return (high . low) if buffer is an Energize buffer, otherwise nil. 2615 Return (high . low) if buffer is an Energize buffer, otherwise nil.
2632 */ ) 2616 */
2633 (buffer) 2617 (buffer))
2634 Lisp_Object buffer;
2635 { 2618 {
2636 BufferInfo *binfo; 2619 BufferInfo *binfo;
2637 2620
2638 if (!energize_connection) return Qnil; 2621 if (!energize_connection) return Qnil;
2639 2622
2643 return Qnil; 2626 return Qnil;
2644 else 2627 else
2645 return word_to_lisp (binfo->id); 2628 return word_to_lisp (binfo->id);
2646 } 2629 }
2647 2630
2648 DEFUN ("energize-request-kill-buffer", Fenergize_request_kill_buffer, 2631 DEFUN ("energize-request-kill-buffer", Fenergize_request_kill_buffer, 1, 1, 0, /*
2649 Senergize_request_kill_buffer, 1, 1, 0 /*
2650 Sends a request to energize for killing buffer. 2632 Sends a request to energize for killing buffer.
2651 */ ) 2633 */
2652 (buffer) 2634 (buffer))
2653 Lisp_Object buffer;
2654 { 2635 {
2655 BufferInfo *binfo; 2636 BufferInfo *binfo;
2656 2637
2657 if (!energize_connection) return Qnil; 2638 if (!energize_connection) return Qnil;
2658 2639
3745 if (conn) 3726 if (conn)
3746 conn->readMethod = my_read; 3727 conn->readMethod = my_read;
3747 return conn; 3728 return conn;
3748 } 3729 }
3749 3730
3750 DEFUN ("handle-energize-request", Fhandle_energize_request, 3731 DEFUN ("handle-energize-request", Fhandle_energize_request, 2, 2, 0, /*
3751 Shandle_energize_request,
3752 2, 2, 0 /*
3753 Filter called when a request is available from Energize. 3732 Filter called when a request is available from Energize.
3754 */ ) 3733 */
3755 (proc, string) 3734 (proc, string))
3756 Lisp_Object proc, string;
3757 { 3735 {
3758 if (!NILP (string)) 3736 if (!NILP (string))
3759 CHECK_STRING (string); 3737 CHECK_STRING (string);
3760 3738
3761 if (!energize_connection || !energize_connection->conn) 3739 if (!energize_connection || !energize_connection->conn)
3835 flags & ~O_NDELAY) 3813 flags & ~O_NDELAY)
3836 == -1) 3814 == -1)
3837 #endif 3815 #endif
3838 abort (); 3816 abort ();
3839 3817
3840 XSETSUBR (fil, &Shandle_energize_request); 3818 XSETSUBR (fil, &SFhandle_energize_request);
3841 set_process_filter (lp, fil, 1); 3819 set_process_filter (lp, fil, 1);
3842 3820
3843 Venergize_kernel_busy = Qnil; 3821 Venergize_kernel_busy = Qnil;
3844 3822
3845 id1 = 0; 3823 id1 = 0;
3930 energize_connection = 0; 3908 energize_connection = 0;
3931 Venergize_process = Qnil; 3909 Venergize_process = Qnil;
3932 } 3910 }
3933 3911
3934 3912
3935 DEFUN ("connect-to-energize-internal", 3913 DEFUN ("connect-to-energize-internal", Fconnect_to_energize_internal, 0, 2, 0, /*
3936 Fconnect_to_energize_internal, Sconnect_to_energize_internal, 0, 2, 0 /*
3937 Usage: (connect-to-energize-internal <server-name> <energizearg>) 3914 Usage: (connect-to-energize-internal <server-name> <energizearg>)
3938 Energizearg representing two 32 bit Energize ids that will be passed 3915 Energizearg representing two 32 bit Energize ids that will be passed
3939 to the Energize server when opening the Energize connection. 3916 to the Energize server when opening the Energize connection.
3940 Only one connection can be open at a time. 3917 Only one connection can be open at a time.
3941 */ ) 3918 */
3942 3919 (server_name, energize_arg))
3943 (server_name, energize_arg)
3944 Lisp_Object server_name, energize_arg;
3945 { 3920 {
3946 unsigned char *server; 3921 unsigned char *server;
3947 unsigned char *arg; 3922 unsigned char *arg;
3948 3923
3949 if (!NILP (energize_arg)) 3924 if (!NILP (energize_arg))
3968 3943
3969 connect_to_energize ((char *)server, (char *)arg); 3944 connect_to_energize ((char *)server, (char *)arg);
3970 return Qnil; 3945 return Qnil;
3971 } 3946 }
3972 3947
3973 DEFUN ("close-connection-to-energize", Fclose_connection_to_energize, 3948 DEFUN ("close-connection-to-energize", Fclose_connection_to_energize, 0, 0, 0, /*
3974 Sclose_connection_to_energize, 0, 0, 0 /*
3975 Close the open Energize connection, if any. 3949 Close the open Energize connection, if any.
3976 */ ) 3950 */
3977 () 3951 ())
3978 { 3952 {
3979 if (!energize_connection) return Qnil; 3953 if (!energize_connection) return Qnil;
3980 3954
3981 close_energize_connection (); 3955 close_energize_connection ();
3982 return Qnil; 3956 return Qnil;
4124 if (!ext) return; 4098 if (!ext) return;
4125 set_extent_flags (extent, ext); 4099 set_extent_flags (extent, ext);
4126 set_extent_attributes_index (extent, ext); 4100 set_extent_attributes_index (extent, ext);
4127 } 4101 }
4128 4102
4129 DEFUN ("extent-to-generic-id", Fextent_to_generic_id, Sextent_to_generic_id, 4103 DEFUN ("extent-to-generic-id", Fextent_to_generic_id, 1, 1, 0, /*
4130 1, 1, 0 /*
4131 Return Energize ID of buffer of EXTENT. 4104 Return Energize ID of buffer of EXTENT.
4132 */ ) 4105 */
4133 (extent_obj) 4106 (extent_obj))
4134 Lisp_Object extent_obj;
4135 { 4107 {
4136 CHECK_EXTENT (extent_obj); 4108 CHECK_EXTENT (extent_obj);
4137 return word_to_lisp (energize_extent_data_id 4109 return word_to_lisp (energize_extent_data_id
4138 (energize_extent_data (XEXTENT (extent_obj)))); 4110 (energize_extent_data (XEXTENT (extent_obj))));
4139 } 4111 }
4363 binfo->emacs_buffer, 0, ME_END_CLOSED); 4335 binfo->emacs_buffer, 0, ME_END_CLOSED);
4364 } 4336 }
4365 4337
4366 /* Send the BufferModified events for the current buffer. 4338 /* Send the BufferModified events for the current buffer.
4367 * Handles both global buffer modified and extents modified. */ 4339 * Handles both global buffer modified and extents modified. */
4368 DEFUN ("energize-send-buffer-modified", Fenergize_send_buffer_modified, 4340 DEFUN ("energize-send-buffer-modified", Fenergize_send_buffer_modified, 3, 3, 0, /*
4369 Senergize_send_buffer_modified,
4370 3, 3, 0 /*
4371 Send a BufferModified request for the current buffer. 4341 Send a BufferModified request for the current buffer.
4372 */ ) 4342 */
4373 (state, from, to) 4343 (state, from, to))
4374 Lisp_Object state, from, to; /* dont use ANSI arglists in DEFUNs */
4375 { 4344 {
4376 int modifiedp = NILP (state)? 0 : 1; 4345 int modifiedp = NILP (state)? 0 : 1;
4377 Lisp_Object buffer; 4346 Lisp_Object buffer;
4378 BufferInfo *binfo; 4347 BufferInfo *binfo;
4379 Bufpos from_int = XINT (from); 4348 Bufpos from_int = XINT (from);
4420 } 4389 }
4421 } 4390 }
4422 return Qnil; 4391 return Qnil;
4423 } 4392 }
4424 4393
4425 DEFUN ("energize-barf-if-buffer-locked", Fenergize_barf_if_buffer_locked, 4394 DEFUN ("energize-barf-if-buffer-locked",
4426 Senergize_barf_if_buffer_locked, 0, 0, 0 /* 4395 Fenergize_barf_if_buffer_locked, 0, 0, 0, /*
4427 Error if the buffer is locked. 4396 Error if the buffer is locked.
4428 */ ) 4397 */
4429 () 4398 ())
4430 { 4399 {
4431 Lisp_Object buffer; 4400 Lisp_Object buffer;
4432 XSETBUFFER (buffer, current_buffer); 4401 XSETBUFFER (buffer, current_buffer);
4433 4402
4434 if (!energize_connection || !energize_connection->conn) 4403 if (!energize_connection || !energize_connection->conn)
4441 } 4410 }
4442 return Qnil; 4411 return Qnil;
4443 } 4412 }
4444 4413
4445 4414
4446 DEFUN ("energize-send-region", Fenergize_send_region, 4415 DEFUN ("energize-send-region", Fenergize_send_region, 2, 2, 0, /*
4447 Senergize_send_region,
4448 2, 2, 0 /*
4449 Send region as user input 4416 Send region as user input
4450 */ ) 4417 */
4451 (start, end) 4418 (start, end))
4452 Lisp_Object start, end;
4453 { 4419 {
4454 BufferInfo *binfo; 4420 BufferInfo *binfo;
4455 Lisp_Object b; 4421 Lisp_Object b;
4456 CEditorRequest *req; 4422 CEditorRequest *req;
4457 4423
4483 return Qnil; 4449 return Qnil;
4484 } 4450 }
4485 return Qnil; 4451 return Qnil;
4486 } 4452 }
4487 4453
4488 DEFUN ("connected-to-energize-p", Fconnected_to_energize_p, 4454 DEFUN ("connected-to-energize-p", Fconnected_to_energize_p, 0, 0, 0, /*
4489 Sconnected_to_energize_p,
4490 0, 0, 0 /*
4491 Return nil if no connection to Energize. 4455 Return nil if no connection to Energize.
4492 */ ) 4456 */
4493 () 4457 ())
4494 { 4458 {
4495 if (!energize_connection || 4459 if (!energize_connection ||
4496 !energize_connection->conn || 4460 !energize_connection->conn ||
4497 !energize_connection->binfo_hash || 4461 !energize_connection->binfo_hash ||
4498 !PROCESSP (energize_connection->proc)) 4462 !PROCESSP (energize_connection->proc))
4499 return Qnil; 4463 return Qnil;
4500 else 4464 else
4501 return Qt; 4465 return Qt;
4502 } 4466 }
4503 4467
4504 DEFUN ("energize-user-input-buffer-mark", Fenergize_user_input_buffer_mark, 4468 DEFUN ("energize-user-input-buffer-mark",
4505 Senergize_user_input_buffer_mark, 0, 1, 0 /* 4469 Fenergize_user_input_buffer_mark, 0, 1, 0, /*
4506 Return the mark associated to the given Energize buffer. 4470 Return the mark associated to the given Energize buffer.
4507 */ ) 4471 */
4508 (buffer) 4472 (buffer))
4509 Lisp_Object buffer;
4510 { 4473 {
4511 BufferInfo *binfo; 4474 BufferInfo *binfo;
4512 4475
4513 XSETBUFFER (buffer, decode_buffer (buffer, 0)); 4476 XSETBUFFER (buffer, decode_buffer (buffer, 0));
4514 if (!energize_connection) return Qnil; 4477 if (!energize_connection) return Qnil;
4588 CSHide, id, buffer_id, ""); 4551 CSHide, id, buffer_id, "");
4589 CWriteRequestBuffer (energize_connection->conn); 4552 CWriteRequestBuffer (energize_connection->conn);
4590 } 4553 }
4591 } 4554 }
4592 4555
4593 DEFUN ("energize-query-buffer", Fenergize_query_buffer, 4556 DEFUN ("energize-query-buffer", Fenergize_query_buffer, 1, 2, 0, /*
4594 Senergize_query_buffer, 1, 2, 0 /*
4595 Ask Energize to create a buffer containing the file filename. 4557 Ask Energize to create a buffer containing the file filename.
4596 Returns the buffer or NIL if Energize cannot create the buffer. 4558 Returns the buffer or NIL if Energize cannot create the buffer.
4597 If second argument just-ask is T, just ask if Energize 4559 If second argument just-ask is T, just ask if Energize
4598 already knows about the file and returns T if yes, NIL otherwise. 4560 already knows about the file and returns T if yes, NIL otherwise.
4599 */ ) 4561 */
4600 (filename, just_ask) 4562 (filename, just_ask))
4601 Lisp_Object filename, just_ask;
4602 { 4563 {
4603 struct Lisp_String *filename_str; 4564 struct Lisp_String *filename_str;
4604 CEditorRequest *creq; 4565 CEditorRequest *creq;
4605 char *dir_sep; 4566 char *dir_sep;
4606 struct reply_wait rw; 4567 struct reply_wait rw;
4643 else 4604 else
4644 return Qnil; 4605 return Qnil;
4645 } 4606 }
4646 4607
4647 4608
4648 DEFUN ("energize-protocol-level", Fenergize_protocol_level, 4609 DEFUN ("energize-protocol-level", Fenergize_protocol_level, 0, 0, 0, /*
4649 Senergize_protocol_level, 0, 0, 0 /*
4650 Return the Energize protocol level. 4610 Return the Energize protocol level.
4651 */ ) 4611 */
4652 () 4612 ())
4653 { 4613 {
4654 return 4614 return
4655 energize_connection 4615 energize_connection
4656 ? Fcons (make_int (energize_connection->major), 4616 ? Fcons (make_int (energize_connection->major),
4657 make_int (energize_connection->minor)) 4617 make_int (energize_connection->minor))
4658 : Qnil; 4618 : Qnil;
4659 } 4619 }
4660 4620
4661 4621
4662 DEFUN ("energize-psheets-visible-p", Fenergize_psheets_visible_p, 4622 DEFUN ("energize-psheets-visible-p", Fenergize_psheets_visible_p, 0, 1, 0, /*
4663 Senergize_psheets_visible_p, 0, 1, 0 /*
4664 Whether the (optional) frame currently has open psheets. 4623 Whether the (optional) frame currently has open psheets.
4665 */ ) 4624 */
4666 (frame) 4625 (frame))
4667 Lisp_Object frame;
4668 { 4626 {
4669 if (NILP (frame)) 4627 if (NILP (frame))
4670 XSETFRAME (frame, XFRAME(Fselected_frame(Qnil))); 4628 XSETFRAME (frame, XFRAME(Fselected_frame(Qnil)));
4671 CHECK_FRAME (frame); 4629 CHECK_FRAME (frame);
4672 if (FRAME_X_CURRENT_PSHEETS (XFRAME (frame))) 4630 if (FRAME_X_CURRENT_PSHEETS (XFRAME (frame)))
4673 return Qt; 4631 return Qt;
4674 return Qnil; 4632 return Qnil;
4675 } 4633 }
4676 4634
4677 DEFUN ("energize-buffer-has-psheets-p", Fenergize_buffer_has_psheets_p, 4635 DEFUN ("energize-buffer-has-psheets-p", Fenergize_buffer_has_psheets_p, 0, 1, 0, /*
4678 Senergize_buffer_has_psheets_p, 0, 1, 0 /*
4679 Whether the buffer has psheets associated with it. 4636 Whether the buffer has psheets associated with it.
4680 */ ) 4637 */
4681 (buf) 4638 (buf))
4682 Lisp_Object buf;
4683 { 4639 {
4684 int count; 4640 int count;
4685 if (NILP (buf)) 4641 if (NILP (buf))
4686 buf = Fcurrent_buffer (); 4642 buf = Fcurrent_buffer ();
4687 CHECK_BUFFER (buf); 4643 CHECK_BUFFER (buf);
4734 return Qnil; 4690 return Qnil;
4735 } 4691 }
4736 4692
4737 /* This function is invoked when the user clicks on the "sheet" button. 4693 /* This function is invoked when the user clicks on the "sheet" button.
4738 */ 4694 */
4739 DEFUN ("energize-toggle-psheet", Fenergize_toggle_psheet, 4695 DEFUN ("energize-toggle-psheet", Fenergize_toggle_psheet, 0, 0, "", /*
4740 Senergize_toggle_psheet, 0, 0, "" /* 4696
4741 4697 */
4742 */ ) 4698 ())
4743 ()
4744 { 4699 {
4745 struct frame *frame = XFRAME(Fselected_frame(Qnil)); 4700 struct frame *frame = XFRAME(Fselected_frame(Qnil));
4746 Lisp_Object buffer = Fwindow_buffer (Fselected_window (Qnil)); 4701 Lisp_Object buffer = Fwindow_buffer (Fselected_window (Qnil));
4747 if (EQ (buffer, desired_psheet_buffer (frame))) 4702 if (EQ (buffer, desired_psheet_buffer (frame)))
4748 make_psheets_desired (frame, Qnil); 4703 make_psheets_desired (frame, Qnil);
4993 return (editmode.ok != 0); 4948 return (editmode.ok != 0);
4994 } 4949 }
4995 4950
4996 extern LWLIB_ID new_lwlib_id (void); 4951 extern LWLIB_ID new_lwlib_id (void);
4997 4952
4998 DEFUN ("energize-edit-mode-prompt", Fenergize_edit_mode_prompt, 4953 DEFUN ("energize-edit-mode-prompt", Fenergize_edit_mode_prompt, 6, 6, 0, /*
4999 Senergize_edit_mode_prompt, 6, 6, 0 /* 4954
5000 4955 */
5001 */ ) 4956 (external, edit_mode, view_mode, other_text, window, split))
5002 (external, edit_mode, view_mode, other_text, window, split)
5003 Lisp_Object external, edit_mode, view_mode, other_text, window, split;
5004 { 4957 {
5005 int dbox_id; 4958 int dbox_id;
5006 struct frame *f = selected_frame (); 4959 struct frame *f = selected_frame ();
5007 widget_value *data; 4960 widget_value *data;
5008 Widget parent, dbox; 4961 Widget parent, dbox;
5236 replace))); 5189 replace)));
5237 } 5190 }
5238 } 5191 }
5239 5192
5240 5193
5241 DEFUN ("energize-search", Fenergize_search, Senergize_search, 0, 0, "" /* 5194 DEFUN ("energize-search", Fenergize_search, 0, 0, "", /*
5242 Pop up the search-and-replace dialog box. 5195 Pop up the search-and-replace dialog box.
5243 */ ) 5196 */
5244 () 5197 ())
5245 { 5198 {
5246 int dbox_id; 5199 int dbox_id;
5247 struct frame *f = selected_frame (); 5200 struct frame *f = selected_frame ();
5248 widget_value *data; 5201 widget_value *data;
5249 Widget parent, dbox; 5202 Widget parent, dbox;
5315 /*************** Definition of Emacs Lisp-callable functions ***************/ 5268 /*************** Definition of Emacs Lisp-callable functions ***************/
5316 5269
5317 void 5270 void
5318 syms_of_energize (void) 5271 syms_of_energize (void)
5319 { 5272 {
5320 defsubr (&Senergize_send_buffer_modified); 5273 DEFSUBR (Fenergize_send_buffer_modified);
5321 defsubr (&Senergize_list_menu); 5274 DEFSUBR (Fenergize_list_menu);
5322 defsubr (&Senergize_execute_menu_item); 5275 DEFSUBR (Fenergize_execute_menu_item);
5323 defsubr (&Senergize_execute_command_internal); 5276 DEFSUBR (Fenergize_execute_command_internal);
5324 defsubr (&Sconnect_to_energize_internal); 5277 DEFSUBR (Fconnect_to_energize_internal);
5325 defsubr (&Sconnected_to_energize_p); 5278 DEFSUBR (Fconnected_to_energize_p);
5326 defsubr (&Sclose_connection_to_energize); 5279 DEFSUBR (Fclose_connection_to_energize);
5327 defsubr (&Shandle_energize_request); 5280 DEFSUBR (Fhandle_energize_request);
5328 defsubr (&Senergize_buffer_p); 5281 DEFSUBR (Fenergize_buffer_p);
5329 defsubr (&Senergize_buffer_type); 5282 DEFSUBR (Fenergize_buffer_type);
5330 defsubr (&Sset_energize_buffer_type_internal); 5283 DEFSUBR (Fset_energize_buffer_type_internal);
5331 defsubr (&Senergize_buffer_id); 5284 DEFSUBR (Fenergize_buffer_id);
5332 defsubr (&Senergize_request_kill_buffer); 5285 DEFSUBR (Fenergize_request_kill_buffer);
5333 defsubr (&Senergize_send_region); 5286 DEFSUBR (Fenergize_send_region);
5334 defsubr (&Senergize_user_input_buffer_mark); 5287 DEFSUBR (Fenergize_user_input_buffer_mark);
5335 defsubr (&Senergize_update_menubar); 5288 DEFSUBR (Fenergize_update_menubar);
5336 defsubr (&Senergize_extent_menu_p); 5289 DEFSUBR (Fenergize_extent_menu_p);
5337 defsubr (&Senergize_query_buffer); 5290 DEFSUBR (Fenergize_query_buffer);
5338 defsubr (&Senergize_barf_if_buffer_locked); 5291 DEFSUBR (Fenergize_barf_if_buffer_locked);
5339 defsubr (&Senergize_psheets_visible_p); 5292 DEFSUBR (Fenergize_psheets_visible_p);
5340 defsubr (&Senergize_buffer_has_psheets_p); 5293 DEFSUBR (Fenergize_buffer_has_psheets_p);
5341 defsubr (&Senergize_toggle_psheet); 5294 DEFSUBR (Fenergize_toggle_psheet);
5342 defsubr (&Senergize_protocol_level); 5295 DEFSUBR (Fenergize_protocol_level);
5343 defsubr (&Senergize_edit_mode_prompt); 5296 DEFSUBR (Fenergize_edit_mode_prompt);
5344 defsubr (&Senergize_search); 5297 DEFSUBR (Fenergize_search);
5345 defsubr (&Sextent_to_generic_id); 5298 DEFSUBR (Fextent_to_generic_id);
5346 5299
5347 defsymbol (&Qenergize_create_buffer_hook, "energize-create-buffer-hook"); 5300 defsymbol (&Qenergize_create_buffer_hook, "energize-create-buffer-hook");
5348 defsymbol (&Qenergize_buffer_modified_hook, "energize-buffer-modified-hook"); 5301 defsymbol (&Qenergize_buffer_modified_hook, "energize-buffer-modified-hook");
5349 5302
5350 defsymbol (&Qenergize_kernel_busy, "energize-kernel-busy"); 5303 defsymbol (&Qenergize_kernel_busy, "energize-kernel-busy");