* src/editfns.c (Fpropertize): Improve error message.
(syms_of_editfns) <Qpropertize>: New DEFSYM.
* test/src/editfns-tests.el
(propertize/error-wrong-number-of-args): New test.
/* Number of args must be odd. */
if ((nargs & 1) == 0)
- error ("Wrong number of arguments");
+ xsignal2 (Qwrong_number_of_arguments, Qpropertize, make_fixnum (nargs));
properties = string = Qnil;
{
DEFSYM (Qbuffer_access_fontify_functions, "buffer-access-fontify-functions");
DEFSYM (Qwall, "wall");
+ DEFSYM (Qpropertize, "propertize");
DEFVAR_LISP ("inhibit-field-text-motion", Vinhibit_field_text_motion,
doc: /* Non-nil means text motion commands don't notice fields. */);
(format (concat "%-3d/" s) 12)
#("12 /X" 4 5 (prop "val"))))))
+(ert-deftest propertize/error-even-number-of-args ()
+ "Number of args for `propertize' must be odd."
+ (should-error (propertize "foo" 'bar) :type 'wrong-number-of-arguments))
+
;; Tests for bug#5131.
(defun transpose-test-reverse-word (start end)
"Reverse characters in a word by transposing pairs of characters."