Changeset 3553

Show
Ignore:
Timestamp:
11/21/04 09:53:25 (4 years ago)
Author:
miyoshi
Message:

* abbrev.c: Sync up with Emacs CVS HEAD.

* acldef.h: Ditto.

* alloca.c: Ditto.

* atimer.c: Ditto.

* atimer.h: Ditto.

* blockinput.h: Ditto.

* buffer.c: Ditto.

* buffer.h: Ditto.

* bytecode.c: Ditto.

* editfns.c: Ditto.

* fileio.c: Ditto.

* lisp.h: Update declarations.

Files:

Legend:

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

    r3546 r3553  
     12004-11-21  MIYOSHI Masanori  <miyoshi@meadowy.org> 
     2 
     3        * abbrev.c: Sync up with Emacs CVS HEAD. 
     4 
     5        * acldef.h: Ditto. 
     6 
     7        * alloca.c: Ditto. 
     8 
     9        * atimer.c: Ditto. 
     10 
     11        * atimer.h: Ditto. 
     12 
     13        * blockinput.h: Ditto. 
     14 
     15        * buffer.c: Ditto. 
     16 
     17        * buffer.h: Ditto. 
     18 
     19        * bytecode.c: Ditto. 
     20 
     21        * editfns.c: Ditto. 
     22 
     23        * fileio.c: Ditto. 
     24 
     25        * lisp.h: Update declarations. 
     26 
    1272004-11-13  MIYOSHI Masanori  <miyoshi@meadowy.org> 
    228 
  • branches/2.2/src/abbrev.c

    r3516 r3553  
    11/* Primitives for word-abbrev mode. 
    2    Copyright (C) 1985, 1986, 1993, 1996, 1998 Free Software Foundation, Inc. 
     2   Copyright (C) 1985, 1986, 1993, 1996, 1998, 2001,02,03,04 
     3   Free Software Foundation, Inc. 
    34 
    45This file is part of GNU Emacs. 
     
    8990     () 
    9091{ 
     92  /* The value 59 is arbitrary chosen prime number.  */ 
    9193  return Fmake_vector (make_number (59), make_number (0)); 
    9294} 
     
    9496DEFUN ("clear-abbrev-table", Fclear_abbrev_table, Sclear_abbrev_table, 1, 1, 0, 
    9597       doc: /* Undefine all abbrevs in abbrev table TABLE, leaving it empty.  */) 
    96   (table) 
     98     (table) 
    9799     Lisp_Object table; 
    98100{ 
     
    203205      if (!NILP (current_buffer->abbrev_table)) 
    204206        sym = Fintern_soft (abbrev, current_buffer->abbrev_table); 
    205       if (NILP (XSYMBOL (sym)->value)) 
     207      if (NILP (SYMBOL_VALUE (sym))) 
    206208        sym = Qnil; 
    207209      if (NILP (sym)) 
    208210        sym = Fintern_soft (abbrev, Vglobal_abbrev_table); 
    209211    } 
    210   if (NILP (XSYMBOL (sym)->value)) return Qnil; 
     212  if (NILP (SYMBOL_VALUE (sym))) 
     213    return Qnil; 
    211214  return sym; 
    212215} 
     
    246249  value = Qnil; 
    247250 
    248   if (!NILP (Vrun_hooks)) 
    249     call1 (Vrun_hooks, Qpre_abbrev_expand_hook); 
     251  Frun_hooks (1, &Qpre_abbrev_expand_hook); 
    250252 
    251253  wordstart = 0; 
     
    318320  else 
    319321    XSETFASTINT (sym, 0); 
    320   if (INTEGERP (sym) || NILP (XSYMBOL (sym)->value)) 
     322 
     323  if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym))) 
    321324    sym = oblookup (Vglobal_abbrev_table, buffer, 
    322325                    wordend - wordstart, p - buffer); 
    323   if (INTEGERP (sym) || NILP (XSYMBOL (sym)->value)) 
     326  if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym))) 
    324327    return value; 
    325328 
     
    343346  if (INTEGERP (XSYMBOL (sym)->plist)) 
    344347    XSETINT (XSYMBOL (sym)->plist, 
    345              XINT (XSYMBOL (sym)->plist) + 1);  /* Increment use count */ 
     348             XINT (XSYMBOL (sym)->plist) + 1); 
     349  else if (INTEGERP (tem = Fget (sym, Qcount))) 
     350    Fput (sym, Qcount, make_number (XINT (tem) + 1)); 
    346351 
    347352  /* If this abbrev has an expansion, delete the abbrev 
    348353     and insert the expansion.  */ 
    349   expansion = XSYMBOL (sym)->value
     354  expansion = SYMBOL_VALUE (sym)
    350355  if (STRINGP (expansion)) 
    351356    { 
    352357      SET_PT (wordstart); 
    353358 
    354       del_range_both (wordstart, wordstart_byte, wordend, wordend_byte, 1); 
    355  
    356       insert_from_string (expansion, 0, 0, XSTRING (expansion)->size, 
    357                           STRING_BYTES (XSTRING (expansion)), 1); 
     359      insert_from_string (expansion, 0, 0, SCHARS (expansion), 
     360                          SBYTES (expansion), 1); 
     361      del_range_both (PT, PT_BYTE, 
     362                      wordend + (PT - wordstart), 
     363                      wordend_byte + (PT_BYTE - wordstart_byte), 
     364                      1); 
     365 
    358366      SET_PT (PT + whitecnt); 
    359367 
     
    433441      int zv_before; 
    434442 
    435       val = XSYMBOL (Vlast_abbrev)->value
     443      val = SYMBOL_VALUE (Vlast_abbrev)
    436444      if (!STRINGP (val)) 
    437445        error ("value of abbrev-symbol must be a string"); 
    438446      zv_before = ZV; 
    439       del_range_byte (PT_BYTE, PT_BYTE + STRING_BYTES (XSTRING (val)), 1); 
     447      del_range_byte (PT_BYTE, PT_BYTE + SBYTES (val), 1); 
    440448      /* Don't inherit properties here; just copy from old contents.  */ 
    441449      insert_from_string (Vlast_abbrev_text, 0, 0, 
    442                           XSTRING (Vlast_abbrev_text)->size
    443                           STRING_BYTES (XSTRING (Vlast_abbrev_text)), 0); 
     450                          SCHARS (Vlast_abbrev_text)
     451                          SBYTES (Vlast_abbrev_text), 0); 
    444452      Vlast_abbrev_text = Qnil; 
    445453      /* Total number of characters deleted.  */ 
     
    454462     Lisp_Object sym, stream; 
    455463{ 
    456   Lisp_Object name; 
    457   if (NILP (XSYMBOL (sym)->value)) 
     464  Lisp_Object name, count, system_flag; 
     465 
     466  if (INTEGERP (XSYMBOL (sym)->plist)) 
     467    { 
     468      count = XSYMBOL (sym)->plist; 
     469      system_flag = Qnil; 
     470    } 
     471  else 
     472    { 
     473      count = Fget (sym, Qcount); 
     474      system_flag = Fget (sym, Qsystem_type); 
     475    } 
     476 
     477  if (NILP (SYMBOL_VALUE (sym)) || ! NILP (system_flag)) 
    458478    return; 
     479 
    459480  insert ("    (", 5); 
    460   XSETSTRING (name, XSYMBOL (sym)->name); 
     481  XSETSTRING (name, SYMBOL_NAME (sym)); 
    461482  Fprin1 (name, stream); 
    462483  insert (" ", 1); 
    463   Fprin1 (XSYMBOL (sym)->value, stream); 
     484  Fprin1 (SYMBOL_VALUE (sym), stream); 
    464485  insert (" ", 1); 
    465486  Fprin1 (XSYMBOL (sym)->function, stream); 
    466487  insert (" ", 1); 
    467   Fprin1 (XSYMBOL (sym)->plist, stream); 
     488  Fprin1 (count, stream); 
    468489  insert (")\n", 2); 
    469490} 
     
    473494     Lisp_Object sym, stream; 
    474495{ 
    475   Lisp_Object one; 
    476  
    477   if (NILP (XSYMBOL (sym)->value)) 
     496  Lisp_Object one, count, system_flag; 
     497 
     498  if (INTEGERP (XSYMBOL (sym)->plist)) 
     499    { 
     500      count = XSYMBOL (sym)->plist; 
     501      system_flag = Qnil; 
     502    } 
     503  else 
     504    { 
     505      count = Fget (sym, Qcount); 
     506      system_flag = Fget (sym, Qsystem_type); 
     507    } 
     508 
     509  if (NILP (SYMBOL_VALUE (sym))) 
    478510    return; 
     511 
    479512  one = make_number (1); 
    480513  Fprin1 (Fsymbol_name (sym), stream); 
    481   Findent_to (make_number (15), one); 
    482   Fprin1 (XSYMBOL (sym)->plist, stream); 
     514 
     515  if (!NILP (system_flag)) 
     516    { 
     517      insert_string (" (sys)"); 
     518      Findent_to (make_number (20), one); 
     519    } 
     520  else 
     521    Findent_to (make_number (15), one); 
     522 
     523  Fprin1 (count, stream); 
    483524  Findent_to (make_number (20), one); 
    484   Fprin1 (XSYMBOL (sym)->value, stream); 
     525  Fprin1 (SYMBOL_VALUE (sym), stream); 
    485526  if (!NILP (XSYMBOL (sym)->function)) 
    486527    { 
     
    498539is inserted.  Otherwise the description is an expression, 
    499540a call to `define-abbrev-table', which would 
    500 define the abbrev table NAME exactly as it is currently defined.  */) 
    501   (name, readable) 
     541define the abbrev table NAME exactly as it is currently defined. 
     542 
     543Abbrevs marked as "system abbrevs" are normally omitted.  However, if 
     544READABLE is non-nil, they are listed.  */) 
     545     (name, readable) 
    502546     Lisp_Object name, readable; 
    503547{ 
     
    616660  DEFVAR_LISP ("abbrev-start-location", &Vabbrev_start_location, 
    617661               doc: /* Buffer position for `expand-abbrev' to use as the start of the abbrev. 
    618 nil means use the word before point as the abbrev. 
     662When nil, use the word before point as the abbrev. 
    619663Calling `expand-abbrev' sets this to nil.  */); 
    620664  Vabbrev_start_location = Qnil; 
     
    657701  defsubr (&Sdefine_abbrev_table); 
    658702} 
     703 
     704/* arch-tag: b721db69-f633-44a8-a361-c275acbdad7d 
     705   (do not change this comment) */ 
  • branches/2.2/src/acldef.h

    r3104 r3553  
    3939#define ACL$B_TYPE      10 
    4040#define ACL$L_LIST      12 
     41 
     42/* arch-tag: 7c11e99d-34df-41e8-98e2-20f152c4ad73 
     43   (do not change this comment) */ 
  • branches/2.2/src/alloca.c

    r3104 r3553  
    11/* alloca.c -- allocate automatically reclaimed memory 
    22   (Mostly) portable public-domain implementation -- D A Gwyn 
     3 
     4   NOTE: The canonical source of this file is maintained with gnulib. 
     5   Bugs can be reported to bug-gnulib@gnu.org. 
    36 
    47   This implementation of the PWB library alloca function, 
     
    2326 
    2427#ifdef HAVE_CONFIG_H 
    25 #include <config.h> 
     28# include <config.h> 
    2629#endif 
    2730 
    2831#ifdef HAVE_STRING_H 
    29 #include <string.h> 
     32# include <string.h> 
    3033#endif 
    3134#ifdef HAVE_STDLIB_H 
    32 #include <stdlib.h> 
     35# include <stdlib.h> 
    3336#endif 
    3437 
    35 #ifdef emacs 
    36 #include "lisp.h" 
    37 #include "blockinput.h" 
     38#ifdef DO_BLOCK_INPUT 
     39# include "blockinput.h" 
    3840#endif 
    3941 
     
    4345/* If someone has defined alloca as a macro, 
    4446   there must be some other way alloca is supposed to work.  */ 
    45 #ifndef alloca 
    46  
    47 #ifdef emacs 
    48 #ifdef static 
     47# ifndef alloca 
     48 
     49#  ifdef emacs 
     50#   ifdef static 
    4951/* actually, only want this if static is defined as "" 
    5052   -- this is for usg, in which emacs must undefine static 
    5153   in order to make unexec workable 
    5254   */ 
    53 #ifndef STACK_DIRECTION 
    54   #error "Must know STACK_DIRECTION at compile-time" 
    55 #endif /* STACK_DIRECTION undefined */ 
    56 #endif /* static */ 
    57 #endif /* emacs */ 
     55#    ifndef STACK_DIRECTION 
     56you 
     57lose 
     58-- must know STACK_DIRECTION at compile-time 
     59/* Using #error here is not wise since this file should work for 
     60   old and obscure compilers.   
     61 
     62   As far as I know, using it is OK if it's indented -- at least for 
     63   pcc-based processors.  -- fx */ 
     64#    endif /* STACK_DIRECTION undefined */ 
     65#   endif /* static */ 
     66#  endif /* emacs */ 
    5867 
    5968/* If your stack is a linked list of frames, you have to 
    6069   provide an "address metric" ADDRESS_FUNCTION macro.  */ 
    6170 
    62 #if defined (CRAY) && defined (CRAY_STACKSEG_END) 
     71#  if defined (CRAY) && defined (CRAY_STACKSEG_END) 
    6372long i00afunc (); 
    64 #define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) 
    65 #else 
    66 #define ADDRESS_FUNCTION(arg) &(arg) 
    67 #endif 
    68  
    69 #ifdef POINTER_TYPE 
     73#   define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) 
     74#  else 
     75#   define ADDRESS_FUNCTION(arg) &(arg) 
     76#  endif 
     77 
     78#  ifndef POINTER_TYPE 
     79#   ifdef __STDC__ 
     80#    define POINTER_TYPE void 
     81#   else 
     82#    define POINTER_TYPE char 
     83#   endif 
     84#  endif 
    7085typedef POINTER_TYPE *pointer; 
    71 #else 
    72 #if __STDC__ 
    73 typedef void *pointer; 
    74 #else 
    75 typedef char *pointer; 
    76 #endif /*__STDC__*/ 
    77 #endif /*POINTER_TYPE*/ 
    78  
    79  
    80 #ifndef NULL 
    81 #define NULL    0 
    82 #endif 
    83  
    84 /* Different portions of Emacs need to call different versions of 
    85    malloc.  The Emacs executable needs alloca to call xmalloc, because 
    86    ordinary malloc isn't protected from input signals.  On the other 
    87    hand, the utilities in lib-src need alloca to call malloc; some of 
    88    them are very simple, and don't have an xmalloc routine. 
    89  
    90    Non-Emacs programs expect this to call use xmalloc. 
     86 
     87#  ifndef NULL 
     88#   define NULL 0 
     89#  endif 
     90 
     91/* The Emacs executable needs alloca to call xmalloc, because ordinary 
     92   malloc isn't protected from input signals.  xmalloc also checks for 
     93   out-of-memory errors, so we should use it generally. 
    9194 
    9295   Callers below should use malloc.  */ 
    9396 
    94 #ifdef emacs 
    95 #define malloc xmalloc 
    96 #ifdef EMACS_FREE 
    97 #define free EMACS_FREE 
    98 #endif 
    99 #endif 
    100 extern pointer malloc (); 
     97#  undef malloc 
     98#  define malloc xmalloc 
     99#  undef free 
     100#  define free xfree 
     101 
     102void *xmalloc _P ((size_t)); 
     103void xfree _P ((void *)); 
    101104 
    102105/* Define STACK_DIRECTION if you know the direction of stack 
     
    108111   STACK_DIRECTION = 0 => direction of growth unknown  */ 
    109112 
    110 #ifndef STACK_DIRECTION 
    111 #define        STACK_DIRECTION        0       /* Direction unknown.  */ 
    112 #endif 
    113  
    114 #if STACK_DIRECTION != 0 
    115  
    116 #define        STACK_DIR      STACK_DIRECTION /* Known at compile-time.  */ 
    117  
    118 #else /* STACK_DIRECTION == 0; need run-time code.  */ 
     113#  ifndef STACK_DIRECTION 
     114#   define STACK_DIRECTION    0       /* Direction unknown.  */ 
     115#  endif 
     116 
     117#  if STACK_DIRECTION != 0 
     118 
     119#   define STACK_DIR  STACK_DIRECTION /* Known at compile-time.  */ 
     120 
     121#  else /* STACK_DIRECTION == 0; need run-time code.  */ 
    119122 
    120123static int stack_dir;           /* 1 or -1 once known.  */ 
    121 #define        STACK_DIR      stack_dir 
     124#   define STACK_DIR  stack_dir 
    122125 
    123126static void 
     
    143146} 
    144147 
    145 #endif /* STACK_DIRECTION == 0 */ 
     148#  endif /* STACK_DIRECTION == 0 */ 
    146149 
    147150/* An "alloca header" is used to: 
     
    152155   alignment chunk size.  The following default should work okay.  */ 
    153156 
    154 #ifndef       ALIGN_SIZE 
    155 #define        ALIGN_SIZE     sizeof(double) 
    156 #endif 
     157#  ifndef     ALIGN_SIZE 
     158#   define ALIGN_SIZE sizeof(double) 
     159#  endif 
    157160 
    158161typedef union hdr 
     
    177180pointer 
    178181alloca (size) 
    179      unsigned size; 
     182     size_t size; 
    180183{ 
    181184  auto char probe;              /* Probes stack depth: */ 
    182185  register char *depth = ADDRESS_FUNCTION (probe); 
    183186 
    184 #if STACK_DIRECTION == 0 
     187#  if STACK_DIRECTION == 0 
    185188  if (STACK_DIR == 0)           /* Unknown growth direction.  */ 
    186189    find_stack_direction (); 
    187 #endif 
     190#  endif 
    188191 
    189192  /* Reclaim garbage, defined as all alloca'd storage that 
     
    193196    register header *hp;        /* Traverses linked list.  */ 
    194197 
    195 #ifdef emacs 
     198#  ifdef DO_BLOCK_INPUT 
    196199    BLOCK_INPUT; 
    197 #endif 
     200#  endif 
    198201 
    199202    for (hp = last_alloca_header; hp != NULL;) 
     
    212215    last_alloca_header = hp;    /* -> last valid storage.  */ 
    213216 
    214 #ifdef emacs 
     217#  ifdef DO_BLOCK_INPUT 
    215218    UNBLOCK_INPUT; 
    216 #endif 
     219#  endif 
    217220  } 
    218221 
     
    223226 
    224227  { 
     228    /* Address of header.  */ 
    225229    register pointer new = malloc (sizeof (header) + size); 
    226     /* Address of header.  */ 
    227230 
    228231    if (new == 0) 
     
    240243} 
    241244 
    242 #if defined (CRAY) && defined (CRAY_STACKSEG_END) 
    243  
    244 #ifdef DEBUG_I00AFUNC 
    245 #include <stdio.h> 
    246 #endif 
    247  
    248 #ifndef CRAY_STACK 
    249 #define CRAY_STACK 
    250 #ifndef CRAY2 
     245#  if defined (CRAY) && defined (CRAY_STACKSEG_END) 
     246 
     247#   ifdef DEBUG_I00AFUNC 
     248#    include <stdio.h> 
     249#   endif 
     250 
     251#   ifndef CRAY_STACK 
     252#    define CRAY_STACK 
     253#    ifndef CRAY2 
    251254/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ 
    252255struct stack_control_header 
     
    300303  }; 
    301304 
    302 #else /* CRAY2 */ 
     305#    else /* CRAY2 */ 
    303306/* The following structure defines the vector of words 
    304307   returned by the STKSTAT library routine.  */ 
     
    353356  }; 
    354357 
    355 #endif /* CRAY2 */ 
    356 #endif /* not CRAY_STACK */ 
    357  
    358 #ifdef CRAY2 
     358#    endif /* CRAY2 */ 
     359#   endif /* not CRAY_STACK */ 
     360 
     361#   ifdef CRAY2 
    359362/* Determine a "stack measure" for an arbitrary ADDRESS. 
    360363   I doubt that "lint" will like this much.  */ 
     
    427430} 
    428431 
    429 #else /* not CRAY2 */ 
     432#   else /* not CRAY2 */ 
    430433/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. 
    431434   Determine the number of the cell within the stack, 
     
    472475  while (!(this_segment <= address && address <= stkl)) 
    473476    { 
    474 #ifdef DEBUG_I00AFUNC 
     477#    ifdef DEBUG_I00AFUNC 
    475478      fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); 
    476 #endif 
     479#    endif 
    477480      if (pseg == 0) 
    478481        break; 
     
    493496  while (pseg != 0) 
    494497    { 
    495 #ifdef DEBUG_I00AFUNC 
     498#    ifdef DEBUG_I00AFUNC 
    496499      fprintf (stderr, "%011o %011o\n", pseg, size); 
    497 #endif 
     500#    endif 
    498501      stkl = stkl - pseg; 
    499502      ssptr = (struct stack_segment_linkage *) stkl; 
     
    505508} 
    506509 
    507 #endif /* not CRAY2 */ 
    508 #endif /* CRAY */ 
    509  
    510 #endif /* no alloca */ 
     510#   endif /* not CRAY2 */ 
     511#  endif /* CRAY */ 
     512 
     513# endif /* no alloca */ 
    511514#endif /* not GCC version 2 */ 
     515 
     516/* arch-tag: 5c9901c8-3cd4-453e-bd66-d9035a175ee3 
     517   (do not change this comment) */ 
  • branches/2.2/src/atimer.c

    r3421 r3553  
    11/* Asynchronous timers. 
    2    Copyright (C) 2000 Free Software Foundation, Inc. 
     2   Copyright (C) 2000, 2004 Free Software Foundation, Inc. 
    33 
    44This file is part of GNU Emacs. 
     
    2020 
    2121#include <config.h> 
     22#include <signal.h> 
     23#include <stdio.h> 
    2224#include <lisp.h> 
    23 #include <signal.h> 
    2425#include <syssignal.h> 
    2526#include <systime.h> 
    2627#include <blockinput.h> 
    2728#include <atimer.h> 
    28 #include <stdio.h> 
    2929 
    3030#ifdef HAVE_UNISTD_H 
     
    3535#include <sys/time.h> 
    3636#endif 
    37  
    38 /* The ubiquitous min/max macros.  */ 
    39  
    40 #define max(X, Y) ((X) > (Y) ? (X) : (Y)) 
    41 #define min(X, Y) ((X) < (Y) ? (X) : (Y)) 
    4237 
    4338/* Free-list of atimer structures.  */ 
     
    6358int pending_atimers; 
    6459 
    65 /* Block/unblock SIGALRM.. */ 
     60/* Block/unblock SIGALRM. */ 
    6661 
    6762#define BLOCK_ATIMERS   sigblock (sigmask (SIGALRM)) 
     
    381376      t = atimers; 
    382377      atimers = atimers->next; 
     378#ifndef MAC_OSX 
    383379      t->fn (t); 
     380#endif 
    384381 
    385382      if (t->type == ATIMER_CONTINUOUS) 
     
    393390          free_atimers = t; 
    394391        } 
     392#ifdef MAC_OSX 
     393      /* Fix for Ctrl-G.  Perhaps this should apply to all platforms. */ 
     394      t->fn (t);  
     395#endif 
    395396 
    396397      EMACS_GET_TIME (now); 
    397398    } 
    398  
    399 #if defined (USG) && !defined (POSIX_SIGNALS) 
    400   /* USG systems forget handlers when they are used; 
    401      must reestablish each time.  */ 
    402   signal (SIGALRM, alarm_signal_handler); 
    403 #endif /* USG */ 
    404399 
    405400  set_alarm (); 
     
    445440  signal (SIGALRM, alarm_signal_handler); 
    446441} 
     442/* arch-tag: e6308261-eec6-404b-89fb-6e5909518d70 
     443   (do not change this comment) */ 
  • branches/2.2/src/atimer.h

    r3421 r3553  
    11/* Asynchronous timers. 
    2    Copyright (C) 2000 Free Software Foundation, Inc. 
     2   Copyright (C) 2000, 2003 Free Software Foundation, Inc. 
    33 
    44This file is part of GNU Emacs. 
     
    2121#ifndef EMACS_ATIMER_H 
    2222#define EMACS_ATIMER_H 
     23 
     24/* Declare the prototype for a general external function.  */ 
     25#if defined (PROTOTYPES) || defined (WINDOWSNT) 
     26#define P_(proto) proto 
     27#else 
     28#define P_(proto) () 
     29#endif 
    2330 
    2431#include "systime.h"            /* for EMACS_TIME */ 
     
    5966  EMACS_TIME interval; 
    6067 
    61   /* Function to call when timer is ripe.  Interupt input is 
    62      garanteed to not be blocked when this function is called.  */ 
     68  /* Function to call when timer is ripe.  Interrupt input is 
     69     guaranteed to not be blocked when this function is called.  */ 
    6370  atimer_callback fn; 
    6471 
     
    8390 
    8491#endif /* EMACS_ATIMER_H */ 
     92 
     93/* arch-tag: 02c7c1c8-45bd-4222-b874-4ca44662f60b 
     94   (do not change this comment) */ 
  • branches/2.2/src/blockinput.h

    r3421 r3553  
    11/* blockinput.h - interface to blocking complicated interrupt-driven input. 
    2    Copyright (C) 1989, 1993 Free Software Foundation, Inc. 
     2   Copyright (C) 1989, 1993, 2004 Free Software Foundation, Inc. 
    33 
    44This file is part of GNU Emacs. 
     
    9898#define UNBLOCK_INPUT_RESIGNAL UNBLOCK_INPUT 
    9999 
     100/* In critical section ? */ 
     101#define INPUT_BLOCKED_P (interrupt_input_blocked > 0) 
     102 
    100103/* Defined in keyboard.c */ 
    101104/* Don't use a prototype here; it causes trouble in some files.  */ 
     
    116119 
    117120#endif /* EMACS_BLOCKINPUT_H */ 
     121 
     122/* arch-tag: 51a9ec86-945a-4966-8f04-2d1341250e03 
     123   (do not change this comment) */ 
  • branches/2.2/src/buffer.c

    r3497 r3553  
    3333 
    3434#ifndef MAXPATHLEN 
    35 /* in 4.1, param.h fails to define this. */ 
     35/* in 4.1 [probably SunOS? -stef] , param.h fails to define this. */ 
    3636#define MAXPATHLEN 1024 
    3737#endif /* not MAXPATHLEN */ 
     
    4040#include <unistd.h> 
    4141#endif 
     42 
    4243#include "lisp.h" 
    4344#include "intervals.h" 
     
    5051#include "blockinput.h" 
    5152#include "keyboard.h" 
     53#include "keymap.h" 
    5254#include "frame.h" 
    5355 
     
    8789   If a slot is -2, then there is no DEFVAR_PER_BUFFER for it, 
    8890   but there is a default value which is copied into each buffer. 
    89  
    90    If a slot in this structure is negative, then even though there may 
    91    be a DEFVAR_PER_BUFFER for the slot, there is no default value for it; 
    92    and the corresponding slot in buffer_defaults is not used. 
    9391 
    9492   If a slot in this structure corresponding to a DEFVAR_PER_BUFFER is 
     
    149147   If any of these functions returns nil, we don't kill it.  */ 
    150148Lisp_Object Vkill_buffer_query_functions; 
     149Lisp_Object Qkill_buffer_query_functions; 
    151150 
    152151/* List of functions to call before changing an unmodified buffer.  */ 
     
    156155Lisp_Object Qbefore_change_functions; 
    157156Lisp_Object Qafter_change_functions; 
     157Lisp_Object Qucs_set_table_for_input; 
    158158 
    159159/* If nonzero, all modification hooks are suppressed.  */ 
     
    192192{ 
    193193  if (STRINGP (spec)) 
    194     error ("No buffer named %s", XSTRING (spec)->data); 
     194    error ("No buffer named %s", SDATA (spec)); 
    195195  error ("Invalid buffer argument"); 
    196196} 
     
    199199       doc: /* Return non-nil if OBJECT is a buffer which has not been killed. 
    200200Value is nil if OBJECT is not a buffer or if it has been killed.  */) 
    201   (object) 
     201     (object) 
    202202     Lisp_Object object; 
    203203{ 
     
    208208DEFUN ("buffer-list", Fbuffer_list, Sbuffer_list, 0, 1, 0, 
    209209       doc: /* Return a list of all existing live buffers. 
    210 If the optional arg FRAME is a frame, we return that frame's buffer list.  */) 
    211   (frame) 
     210If the optional arg FRAME is a frame, we return the buffer list 
     211in the proper order for that frame: the buffers in FRAME's `buffer-list' 
     212frame parameter come first, followed by the rest of the buffers.  */) 
     213     (frame) 
    212214     Lisp_Object frame; 
    213215{ 
     
    246248{ 
    247249  register Lisp_Object tail; 
    248   for (tail = list; !NILP (tail); tail = Fcdr (tail)) 
     250  for (tail = list; CONSP (tail); tail = XCDR (tail)) 
    249251    { 
    250252      register Lisp_Object elt, tem; 
    251       elt = Fcar (tail); 
     253      elt = XCAR (tail); 
    252254      tem = Fstring_equal (Fcar (elt), key); 
    253255      if (!NILP (tem)) 
     
    261263If there is no live buffer named NAME, return nil. 
    262264NAME may also be a buffer; if so, the value is that buffer.  */) 
    263   (name) 
     265     (name) 
    264266     register Lisp_Object name; 
    265267{ 
     
    276278If there is no such live buffer, return nil. 
    277279See also `find-buffer-visiting'.  */) 
    278   (filename) 
     280     (filename) 
    279281     register Lisp_Object filename; 
    280282{ 
     
    330332If NAME is a buffer instead of a string, then it is the value returned. 
    331333The value is never nil.  */) 
    332   (name) 
     334     (name) 
    333335     register Lisp_Object name; 
    334336{ 
     
    340342    return buf; 
    341343 
    342   if (XSTRING (name)->size == 0) 
     344  if (SCHARS (name) == 0) 
    343345    error ("Empty string for buffer name is not allowed"); 
    344346 
     
    360362    buffer_memory_full (); 
    361363 
    362   BUF_PT (b) = 1
    363   BUF_GPT (b) = 1
    364   BUF_BEGV (b) = 1
    365   BUF_ZV (b) = 1
    366   BUF_Z (b) = 1
    367   BUF_PT_BYTE (b) = 1
    368   BUF_GPT_BYTE (b) = 1
    369   BUF_BEGV_BYTE (b) = 1
    370   BUF_ZV_BYTE (b) = 1
    371   BUF_Z_BYTE (b) = 1
     364  BUF_PT (b) = BEG
     365  BUF_GPT (b) = BEG
     366  BUF_BEGV (b) = BEG
     367  BUF_ZV (b) = BEG
     368  BUF_Z (b) = BEG
     369  BUF_PT_BYTE (b) = BEG_BYTE
     370  BUF_GPT_BYTE (b) = BEG_BYTE
     371  BUF_BEGV_BYTE (b) = BEG_BYTE
     372  BUF_ZV_BYTE (b) = BEG_BYTE
     373  BUF_Z_BYTE (b) = BEG_BYTE
    372374  BUF_MODIFF (b) = 1; 
    373375  BUF_OVERLAY_MODIFF (b) = 1; 
     
    396398 
    397399  name = Fcopy_sequence (name); 
    398   XSTRING (name)->intervals = NULL_INTERVAL
     400  STRING_SET_INTERVALS (name, NULL_INTERVAL)
    399401  b->name = name; 
    400402 
    401   if (XSTRING (name)->data[0] != ' ') 
     403  if (SREF (name, 0) != ' ') 
    402404    b->undo_list = Qnil; 
    403405  else 
     
    407409  reset_buffer_local_variables (b, 1); 
    408410 
     411  b->mark = Fmake_marker (); 
     412  BUF_MARKERS (b) = Qnil; 
     413  b->name = name; 
     414 
    409415  /* Put this in the alist of all live buffers.  */ 
    410416  XSETBUFFER (buf, b); 
    411417  Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil)); 
    412418 
    413   b->mark = Fmake_marker (); 
    414   BUF_MARKERS (b) = Qnil; 
    415   b->name = name; 
    416419  return buf; 
    417420} 
     
    433436    { 
    434437      Lisp_Object overlay, start, end, old_overlay; 
    435       int charpos; 
     438      EMACS_INT charpos; 
    436439 
    437440      old_overlay = XCAR (list); 
     
    472475     struct buffer *from, *to; 
    473476{ 
    474   Lisp_Object to_buffer
     477  Lisp_Object to_buffer, tem
    475478  int offset; 
    476479 
     
    499502  to->overlays_before = copy_overlays (to, from->overlays_before); 
    500503  to->overlays_after = copy_overlays (to, from->overlays_after); 
     504 
     505  /* Copy the alist of local variables, 
     506     and all the alist elements too.  */ 
     507  to->local_var_alist 
     508    = Fcopy_sequence (from->local_var_alist); 
     509  for (tem = to->local_var_alist; CONSP (tem); 
     510       tem = XCDR (tem)) 
     511    XSETCAR (tem, Fcons (XCAR (XCAR (tem)), XCDR (XCAR (tem)))); 
    501512} 
    502513 
     
    506517       "bMake indirect buffer (to buffer): \nBName of indirect buffer: ", 
    507518       doc: /* Create and return an indirect buffer for buffer BASE-BUFFER, named NAME. 
    508 BASE-BUFFER should be an existing buffer (or buffer name)
     519BASE-BUFFER should be a live buffer, or the name of an existing buffer
    509520NAME should be a string which is not the name of an existing buffer. 
    510521Optional argument CLONE non-nil means preserve BASE-BUFFER's state, 
    511522such as major and minor modes, in the indirect buffer. 
    512523CLONE nil means the indirect buffer's state is reset to default values.  */) 
    513   (base_buffer, name, clone) 
     524     (base_buffer, name, clone) 
    514525     Lisp_Object base_buffer, name, clone; 
    515526{ 
    516   Lisp_Object buf
     527  Lisp_Object buf, tem
    517528  struct buffer *b; 
    518529 
     530  CHECK_STRING (name); 
    519531  buf = Fget_buffer (name); 
    520532  if (!NILP (buf)) 
    521     error ("Buffer name `%s' is in use", XSTRING (name)->data); 
    522  
     533    error ("Buffer name `%s' is in use", SDATA (name)); 
     534 
     535  tem = base_buffer; 
    523536  base_buffer = Fget_buffer (base_buffer); 
    524537  if (NILP (base_buffer)) 
    525     error ("No such buffer: `%s'", XSTRING (name)->data); 
    526  
    527   if (XSTRING (name)->size == 0) 
     538    error ("No such buffer: `%s'", SDATA (tem)); 
     539  if (NILP (XBUFFER (base_buffer)->name)) 
     540    error ("Base buffer has been killed"); 
     541 
     542  if (SCHARS (name) == 0) 
    528543    error ("Empty string for buffer name is not allowed"); 
    529544 
     
    555570 
    556571  name = Fcopy_sequence (name); 
    557   XSTRING (name)->intervals = NULL_INTERVAL
     572  STRING_SET_INTERVALS (name, NULL_INTERVAL)
    558573  b->name = name; 
    559574 
     
    633648 
    634649/* Reinitialize everything about a buffer except its name and contents 
    635    and local variables.  */ 
     650   and local variables. 
     651   If called on an already-initialized buffer, the list of overlays 
     652   should be deleted before calling this function, otherwise we end up 
     653   with overlays that claim to belong to the buffer but the buffer 
     654   claims it doesn't belong to it.  */ 
    636655 
    637656void 
     
    712731#endif 
    713732 
    714 #if 0 
    715   b->sort_table = XSTRING (Vascii_sort_table); 
    716   b->folding_sort_table = XSTRING (Vascii_folding_sort_table); 
    717 #endif /* 0 */ 
    718  
    719733  /* Reset all (or most) per-buffer variables to their defaults.  */ 
    720734  b->local_var_alist = Qnil; 
     
    749763If there is no live buffer named NAME, then return NAME. 
    750764Otherwise modify name by appending `<NUMBER>', incrementing NUMBER 
    751 until an unused name is found, and then return that name. 
     765\(starting at 2) until an unused name is found, and then return that name. 
    752766Optional second argument IGNORE specifies a name that is okay to use 
    753767\(if it is in the sequence to be tried) 
    754768even if a buffer with that name exists.  */) 
    755  (name, ignore) 
     769     (name, ignore) 
    756770     register Lisp_Object name, ignore; 
    757771{ 
     
    762776  CHECK_STRING (name); 
    763777 
     778  tem = Fstring_equal (name, ignore); 
     779  if (!NILP (tem)) 
     780    return name; 
    764781  tem = Fget_buffer (name); 
    765782  if (NILP (tem)) 
     
    784801       doc: /* Return the name of BUFFER, as a string. 
    785802With no argument or nil as argument, return the name of the current buffer.  */) 
    786   (buffer) 
     803     (buffer) 
    787804     register Lisp_Object buffer; 
    788805{ 
     
    796813       doc: /* Return name of file BUFFER is visiting, or nil if none. 
    797814No argument or nil as argument means use the current buffer.  */) 
    798   (buffer) 
     815     (buffer) 
    799816     register Lisp_Object buffer; 
    800817{ 
     
    808825       0, 1, 0, 
    809826       doc: /* Return the base buffer of indirect buffer BUFFER. 
    810 If BUFFER is not indirect, return nil.  */) 
    811   (buffer) 
     827If BUFFER is not indirect, return nil. 
     828BUFFER defaults to the current buffer.  */) 
     829     (buffer) 
    812830     register Lisp_Object buffer; 
    813831{ 
     
    878896 
    879897      /* What binding is loaded right now?  */ 
    880       valcontents = XSYMBOL (symbol)->value
     898      valcontents = SYMBOL_VALUE (symbol)
    881899      current_alist_element 
    882900        = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr); 
     
    907925Note that storing new VALUEs in these elements doesn't change the variables. 
    908926No argument or nil as argument means use current buffer as BUFFER.  */) 
    909   (buffer) 
     927     (buffer) 
    910928     register Lisp_Object buffer; 
    911929{ 
     
    976994       doc: /* Return t if BUFFER was modified since its file was last read or saved. 
    977995No argument or nil as argument means use current buffer as BUFFER.  */) 
    978   (buffer) 
     996     (buffer) 
    979997     register Lisp_Object buffer; 
    980998{ 
     
    9951013       doc: /* Mark current buffer as modified or unmodified according to FLAG. 
    9961014A non-nil FLAG means mark the buffer modified.  */) 
    997   (flag) 
     1015     (flag) 
    9981016     register Lisp_Object flag; 
    9991017{ 
     
    10441062DEFUN ("restore-buffer-modified-p", Frestore_buffer_modified_p, 
    10451063       Srestore_buffer_modified_p, 1, 1, 0, 
    1046        doc: /* Like `set-buffer-modified-p', with a differences concerning redisplay. 
     1064       doc: /* Like `set-buffer-modified-p', with a difference concerning redisplay. 
    10471065It is not ensured that mode lines will be updated to show the modified 
    10481066state of the current buffer.  Use with care.  */) 
    1049   (flag) 
     1067     (flag) 
    10501068     Lisp_Object flag; 
    10511069{ 
     
    10781096that buffer is changed.  It wraps around occasionally. 
    10791097No argument or nil as argument means use current buffer as BUFFER.  */) 
    1080   (buffer) 
     1098     (buffer) 
    10811099     register Lisp_Object buffer; 
    10821100{ 
     
    11031121We return the name we actually gave the buffer. 
    11041122This does not change the name of the visited file (if any).  */) 
    1105   (newname, unique) 
     1123     (newname, unique) 
    11061124&n