comparison src/energize.c @ 14:9ee227acff29 r19-15b90

Import from CVS: tag r19-15b90
author cvs
date Mon, 13 Aug 2007 08:48:42 +0200
parents 376386a54a3c
children 859a2309aef8
comparison
equal deleted inserted replaced
13:13c6d0aaafe5 14:9ee227acff29
720 720
721 if (SYMBOLP (type)) 721 if (SYMBOLP (type))
722 XSETSTRING (type, XSYMBOL (type)->name); 722 XSETSTRING (type, XSYMBOL (type)->name);
723 723
724 if (STRINGP (type)) 724 if (STRINGP (type))
725 type_string = (char *)string_data (XSTRING (type)); 725 type_string = (char *) XSTRING_DATA (type);
726 726
727 type_string = copy_string (type_string); 727 type_string = copy_string (type_string);
728 728
729 if (!type_string) return Qnil; 729 if (!type_string) return Qnil;
730 730
814 adjustment = 0, 814 adjustment = 0,
815 mapindex= 0; 815 mapindex= 0;
816 wchar_t *buf, t; 816 wchar_t *buf, t;
817 817
818 #ifdef SANITY_CHECK 818 #ifdef SANITY_CHECK
819 stderr_out ("rebuilding widechar map for %s\n", string_data (XSTRING (current_buffer->name))); 819 stderr_out ("rebuilding widechar map for %s\n", XSTRING_DATA (current_buffer->name));
820 #endif 820 #endif
821 821
822 /* #### this is not gonna compile. move_gap() is now a private function 822 /* #### this is not gonna compile. move_gap() is now a private function
823 inside of insdel.c and it should stay that way. */ 823 inside of insdel.c and it should stay that way. */
824 if (BUF_BEGV (current_buffer) < GPT && BUF_ZV (current_buffer) > GPT) 824 if (BUF_BEGV (current_buffer) < GPT && BUF_ZV (current_buffer) > GPT)
1609 } 1609 }
1610 1610
1611 /* make sure that pathname_directory ends with a '/', if it exists */ 1611 /* make sure that pathname_directory ends with a '/', if it exists */
1612 if (!NILP (pathname_directory)) 1612 if (!NILP (pathname_directory))
1613 { 1613 {
1614 Bufbyte *str = string_data (XSTRING (pathname_directory)); 1614 Bufbyte *str = XSTRING_DATA (pathname_directory);
1615 Bytecount size = string_length (XSTRING (pathname_directory)); 1615 Bytecount size = XSTRING_LENGTH (pathname_directory);
1616 if (str[size - 1] != '/') 1616 if (str[size - 1] != '/')
1617 { 1617 {
1618 Lisp_Object tmp = make_string (str, size + 1); 1618 Lisp_Object tmp = make_string (str, size + 1);
1619 set_string_byte (XSTRING (tmp), size, '/'); 1619 set_string_byte (XSTRING (tmp), size, '/');
1620 pathname_directory = tmp; 1620 pathname_directory = tmp;
1667 1667
1668 /* set buffer name */ 1668 /* set buffer name */
1669 if (!NILP (buffer_name)) 1669 if (!NILP (buffer_name))
1670 { 1670 {
1671 if (modifying_p 1671 if (modifying_p
1672 && strcmp ((char*)string_data (XSTRING (buffer_name)), 1672 && strcmp ((char*) XSTRING_DATA (buffer_name),
1673 (char*) 1673 (char*) XSTRING_DATA (XBUFFER (binfo->emacs_buffer)->name)))
1674 string_data (XSTRING (XBUFFER (binfo->emacs_buffer)->name))))
1675 rename_the_buffer (buffer_name); 1674 rename_the_buffer (buffer_name);
1676 } 1675 }
1677 1676
1678 if (modifying_p) 1677 if (modifying_p)
1679 { 1678 {
2108 cbu->nGeneric = 0; 2107 cbu->nGeneric = 0;
2109 2108
2110 /* file name */ 2109 /* file name */
2111 file_name = current_buffer->filename; 2110 file_name = current_buffer->filename;
2112 if (STRINGP (file_name)) 2111 if (STRINGP (file_name))
2113 CWriteVstring0 (conn, string_data (XSTRING (file_name))); 2112 CWriteVstring0 (conn, XSTRING_DATA (file_name));
2114 else 2113 else
2115 CWriteVstring0 (conn, ""); 2114 CWriteVstring0 (conn, "");
2116 CWriteVstring0 (conn, ""); /* directory name */ 2115 CWriteVstring0 (conn, ""); /* directory name */
2117 CWriteVstring0 (conn, ""); /* buffer name */ 2116 CWriteVstring0 (conn, ""); /* buffer name */
2118 2117
2136 #endif /* ENERGIZE_V2_HEADERS */ 2135 #endif /* ENERGIZE_V2_HEADERS */
2137 { 2136 {
2138 Lisp_Object string = make_string_from_buffer (current_buffer, 2137 Lisp_Object string = make_string_from_buffer (current_buffer,
2139 BUF_BEG (current_buffer), 2138 BUF_BEG (current_buffer),
2140 BUF_Z (current_buffer)); 2139 BUF_Z (current_buffer));
2141 CNeedOutputSize (conn, string_length (XSTRING (string)) + 9); 2140 CNeedOutputSize (conn, XSTRING_LENGTH (string) + 9);
2142 CWriteVstringLen (conn, string_data (XSTRING (string)), 2141 CWriteVstringLen (conn, XSTRING_DATA (string), XSTRING_LENGTH (string));
2143 string_length (XSTRING (string)));
2144 } 2142 }
2145 2143
2146 /* write the extents */ 2144 /* write the extents */
2147 bane.binfo = binfo; 2145 bane.binfo = binfo;
2148 bane.n_extents = 0; 2146 bane.n_extents = 0;
2317 conn->header->serial = ++request_serial_number; 2315 conn->header->serial = ++request_serial_number;
2318 conn->header->data = 0; 2316 conn->header->data = 0;
2319 if (STRINGP (selection)) 2317 if (STRINGP (selection))
2320 { 2318 {
2321 conn->header->data |= CEChasCharSelection; 2319 conn->header->data |= CEChasCharSelection;
2322 CWriteVstringLen (conn, string_data (XSTRING (selection)), 2320 CWriteVstringLen (conn, XSTRING_DATA (selection),
2323 string_length (XSTRING (selection))); 2321 XSTRING_LENGTH (selection));
2324 } 2322 }
2325 else if (VECTORP (selection)) 2323 else if (VECTORP (selection))
2326 { 2324 {
2327 int i; 2325 int i;
2328 EId data; 2326 EId data;
2348 Lisp_Object value = Fcdr (selection); 2346 Lisp_Object value = Fcdr (selection);
2349 if (EQ (type, intern ("ENERGIZE_OBJECT")) 2347 if (EQ (type, intern ("ENERGIZE_OBJECT"))
2350 && STRINGP (value)) 2348 && STRINGP (value))
2351 { 2349 {
2352 conn->header->data |= CEChasObjectSelection; 2350 conn->header->data |= CEChasObjectSelection;
2353 CWriteN (conn, char, string_data (XSTRING (value)), 2351 CWriteN (conn, char, XSTRING_DATA (value),
2354 string_length (XSTRING (value))); 2352 XSTRING_LENGTH (value));
2355 } 2353 }
2356 } 2354 }
2357 else if (!NILP (selection)) 2355 else if (!NILP (selection))
2358 error ("unrecognized energize selection"); 2356 error ("unrecognized energize selection");
2359 2357
2444 arg_name += 1; 2442 arg_name += 1;
2445 } 2443 }
2446 2444
2447 if (!NILP (only_name)) 2445 if (!NILP (only_name))
2448 { 2446 {
2449 if (!strcmp ((char*) string_data (XSTRING (only_name)), name)) 2447 if (!strcmp ((char*) XSTRING_DATA (only_name), name))
2450 { 2448 {
2451 if (NILP (item)) 2449 if (NILP (item))
2452 { 2450 {
2453 item = make_vector (5, Qnil); 2451 item = make_vector (5, Qnil);
2454 v = XVECTOR (item); 2452 v = XVECTOR (item);
2534 if (vector_length (v) != 4) 2532 if (vector_length (v) != 4)
2535 error ("Bad menu item to energize-execute-menu-item"); 2533 error ("Bad menu item to energize-execute-menu-item");
2536 2534
2537 /* ignore the flags for now */ 2535 /* ignore the flags for now */
2538 execute_energize_menu (buffer, extent_to_data (extent_obj), 2536 execute_energize_menu (buffer, extent_to_data (extent_obj),
2539 (char*)string_data (XSTRING (v->contents [0])), 2537 (char*) XSTRING_DATA (v->contents [0]),
2540 lisp_to_word (v->contents [1]), 2538 lisp_to_word (v->contents [1]),
2541 XINT (v->contents [3]), 2539 XINT (v->contents [3]),
2542 selection, 2540 selection,
2543 no_confirm); 2541 no_confirm);
2544 2542
2562 2560
2563 CHECK_BUFFER (buffer); 2561 CHECK_BUFFER (buffer);
2564 CHECK_STRING (command); 2562 CHECK_STRING (command);
2565 2563
2566 execute_energize_menu (buffer, extent_to_data (extent_obj), 2564 execute_energize_menu (buffer, extent_to_data (extent_obj),
2567 (char*)string_data (XSTRING (command)), 0, 0, selection, 2565 (char*) XSTRING_DATA (command), 0, 0, selection,
2568 no_confirm); 2566 no_confirm);
2569 2567
2570 return Qt; 2568 return Qt;
2571 } 2569 }
2572 2570
2691 2689
2692 #ifdef EMACS_BTL 2690 #ifdef EMACS_BTL
2693 { 2691 {
2694 char *execname = 2692 char *execname =
2695 (STRINGP (Vinvocation_directory))? 2693 (STRINGP (Vinvocation_directory))?
2696 ((char *) string_data (XSTRING (Vinvocation_directory))):0; 2694 ((char *) XSTRING_DATA (Vinvocation_directory)):0;
2697 2695
2698 switch (creq->type) 2696 switch (creq->type)
2699 { 2697 {
2700 case CLRInitBTL: 2698 case CLRInitBTL:
2701 cadillac_terminate_logging (); /* #### rename me */ 2699 cadillac_terminate_logging (); /* #### rename me */
3771 return make_int (0); 3769 return make_int (0);
3772 } 3770 }
3773 3771
3774 if (!NILP (string)) 3772 if (!NILP (string))
3775 add_in_connection_input_buffer (energize_connection->conn, 3773 add_in_connection_input_buffer (energize_connection->conn,
3776 (char *) string_data (XSTRING (string)), 3774 (char *) XSTRING_DATA (string),
3777 string_length (XSTRING (string))); 3775 XSTRING_LENGTH (string));
3778 3776
3779 return process_energize_request_1 (); 3777 return process_energize_request_1 ();
3780 } 3778 }
3781 3779
3782 3780
3949 unsigned char *arg; 3947 unsigned char *arg;
3950 3948
3951 if (!NILP (energize_arg)) 3949 if (!NILP (energize_arg))
3952 { 3950 {
3953 CHECK_STRING (energize_arg); 3951 CHECK_STRING (energize_arg);
3954 arg = string_data (XSTRING (energize_arg)); 3952 arg = XSTRING_DATA (energize_arg);
3955 } 3953 }
3956 else 3954 else
3957 arg = 0; 3955 arg = 0;
3958 3956
3959 if (!NILP (server_name)) 3957 if (!NILP (server_name))
3960 { 3958 {
3961 CHECK_STRING (server_name); 3959 CHECK_STRING (server_name);
3962 server = string_data (XSTRING (server_name)); 3960 server = XSTRING_DATA (server_name);
3963 } 3961 }
3964 else 3962 else
3965 server = 0; 3963 server = 0;
3966 3964
3967 /* since we are going ahead with this, make sure that we are 3965 /* since we are going ahead with this, make sure that we are
5086 } 5084 }
5087 lw_modify_all_widgets (dbox_id, data, True); 5085 lw_modify_all_widgets (dbox_id, data, True);
5088 5086
5089 data->name = "otherText"; 5087 data->name = "otherText";
5090 data->selected = 0; 5088 data->selected = 0;
5091 data->value = (char *) string_data (XSTRING (other_text)); 5089 data->value = (char *) XSTRING_DATA (other_text);
5092 data->enabled = (editmode.external == 3); 5090 data->enabled = (editmode.external == 3);
5093 lw_modify_all_widgets (dbox_id, data, True); 5091 lw_modify_all_widgets (dbox_id, data, True);
5094 5092
5095 data->name = "splitScreens"; 5093 data->name = "splitScreens";
5096 data->enabled = 1; 5094 data->enabled = 1;