From: Stefan Kangas Date: Sun, 18 Sep 2022 16:55:19 +0000 (+0200) Subject: Prefer using DEFSYMs to intern with wrong_type_argument X-Git-Tag: emacs-29.0.90~1856^2~388 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1bdac41e4d9bbc23b654b90d593a8a3588052868;p=emacs.git Prefer using DEFSYMs to intern with wrong_type_argument * src/data.c (syms_of_data) : * src/fileio.c (syms_of_fileio) : * src/font.c (syms_of_font) : New DEFSYMs. * src/dbusbind.c (xd_signature, xd_append_arg): * src/fileio.c (file_offset, Finsert_file_contents): * src/font.c (Ffontp): Prefer using above new DEFSYMs to using intern directly. --- diff --git a/src/data.c b/src/data.c index b19e10582e5..221a6f58835 100644 --- a/src/data.c +++ b/src/data.c @@ -4124,6 +4124,7 @@ syms_of_data (void) DEFSYM (Qsymbolp, "symbolp"); DEFSYM (Qfixnump, "fixnump"); DEFSYM (Qintegerp, "integerp"); + DEFSYM (Qbooleanp, "booleanp"); DEFSYM (Qnatnump, "natnump"); DEFSYM (Qwholenump, "wholenump"); DEFSYM (Qstringp, "stringp"); diff --git a/src/dbusbind.c b/src/dbusbind.c index 943a4aff8e7..1c74180f15c 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -398,7 +398,7 @@ xd_signature (char *signature, int dtype, int parent_type, Lisp_Object object) case DBUS_TYPE_BOOLEAN: /* There must be an argument. */ if (EQ (QCboolean, object)) - wrong_type_argument (intern ("booleanp"), object); + wrong_type_argument (Qbooleanp, object); sprintf (signature, "%c", dtype); break; @@ -649,7 +649,7 @@ xd_append_arg (int dtype, Lisp_Object object, DBusMessageIter *iter) case DBUS_TYPE_BOOLEAN: /* There must be an argument. */ if (EQ (QCboolean, object)) - wrong_type_argument (intern ("booleanp"), object); + wrong_type_argument (Qbooleanp, object); { dbus_bool_t val = (NILP (object)) ? FALSE : TRUE; XD_DEBUG_MESSAGE ("%c %s", dtype, (val == FALSE) ? "false" : "true"); diff --git a/src/fileio.c b/src/fileio.c index 9697f6c8cf1..6efea8ac369 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3808,7 +3808,7 @@ file_offset (Lisp_Object val) } } - wrong_type_argument (intern ("file-offset"), val); + wrong_type_argument (Qfile_offset, val); } /* Return a special time value indicating the error number ERRNUM. */ @@ -4875,7 +4875,7 @@ by calling `format-decode', which see. */) if (! NILP (insval)) { if (! RANGED_FIXNUMP (0, insval, ZV - PT)) - wrong_type_argument (intern ("inserted-chars"), insval); + wrong_type_argument (Qinserted_chars, insval); inserted = XFIXNAT (insval); } } @@ -4898,7 +4898,7 @@ by calling `format-decode', which see. */) insval = call3 (Qformat_decode, Qnil, make_fixnum (inserted), visit); if (! RANGED_FIXNUMP (0, insval, ZV - PT)) - wrong_type_argument (intern ("inserted-chars"), insval); + wrong_type_argument (Qinserted_chars, insval); inserted = XFIXNAT (insval); } else @@ -4921,7 +4921,7 @@ by calling `format-decode', which see. */) insval = call3 (Qformat_decode, Qnil, make_fixnum (oinserted), visit); if (! RANGED_FIXNUMP (0, insval, ZV - PT)) - wrong_type_argument (intern ("inserted-chars"), insval); + wrong_type_argument (Qinserted_chars, insval); if (ochars_modiff == CHARS_MODIFF) /* format_decode didn't modify buffer's characters => move point back to position before inserted text and leave @@ -4944,7 +4944,7 @@ by calling `format-decode', which see. */) if (!NILP (insval)) { if (! RANGED_FIXNUMP (0, insval, ZV - PT)) - wrong_type_argument (intern ("inserted-chars"), insval); + wrong_type_argument (Qinserted_chars, insval); inserted = XFIXNAT (insval); } } @@ -4962,7 +4962,7 @@ by calling `format-decode', which see. */) if (!NILP (insval)) { if (! RANGED_FIXNUMP (0, insval, ZV - PT)) - wrong_type_argument (intern ("inserted-chars"), insval); + wrong_type_argument (Qinserted_chars, insval); if (ochars_modiff == CHARS_MODIFF) /* after_insert_file_functions didn't modify buffer's characters => move point back to @@ -6431,9 +6431,11 @@ syms_of_fileio (void) DEFSYM (Qfile_date_error, "file-date-error"); DEFSYM (Qfile_missing, "file-missing"); DEFSYM (Qpermission_denied, "permission-denied"); + DEFSYM (Qfile_offset, "file-offset"); DEFSYM (Qfile_notify_error, "file-notify-error"); DEFSYM (Qremote_file_error, "remote-file-error"); DEFSYM (Qexcl, "excl"); + DEFSYM (Qinserted_chars, "inserted-chars"); DEFVAR_LISP ("file-name-coding-system", Vfile_name_coding_system, doc: /* Coding system for encoding file names. diff --git a/src/font.c b/src/font.c index 8acedb9bf88..2a8f00630cc 100644 --- a/src/font.c +++ b/src/font.c @@ -4041,7 +4041,7 @@ which kind of font it is. It must be one of `font-spec', `font-entity', return (FONT_ENTITY_P (object) ? Qt : Qnil); if (EQ (extra_type, Qfont_object)) return (FONT_OBJECT_P (object) ? Qt : Qnil); - wrong_type_argument (intern ("font-extra-type"), extra_type); + wrong_type_argument (Qfont_extra_type, extra_type); ; } DEFUN ("font-spec", Ffont_spec, Sfont_spec, 0, MANY, 0, @@ -5594,6 +5594,7 @@ syms_of_font (void) DEFSYM (QL2R, "L2R"); DEFSYM (QR2L, "R2L"); + DEFSYM (Qfont_extra_type, "font-extra-type"); DEFSYM (Qfont_driver_superseded_by, "font-driver-superseded-by"); scratch_font_spec = Ffont_spec (0, NULL);