Mercurial > emacs
comparison src/buffer.c @ 90188:01137c1fdbe9
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-57
Merge from emacs--cvs-trunk--0
Patches applied:
* emacs--cvs-trunk--0 (patch 324-352)
- Merge from gnus--rel--5.10
- Update from CVS
- etc/emacs-buffer.gdb: Remove RCS keywords
* gnus--rel--5.10 (patch 70-79)
- Update from CVS
- Merge from emacs--cvs-trunk--0
| author | Miles Bader <miles@gnu.org> |
|---|---|
| date | Mon, 06 Jun 2005 02:39:45 +0000 |
| parents | 62afea0771d8 5ef5c45c0187 |
| children | b7da78284d4c |
comparison
equal
deleted
inserted
replaced
| 90187:587ea1490d70 | 90188:01137c1fdbe9 |
|---|---|
| 876 | 876 |
| 877 DEFUN ("buffer-local-value", Fbuffer_local_value, | 877 DEFUN ("buffer-local-value", Fbuffer_local_value, |
| 878 Sbuffer_local_value, 2, 2, 0, | 878 Sbuffer_local_value, 2, 2, 0, |
| 879 doc: /* Return the value of VARIABLE in BUFFER. | 879 doc: /* Return the value of VARIABLE in BUFFER. |
| 880 If VARIABLE does not have a buffer-local binding in BUFFER, the value | 880 If VARIABLE does not have a buffer-local binding in BUFFER, the value |
| 881 is the default binding of variable. */) | 881 is the default binding of the variable. */) |
| 882 (symbol, buffer) | 882 (variable, buffer) |
| 883 register Lisp_Object symbol; | 883 register Lisp_Object variable; |
| 884 register Lisp_Object buffer; | 884 register Lisp_Object buffer; |
| 885 { | 885 { |
| 886 register struct buffer *buf; | 886 register struct buffer *buf; |
| 887 register Lisp_Object result; | 887 register Lisp_Object result; |
| 888 | 888 |
| 889 CHECK_SYMBOL (symbol); | 889 CHECK_SYMBOL (variable); |
| 890 CHECK_BUFFER (buffer); | 890 CHECK_BUFFER (buffer); |
| 891 buf = XBUFFER (buffer); | 891 buf = XBUFFER (buffer); |
| 892 | 892 |
| 893 if (SYMBOLP (variable)) | |
| 894 variable = indirect_variable (variable); | |
| 895 | |
| 893 /* Look in local_var_list */ | 896 /* Look in local_var_list */ |
| 894 result = Fassoc (symbol, buf->local_var_alist); | 897 result = Fassoc (variable, buf->local_var_alist); |
| 895 if (NILP (result)) | 898 if (NILP (result)) |
| 896 { | 899 { |
| 897 int offset, idx; | 900 int offset, idx; |
| 898 int found = 0; | 901 int found = 0; |
| 899 | 902 |
| 904 offset += (sizeof (EMACS_INT))) | 907 offset += (sizeof (EMACS_INT))) |
| 905 { | 908 { |
| 906 idx = PER_BUFFER_IDX (offset); | 909 idx = PER_BUFFER_IDX (offset); |
| 907 if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx)) | 910 if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx)) |
| 908 && SYMBOLP (PER_BUFFER_SYMBOL (offset)) | 911 && SYMBOLP (PER_BUFFER_SYMBOL (offset)) |
| 909 && EQ (PER_BUFFER_SYMBOL (offset), symbol)) | 912 && EQ (PER_BUFFER_SYMBOL (offset), variable)) |
| 910 { | 913 { |
| 911 result = PER_BUFFER_VALUE (buf, offset); | 914 result = PER_BUFFER_VALUE (buf, offset); |
| 912 found = 1; | 915 found = 1; |
| 913 break; | 916 break; |
| 914 } | 917 } |
| 915 } | 918 } |
| 916 | 919 |
| 917 if (!found) | 920 if (!found) |
| 918 result = Fdefault_value (symbol); | 921 result = Fdefault_value (variable); |
| 919 } | 922 } |
| 920 else | 923 else |
| 921 { | 924 { |
| 922 Lisp_Object valcontents; | 925 Lisp_Object valcontents; |
| 923 Lisp_Object current_alist_element; | 926 Lisp_Object current_alist_element; |
| 924 | 927 |
| 925 /* What binding is loaded right now? */ | 928 /* What binding is loaded right now? */ |
| 926 valcontents = SYMBOL_VALUE (symbol); | 929 valcontents = SYMBOL_VALUE (variable); |
| 927 current_alist_element | 930 current_alist_element |
| 928 = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr); | 931 = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr); |
| 929 | 932 |
| 930 /* The value of the currently loaded binding is not | 933 /* The value of the currently loaded binding is not |
| 931 stored in it, but rather in the realvalue slot. | 934 stored in it, but rather in the realvalue slot. |
| 938 /* Now get the (perhaps updated) value out of the binding. */ | 941 /* Now get the (perhaps updated) value out of the binding. */ |
| 939 result = XCDR (result); | 942 result = XCDR (result); |
| 940 } | 943 } |
| 941 | 944 |
| 942 if (EQ (result, Qunbound)) | 945 if (EQ (result, Qunbound)) |
| 943 return Fsignal (Qvoid_variable, Fcons (symbol, Qnil)); | 946 return Fsignal (Qvoid_variable, Fcons (variable, Qnil)); |
| 944 | 947 |
| 945 return result; | 948 return result; |
| 946 } | 949 } |
| 947 | 950 |
| 948 /* Return an alist of the Lisp-level buffer-local bindings of | 951 /* Return an alist of the Lisp-level buffer-local bindings of |
| 5290 DEFVAR_LISP_NOPRO ("default-ctl-arrow", | 5293 DEFVAR_LISP_NOPRO ("default-ctl-arrow", |
| 5291 &buffer_defaults.ctl_arrow, | 5294 &buffer_defaults.ctl_arrow, |
| 5292 doc: /* Default value of `ctl-arrow' for buffers that do not override it. | 5295 doc: /* Default value of `ctl-arrow' for buffers that do not override it. |
| 5293 This is the same as (default-value 'ctl-arrow). */); | 5296 This is the same as (default-value 'ctl-arrow). */); |
| 5294 | 5297 |
| 5295 DEFVAR_LISP_NOPRO ("default-direction-reversed", | 5298 DEFVAR_LISP_NOPRO ("default-direction-reversed", |
| 5296 &buffer_defaults.direction_reversed, | 5299 &buffer_defaults.direction_reversed, |
| 5297 doc: /* Default value of `direction-reversed' for buffers that do not override it. | 5300 doc: /* Default value of `direction-reversed' for buffers that do not override it. |
| 5298 This is the same as (default-value 'direction-reversed). */); | 5301 This is the same as (default-value 'direction-reversed). */); |
| 5299 | 5302 |
| 5300 DEFVAR_LISP_NOPRO ("default-enable-multibyte-characters", | 5303 DEFVAR_LISP_NOPRO ("default-enable-multibyte-characters", |
| 5301 &buffer_defaults.enable_multibyte_characters, | 5304 &buffer_defaults.enable_multibyte_characters, |
| 5302 doc: /* *Default value of `enable-multibyte-characters' for buffers not overriding it. | 5305 doc: /* *Default value of `enable-multibyte-characters' for buffers not overriding it. |
| 5303 This is the same as (default-value 'enable-multibyte-characters). */); | 5306 This is the same as (default-value 'enable-multibyte-characters). */); |
| 5304 | 5307 |
| 5305 DEFVAR_LISP_NOPRO ("default-buffer-file-coding-system", | 5308 DEFVAR_LISP_NOPRO ("default-buffer-file-coding-system", |
| 5306 &buffer_defaults.buffer_file_coding_system, | 5309 &buffer_defaults.buffer_file_coding_system, |
| 5307 doc: /* Default value of `buffer-file-coding-system' for buffers not overriding it. | 5310 doc: /* Default value of `buffer-file-coding-system' for buffers not overriding it. |
| 5308 This is the same as (default-value 'buffer-file-coding-system). */); | 5311 This is the same as (default-value 'buffer-file-coding-system). */); |
| 5309 | 5312 |
| 5310 DEFVAR_LISP_NOPRO ("default-truncate-lines", | 5313 DEFVAR_LISP_NOPRO ("default-truncate-lines", |
| 5311 &buffer_defaults.truncate_lines, | 5314 &buffer_defaults.truncate_lines, |
| 5312 doc: /* Default value of `truncate-lines' for buffers that do not override it. | 5315 doc: /* Default value of `truncate-lines' for buffers that do not override it. |
