Changeset 3674

Show
Ignore:
Timestamp:
04/10/05 08:38:44 (4 years ago)
Author:
miyoshi
Message:

* mw32term.c: Follow the change of struct glyph_row' and struct
glyph_string'.

* mw32menu.c (Fx_popup_menu): Use Fkeymap_prompt() instead of
map_prompt().

* dispextern.h: Sync up with Emacs CVS HEAD.

* emacs.c: Ditto.

* fileio.c: Ditto.

* fontset.c: Ditto.

* keyboard.c: Ditto.

* keyboard.h: Ditto.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.2/src/ChangeLog.Meadow

    r3673 r3674  
     12005-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 
    1212005-04-09  MIYOSHI Masanori  <miyoshi@meadowy.org> 
    222 
  • branches/2.2/src/dispextern.h

    r3621 r3674  
    11/* Interface definitions for display code. 
    2    Copyright (C) 1985, 1993, 1994, 1997, 1998, 1999, 2000, 2001 
     2   Copyright (C) 1985,93,94,97,98,99, 2000,01,02,03, 2004, 2005 
    33     Free Software Foundation, Inc. 
    44 
     
    7373#endif 
    7474 
    75 #ifdef HAVE_CARBON 
     75#ifdef MAC_OS 
    7676#include "macgui.h" 
    7777typedef struct mac_display_info Display_Info; 
     
    115115 
    116116/* Number of bits allocated to store fringe bitmap numbers.  */ 
    117 #define FRINGE_ID_BITS  8 
     117#define FRINGE_ID_BITS  16 
    118118 
    119119 
     
    134134#if GLYPH_DEBUG 
    135135#define IF_DEBUG(X)     X 
    136 #define xassert(X)      do {if (!(X)) abort ();} while (0) 
    137136#else 
    138137#define IF_DEBUG(X)     (void) 0 
    139 #define xassert(X)      (void) 0 
    140138#endif 
     139 
     140/* Maybe move this inside the above `#ifdef GLYPH_DEBUG' for release.  */ 
     141#define xassert(X)      do {if (!(X)) abort ();} while (0) 
    141142 
    142143/* Macro for displaying traces of redisplay.  If Emacs was compiled 
     
    364365  unsigned glyph_not_available_p : 1; 
    365366 
    366 #define FACE_ID_BITS    22 
     367#define FACE_ID_BITS    21 
    367368 
    368369  /* Face of the glyph.  */ 
     
    720721  unsigned left_user_fringe_bitmap : FRINGE_ID_BITS; 
    721722 
     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 
    722732  /* Face of the left fringe glyph.  */ 
    723733  unsigned left_user_fringe_face_id : FACE_ID_BITS; 
    724734 
    725   /* Right fringe bitmap number (enum fringe_bitmap_type).  */ 
    726   unsigned right_user_fringe_bitmap : FRINGE_ID_BITS; 
    727  
    728735  /* Face of the right fringe glyph.  */ 
    729736  unsigned right_user_fringe_face_id : FACE_ID_BITS; 
    730737 
    731   /* Left fringe bitmap number (enum fringe_bitmap_type).  */ 
    732   unsigned left_fringe_bitmap : FRINGE_ID_BITS; 
    733  
    734738  /* Face of the left fringe glyph.  */ 
    735739  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; 
    739740 
    740741  /* Face of the right fringe glyph.  */ 
     
    749750     screen.  */ 
    750751  unsigned enabled_p : 1; 
    751  
    752   /* Display this line in inverse video?  Used for the mode line and 
    753      menu bar lines.  */ 
    754   unsigned inverse_p : 1; 
    755752 
    756753  /* 1 means row displays a text line that is truncated on the left or 
     
    983980 
    984981#define MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P(ROW)        \ 
    985      ((ROW)->end.dpvec_index >= 0                     \ 
     982     ((ROW)->end.dpvec_index > 0                      \ 
    986983      || (ROW)->end.overlay_string_index >= 0           \ 
    987984      || (ROW)->ends_in_middle_of_char_p) 
     
    995992 
    996993#define MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P(ROW)      \ 
    997      ((ROW)->start.dpvec_index >= 0                   \ 
     994     ((ROW)->start.dpvec_index > 0                    \ 
    998995      || (ROW)->starts_in_middle_of_char_p              \ 
    999996      || ((ROW)->start.overlay_string_index >= 0        \ 
     
    11311128 
    11321129  /* Characters to be drawn, and number of characters.  */ 
    1133   XChar2b *pfcp
     1130  XChar2b *char2b
    11341131  unsigned char *pstr; 
    11351132  int nchars; 
    11361133  int nbytes; 
    1137   /* Glyph Layout Information */ 
    11381134  int *pdx; 
    11391135 
     
    15981594}; 
    15991595 
     1596#define MAX_FACE_ID  ((1 << FACE_ID_BITS) - 1) 
    16001597 
    16011598/* A cache of realized faces.  Each frame has its own cache because 
     
    21042101  unsigned left_user_fringe_bitmap : FRINGE_ID_BITS; 
    21052102 
     2103  /* Right fringe bitmap number (enum fringe_bitmap_type).  */ 
     2104  unsigned right_user_fringe_bitmap : FRINGE_ID_BITS; 
     2105 
    21062106  /* Face of the left fringe glyph.  */ 
    21072107  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; 
    21112108 
    21122109  /* Face of the right fringe glyph.  */ 
     
    22942291extern struct redisplay_interface *rif; 
    22952292 
    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  
    23012293  
    23022294/*********************************************************************** 
     
    25092501  TOOL_BAR_IMAGE_DISABLED_DESELECTED 
    25102502}; 
    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; 
    25152503 
    25162504/* Margin around tool-bar buttons in pixels.  */ 
     
    26392627                                          struct glyph_row *, 
    26402628                                          enum draw_glyphs_face)); 
     2629extern int get_phys_cursor_geometry P_ ((struct window *, struct glyph_row *, 
     2630                                         struct glyph *, int *)); 
    26412631extern void erase_phys_cursor P_ ((struct window *)); 
    26422632extern void display_and_set_cursor P_ ((struct window *, 
     
    26732663/* Defined in fringe.c */ 
    26742664 
    2675 int valid_fringe_bitmap_id_p (int); 
     2665int lookup_fringe_bitmap (Lisp_Object); 
    26762666void draw_fringe_bitmap P_ ((struct window *, struct glyph_row *, int)); 
    26772667void draw_row_fringe_bitmaps P_ ((struct window *, struct glyph_row *)); 
     
    26852675#endif 
    26862676 
     2677/* Defined in image.c */ 
     2678 
     2679struct image_cache *make_image_cache P_ ((void)); 
     2680void free_image_cache P_ ((struct frame *)); 
     2681void clear_image_cache P_ ((struct frame *, int)); 
     2682void forall_images_in_image_cache P_ ((struct frame *, 
     2683                                       void (*) P_ ((struct image *)))); 
     2684int valid_image_p P_ ((Lisp_Object)); 
     2685void prepare_image_for_display P_ ((struct frame *, struct image *)); 
     2686int lookup_image P_ ((struct frame *, Lisp_Object)); 
    26872687/* Defined in sysdep.c */ 
    26882688 
     
    27072707                              enum lface_attribute_index)); 
    27082708void unload_color P_ ((struct frame *, unsigned long)); 
    2709 int frame_update_line_height P_ ((struct frame *)); 
     2709int face_font_available_p P_ ((struct frame *, Lisp_Object)); 
    27102710int ascii_face_of_lisp_face P_ ((struct frame *, int)); 
    27112711void prepare_face_for_display P_ ((struct frame *, struct face *)); 
     
    27232723int face_at_string_position P_ ((struct window *, Lisp_Object, int, int, int, 
    27242724                                 int, int *, enum face_id, int)); 
     2725int merge_faces P_ ((struct frame *, Lisp_Object, int, int)); 
    27252726int compute_char_face P_ ((struct frame *, int, Lisp_Object)); 
    27262727void free_all_realized_faces P_ ((Lisp_Object)); 
     
    27472748#ifdef HAVE_WINDOW_SYSTEM 
    27482749 
    2749 void x_kill_gs_process P_ ((Pixmap, struct frame *)); 
    27502750int x_screen_planes P_ ((struct frame *)); 
    27512751void 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 
    27602753extern Lisp_Object tip_frame; 
    27612754extern Window tip_window; 
     
    27652758extern void cancel_hourglass P_ ((void)); 
    27662759extern 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)) 
    27672778 
    27682779#endif /* HAVE_WINDOW_SYSTEM */ 
     
    27872798                                         Lisp_Object *, 
    27882799                                         int *, int *, int *, int *)); 
     2800extern Lisp_Object marginal_area_string P_ ((struct window *, enum window_part, 
     2801                                             int *, int *, int *, 
     2802                                             Lisp_Object *, 
     2803                                             int *, int *, int *, int *)); 
    27892804extern void redraw_frame P_ ((struct frame *)); 
    27902805extern void redraw_garbaged_frames P_ ((void)); 
     
    28472862extern void turn_off_highlight P_ ((void)); 
    28482863extern void background_highlight P_ ((void)); 
    2849 extern void reassert_line_highlight P_ ((int, int)); 
    28502864extern void clear_frame P_ ((void)); 
    28512865extern void clear_end_of_line P_ ((int)); 
     
    29052919 
    29062920#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  
    11/* Fully extensible Emacs, running on Unix, intended for GNU. 
    2    Copyright (C) 1985,86,87,93,94,95,97,98,1999,2001,02,03,2004 
    3       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. 
    44 
    55This file is part of GNU Emacs. 
     
    6666#include <sys/time.h> 
    6767#include <sys/resource.h> 
     68#endif 
     69 
     70#ifdef HAVE_PERSONALITY_LINUX32 
     71#include <sys/personality.h> 
    6872#endif 
    6973 
     
    192196   Tells GC how to save a copy of the stack.  */ 
    193197char *stack_bottom; 
     198 
     199/* The address where the heap starts (from the first sbrk (0) call).  */ 
     200static void *my_heap_start; 
     201 
     202/* The gap between BSS end and heap start as far as we can tell.  */ 
     203static 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 
    194209 
    195210#ifdef HAVE_WINDOW_SYSTEM 
     
    291306--fullwidth, -fw                make the first frame wide as the screen\n\ 
    292307--geometry, -g GEOMETRY         window geometry\n\ 
    293 --horizontal-scroll-bars, -hb   enable horizontal scroll bars\n\ 
    294308--icon-type, -i                 use picture of gnu for Emacs icon\n\ 
    295309--iconic                        start Emacs in iconified state\n\ 
     
    329343void (*fatal_error_signal_hook) P_ ((void)); 
    330344 
     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 
     350pthread_t main_thread; 
     351#endif 
     352 
    331353 
    332354#ifdef SIGUSR1 
     
    337359  struct input_event buf; 
    338360 
     361  SIGNAL_THREAD_CHECK (sig); 
    339362  bzero (&buf, sizeof buf); 
    340363  buf.kind = USER_SIGNAL_EVENT; 
     
    352375  struct input_event buf; 
    353376 
     377  SIGNAL_THREAD_CHECK (sig); 
    354378  bzero (&buf, sizeof buf); 
    355379  buf.kind = USER_SIGNAL_EVENT; 
     
    366390     int sig; 
    367391{ 
     392  SIGNAL_THREAD_CHECK (sig); 
    368393  fatal_error_code = sig; 
    369394  signal (sig, SIG_DFL); 
     
    405430{ 
    406431  signal (sig, memory_warning_signal); 
     432  SIGNAL_THREAD_CHECK (sig); 
    407433 
    408434  malloc_warning ("Operating system warns that virtual memory is running low.\n"); 
     
    567593    { 
    568594      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.  */ 
    569598        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); 
    571601    } 
    572602 
     
    731761 
    732762      malloc_set_state (malloc_state_ptr); 
     763#ifndef XMALLOC_OVERRUN_CHECK 
    733764      free (malloc_state_ptr); 
     765#endif 
    734766    } 
    735767  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    } 
    737773} 
    738774 
     
    745781#define REPORT_EMACS_BUG_PRETEST_ADDRESS "emacs-pretest-bug@gnu.org" 
    746782 
    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 
     786char * 
     787bug_reporting_address () 
    749788{ 
    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; 
    768812} 
    769813 
     
    795839#endif 
    796840  int no_loadup = 0; 
     841  char *junk = 0; 
    797842#ifdef PDUMP 
    798843  int print_version = 0; 
     
    805850#endif 
    806851 
     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 
    807865#ifdef LINUX_SBRK_BUG 
    808866  __sbrk (1); 
     
    812870  if (initialized) 
    813871    run_time_remap (argv[0]); 
     872#endif 
     873 
     874#ifdef MAC_OSX 
     875  if (!initialized) 
     876    unexec_init_emacs_zone (); 
    814877#endif 
    815878 
     
    828891#ifdef PDUMP 
    829892      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 */ 
    834935 
    835936#ifdef PDUMP 
     
    864965#endif /* NeXT */ 
    865966 
     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 
    866974#ifdef VMS 
    867975  /* If -map specified, map the data file in.  */ 
    868976  { 
    869977    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)) 
    871979      mapin_data (file); 
    872980  } 
     
    9491057  free (realloc (malloc (4), 4)); 
    9501058 
     1059# ifndef SYNC_INPUT 
    9511060  /* Arrange to disable interrupt input inside malloc etc.  */ 
    9521061  uninterrupt_malloc (); 
     1062# endif /* not SYNC_INPUT */ 
    9531063#endif  /* not SYSTEM_MALLOC */ 
    9541064 
    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) 
    9561070  /* We do all file input/output as binary files.  When we need to translate 
    9571071     newlines, we do that manually.  */ 
    9581072  _fmode = O_BINARY; 
    959  
     1073#endif /* MSDOS || WINDOWSNT */ 
     1074 
     1075#ifdef MSDOS 
    9601076#if __DJGPP__ >= 2 
    9611077  if (!isatty (fileno (stdin))) 
     
    10351151  /* Command line option --no-windows is deprecated and thus not mentioned 
    10361152     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)) 
    10381155    inhibit_window_system = 1; 
    10391156 
     
    10411158  noninteractive = 0; 
    10421159  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    } 
    10441173 
    10451174  /* Handle the --help option, which gives a usage message.  */ 
    10461175  if (argmatch (argv, argc, "-help", "--help", 3, NULL, &skip_args)) 
    10471176    { 
    1048       printf (USAGE1, argv[0]); 
    1049       printf (USAGE2); 
     1177      printf (USAGE1, argv[0], USAGE2); 
     1178      printf (USAGE3); 
     1179      printf (USAGE4, bug_reporting_address ()); 
    10501180      exit (0); 
    10511181    } 
     
    10861216  if ( 
    10871217#ifndef CANNOT_DUMP 
    1088       ! noninteractive 
    1089       || initialized 
     1218      ! noninteractive || initialized 
    10901219#else 
    10911220      1 
     
    12081337         work correctly before syms_of_textprop, syms_of_macfns, 
    12091338         syms_of_ccl, syms_of_fontset, syms_of_xterm, syms_of_search, 
    1210          syms_of_frame, mac_initialize, and init_keyboard have already 
     1339         syms_of_frame, mac_term_init, and init_keyboard have already 
    12111340         been called.  */ 
    12121341      syms_of_textprop (); 
     
    12201349      syms_of_frame (); 
    12211350 
    1222       mac_initialize (); 
     1351      mac_term_init (build_string ("Mac"), NULL, NULL); 
    12231352      init_keyboard (); 
    12241353#endif 
     
    12851414      /* --multibyte overrides EMACS_UNIBYTE.  */ 
    12861415      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)) 
    12881419        inhibit_unibyte = 1; 
    12891420 
     
    14031534 
    14041535#ifdef WINDOWSNT 
     1536#ifndef MEADOW 
     1537  globals_of_w32 (); 
     1538#endif 
    14051539  /* Initialize environment from registry settings.  */ 
    14061540  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 (); 
    14081547#endif 
    14091548 
     
    15221661      syms_of_xfns (); 
    15231662      syms_of_fontset (); 
     1663#ifdef HAVE_X_SM 
     1664      syms_of_xsmfns (); 
     1665#endif 
    15241666#ifdef HAVE_X11 
    15251667      syms_of_xselect (); 
     
    15461688      syms_of_mw32mci (); 
    15471689      syms_of_fontset (); 
    1548 #else 
     1690#else /* not MEADOW */ 
    15491691#ifdef HAVE_NTGUI 
    15501692      syms_of_w32term (); 
     
    15561698#endif /* not MEADOW */ 
    15571699 
     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 
    15581707#ifdef SYMS_SYSTEM 
    15591708      SYMS_SYSTEM; 
     
    15741723  else 
    15751724    { 
     1725      /* Initialization that must be done even if the global variable 
     1726         initialized is non zero.  */ 
    15761727#ifdef PDUMP 
    15771728      reinit_syms_of_abbrev (); 
     
    15851736      reinit_syms_of_editfns (); 
    15861737      reinit_syms_of_insdel (); 
    1587 #ifdef HAVE_X_WINDOWS 
    1588       reinit_syms_of_xfns (); 
    1589 #ifdef HAVE_X11 
    1590       reinit_syms_of_xselect (); 
    1591 #endif 
    1592 #endif /* HAVE_X_WINDOWS */ 
    1593  
    1594 #ifndef HAVE_NTGUI 
    1595       reinit_syms_of_xmenu (); 
    1596 #endif 
    15971738 
    15981739#ifdef MEADOW 
     
    16021743      reinit_syms_of_mw32reg (); 
    16031744      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 
    16051757#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 */ 
    16171761      globals_of_w32menu (); 
    1618 #endif /* HAVE_NTGUI */ 
    1619 #endif /* MEADOW */ 
     1762#endif  /* HAVE_NTGUI */ 
    16201763    } 
    16211764 
     
    16341777  init_vmsproc ();      /* And this too.  */ 
    16351778#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.).  */ 
    16401780#ifdef MEADOW 
    16411781  init_mw32fns (); 
     
    16671807        Vtop_level = Fcons (intern ("load"), 
    16681808                            Fcons (build_string (file), Qnil)); 
    1669 #ifdef CANNOT_DUMP 
    1670 #ifdef SPECIAL_EXEC 
    1671       Vtop_level = Fcons (intern ("load"), 
    1672                           Fcons (build_string ("cd-startup.el"), Qnil)); 
    1673 #else 
    16741809      /* Unless next switch is -nl, load "loadup.el" first thing.  */ 
    16751810      if (! no_loadup) 
    16761811        Vtop_level = Fcons (intern ("load"), 
    16771812                            Fcons (build_string ("loadup.el"), Qnil)); 
    1678 #endif 
    1679 #endif /* CANNOT_DUMP */ 
    16801813    } 
    16811814 
     
    17801913#endif 
    17811914  { "-t", "--terminal", 120, 1 }, 
     1915  { "-nw", "--no-window-system", 110, 0 }, 
    17821916  { "-nw", "--no-windows", 110, 0 }, 
    17831917  { "-batch", "--batch", 100, 0 }, 
     1918  { "-script", "--script", 100, 1 }, 
    17841919  { "-help", "--help", 90, 0 }, 
    17851920  { "-no-unibyte", "--no-unibyte", 83, 0 }, 
     
    17871922  { "-unibyte", "--unibyte", 81, 0 }, 
    17881923  { "-no-multibyte", "--no-multibyte", 80, 0 }, 
    1789 #ifdef CANNOT_DUMP 
    17901924  { "-nl", "--no-loadup", 70, 0 }, 
    1791 #endif 
    17921925  /* -d must come last before the options handled in startup.el.  */ 
    17931926  { "-d", "--display", 60, 1 }, 
     
    17971930  { "-no-init-file", 0, 50, 0 }, 
    17981931  { "-no-site-file", "--no-site-file", 40, 0 }, 
     1932  { "-no-splash", "--no-splash", 40, 0 }, 
    17991933  { "-u", "--user", 30, 1 }, 
    18001934  { "-user", 0, 30, 1 }, 
     
    18141948  { "-fn", "--font", 10, 1 }, 
    18151949  { "-font", 0, 10, 1 }, 
     1950  { "-fs", "--fullscreen", 10, 0 }, 
     1951  { "-fw", "--fullwidth", 10, 0 }, 
     1952  { "-fh", "--fullheight", 10, 0 }, 
    18161953  { "-g", "--geometry", 10, 1 }, 
    18171954  { "-geometry", 0, 10, 1 }, 
     
    18251962  { "-hb", "--horizontal-scroll-bars", 5, 0 }, 
    18261963  { "-vb", "--vertical-scroll-bars", 5, 0 }, 
     1964  { "-color", "--color", 5, 0}, 
    18271965  /* These have the same priority as ordinary file name args, 
    18281966     so they are not reordered with respect to those.  */ 
     
    19942132  bcopy (new, argv, sizeof (char *) * argc); 
    19952133 
    1996   free (options); 
    1997   free (new); 
    1998   free (priority); 
     2134  xfree (options); 
     2135  xfree (new); 
     2136  xfree (priority); 
    19992137} 
    20002138  
     
    20702208  Vrun_hooks = Qnil; 
    20712209 
    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.  */ 
    20732214#ifdef EMACS_HAVE_TTY_PGRP 
    20742215  { 
     
    21072248  /* It's not safe to call intern here.  Maybe we are crashing.  */ 
    21082249  if (!noninteractive && SYMBOLP (Vwindow_system) 
    2109       && XSYMBOL (Vwindow_system)->name->size == 1 
    2110       && XSYMBOL (Vwindow_system)->name->data[0] == 'x' 
     2250      && SCHARS (SYMBOL_NAME (Vwindow_system)) == 1 
     2251      && SREF (SYMBOL_NAME (Vwindow_system), 0) == 'x' 
    21112252      && ! no_x) 
    21122253    Fx_close_current_connection (); 
     
    21532294  Lisp_Object tem; 
    21542295 
     2296  check_pure_size (); 
    21552297  CHECK_STRING (filename); 
    21562298  filename = Fexpand_file_name (filename, Qnil); 
     
    21882330  int count = SPECPDL_INDEX (); 
    21892331 
     2332  check_pure_size (); 
     2333 
    21902334  if (! noninteractive) 
    21912335    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__ */ 
    21922350 
    21932351  /* Bind `command-line-processed' to nil before dumping, 
     
    22232381  fflush (stdout); 
    22242382#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. */ 
    22282386  /* Also arrange for warnings when nearly out of space.  */ 
    22292387#ifndef SYSTEM_MALLOC 
     
    22332391  memory_warnings (my_edata, malloc_warning); 
    22342392#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 
    22362400#ifdef PDUMP 
    22372401  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 
    22452403  { 
    22462404    char temacs_exe[MAX_PATH]; 
     
    22662424#ifdef DOUG_LEA_MALLOC 
    22672425  malloc_state_ptr = malloc_get_state (); 
    2268 #endif /* DOUG_LEA_MALLOC */ 
     2426#endif 
    22692427 
    22702428#ifdef USE_MMAP_FOR_BUFFERS 
    22712429  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); 
    22752433#ifdef USE_MMAP_FOR_BUFFERS 
    22762434  mmap_set_vars (1); 
    2277 #endif /* USE_MMAP_FOR_BUFFERS */ 
     2435#endif 
    22782436#ifdef DOUG_LEA_MALLOC 
    22792437  free (malloc_state_ptr); 
    2280 #endif /* DOUG_LEA_MALLOC */ 
     2438#endif 
    22812439#endif /* not PDUMP */ 
    22822440#endif /* not VMS */ 
     
    23132471      *plocale = desired_locale; 
    23142472      setlocale (category, (STRINGP (desired_locale) 
    2315                             ? (char *)(XSTRING (desired_locale)->data
     2473                            ? (char *) SDATA (desired_locale
    23162474                            : "")); 
    23172475    } 
     
    24302588 
    24312589  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.  */); 
    24332600  Vsystem_type = intern (SYSTEM_TYPE); 
    24342601 
     
    25072674  Vprevious_system_time_locale = Qnil; 
    25082675} 
     2676 
     2677/* arch-tag: 7bfd356a-c720-4612-8ab6-aa4222931c2e 
     2678   (do not change this comment) */ 
  • branches/2.2/src/fileio.c

    r3671 r3674  
    142142#include "commands.h" 
    143143extern int use_dialog_box; 
    144 #if 0 
    145144extern int use_file_dialog; 
    146 #endif 
    147145 
    148146#ifndef O_WRONLY 
     
    183181Lisp_Object Vfile_name_handler_alist; 
    184182 
    185 /* Format for auto-save files */ 
    186 Lisp_Object Vauto_save_file_format; 
    187  
    188183/* Lisp functions for translating file formats */ 
    189184Lisp_Object Qformat_decode, Qformat_annotate_function; 
     
    240235 
    241236extern int minibuffer_auto_raise; 
     237 
     238extern int history_delete_duplicates; 
    242239 
    243240/* These variables describe handlers that have "already" had a chance 
     
    357354{ 
    358355  /* 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; 
    361360  CHECK_STRING (filename); 
    362361 
     
    374373        { 
    375374          Lisp_Object string; 
     375          int match_pos; 
    376376          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) 
    378379            { 
    379380              Lisp_Object handler, tem; 
     
    382383              tem = Fmemq (handler, inhibited_handlers); 
    383384              if (NILP (tem)) 
    384                 return handler; 
     385                { 
     386                  result = handler; 
     387                  pos = match_pos; 
     388                } 
    385389            } 
    386390        } 
     
    388392      QUIT; 
    389393    } 
    390   return Qnil
     394  return result
    39139