aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2007-10-02 20:51:02 +0000
committerStefan Monnier2007-10-02 20:51:02 +0000
commitd6aa1876eb29c086ef190c46d488d391db062f50 (patch)
treee809e1bbd31b4dc7958049774229273873e38828 /src
parentde509a6071aa4d046e666860468bb7d8bf134e02 (diff)
downloademacs-d6aa1876eb29c086ef190c46d488d391db062f50.tar.gz
emacs-d6aa1876eb29c086ef190c46d488d391db062f50.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog13
-rw-r--r--src/abbrev.c3
-rw-r--r--src/buffer.c43
-rw-r--r--src/lisp.h16
-rw-r--r--src/lread.c31
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 @@
12007-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * buffer.c (syms_of_buffer) <local-abbrev-table>: Move from abbrev.c.
4 (DEFVAR_PER_BUFFER, defvar_per_buffer): Move from lisp.h and lread.c.
5 * lisp.h (defvar_per_buffer, DEFVAR_PER_BUFFER):
6 * lread.c (defvar_per_buffer):
7 * abbrev.c (syms_of_abbrev) <local-abbrev-tabl>: Move to buffer.c.
8
9 * window.c (candidate_window_p): Only consider as visible frames that
10 are on the same terminal.
11
12 * m/ibms390x.h (MARKBIT): Remove unused macro.
13
12007-10-01 Juanma Barranquero <lekktu@gmail.com> 142007-10-01 Juanma Barranquero <lekktu@gmail.com>
2 15
3 * lread.c (Fload): Fix typo in docstring. 16 * 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. */);
769Trying to expand an abbrev in any other buffer clears `abbrev-start-location'. */); 769Trying to expand an abbrev in any other buffer clears `abbrev-start-location'. */);
770 Vabbrev_start_location_buffer = Qnil; 770 Vabbrev_start_location_buffer = Qnil;
771 771
772 DEFVAR_PER_BUFFER ("local-abbrev-table", &current_buffer->abbrev_table, Qnil,
773 doc: /* Local (mode-specific) abbrev table of current buffer. */);
774
775 DEFVAR_BOOL ("abbrevs-changed", &abbrevs_changed, 772 DEFVAR_BOOL ("abbrevs-changed", &abbrevs_changed,
776 doc: /* Set non-nil by defining or altering any word abbrevs. 773 doc: /* Set non-nil by defining or altering any word abbrevs.
777This causes `save-some-buffers' to offer to save the abbrevs. */); 774This 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 ()
5275 free (pwd); 5275 free (pwd);
5276} 5276}
5277 5277
5278/* Similar to defvar_lisp but define a variable whose value is the Lisp
5279 Object stored in the current buffer. address is the address of the slot
5280 in the buffer that is current now. */
5281
5282/* TYPE is nil for a general Lisp variable.
5283 An integer specifies a type; then only LIsp values
5284 with that type code are allowed (except that nil is allowed too).
5285 LNAME is the LIsp-level variable name.
5286 VNAME is the name of the buffer slot.
5287 DOC is a dummy where you write the doc string as a comment. */
5288#define DEFVAR_PER_BUFFER(lname, vname, type, doc) \
5289 defvar_per_buffer (lname, vname, type, 0)
5290
5291static void
5292defvar_per_buffer (namestring, address, type, doc)
5293 char *namestring;
5294 Lisp_Object *address;
5295 Lisp_Object type;
5296 char *doc;
5297{
5298 Lisp_Object sym, val;
5299 int offset;
5300
5301 sym = intern (namestring);
5302 val = allocate_misc ();
5303 offset = (char *)address - (char *)current_buffer;
5304
5305 XMISCTYPE (val) = Lisp_Misc_Buffer_Objfwd;
5306 XBUFFER_OBJFWD (val)->offset = offset;
5307 SET_SYMBOL_VALUE (sym, val);
5308 PER_BUFFER_SYMBOL (offset) = sym;
5309 PER_BUFFER_TYPE (offset) = type;
5310
5311 if (PER_BUFFER_IDX (offset) == 0)
5312 /* Did a DEFVAR_PER_BUFFER without initializing the corresponding
5313 slot of buffer_local_flags */
5314 abort ();
5315}
5316
5317
5278/* initialize the buffer routines */ 5318/* initialize the buffer routines */
5279void 5319void
5280syms_of_buffer () 5320syms_of_buffer ()
@@ -5560,6 +5600,9 @@ its hooks should not expect certain variables such as
5560 Qnil, 5600 Qnil,
5561 doc: /* Pretty name of current buffer's major mode (a string). */); 5601 doc: /* Pretty name of current buffer's major mode (a string). */);
5562 5602
5603 DEFVAR_PER_BUFFER ("local-abbrev-table", &current_buffer->abbrev_table, Qnil,
5604 doc: /* Local (mode-specific) abbrev table of current buffer. */);
5605
5563 DEFVAR_PER_BUFFER ("abbrev-mode", &current_buffer->abbrev_mode, Qnil, 5606 DEFVAR_PER_BUFFER ("abbrev-mode", &current_buffer->abbrev_mode, Qnil,
5564 doc: /* Non-nil turns on automatic expansion of abbrevs as they are inserted. */); 5607 doc: /* Non-nil turns on automatic expansion of abbrevs as they are inserted. */);
5565 5608
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
1145 1145
1146 /* For markers that point somewhere, 1146 /* For markers that point somewhere,
1147 this is used to chain of all the markers in a given buffer. */ 1147 this is used to chain of all the markers in a given buffer. */
1148 /* We could remove it and use an array in buffer_text instead.
1149 That would also allow to preserve it ordered. */
1148 struct Lisp_Marker *next; 1150 struct Lisp_Marker *next;
1149 /* This is the char position where the marker points. */ 1151 /* This is the char position where the marker points. */
1150 EMACS_INT charpos; 1152 EMACS_INT charpos;
@@ -1242,6 +1244,10 @@ struct Lisp_Buffer_Local_Value
1242 unsigned int found_for_frame : 1; 1244 unsigned int found_for_frame : 1;
1243 Lisp_Object realvalue; 1245 Lisp_Object realvalue;
1244 /* The buffer and frame for which the loaded binding was found. */ 1246 /* The buffer and frame for which the loaded binding was found. */
1247 /* Having both is only needed if we want to allow variables that are
1248 both buffer local and frame local (in which case, we currently give
1249 precedence to the buffer-local binding). I don't think such
1250 a combination is desirable. --Stef */
1245 Lisp_Object buffer, frame; 1251 Lisp_Object buffer, frame;
1246 1252
1247 /* A cons cell, (LOADED-BINDING . DEFAULT-VALUE). 1253 /* A cons cell, (LOADED-BINDING . DEFAULT-VALUE).
@@ -1723,7 +1729,6 @@ extern void defvar_lisp P_ ((char *, Lisp_Object *));
1723extern void defvar_lisp_nopro P_ ((char *, Lisp_Object *)); 1729extern void defvar_lisp_nopro P_ ((char *, Lisp_Object *));
1724extern void defvar_bool P_ ((char *, int *)); 1730extern void defvar_bool P_ ((char *, int *));
1725extern void defvar_int P_ ((char *, EMACS_INT *)); 1731extern void defvar_int P_ ((char *, EMACS_INT *));
1726extern void defvar_per_buffer P_ ((char *, Lisp_Object *, Lisp_Object, char *));
1727extern void defvar_kboard P_ ((char *, int)); 1732extern void defvar_kboard P_ ((char *, int));
1728 1733
1729/* Macros we use to define forwarded Lisp variables. 1734/* Macros we use to define forwarded Lisp variables.
@@ -1734,15 +1739,6 @@ extern void defvar_kboard P_ ((char *, int));
1734#define DEFVAR_BOOL(lname, vname, doc) defvar_bool (lname, vname) 1739#define DEFVAR_BOOL(lname, vname, doc) defvar_bool (lname, vname)
1735#define DEFVAR_INT(lname, vname, doc) defvar_int (lname, vname) 1740#define DEFVAR_INT(lname, vname, doc) defvar_int (lname, vname)
1736 1741
1737/* TYPE is nil for a general Lisp variable.
1738 An integer specifies a type; then only LIsp values
1739 with that type code are allowed (except that nil is allowed too).
1740 LNAME is the LIsp-level variable name.
1741 VNAME is the name of the buffer slot.
1742 DOC is a dummy where you write the doc string as a comment. */
1743#define DEFVAR_PER_BUFFER(lname, vname, type, doc) \
1744 defvar_per_buffer (lname, vname, type, 0)
1745
1746#define DEFVAR_KBOARD(lname, vname, doc) \ 1742#define DEFVAR_KBOARD(lname, vname, doc) \
1747 defvar_kboard (lname, \ 1743 defvar_kboard (lname, \
1748 (int)((char *)(&current_kboard->vname) \ 1744 (int)((char *)(&current_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)
3746 staticpro (address); 3746 staticpro (address);
3747} 3747}
3748 3748
3749/* Similar but define a variable whose value is the Lisp Object stored in
3750 the current buffer. address is the address of the slot in the buffer
3751 that is current now. */
3752
3753void
3754defvar_per_buffer (namestring, address, type, doc)
3755 char *namestring;
3756 Lisp_Object *address;
3757 Lisp_Object type;
3758 char *doc;
3759{
3760 Lisp_Object sym, val;
3761 int offset;
3762
3763 sym = intern (namestring);
3764 val = allocate_misc ();
3765 offset = (char *)address - (char *)current_buffer;
3766
3767 XMISCTYPE (val) = Lisp_Misc_Buffer_Objfwd;
3768 XBUFFER_OBJFWD (val)->offset = offset;
3769 SET_SYMBOL_VALUE (sym, val);
3770 PER_BUFFER_SYMBOL (offset) = sym;
3771 PER_BUFFER_TYPE (offset) = type;
3772
3773 if (PER_BUFFER_IDX (offset) == 0)
3774 /* Did a DEFVAR_PER_BUFFER without initializing the corresponding
3775 slot of buffer_local_flags */
3776 abort ();
3777}
3778
3779
3780/* Similar but define a variable whose value is the Lisp Object stored 3749/* Similar but define a variable whose value is the Lisp Object stored
3781 at a particular offset in the current kboard object. */ 3750 at a particular offset in the current kboard object. */
3782 3751