diff options
| author | Miles Bader | 2005-03-19 02:42:17 +0000 |
|---|---|---|
| committer | Miles Bader | 2005-03-19 02:42:17 +0000 |
| commit | 1bac4db5629da854a984a0e84a9469f14b6b9e76 (patch) | |
| tree | 068627144f173fed8c3331d541debae6c36f8988 /src/buffer.c | |
| parent | f603a66a19f5bfbba314daaa21e77665b3e03dd5 (diff) | |
| parent | 951f97e67d904729032b476caf5f7c2e7e303d73 (diff) | |
| download | emacs-1bac4db5629da854a984a0e84a9469f14b6b9e76.tar.gz emacs-1bac4db5629da854a984a0e84a9469f14b6b9e76.zip | |
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-28
Merge from emacs--cvs-trunk--0
Patches applied:
* emacs--cvs-trunk--0 (patch 180-191)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 39-44)
- Merge from emacs--cvs-trunk--0
- Update from CVS
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 79 |
1 files changed, 42 insertions, 37 deletions
diff --git a/src/buffer.c b/src/buffer.c index 224c1bbcdef..dcda7bc80ab 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -182,6 +182,7 @@ static void alloc_buffer_text P_ ((struct buffer *, size_t)); | |||
| 182 | static void free_buffer_text P_ ((struct buffer *b)); | 182 | static void free_buffer_text P_ ((struct buffer *b)); |
| 183 | static struct Lisp_Overlay * copy_overlays P_ ((struct buffer *, struct Lisp_Overlay *)); | 183 | static struct Lisp_Overlay * copy_overlays P_ ((struct buffer *, struct Lisp_Overlay *)); |
| 184 | static void modify_overlay P_ ((struct buffer *, EMACS_INT, EMACS_INT)); | 184 | static void modify_overlay P_ ((struct buffer *, EMACS_INT, EMACS_INT)); |
| 185 | static Lisp_Object buffer_lisp_local_variables P_ ((struct buffer *)); | ||
| 185 | 186 | ||
| 186 | extern char * emacs_strerror P_ ((int)); | 187 | extern char * emacs_strerror P_ ((int)); |
| 187 | 188 | ||
| @@ -516,16 +517,11 @@ clone_per_buffer_values (from, to) | |||
| 516 | to->overlays_before = copy_overlays (to, from->overlays_before); | 517 | to->overlays_before = copy_overlays (to, from->overlays_before); |
| 517 | to->overlays_after = copy_overlays (to, from->overlays_after); | 518 | to->overlays_after = copy_overlays (to, from->overlays_after); |
| 518 | 519 | ||
| 519 | /* Copy the alist of local variables, | 520 | /* Get (a copy of) the alist of Lisp-level local variables of FROM |
| 520 | and all the alist elements too. */ | 521 | and install that in TO. */ |
| 521 | to->local_var_alist | 522 | to->local_var_alist = buffer_lisp_local_variables (from); |
| 522 | = Fcopy_sequence (from->local_var_alist); | ||
| 523 | for (tem = to->local_var_alist; CONSP (tem); | ||
| 524 | tem = XCDR (tem)) | ||
| 525 | XSETCAR (tem, Fcons (XCAR (XCAR (tem)), XCDR (XCAR (tem)))); | ||
| 526 | } | 523 | } |
| 527 | 524 | ||
| 528 | |||
| 529 | DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer, | 525 | DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer, |
| 530 | 2, 3, | 526 | 2, 3, |
| 531 | "bMake indirect buffer (to buffer): \nBName of indirect buffer: ", | 527 | "bMake indirect buffer (to buffer): \nBName of indirect buffer: ", |
| @@ -935,6 +931,43 @@ is the default binding of variable. */) | |||
| 935 | return result; | 931 | return result; |
| 936 | } | 932 | } |
| 937 | 933 | ||
| 934 | /* Return an alist of the Lisp-level buffer-local bindings of | ||
| 935 | buffer BUF. That is, do't include the variables maintained | ||
| 936 | in special slots in the buffer object. */ | ||
| 937 | |||
| 938 | static Lisp_Object | ||
| 939 | buffer_lisp_local_variables (buf) | ||
| 940 | struct buffer *buf; | ||
| 941 | { | ||
| 942 | Lisp_Object result = Qnil; | ||
| 943 | register Lisp_Object tail; | ||
| 944 | for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) | ||
| 945 | { | ||
| 946 | Lisp_Object val, elt; | ||
| 947 | |||
| 948 | elt = XCAR (tail); | ||
| 949 | |||
| 950 | /* Reference each variable in the alist in buf. | ||
| 951 | If inquiring about the current buffer, this gets the current values, | ||
| 952 | so store them into the alist so the alist is up to date. | ||
| 953 | If inquiring about some other buffer, this swaps out any values | ||
| 954 | for that buffer, making the alist up to date automatically. */ | ||
| 955 | val = find_symbol_value (XCAR (elt)); | ||
| 956 | /* Use the current buffer value only if buf is the current buffer. */ | ||
| 957 | if (buf != current_buffer) | ||
| 958 | val = XCDR (elt); | ||
| 959 | |||
| 960 | /* If symbol is unbound, put just the symbol in the list. */ | ||
| 961 | if (EQ (val, Qunbound)) | ||
| 962 | result = Fcons (XCAR (elt), result); | ||
| 963 | /* Otherwise, put (symbol . value) in the list. */ | ||
| 964 | else | ||
| 965 | result = Fcons (Fcons (XCAR (elt), val), result); | ||
| 966 | } | ||
| 967 | |||
| 968 | return result; | ||
| 969 | } | ||
| 970 | |||
| 938 | DEFUN ("buffer-local-variables", Fbuffer_local_variables, | 971 | DEFUN ("buffer-local-variables", Fbuffer_local_variables, |
| 939 | Sbuffer_local_variables, 0, 1, 0, | 972 | Sbuffer_local_variables, 0, 1, 0, |
| 940 | doc: /* Return an alist of variables that are buffer-local in BUFFER. | 973 | doc: /* Return an alist of variables that are buffer-local in BUFFER. |
| @@ -956,34 +989,7 @@ No argument or nil as argument means use current buffer as BUFFER. */) | |||
| 956 | buf = XBUFFER (buffer); | 989 | buf = XBUFFER (buffer); |
| 957 | } | 990 | } |
| 958 | 991 | ||
| 959 | result = Qnil; | 992 | result = buffer_lisp_local_variables (buf); |
| 960 | |||
| 961 | { | ||
| 962 | register Lisp_Object tail; | ||
| 963 | for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) | ||
| 964 | { | ||
| 965 | Lisp_Object val, elt; | ||
| 966 | |||
| 967 | elt = XCAR (tail); | ||
| 968 | |||
| 969 | /* Reference each variable in the alist in buf. | ||
| 970 | If inquiring about the current buffer, this gets the current values, | ||
| 971 | so store them into the alist so the alist is up to date. | ||
| 972 | If inquiring about some other buffer, this swaps out any values | ||
| 973 | for that buffer, making the alist up to date automatically. */ | ||
| 974 | val = find_symbol_value (XCAR (elt)); | ||
| 975 | /* Use the current buffer value only if buf is the current buffer. */ | ||
| 976 | if (buf != current_buffer) | ||
| 977 | val = XCDR (elt); | ||
| 978 | |||
| 979 | /* If symbol is unbound, put just the symbol in the list. */ | ||
| 980 | if (EQ (val, Qunbound)) | ||
| 981 | result = Fcons (XCAR (elt), result); | ||
| 982 | /* Otherwise, put (symbol . value) in the list. */ | ||
| 983 | else | ||
| 984 | result = Fcons (Fcons (XCAR (elt), val), result); | ||
| 985 | } | ||
| 986 | } | ||
| 987 | 993 | ||
| 988 | /* Add on all the variables stored in special slots. */ | 994 | /* Add on all the variables stored in special slots. */ |
| 989 | { | 995 | { |
| @@ -1005,7 +1011,6 @@ No argument or nil as argument means use current buffer as BUFFER. */) | |||
| 1005 | 1011 | ||
| 1006 | return result; | 1012 | return result; |
| 1007 | } | 1013 | } |
| 1008 | |||
| 1009 | 1014 | ||
| 1010 | DEFUN ("buffer-modified-p", Fbuffer_modified_p, Sbuffer_modified_p, | 1015 | DEFUN ("buffer-modified-p", Fbuffer_modified_p, Sbuffer_modified_p, |
| 1011 | 0, 1, 0, | 1016 | 0, 1, 0, |