diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 13 | ||||
| -rw-r--r-- | src/abbrev.c | 3 | ||||
| -rw-r--r-- | src/buffer.c | 43 | ||||
| -rw-r--r-- | src/lisp.h | 16 | ||||
| -rw-r--r-- | src/lread.c | 31 | 
5 files changed, 62 insertions, 44 deletions
| diff --git a/src/ChangeLog b/src/ChangeLog index 1ace8bec331..6c951c9ac8f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2007-10-02  Stefan Monnier  <monnier@iro.umontreal.ca> + +	* buffer.c (syms_of_buffer) <local-abbrev-table>: Move from abbrev.c. +	(DEFVAR_PER_BUFFER, defvar_per_buffer): Move from lisp.h and lread.c. +	* lisp.h (defvar_per_buffer, DEFVAR_PER_BUFFER): +	* lread.c (defvar_per_buffer): +	* abbrev.c (syms_of_abbrev) <local-abbrev-tabl>: Move to buffer.c. + +	* window.c (candidate_window_p): Only consider as visible frames that +	are on the same terminal. + +	* m/ibms390x.h (MARKBIT): Remove unused macro. +  2007-10-01  Juanma Barranquero  <lekktu@gmail.com>  	* lread.c (Fload): Fix typo in docstring. diff --git a/src/abbrev.c b/src/abbrev.c index da1724e2998..403afdb99a7 100644 --- a/src/abbrev.c +++ b/src/abbrev.c @@ -769,9 +769,6 @@ Calling `expand-abbrev' sets this to nil.  */);  Trying to expand an abbrev in any other buffer clears `abbrev-start-location'.  */);    Vabbrev_start_location_buffer = Qnil; -  DEFVAR_PER_BUFFER ("local-abbrev-table", ¤t_buffer->abbrev_table, Qnil, -		     doc: /* Local (mode-specific) abbrev table of current buffer.  */); -    DEFVAR_BOOL ("abbrevs-changed", &abbrevs_changed,  	       doc: /* Set non-nil by defining or altering any word abbrevs.  This causes `save-some-buffers' to offer to save the abbrevs.  */); diff --git a/src/buffer.c b/src/buffer.c index 8cd13b07855..bdb13adcba8 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5275,6 +5275,46 @@ init_buffer ()    free (pwd);  } +/* Similar to defvar_lisp but define a variable whose value is the Lisp +   Object stored in the current buffer.  address is the address of the slot +   in the buffer that is current now. */ + +/* TYPE is nil for a general Lisp variable. +   An integer specifies a type; then only LIsp values +   with that type code are allowed (except that nil is allowed too). +   LNAME is the LIsp-level variable name. +   VNAME is the name of the buffer slot. +   DOC is a dummy where you write the doc string as a comment.  */ +#define DEFVAR_PER_BUFFER(lname, vname, type, doc)  \ + defvar_per_buffer (lname, vname, type, 0) + +static void +defvar_per_buffer (namestring, address, type, doc) +     char *namestring; +     Lisp_Object *address; +     Lisp_Object type; +     char *doc; +{ +  Lisp_Object sym, val; +  int offset; + +  sym = intern (namestring); +  val = allocate_misc (); +  offset = (char *)address - (char *)current_buffer; + +  XMISCTYPE (val) = Lisp_Misc_Buffer_Objfwd; +  XBUFFER_OBJFWD (val)->offset = offset; +  SET_SYMBOL_VALUE (sym, val); +  PER_BUFFER_SYMBOL (offset) = sym; +  PER_BUFFER_TYPE (offset) = type; + +  if (PER_BUFFER_IDX (offset) == 0) +    /* Did a DEFVAR_PER_BUFFER without initializing the corresponding +       slot of buffer_local_flags */ +    abort (); +} + +  /* initialize the buffer routines */  void  syms_of_buffer () @@ -5560,6 +5600,9 @@ its hooks should not expect certain variables such as                       Qnil,  		     doc: /* Pretty name of current buffer's major mode (a string).  */); +  DEFVAR_PER_BUFFER ("local-abbrev-table", ¤t_buffer->abbrev_table, Qnil, +		     doc: /* Local (mode-specific) abbrev table of current buffer.  */); +    DEFVAR_PER_BUFFER ("abbrev-mode", ¤t_buffer->abbrev_mode, Qnil,  		     doc: /* Non-nil turns on automatic expansion of abbrevs as they are inserted.  */); diff --git a/src/lisp.h b/src/lisp.h index b30af269508..69ef17f7b85 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1145,6 +1145,8 @@ struct Lisp_Marker    /* For markers that point somewhere,       this is used to chain of all the markers in a given buffer.  */ +  /* We could remove it and use an array in buffer_text instead. +     That would also allow to preserve it ordered.  */    struct Lisp_Marker *next;    /* This is the char position where the marker points.  */    EMACS_INT charpos; @@ -1242,6 +1244,10 @@ struct Lisp_Buffer_Local_Value      unsigned int found_for_frame : 1;      Lisp_Object realvalue;      /* The buffer and frame for which the loaded binding was found.  */ +    /* Having both is only needed if we want to allow variables that are +       both buffer local and frame local (in which case, we currently give +       precedence to the buffer-local binding).  I don't think such +       a combination is desirable.  --Stef  */      Lisp_Object buffer, frame;      /* A cons cell, (LOADED-BINDING . DEFAULT-VALUE). @@ -1723,7 +1729,6 @@ extern void defvar_lisp P_ ((char *, Lisp_Object *));  extern void defvar_lisp_nopro P_ ((char *, Lisp_Object *));  extern void defvar_bool P_ ((char *, int *));  extern void defvar_int P_ ((char *, EMACS_INT *)); -extern void defvar_per_buffer P_ ((char *, Lisp_Object *, Lisp_Object, char *));  extern void defvar_kboard P_ ((char *, int));  /* Macros we use to define forwarded Lisp variables. @@ -1734,15 +1739,6 @@ extern void defvar_kboard P_ ((char *, int));  #define DEFVAR_BOOL(lname, vname, doc) defvar_bool (lname, vname)  #define DEFVAR_INT(lname, vname, doc) defvar_int (lname, vname) -/* TYPE is nil for a general Lisp variable. -   An integer specifies a type; then only LIsp values -   with that type code are allowed (except that nil is allowed too). -   LNAME is the LIsp-level variable name. -   VNAME is the name of the buffer slot. -   DOC is a dummy where you write the doc string as a comment.  */ -#define DEFVAR_PER_BUFFER(lname, vname, type, doc)  \ - defvar_per_buffer (lname, vname, type, 0) -  #define DEFVAR_KBOARD(lname, vname, doc) \   defvar_kboard (lname, \  		(int)((char *)(¤t_kboard->vname) \ diff --git a/src/lread.c b/src/lread.c index d2709dead4c..189fcc0977f 100644 --- a/src/lread.c +++ b/src/lread.c @@ -3746,37 +3746,6 @@ defvar_lisp (namestring, address)    staticpro (address);  } -/* Similar but define a variable whose value is the Lisp Object stored in -   the current buffer.  address is the address of the slot in the buffer -   that is current now. */ - -void -defvar_per_buffer (namestring, address, type, doc) -     char *namestring; -     Lisp_Object *address; -     Lisp_Object type; -     char *doc; -{ -  Lisp_Object sym, val; -  int offset; - -  sym = intern (namestring); -  val = allocate_misc (); -  offset = (char *)address - (char *)current_buffer; - -  XMISCTYPE (val) = Lisp_Misc_Buffer_Objfwd; -  XBUFFER_OBJFWD (val)->offset = offset; -  SET_SYMBOL_VALUE (sym, val); -  PER_BUFFER_SYMBOL (offset) = sym; -  PER_BUFFER_TYPE (offset) = type; - -  if (PER_BUFFER_IDX (offset) == 0) -    /* Did a DEFVAR_PER_BUFFER without initializing the corresponding -       slot of buffer_local_flags */ -    abort (); -} - -  /* Similar but define a variable whose value is the Lisp Object stored     at a particular offset in the current kboard object.  */ | 
