Commit d6aa1876 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* 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.
parent de509a60
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.
......
......@@ -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", &current_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. */);
......
......@@ -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", &current_buffer->abbrev_table, Qnil,
doc: /* Local (mode-specific) abbrev table of current buffer. */);
DEFVAR_PER_BUFFER ("abbrev-mode", &current_buffer->abbrev_mode, Qnil,
doc: /* Non-nil turns on automatic expansion of abbrevs as they are inserted. */);
......
......@@ -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 *)(&current_kboard->vname) \
......
......@@ -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. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment