aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
authorDmitry Antipov2013-01-10 14:30:16 +0400
committerDmitry Antipov2013-01-10 14:30:16 +0400
commit58cc0a010b7e16dfcf03d7e858ea27eba5dece65 (patch)
treec7df6a362013ac141d0cff69529052977b45e4b8 /src/data.c
parent997d5f2d1d86acc55fa9b659ab69399c2968bbdc (diff)
downloademacs-58cc0a010b7e16dfcf03d7e858ea27eba5dece65.tar.gz
emacs-58cc0a010b7e16dfcf03d7e858ea27eba5dece65.zip
Omit buffer_slot_type_mismatch and use generic predicates to enforce
the type of per-buffer values where appropriate. * src/lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to predicate, which is how it's really used now. Adjust comment. * src/buffer.h (buffer_slot_type_mismatch): Remove prototype. * src/buffer.c (buffer_slot_type_mismatch): Remove. (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to predicate. Adjust comment. (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for fill-column, left-margin, tab-width, buffer-saved-size, left-margin-width, right-margin-width, left-fringe-width, right-fringe-width, scroll-bar-width and buffer-display-count. Use Qstringp for default-directory, buffer-file-name, buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for line-spacing. * src/data.c (store_symval_forwarding): Adjust to call the predicate. * lisp/cus-start.el (toplevel): Only allow float values for scroll-up-aggressively and scroll-down-aggressively. Allow any number for line-spacing.
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/data.c b/src/data.c
index 50dc188684f..6622088b648 100644
--- a/src/data.c
+++ b/src/data.c
@@ -914,13 +914,11 @@ store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newva
914 case Lisp_Fwd_Buffer_Obj: 914 case Lisp_Fwd_Buffer_Obj:
915 { 915 {
916 int offset = XBUFFER_OBJFWD (valcontents)->offset; 916 int offset = XBUFFER_OBJFWD (valcontents)->offset;
917 Lisp_Object type = XBUFFER_OBJFWD (valcontents)->slottype; 917 Lisp_Object predicate = XBUFFER_OBJFWD (valcontents)->predicate;
918 918
919 if (!(NILP (type) || NILP (newval) 919 if (!NILP (predicate) && !NILP (newval)
920 || (XINT (type) == Lisp_Int0 920 && NILP (call1 (predicate, newval)))
921 ? INTEGERP (newval) 921 wrong_type_argument (predicate, newval);
922 : XTYPE (newval) == XINT (type))))
923 buffer_slot_type_mismatch (newval, XINT (type));
924 922
925 if (buf == NULL) 923 if (buf == NULL)
926 buf = current_buffer; 924 buf = current_buffer;