(defun abbrev-table-p (object)
"Return non-nil if OBJECT is an abbrev table."
(and (obarrayp object)
- (numberp (abbrev-table-get object :abbrev-table-modiff))))
+ (numberp (ignore-error 'wrong-type-argument
+ (abbrev-table-get object :abbrev-table-modiff)))))
(defun abbrev-table-empty-p (object &optional ignore-system)
"Return nil if there are no abbrev symbols in OBJECT.
if (EQ (bucket, make_fixnum (0)))
;
else if (!SYMBOLP (bucket))
- error ("Bad data in guts of obarray"); /* Like CADR error message. */
+ /* Like CADR error message. */
+ xsignal2 (Qwrong_type_argument, Qobarrayp,
+ build_string ("Bad data in guts of obarray"));
else
for (tail = bucket; ; XSETSYMBOL (tail, XSYMBOL (tail)->u.s.next))
{
See Info node `(elisp)Shorthands' for more details. */);
Vread_symbol_shorthands = Qnil;
DEFSYM (Qobarray_cache, "obarray-cache");
+ DEFSYM (Qobarrayp, "obarrayp");
DEFSYM (Qmacroexp__dynvars, "macroexp--dynvars");
DEFVAR_LISP ("macroexp--dynvars", Vmacroexp__dynvars,
(inverse-add-abbrev table "Global" -1)))
(should (string= (abbrev-expansion "text" table) "bar"))))
+(ert-deftest test-abbrev-table-p ()
+ (should-not (abbrev-table-p translation-table-vector))
+ (should (abbrev-table-p (make-abbrev-table))))
+
(provide 'abbrev-tests)
;;; abbrev-tests.el ends here