diff options
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 47 |
1 files changed, 21 insertions, 26 deletions
diff --git a/src/data.c b/src/data.c index 3e651414e68..9977a3aaadd 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -979,17 +979,21 @@ wrong_choice (Lisp_Object choice, Lisp_Object wrong) | |||
| 979 | { | 979 | { |
| 980 | ptrdiff_t i = 0, len = XINT (Flength (choice)); | 980 | ptrdiff_t i = 0, len = XINT (Flength (choice)); |
| 981 | Lisp_Object obj, *args; | 981 | Lisp_Object obj, *args; |
| 982 | AUTO_STRING (one_of, "One of "); | ||
| 983 | AUTO_STRING (comma, ", "); | ||
| 984 | AUTO_STRING (or, " or "); | ||
| 985 | AUTO_STRING (should_be_specified, " should be specified"); | ||
| 982 | 986 | ||
| 983 | USE_SAFE_ALLOCA; | 987 | USE_SAFE_ALLOCA; |
| 984 | SAFE_ALLOCA_LISP (args, len * 2 + 1); | 988 | SAFE_ALLOCA_LISP (args, len * 2 + 1); |
| 985 | 989 | ||
| 986 | args[i++] = build_string ("One of "); | 990 | args[i++] = one_of; |
| 987 | 991 | ||
| 988 | for (obj = choice; !NILP (obj); obj = XCDR (obj)) | 992 | for (obj = choice; !NILP (obj); obj = XCDR (obj)) |
| 989 | { | 993 | { |
| 990 | args[i++] = SYMBOL_NAME (XCAR (obj)); | 994 | args[i++] = SYMBOL_NAME (XCAR (obj)); |
| 991 | args[i++] = build_string (NILP (XCDR (obj)) ? " should be specified" | 995 | args[i++] = (NILP (XCDR (obj)) ? should_be_specified |
| 992 | : (NILP (XCDR (XCDR (obj))) ? " or " : ", ")); | 996 | : NILP (XCDR (XCDR (obj))) ? or : comma); |
| 993 | } | 997 | } |
| 994 | 998 | ||
| 995 | obj = Fconcat (i, args); | 999 | obj = Fconcat (i, args); |
| @@ -1003,14 +1007,13 @@ wrong_choice (Lisp_Object choice, Lisp_Object wrong) | |||
| 1003 | static void | 1007 | static void |
| 1004 | wrong_range (Lisp_Object min, Lisp_Object max, Lisp_Object wrong) | 1008 | wrong_range (Lisp_Object min, Lisp_Object max, Lisp_Object wrong) |
| 1005 | { | 1009 | { |
| 1006 | Lisp_Object args[4]; | 1010 | AUTO_STRING (value_should_be_from, "Value should be from "); |
| 1007 | 1011 | AUTO_STRING (to, " to "); | |
| 1008 | args[0] = build_string ("Value should be from "); | 1012 | xsignal2 (Qerror, |
| 1009 | args[1] = Fnumber_to_string (min); | 1013 | Fconcat (4, ((Lisp_Object []) |
| 1010 | args[2] = build_string (" to "); | 1014 | {value_should_be_from, Fnumber_to_string (min), |
| 1011 | args[3] = Fnumber_to_string (max); | 1015 | to, Fnumber_to_string (max)})), |
| 1012 | 1016 | wrong); | |
| 1013 | xsignal2 (Qerror, Fconcat (4, args), wrong); | ||
| 1014 | } | 1017 | } |
| 1015 | 1018 | ||
| 1016 | /* Store NEWVAL into SYMBOL, where VALCONTENTS is found in the value cell | 1019 | /* Store NEWVAL into SYMBOL, where VALCONTENTS is found in the value cell |
| @@ -1311,10 +1314,10 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, | |||
| 1311 | 1314 | ||
| 1312 | /* Find the new binding. */ | 1315 | /* Find the new binding. */ |
| 1313 | XSETSYMBOL (symbol, sym); /* May have changed via aliasing. */ | 1316 | XSETSYMBOL (symbol, sym); /* May have changed via aliasing. */ |
| 1314 | tem1 = Fassq (symbol, | 1317 | tem1 = assq_no_quit (symbol, |
| 1315 | (blv->frame_local | 1318 | (blv->frame_local |
| 1316 | ? XFRAME (where)->param_alist | 1319 | ? XFRAME (where)->param_alist |
| 1317 | : BVAR (XBUFFER (where), local_var_alist))); | 1320 | : BVAR (XBUFFER (where), local_var_alist))); |
| 1318 | set_blv_where (blv, where); | 1321 | set_blv_where (blv, where); |
| 1319 | blv->found = 1; | 1322 | blv->found = 1; |
| 1320 | 1323 | ||
| @@ -1952,19 +1955,11 @@ DEFUN ("local-variable-p", Flocal_variable_p, Slocal_variable_p, | |||
| 1952 | 1, 2, 0, | 1955 | 1, 2, 0, |
| 1953 | doc: /* Non-nil if VARIABLE has a local binding in buffer BUFFER. | 1956 | doc: /* Non-nil if VARIABLE has a local binding in buffer BUFFER. |
| 1954 | BUFFER defaults to the current buffer. */) | 1957 | BUFFER defaults to the current buffer. */) |
| 1955 | (register Lisp_Object variable, Lisp_Object buffer) | 1958 | (Lisp_Object variable, Lisp_Object buffer) |
| 1956 | { | 1959 | { |
| 1957 | register struct buffer *buf; | 1960 | struct buffer *buf = decode_buffer (buffer); |
| 1958 | struct Lisp_Symbol *sym; | 1961 | struct Lisp_Symbol *sym; |
| 1959 | 1962 | ||
| 1960 | if (NILP (buffer)) | ||
| 1961 | buf = current_buffer; | ||
| 1962 | else | ||
| 1963 | { | ||
| 1964 | CHECK_BUFFER (buffer); | ||
| 1965 | buf = XBUFFER (buffer); | ||
| 1966 | } | ||
| 1967 | |||
| 1968 | CHECK_SYMBOL (variable); | 1963 | CHECK_SYMBOL (variable); |
| 1969 | sym = XSYMBOL (variable); | 1964 | sym = XSYMBOL (variable); |
| 1970 | 1965 | ||
| @@ -2318,7 +2313,7 @@ bool-vector. IDX starts at 0. */) | |||
| 2318 | { | 2313 | { |
| 2319 | if (! SINGLE_BYTE_CHAR_P (c)) | 2314 | if (! SINGLE_BYTE_CHAR_P (c)) |
| 2320 | { | 2315 | { |
| 2321 | int i; | 2316 | ptrdiff_t i; |
| 2322 | 2317 | ||
| 2323 | for (i = SBYTES (array) - 1; i >= 0; i--) | 2318 | for (i = SBYTES (array) - 1; i >= 0; i--) |
| 2324 | if (SREF (array, i) >= 0x80) | 2319 | if (SREF (array, i) >= 0x80) |