diff options
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/src/buffer.c b/src/buffer.c index d9769ce10ab..a8daebc3088 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -878,20 +878,23 @@ 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; |
| @@ -906,7 +909,7 @@ is the default binding of variable. */) | |||
| 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; |
| @@ -915,7 +918,7 @@ is the default binding of variable. */) | |||
| 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 | { |
| @@ -923,7 +926,7 @@ is the default binding of variable. */) | |||
| 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 | ||
| @@ -940,7 +943,7 @@ is the default binding of variable. */) | |||
| 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 | } |
| @@ -5292,19 +5295,19 @@ This is the same as (default-value 'abbrev-mode). */); | |||
| 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", |