comparison src/buffer.c @ 62793:71f6142fcfb9

(Fbuffer_local_value): Make argument name match its use in docstring.
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 27 May 2005 11:01:38 +0000
parents a0a348c8b14b
children 5ef5c45c0187 63b7247f4be6
comparison
equal deleted inserted replaced
62792:e82e717e3b6d 62793:71f6142fcfb9
875 875
876 DEFUN ("buffer-local-value", Fbuffer_local_value, 876 DEFUN ("buffer-local-value", Fbuffer_local_value,
877 Sbuffer_local_value, 2, 2, 0, 877 Sbuffer_local_value, 2, 2, 0,
878 doc: /* Return the value of VARIABLE in BUFFER. 878 doc: /* Return the value of VARIABLE in BUFFER.
879 If VARIABLE does not have a buffer-local binding in BUFFER, the value 879 If VARIABLE does not have a buffer-local binding in BUFFER, the value
880 is the default binding of variable. */) 880 is the default binding of the variable. */)
881 (symbol, buffer) 881 (variable, buffer)
882 register Lisp_Object symbol; 882 register Lisp_Object variable;
883 register Lisp_Object buffer; 883 register Lisp_Object buffer;
884 { 884 {
885 register struct buffer *buf; 885 register struct buffer *buf;
886 register Lisp_Object result; 886 register Lisp_Object result;
887 887
888 CHECK_SYMBOL (symbol); 888 CHECK_SYMBOL (variable);
889 CHECK_BUFFER (buffer); 889 CHECK_BUFFER (buffer);
890 buf = XBUFFER (buffer); 890 buf = XBUFFER (buffer);
891 891
892 /* Look in local_var_list */ 892 /* Look in local_var_list */
893 result = Fassoc (symbol, buf->local_var_alist); 893 result = Fassoc (variable, buf->local_var_alist);
894 if (NILP (result)) 894 if (NILP (result))
895 { 895 {
896 int offset, idx; 896 int offset, idx;
897 int found = 0; 897 int found = 0;
898 898
903 offset += (sizeof (EMACS_INT))) 903 offset += (sizeof (EMACS_INT)))
904 { 904 {
905 idx = PER_BUFFER_IDX (offset); 905 idx = PER_BUFFER_IDX (offset);
906 if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx)) 906 if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx))
907 && SYMBOLP (PER_BUFFER_SYMBOL (offset)) 907 && SYMBOLP (PER_BUFFER_SYMBOL (offset))
908 && EQ (PER_BUFFER_SYMBOL (offset), symbol)) 908 && EQ (PER_BUFFER_SYMBOL (offset), variable))
909 { 909 {
910 result = PER_BUFFER_VALUE (buf, offset); 910 result = PER_BUFFER_VALUE (buf, offset);
911 found = 1; 911 found = 1;
912 break; 912 break;
913 } 913 }
914 } 914 }
915 915
916 if (!found) 916 if (!found)
917 result = Fdefault_value (symbol); 917 result = Fdefault_value (variable);
918 } 918 }
919 else 919 else
920 { 920 {
921 Lisp_Object valcontents; 921 Lisp_Object valcontents;
922 Lisp_Object current_alist_element; 922 Lisp_Object current_alist_element;
923 923
924 /* What binding is loaded right now? */ 924 /* What binding is loaded right now? */
925 valcontents = SYMBOL_VALUE (symbol); 925 valcontents = SYMBOL_VALUE (variable);
926 current_alist_element 926 current_alist_element
927 = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr); 927 = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr);
928 928
929 /* The value of the currently loaded binding is not 929 /* The value of the currently loaded binding is not
930 stored in it, but rather in the realvalue slot. 930 stored in it, but rather in the realvalue slot.
937 /* Now get the (perhaps updated) value out of the binding. */ 937 /* Now get the (perhaps updated) value out of the binding. */
938 result = XCDR (result); 938 result = XCDR (result);
939 } 939 }
940 940
941 if (EQ (result, Qunbound)) 941 if (EQ (result, Qunbound))
942 return Fsignal (Qvoid_variable, Fcons (symbol, Qnil)); 942 return Fsignal (Qvoid_variable, Fcons (variable, Qnil));
943 943
944 return result; 944 return result;
945 } 945 }
946 946
947 /* Return an alist of the Lisp-level buffer-local bindings of 947 /* Return an alist of the Lisp-level buffer-local bindings of
5274 DEFVAR_LISP_NOPRO ("default-ctl-arrow", 5274 DEFVAR_LISP_NOPRO ("default-ctl-arrow",
5275 &buffer_defaults.ctl_arrow, 5275 &buffer_defaults.ctl_arrow,
5276 doc: /* Default value of `ctl-arrow' for buffers that do not override it. 5276 doc: /* Default value of `ctl-arrow' for buffers that do not override it.
5277 This is the same as (default-value 'ctl-arrow). */); 5277 This is the same as (default-value 'ctl-arrow). */);
5278 5278
5279 DEFVAR_LISP_NOPRO ("default-direction-reversed", 5279 DEFVAR_LISP_NOPRO ("default-direction-reversed",
5280 &buffer_defaults.direction_reversed, 5280 &buffer_defaults.direction_reversed,
5281 doc: /* Default value of `direction-reversed' for buffers that do not override it. 5281 doc: /* Default value of `direction-reversed' for buffers that do not override it.
5282 This is the same as (default-value 'direction-reversed). */); 5282 This is the same as (default-value 'direction-reversed). */);
5283 5283
5284 DEFVAR_LISP_NOPRO ("default-enable-multibyte-characters", 5284 DEFVAR_LISP_NOPRO ("default-enable-multibyte-characters",
5285 &buffer_defaults.enable_multibyte_characters, 5285 &buffer_defaults.enable_multibyte_characters,
5286 doc: /* *Default value of `enable-multibyte-characters' for buffers not overriding it. 5286 doc: /* *Default value of `enable-multibyte-characters' for buffers not overriding it.
5287 This is the same as (default-value 'enable-multibyte-characters). */); 5287 This is the same as (default-value 'enable-multibyte-characters). */);
5288 5288
5289 DEFVAR_LISP_NOPRO ("default-buffer-file-coding-system", 5289 DEFVAR_LISP_NOPRO ("default-buffer-file-coding-system",
5290 &buffer_defaults.buffer_file_coding_system, 5290 &buffer_defaults.buffer_file_coding_system,
5291 doc: /* Default value of `buffer-file-coding-system' for buffers not overriding it. 5291 doc: /* Default value of `buffer-file-coding-system' for buffers not overriding it.
5292 This is the same as (default-value 'buffer-file-coding-system). */); 5292 This is the same as (default-value 'buffer-file-coding-system). */);
5293 5293
5294 DEFVAR_LISP_NOPRO ("default-truncate-lines", 5294 DEFVAR_LISP_NOPRO ("default-truncate-lines",
5295 &buffer_defaults.truncate_lines, 5295 &buffer_defaults.truncate_lines,
5296 doc: /* Default value of `truncate-lines' for buffers that do not override it. 5296 doc: /* Default value of `truncate-lines' for buffers that do not override it.