Changeset 3674
- Timestamp:
- 04/10/05 08:38:44 (4 years ago)
- Files:
-
- branches/2.2/src/ChangeLog.Meadow (modified) (1 diff)
- branches/2.2/src/dispextern.h (modified) (24 diffs)
- branches/2.2/src/emacs.c (modified) (49 diffs)
- branches/2.2/src/fileio.c (modified) (78 diffs)
- branches/2.2/src/fontset.c (modified) (26 diffs)
- branches/2.2/src/keyboard.c (modified) (162 diffs)
- branches/2.2/src/keyboard.h (modified) (7 diffs)
- branches/2.2/src/mw32menu.c (modified) (2 diffs)
- branches/2.2/src/mw32term.c (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2.2/src/ChangeLog.Meadow
r3673 r3674 1 2005-04-10 MIYOSHI Masanori <miyoshi@meadowy.org> 2 3 * mw32term.c: Follow the change of `struct glyph_row' and `struct 4 glyph_string'. 5 6 * mw32menu.c (Fx_popup_menu): Use Fkeymap_prompt() instead of 7 map_prompt(). 8 9 * dispextern.h: Sync up with Emacs CVS HEAD. 10 11 * emacs.c: Ditto. 12 13 * fileio.c: Ditto. 14 15 * fontset.c: Ditto. 16 17 * keyboard.c: Ditto. 18 19 * keyboard.h: Ditto. 20 1 21 2005-04-09 MIYOSHI Masanori <miyoshi@meadowy.org> 2 22 branches/2.2/src/dispextern.h
r3621 r3674 1 1 /* Interface definitions for display code. 2 Copyright (C) 1985, 1993, 1994, 1997, 1998, 1999, 2000, 20012 Copyright (C) 1985,93,94,97,98,99, 2000,01,02,03, 2004, 2005 3 3 Free Software Foundation, Inc. 4 4 … … 73 73 #endif 74 74 75 #ifdef HAVE_CARBON75 #ifdef MAC_OS 76 76 #include "macgui.h" 77 77 typedef struct mac_display_info Display_Info; … … 115 115 116 116 /* Number of bits allocated to store fringe bitmap numbers. */ 117 #define FRINGE_ID_BITS 8117 #define FRINGE_ID_BITS 16 118 118 119 119 … … 134 134 #if GLYPH_DEBUG 135 135 #define IF_DEBUG(X) X 136 #define xassert(X) do {if (!(X)) abort ();} while (0)137 136 #else 138 137 #define IF_DEBUG(X) (void) 0 139 #define xassert(X) (void) 0140 138 #endif 139 140 /* Maybe move this inside the above `#ifdef GLYPH_DEBUG' for release. */ 141 #define xassert(X) do {if (!(X)) abort ();} while (0) 141 142 142 143 /* Macro for displaying traces of redisplay. If Emacs was compiled … … 364 365 unsigned glyph_not_available_p : 1; 365 366 366 #define FACE_ID_BITS 2 2367 #define FACE_ID_BITS 21 367 368 368 369 /* Face of the glyph. */ … … 720 721 unsigned left_user_fringe_bitmap : FRINGE_ID_BITS; 721 722 723 /* Right fringe bitmap number (enum fringe_bitmap_type). */ 724 unsigned right_user_fringe_bitmap : FRINGE_ID_BITS; 725 726 /* Left fringe bitmap number (enum fringe_bitmap_type). */ 727 unsigned left_fringe_bitmap : FRINGE_ID_BITS; 728 729 /* Right fringe bitmap number (enum fringe_bitmap_type). */ 730 unsigned right_fringe_bitmap : FRINGE_ID_BITS; 731 722 732 /* Face of the left fringe glyph. */ 723 733 unsigned left_user_fringe_face_id : FACE_ID_BITS; 724 734 725 /* Right fringe bitmap number (enum fringe_bitmap_type). */726 unsigned right_user_fringe_bitmap : FRINGE_ID_BITS;727 728 735 /* Face of the right fringe glyph. */ 729 736 unsigned right_user_fringe_face_id : FACE_ID_BITS; 730 737 731 /* Left fringe bitmap number (enum fringe_bitmap_type). */732 unsigned left_fringe_bitmap : FRINGE_ID_BITS;733 734 738 /* Face of the left fringe glyph. */ 735 739 unsigned left_fringe_face_id : FACE_ID_BITS; 736 737 /* Right fringe bitmap number (enum fringe_bitmap_type). */738 unsigned right_fringe_bitmap : FRINGE_ID_BITS;739 740 740 741 /* Face of the right fringe glyph. */ … … 749 750 screen. */ 750 751 unsigned enabled_p : 1; 751 752 /* Display this line in inverse video? Used for the mode line and753 menu bar lines. */754 unsigned inverse_p : 1;755 752 756 753 /* 1 means row displays a text line that is truncated on the left or … … 983 980 984 981 #define MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P(ROW) \ 985 ((ROW)->end.dpvec_index > =0 \982 ((ROW)->end.dpvec_index > 0 \ 986 983 || (ROW)->end.overlay_string_index >= 0 \ 987 984 || (ROW)->ends_in_middle_of_char_p) … … 995 992 996 993 #define MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P(ROW) \ 997 ((ROW)->start.dpvec_index > =0 \994 ((ROW)->start.dpvec_index > 0 \ 998 995 || (ROW)->starts_in_middle_of_char_p \ 999 996 || ((ROW)->start.overlay_string_index >= 0 \ … … 1131 1128 1132 1129 /* Characters to be drawn, and number of characters. */ 1133 XChar2b * pfcp;1130 XChar2b *char2b; 1134 1131 unsigned char *pstr; 1135 1132 int nchars; 1136 1133 int nbytes; 1137 /* Glyph Layout Information */1138 1134 int *pdx; 1139 1135 … … 1598 1594 }; 1599 1595 1596 #define MAX_FACE_ID ((1 << FACE_ID_BITS) - 1) 1600 1597 1601 1598 /* A cache of realized faces. Each frame has its own cache because … … 2104 2101 unsigned left_user_fringe_bitmap : FRINGE_ID_BITS; 2105 2102 2103 /* Right fringe bitmap number (enum fringe_bitmap_type). */ 2104 unsigned right_user_fringe_bitmap : FRINGE_ID_BITS; 2105 2106 2106 /* Face of the left fringe glyph. */ 2107 2107 unsigned left_user_fringe_face_id : FACE_ID_BITS; 2108 2109 /* Right fringe bitmap number (enum fringe_bitmap_type). */2110 unsigned right_user_fringe_bitmap : FRINGE_ID_BITS;2111 2108 2112 2109 /* Face of the right fringe glyph. */ … … 2294 2291 extern struct redisplay_interface *rif; 2295 2292 2296 /* Hook to call in estimate_mode_line_height. */2297 2298 extern int (* estimate_mode_line_height_hook) P_ ((struct frame *,2299 enum face_id));2300 2301 2293 2302 2294 /*********************************************************************** … … 2509 2501 TOOL_BAR_IMAGE_DISABLED_DESELECTED 2510 2502 }; 2511 2512 /* Non-zero means raise tool-bar buttons when the mouse moves over them. */2513 2514 extern int auto_raise_tool_bar_buttons_p;2515 2503 2516 2504 /* Margin around tool-bar buttons in pixels. */ … … 2639 2627 struct glyph_row *, 2640 2628 enum draw_glyphs_face)); 2629 extern int get_phys_cursor_geometry P_ ((struct window *, struct glyph_row *, 2630 struct glyph *, int *)); 2641 2631 extern void erase_phys_cursor P_ ((struct window *)); 2642 2632 extern void display_and_set_cursor P_ ((struct window *, … … 2673 2663 /* Defined in fringe.c */ 2674 2664 2675 int valid_fringe_bitmap_id_p (int);2665 int lookup_fringe_bitmap (Lisp_Object); 2676 2666 void draw_fringe_bitmap P_ ((struct window *, struct glyph_row *, int)); 2677 2667 void draw_row_fringe_bitmaps P_ ((struct window *, struct glyph_row *)); … … 2685 2675 #endif 2686 2676 2677 /* Defined in image.c */ 2678 2679 struct image_cache *make_image_cache P_ ((void)); 2680 void free_image_cache P_ ((struct frame *)); 2681 void clear_image_cache P_ ((struct frame *, int)); 2682 void forall_images_in_image_cache P_ ((struct frame *, 2683 void (*) P_ ((struct image *)))); 2684 int valid_image_p P_ ((Lisp_Object)); 2685 void prepare_image_for_display P_ ((struct frame *, struct image *)); 2686 int lookup_image P_ ((struct frame *, Lisp_Object)); 2687 2687 /* Defined in sysdep.c */ 2688 2688 … … 2707 2707 enum lface_attribute_index)); 2708 2708 void unload_color P_ ((struct frame *, unsigned long)); 2709 int f rame_update_line_height P_ ((struct frame *));2709 int face_font_available_p P_ ((struct frame *, Lisp_Object)); 2710 2710 int ascii_face_of_lisp_face P_ ((struct frame *, int)); 2711 2711 void prepare_face_for_display P_ ((struct frame *, struct face *)); … … 2723 2723 int face_at_string_position P_ ((struct window *, Lisp_Object, int, int, int, 2724 2724 int, int *, enum face_id, int)); 2725 int merge_faces P_ ((struct frame *, Lisp_Object, int, int)); 2725 2726 int compute_char_face P_ ((struct frame *, int, Lisp_Object)); 2726 2727 void free_all_realized_faces P_ ((Lisp_Object)); … … 2747 2748 #ifdef HAVE_WINDOW_SYSTEM 2748 2749 2749 void x_kill_gs_process P_ ((Pixmap, struct frame *));2750 2750 int x_screen_planes P_ ((struct frame *)); 2751 2751 void x_implicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object)); 2752 struct image_cache *make_image_cache P_ ((void)); 2753 void free_image_cache P_ ((struct frame *)); 2754 void clear_image_cache P_ ((struct frame *, int)); 2755 void forall_images_in_image_cache P_ ((struct frame *, 2756 void (*) P_ ((struct image *)))); 2757 int valid_image_p P_ ((Lisp_Object)); 2758 void prepare_image_for_display P_ ((struct frame *, struct image *)); 2759 int lookup_image P_ ((struct frame *, Lisp_Object)); 2752 2760 2753 extern Lisp_Object tip_frame; 2761 2754 extern Window tip_window; … … 2765 2758 extern void cancel_hourglass P_ ((void)); 2766 2759 extern int display_hourglass_p; 2760 2761 /* Returns the background color of IMG, calculating one heuristically if 2762 necessary. If non-zero, XIMG is an existing XImage object to use for 2763 the heuristic. */ 2764 2765 #define IMAGE_BACKGROUND(img, f, ximg) \ 2766 ((img)->background_valid \ 2767 ? (img)->background \ 2768 : image_background (img, f, ximg)) 2769 2770 /* Returns true if IMG has a `transparent' background, using heuristics 2771 to decide if necessary. If non-zero, MASK is an existing XImage 2772 object to use for the heuristic. */ 2773 2774 #define IMAGE_BACKGROUND_TRANSPARENT(img, f, mask) \ 2775 ((img)->background_transparent_valid \ 2776 ? (img)->background_transparent \ 2777 : image_background_transparent (img, f, mask)) 2767 2778 2768 2779 #endif /* HAVE_WINDOW_SYSTEM */ … … 2787 2798 Lisp_Object *, 2788 2799 int *, int *, int *, int *)); 2800 extern Lisp_Object marginal_area_string P_ ((struct window *, enum window_part, 2801 int *, int *, int *, 2802 Lisp_Object *, 2803 int *, int *, int *, int *)); 2789 2804 extern void redraw_frame P_ ((struct frame *)); 2790 2805 extern void redraw_garbaged_frames P_ ((void)); … … 2847 2862 extern void turn_off_highlight P_ ((void)); 2848 2863 extern void background_highlight P_ ((void)); 2849 extern void reassert_line_highlight P_ ((int, int));2850 2864 extern void clear_frame P_ ((void)); 2851 2865 extern void clear_end_of_line P_ ((int)); … … 2905 2919 2906 2920 #endif /* not DISPEXTERN_H_INCLUDED */ 2921 2922 /* arch-tag: c65c475f-1c1e-4534-8795-990b8509fd65 2923 (do not change this comment) */ branches/2.2/src/emacs.c
r3600 r3674 1 1 /* Fully extensible Emacs, running on Unix, intended for GNU. 2 Copyright (C) 1985, 86,87,93,94,95,97,98,1999,2001,02,03,20043 Free Software Foundation, Inc.2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999, 2001, 3 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 4 4 5 5 This file is part of GNU Emacs. … … 66 66 #include <sys/time.h> 67 67 #include <sys/resource.h> 68 #endif 69 70 #ifdef HAVE_PERSONALITY_LINUX32 71 #include <sys/personality.h> 68 72 #endif 69 73 … … 192 196 Tells GC how to save a copy of the stack. */ 193 197 char *stack_bottom; 198 199 /* The address where the heap starts (from the first sbrk (0) call). */ 200 static void *my_heap_start; 201 202 /* The gap between BSS end and heap start as far as we can tell. */ 203 static unsigned long heap_bss_diff; 204 205 /* If the gap between BSS end and heap start is larger than this we try to 206 work around it, and if that fails, output a warning in dump-emacs. */ 207 #define MAX_HEAP_BSS_DIFF (1024*1024) 208 194 209 195 210 #ifdef HAVE_WINDOW_SYSTEM … … 291 306 --fullwidth, -fw make the first frame wide as the screen\n\ 292 307 --geometry, -g GEOMETRY window geometry\n\ 293 --horizontal-scroll-bars, -hb enable horizontal scroll bars\n\294 308 --icon-type, -i use picture of gnu for Emacs icon\n\ 295 309 --iconic start Emacs in iconified state\n\ … … 329 343 void (*fatal_error_signal_hook) P_ ((void)); 330 344 345 #ifdef HAVE_GTK_AND_PTHREAD 346 /* When compiled with GTK and running under Gnome, multiple threads meay be 347 created. Keep track of our main thread to make sure signals are delivered 348 to it (see syssignal.h). */ 349 350 pthread_t main_thread; 351 #endif 352 331 353 332 354 #ifdef SIGUSR1 … … 337 359 struct input_event buf; 338 360 361 SIGNAL_THREAD_CHECK (sig); 339 362 bzero (&buf, sizeof buf); 340 363 buf.kind = USER_SIGNAL_EVENT; … … 352 375 struct input_event buf; 353 376 377 SIGNAL_THREAD_CHECK (sig); 354 378 bzero (&buf, sizeof buf); 355 379 buf.kind = USER_SIGNAL_EVENT; … … 366 390 int sig; 367 391 { 392 SIGNAL_THREAD_CHECK (sig); 368 393 fatal_error_code = sig; 369 394 signal (sig, SIG_DFL); … … 405 430 { 406 431 signal (sig, memory_warning_signal); 432 SIGNAL_THREAD_CHECK (sig); 407 433 408 434 malloc_warning ("Operating system warns that virtual memory is running low.\n"); … … 567 593 { 568 594 if (i == 0 || i > skip_args) 595 /* For the moment, we keep arguments as is in unibyte strings. 596 They are decoded in the function command-line after we know 597 locale-coding-system. */ 569 598 Vcommand_line_args 570 = Fcons (build_string (argv[i]), Vcommand_line_args); 599 = Fcons (make_unibyte_string (argv[i], strlen (argv[i])), 600 Vcommand_line_args); 571 601 } 572 602 … … 731 761 732 762 malloc_set_state (malloc_state_ptr); 763 #ifndef XMALLOC_OVERRUN_CHECK 733 764 free (malloc_state_ptr); 765 #endif 734 766 } 735 767 else 736 malloc_using_checking = getenv ("MALLOC_CHECK_") != NULL; 768 { 769 if (my_heap_start == 0) 770 my_heap_start = sbrk (0); 771 malloc_using_checking = getenv ("MALLOC_CHECK_") != NULL; 772 } 737 773 } 738 774 … … 745 781 #define REPORT_EMACS_BUG_PRETEST_ADDRESS "emacs-pretest-bug@gnu.org" 746 782 747 static void 748 print_version_and_exit () 783 /* This function is used to determine an address to which bug report should 784 be sent. */ 785 786 char * 787 bug_reporting_address () 749 788 { 750 Lisp_Object tem; 751 tem = Fsymbol_value (intern ("emacs-version")); 752 if (!STRINGP (tem)) 753 { 754 fprintf (stderr, "Invalid value of `emacs-version'\n"); 755 exit (1); 756 } 757 else 758 { 759 printf ("GNU Emacs %s\n", XSTRING (tem)->data); 760 printf ("Copyright (C) 2002 Free Software Foundation, Inc.\n"); 761 printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n"); 762 printf ("You may redistribute copies of Emacs\n"); 763 printf ("under the terms of the GNU General Public License.\n"); 764 printf ("For more information about these matters, "); 765 printf ("see the file named COPYING.\n"); 766 exit (0); 767 } 789 int count = 0; 790 Lisp_Object temp; 791 char *string; 792 793 temp = Fsymbol_value (intern ("emacs-version")); 794 795 /* When `emacs-version' is invalid, use normal address. */ 796 if (!STRINGP(temp)) 797 return REPORT_EMACS_BUG_ADDRESS; 798 799 string = SDATA (temp); 800 801 /* Count dots in `emacs-version'. */ 802 while (*string) 803 { 804 if (*string == '.') 805 count++; 806 string++; 807 } 808 809 /* When `emacs-version' has at least three dots, it is development or 810 pretest version of Emacs. */ 811 return count >= 3 ? REPORT_EMACS_BUG_PRETEST_ADDRESS : REPORT_EMACS_BUG_ADDRESS; 768 812 } 769 813 … … 795 839 #endif 796 840 int no_loadup = 0; 841 char *junk = 0; 797 842 #ifdef PDUMP 798 843 int print_version = 0; … … 805 850 #endif 806 851 852 #ifndef MEADOW 853 if (!initialized) 854 { 855 extern char my_endbss[]; 856 extern char *my_endbss_static; 857 858 if (my_heap_start == 0) 859 my_heap_start = sbrk (0); 860 861 heap_bss_diff = (char *)my_heap_start - max (my_endbss, my_endbss_static); 862 } 863 #endif 864 807 865 #ifdef LINUX_SBRK_BUG 808 866 __sbrk (1); … … 812 870 if (initialized) 813 871 run_time_remap (argv[0]); 872 #endif 873 874 #ifdef MAC_OSX 875 if (!initialized) 876 unexec_init_emacs_zone (); 814 877 #endif 815 878 … … 828 891 #ifdef PDUMP 829 892 print_version = 1; 830 #else 831 print_version_and_exit (); 832 #endif 833 } 893 #else /* not PDUMP */ 894 Lisp_Object tem; 895 tem = Fsymbol_value (intern ("emacs-version")); 896 if (!STRINGP (tem)) 897 { 898 fprintf (stderr, "Invalid value of `emacs-version'\n"); 899 exit (1); 900 } 901 else 902 { 903 printf ("GNU Emacs %s\n", SDATA (tem)); 904 printf ("Copyright (C) 2004 Free Software Foundation, Inc.\n"); 905 printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n"); 906 printf ("You may redistribute copies of Emacs\n"); 907 printf ("under the terms of the GNU General Public License.\n"); 908 printf ("For more information about these matters, "); 909 printf ("see the file named COPYING.\n"); 910 exit (0); 911 } 912 #endif /* not PDUMP */ 913 } 914 915 #ifdef HAVE_PERSONALITY_LINUX32 916 /* See if there is a gap between the end of BSS and the heap. 917 In that case, set personality and exec ourself again. */ 918 if (!initialized 919 && (strcmp (argv[argc-1], "dump") == 0 920 || strcmp (argv[argc-1], "bootstrap") == 0) 921 && heap_bss_diff > MAX_HEAP_BSS_DIFF) 922 { 923 if (! getenv ("EMACS_HEAP_EXEC")) 924 { 925 /* Set this so we only do this once. */ 926 putenv("EMACS_HEAP_EXEC=true"); 927 personality (PER_LINUX32); 928 execvp (argv[0], argv); 929 930 /* If the exec fails, try to dump anyway. */ 931 perror ("execvp"); 932 } 933 } 934 #endif /* HAVE_PERSONALITY_LINUX32 */ 834 935 835 936 #ifdef PDUMP … … 864 965 #endif /* NeXT */ 865 966 967 #ifdef MAC_OSX 968 /* Skip process serial number passed in the form -psn_x_y as 969 command-line argument. */ 970 if (argc > skip_args + 1 && strncmp (argv[skip_args+1], "-psn_", 5) == 0) 971 skip_args++; 972 #endif /* MAC_OSX */ 973 866 974 #ifdef VMS 867 975 /* If -map specified, map the data file in. */ 868 976 { 869 977 char *file; 870 if (argmatch (argv, argc, "-map", "--map-data", 3, & mapin_file, &skip_args))978 if (argmatch (argv, argc, "-map", "--map-data", 3, &file, &skip_args)) 871 979 mapin_data (file); 872 980 } … … 949 1057 free (realloc (malloc (4), 4)); 950 1058 1059 # ifndef SYNC_INPUT 951 1060 /* Arrange to disable interrupt input inside malloc etc. */ 952 1061 uninterrupt_malloc (); 1062 # endif /* not SYNC_INPUT */ 953 1063 #endif /* not SYSTEM_MALLOC */ 954 1064 955 #ifdef MSDOS 1065 #ifdef HAVE_GTK_AND_PTHREAD 1066 main_thread = pthread_self (); 1067 #endif /* HAVE_GTK_AND_PTHREAD */ 1068 1069 #if defined (MSDOS) || defined (WINDOWSNT) 956 1070 /* We do all file input/output as binary files. When we need to translate 957 1071 newlines, we do that manually. */ 958 1072 _fmode = O_BINARY; 959 1073 #endif /* MSDOS || WINDOWSNT */ 1074 1075 #ifdef MSDOS 960 1076 #if __DJGPP__ >= 2 961 1077 if (!isatty (fileno (stdin))) … … 1035 1151 /* Command line option --no-windows is deprecated and thus not mentioned 1036 1152 in the manual and usage informations. */ 1037 if (argmatch (argv, argc, "-nw", "--no-windows", 6, NULL, &skip_args)) 1153 if (argmatch (argv, argc, "-nw", "--no-window-system", 6, NULL, &skip_args) 1154 || argmatch (argv, argc, "-nw", "--no-windows", 6, NULL, &skip_args)) 1038 1155 inhibit_window_system = 1; 1039 1156 … … 1041 1158 noninteractive = 0; 1042 1159 if (argmatch (argv, argc, "-batch", "--batch", 5, NULL, &skip_args)) 1043 noninteractive = 1; 1160 { 1161 noninteractive = 1; 1162 Vundo_outer_limit = Qnil; 1163 } 1164 if (argmatch (argv, argc, "-script", "--script", 3, &junk, &skip_args)) 1165 { 1166 noninteractive = 1; /* Set batch mode. */ 1167 /* Convert --script to -l, un-skip it, and sort again so that -l will be 1168 handled in proper sequence. */ 1169 argv[skip_args - 1] = "-l"; 1170 skip_args -= 2; 1171 sort_args (argc, argv); 1172 } 1044 1173 1045 1174 /* Handle the --help option, which gives a usage message. */ 1046 1175 if (argmatch (argv, argc, "-help", "--help", 3, NULL, &skip_args)) 1047 1176 { 1048 printf (USAGE1, argv[0]); 1049 printf (USAGE2); 1177 printf (USAGE1, argv[0], USAGE2); 1178 printf (USAGE3); 1179 printf (USAGE4, bug_reporting_address ()); 1050 1180 exit (0); 1051 1181 } … … 1086 1216 if ( 1087 1217 #ifndef CANNOT_DUMP 1088 ! noninteractive 1089 || initialized 1218 ! noninteractive || initialized 1090 1219 #else 1091 1220 1 … … 1208 1337 work correctly before syms_of_textprop, syms_of_macfns, 1209 1338 syms_of_ccl, syms_of_fontset, syms_of_xterm, syms_of_search, 1210 syms_of_frame, mac_ initialize, and init_keyboard have already1339 syms_of_frame, mac_term_init, and init_keyboard have already 1211 1340 been called. */ 1212 1341 syms_of_textprop (); … … 1220 1349 syms_of_frame (); 1221 1350 1222 mac_ initialize ();1351 mac_term_init (build_string ("Mac"), NULL, NULL); 1223 1352 init_keyboard (); 1224 1353 #endif … … 1285 1414 /* --multibyte overrides EMACS_UNIBYTE. */ 1286 1415 if (argmatch (argv, argc, "-no-unibyte", "--no-unibyte", 4, NULL, &skip_args) 1287 || argmatch (argv, argc, "-multibyte", "--multibyte", 4, NULL, &skip_args)) 1416 || argmatch (argv, argc, "-multibyte", "--multibyte", 4, NULL, &skip_args) 1417 /* Ignore EMACS_UNIBYTE before dumping. */ 1418 || (!initialized && noninteractive)) 1288 1419 inhibit_unibyte = 1; 1289 1420 … … 1403 1534 1404 1535 #ifdef WINDOWSNT 1536 #ifndef MEADOW 1537 globals_of_w32 (); 1538 #endif 1405 1539 /* Initialize environment from registry settings. */ 1406 1540 init_environment (argv); 1407 init_ntproc (); /* must precede init_editfns */ 1541 init_ntproc (); /* must precede init_editfns. */ 1542 #endif 1543 1544 #ifdef HAVE_CARBON 1545 if (initialized) 1546 init_mac_osx_environment (); 1408 1547 #endif 1409 1548 … … 1522 1661 syms_of_xfns (); 1523 1662 syms_of_fontset (); 1663 #ifdef HAVE_X_SM 1664 syms_of_xsmfns (); 1665 #endif 1524 1666 #ifdef HAVE_X11 1525 1667 syms_of_xselect (); … … 1546 1688 syms_of_mw32mci (); 1547 1689 syms_of_fontset (); 1548 #else 1690 #else /* not MEADOW */ 1549 1691 #ifdef HAVE_NTGUI 1550 1692 syms_of_w32term (); … … 1556 1698 #endif /* not MEADOW */ 1557 1699 1700 #ifdef HAVE_CARBON 1701 syms_of_macterm (); 1702 syms_of_macfns (); 1703 syms_of_macmenu (); 1704 syms_of_fontset (); 1705 #endif /* HAVE_CARBON */ 1706 1558 1707 #ifdef SYMS_SYSTEM 1559 1708 SYMS_SYSTEM; … … 1574 1723 else 1575 1724 { 1725 /* Initialization that must be done even if the global variable 1726 initialized is non zero. */ 1576 1727 #ifdef PDUMP 1577 1728 reinit_syms_of_abbrev (); … … 1585 1736 reinit_syms_of_editfns (); 1586 1737 reinit_syms_of_insdel (); 1587 #ifdef HAVE_X_WINDOWS1588 reinit_syms_of_xfns ();1589 #ifdef HAVE_X111590 reinit_syms_of_xselect ();1591 #endif1592 #endif /* HAVE_X_WINDOWS */1593 1594 #ifndef HAVE_NTGUI1595 reinit_syms_of_xmenu ();1596 #endif1597 1738 1598 1739 #ifdef MEADOW … … 1602 1743 reinit_syms_of_mw32reg (); 1603 1744 reinit_syms_of_fontset (); 1604 #else 1745 #endif /* MEADOW */ 1746 1747 if (print_version) 1748 { 1749 printf (USAGE1, argv[0], USAGE2); 1750 printf (USAGE3); 1751 printf (USAGE4, bug_reporting_address ()); 1752 exit (0); 1753 } 1754 1755 #endif /* PDUMP */ 1756 1605 1757 #ifdef HAVE_NTGUI 1606 reinit_syms_of_w32fns (); 1607 reinit_syms_of_w32menu (); 1608 #endif /* HAVE_NTGUI */ 1609 #endif /* MEADOW */ 1610 1611 if (print_version) 1612 print_version_and_exit (); 1613 #endif /* PDUMP */ 1614 1615 #ifdef MEADOW 1616 #ifdef HAVE_NTGUI 1758 #ifndef MEADOW 1759 globals_of_w32fns (); 1760 #endif /* not MEADOW */ 1617 1761 globals_of_w32menu (); 1618 #endif /* HAVE_NTGUI */ 1619 #endif /* MEADOW */ 1762 #endif /* HAVE_NTGUI */ 1620 1763 } 1621 1764 … … 1634 1777 init_vmsproc (); /* And this too. */ 1635 1778 #endif /* VMS */ 1636 init_sys_modes (); /* Init system terminal modes (RAW or CBREAK, etc.) */ 1637 #ifdef HAVE_X_WINDOWS 1638 init_xfns (); 1639 #endif /* HAVE_X_WINDOWS */ 1779 init_sys_modes (); /* Init system terminal modes (RAW or CBREAK, etc.). */ 1640 1780 #ifdef MEADOW 1641 1781 init_mw32fns (); … … 1667 1807 Vtop_level = Fcons (intern ("load"), 1668 1808 Fcons (build_string (file), Qnil)); 1669 #ifdef CANNOT_DUMP1670 #ifdef SPECIAL_EXEC1671 Vtop_level = Fcons (intern ("load"),1672 Fcons (build_string ("cd-startup.el"), Qnil));1673 #else1674 1809 /* Unless next switch is -nl, load "loadup.el" first thing. */ 1675 1810 if (! no_loadup) 1676 1811 Vtop_level = Fcons (intern ("load"), 1677 1812 Fcons (build_string ("loadup.el"), Qnil)); 1678 #endif1679 #endif /* CANNOT_DUMP */1680 1813 } 1681 1814 … … 1780 1913 #endif 1781 1914 { "-t", "--terminal", 120, 1 }, 1915 { "-nw", "--no-window-system", 110, 0 }, 1782 1916 { "-nw", "--no-windows", 110, 0 }, 1783 1917 { "-batch", "--batch", 100, 0 }, 1918 { "-script", "--script", 100, 1 }, 1784 1919 { "-help", "--help", 90, 0 }, 1785 1920 { "-no-unibyte", "--no-unibyte", 83, 0 }, … … 1787 1922 { "-unibyte", "--unibyte", 81, 0 }, 1788 1923 { "-no-multibyte", "--no-multibyte", 80, 0 }, 1789 #ifdef CANNOT_DUMP1790 1924 { "-nl", "--no-loadup", 70, 0 }, 1791 #endif1792 1925 /* -d must come last before the options handled in startup.el. */ 1793 1926 { "-d", "--display", 60, 1 }, … … 1797 1930 { "-no-init-file", 0, 50, 0 }, 1798 1931 { "-no-site-file", "--no-site-file", 40, 0 }, 1932 { "-no-splash", "--no-splash", 40, 0 }, 1799 1933 { "-u", "--user", 30, 1 }, 1800 1934 { "-user", 0, 30, 1 }, … … 1814 1948 { "-fn", "--font", 10, 1 }, 1815 1949 { "-font", 0, 10, 1 }, 1950 { "-fs", "--fullscreen", 10, 0 }, 1951 { "-fw", "--fullwidth", 10, 0 }, 1952 { "-fh", "--fullheight", 10, 0 }, 1816 1953 { "-g", "--geometry", 10, 1 }, 1817 1954 { "-geometry", 0, 10, 1 }, … … 1825 1962 { "-hb", "--horizontal-scroll-bars", 5, 0 }, 1826 1963 { "-vb", "--vertical-scroll-bars", 5, 0 }, 1964 { "-color", "--color", 5, 0}, 1827 1965 /* These have the same priority as ordinary file name args, 1828 1966 so they are not reordered with respect to those. */ … … 1994 2132 bcopy (new, argv, sizeof (char *) * argc); 1995 2133 1996 free (options);1997 free (new);1998 free (priority);2134 xfree (options); 2135 xfree (new); 2136 xfree (priority); 1999 2137 } 2000 2138 … … 2070 2208 Vrun_hooks = Qnil; 2071 2209 2072 /* If we are controlling the terminal, reset terminal modes */ 2210 /* Don't update display from now on. */ 2211 Vinhibit_redisplay = Qt; 2212 2213 /* If we are controlling the terminal, reset terminal modes. */ 2073 2214 #ifdef EMACS_HAVE_TTY_PGRP 2074 2215 { … … 2107 2248 /* It's not safe to call intern here. Maybe we are crashing. */ 2108 2249 if (!noninteractive && SYMBOLP (Vwindow_system) 2109 && XSYMBOL (Vwindow_system)->name->size== 12110 && XSYMBOL (Vwindow_system)->name->data[0]== 'x'2250 && SCHARS (SYMBOL_NAME (Vwindow_system)) == 1 2251 && SREF (SYMBOL_NAME (Vwindow_system), 0) == 'x' 2111 2252 && ! no_x) 2112 2253 Fx_close_current_connection (); … … 2153 2294 Lisp_Object tem; 2154 2295 2296 check_pure_size (); 2155 2297 CHECK_STRING (filename); 2156 2298 filename = Fexpand_file_name (filename, Qnil); … … 2188 2330 int count = SPECPDL_INDEX (); 2189 2331 2332 check_pure_size (); 2333 2190 2334 if (! noninteractive) 2191 2335 error ("Dumping Emacs works only in batch mode"); 2336 2337 #ifdef __linux__ 2338 if (heap_bss_diff > MAX_HEAP_BSS_DIFF) 2339 { 2340 fprintf (stderr, "**************************************************\n"); 2341 fprintf (stderr, "Warning: Your system has a gap between BSS and the\n"); 2342 fprintf (stderr, "heap (%lu byte). This usually means that exec-shield\n", 2343 heap_bss_diff); 2344 fprintf (stderr, "or something similar is in effect. The dump may\n"); 2345 fprintf (stderr, "fail because of this. See the section about \n"); 2346 fprintf (stderr, "exec-shield in etc/PROBLEMS for more information.\n"); 2347 fprintf (stderr, "**************************************************\n"); 2348 } 2349 #endif /* __linux__ */ 2192 2350 2193 2351 /* Bind `command-line-processed' to nil before dumping, … … 2223 2381 fflush (stdout); 2224 2382 #ifdef VMS 2225 mapout_data ( XSTRING (filename)->data);2226 #else /* VMS */2227 /* Tell malloc where start of impure now is */2383 mapout_data (SDATA (filename)); 2384 #else 2385 /* Tell malloc where start of impure now is. */ 2228 2386 /* Also arrange for warnings when nearly out of space. */ 2229 2387 #ifndef SYSTEM_MALLOC … … 2233 2391 memory_warnings (my_edata, malloc_warning); 2234 2392 #endif /* not WINDOWSNT */ 2235 #endif /* not SYSTEM_MALLOC */ 2393 #endif 2394 #if !defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) && !defined SYNC_INPUT 2395 /* Pthread may call malloc before main, and then we will get an endless 2396 loop, because pthread_self (see alloc.c) calls malloc the first time 2397 it is called on some systems. */ 2398 reset_malloc_hooks (); 2399 #endif 2236 2400 #ifdef PDUMP 2237 2401 pdump (); 2238 /* copy temacs -> emacs */ 2239 #ifndef WINDOWSNT 2240 { 2241 printf ("copying temacs -> emacs\n"); 2242 Fadd_name_to_file (build_string ("temacs"), build_string ("emacs"), Qt); 2243 } 2244 #else /* WINDOWSNT */ 2402 #ifdef WINDOWSNT 2245 2403 { 2246 2404 char temacs_exe[MAX_PATH]; … … 2266 2424 #ifdef DOUG_LEA_MALLOC 2267 2425 malloc_state_ptr = malloc_get_state (); 2268 #endif /* DOUG_LEA_MALLOC */2426 #endif 2269 2427 2270 2428 #ifdef USE_MMAP_FOR_BUFFERS 2271 2429 mmap_set_vars (0); 2272 #endif /* USE_MMAP_FOR_BUFFERS */2273 unexec ( XSTRING (filename)->data,2274 !NILP (symfile) ? XSTRING (symfile)->data: 0, my_edata, 0, 0);2430 #endif 2431 unexec (SDATA (filename), 2432 !NILP (symfile) ? SDATA (symfile) : 0, my_edata, 0, 0); 2275 2433 #ifdef USE_MMAP_FOR_BUFFERS 2276 2434 mmap_set_vars (1); 2277 #endif /* USE_MMAP_FOR_BUFFERS */2435 #endif 2278 2436 #ifdef DOUG_LEA_MALLOC 2279 2437 free (malloc_state_ptr); 2280 #endif /* DOUG_LEA_MALLOC */2438 #endif 2281 2439 #endif /* not PDUMP */ 2282 2440 #endif /* not VMS */ … … 2313 2471 *plocale = desired_locale; 2314 2472 setlocale (category, (STRINGP (desired_locale) 2315 ? (char *) (XSTRING (desired_locale)->data)2473 ? (char *) SDATA (desired_locale) 2316 2474 : "")); 2317 2475 } … … 2430 2588 2431 2589 DEFVAR_LISP ("system-type", &Vsystem_type, 2432 doc: /* Value is symbol indicating type of operating system you are using. */); 2590 + doc: /* Value is symbol indicating type of operating system you are using. 2591 +Special values: 2592 + `gnu/linux' compiled for a GNU/Linux system. 2593 + `darwin' compiled for Darwin (GNU-Darwin, Mac OS X, ...). 2594 + `macos' compiled for Mac OS 9. 2595 + `ms-dos' compiled as an MS-DOS application. 2596 + `windows-nt' compiled as a native W32 application. 2597 + `cygwin' compiled using the Cygwin library. 2598 + `vax-vms' or `axp-vms': compiled for a (Open)VMS system. 2599 +Anything else indicates some sort of Unix system. */); 2433 2600 Vsystem_type = intern (SYSTEM_TYPE); 2434 2601 … … 2507 2674 Vprevious_system_time_locale = Qnil; 2508 2675 } 2676 2677 /* arch-tag: 7bfd356a-c720-4612-8ab6-aa4222931c2e 2678 (do not change this comment) */ branches/2.2/src/fileio.c
r3671 r3674 142 142 #include "commands.h" 143 143 extern int use_dialog_box; 144 #if 0145 144 extern int use_file_dialog; 146 #endif147 145 148 146 #ifndef O_WRONLY … … 183 181 Lisp_Object Vfile_name_handler_alist; 184 182 185 /* Format for auto-save files */186 Lisp_Object Vauto_save_file_format;187 188 183 /* Lisp functions for translating file formats */ 189 184 Lisp_Object Qformat_decode, Qformat_annotate_function; … … 240 235 241 236 extern int minibuffer_auto_raise; 237 238 extern int history_delete_duplicates; 242 239 243 240 /* These variables describe handlers that have "already" had a chance … … 357 354 { 358 355 /* This function must not munge the match data. */ 359 Lisp_Object chain, inhibited_handlers; 360 356 Lisp_Object chain, inhibited_handlers, result; 357 int pos = -1; 358 359 result = Qnil; 361 360 CHECK_STRING (filename); 362 361 … … 374 373 { 375 374 Lisp_Object string; 375 int match_pos; 376 376 string = XCAR (elt); 377 if (STRINGP (string) && fast_string_match (string, filename) >= 0) 377 if (STRINGP (string) 378 && (match_pos = fast_string_match (string, filename)) > pos) 378 379 { 379 380 Lisp_Object handler, tem; … … 382 383 tem = Fmemq (handler, inhibited_handlers); 383 384 if (NILP (tem)) 384 return handler; 385 { 386 result = handler; 387 pos = match_pos; 388 } 385 389 } 386 390 } … … 388 392 QUIT; 389 393 } 390 return Qnil;394 return result; 391 39
