X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/358a8b34ac954ca147de9ececa4a51a21e60c97e..0e963201d03d9229bb8ac4323291d2b0119526ed:/lisp/emacs-lisp/subr-x.el diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 78a6dc9845..e8d1939865 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -1,6 +1,6 @@ ;;; subr-x.el --- extra Lisp functions -*- lexical-binding:t -*- -;; Copyright (C) 2013-2015 Free Software Foundation, Inc. +;; Copyright (C) 2013-2016 Free Software Foundation, Inc. ;; Maintainer: emacs-devel@gnu.org ;; Keywords: convenience @@ -120,7 +120,8 @@ Argument BINDINGS is a list of tuples whose car is a symbol to be bound and (optionally) used in THEN, and its cadr is a sexp to be evalled to set symbol's value. In the special case you only want to bind a single value, BINDINGS can just be a plain tuple." - (declare (indent 2) (debug ((&rest (symbolp form)) form body))) + (declare (indent 2) + (debug ([&or (&rest (symbolp form)) (symbolp form)] form body))) (when (and (<= (length bindings) 2) (not (listp (car bindings)))) ;; Adjust the single binding case @@ -139,6 +140,10 @@ to bind a single value, BINDINGS can just be a plain tuple." (declare (indent 1) (debug if-let)) (list 'if-let bindings (macroexp-progn body))) +(defsubst hash-table-empty-p (hash-table) + "Check whether HASH-TABLE is empty (has 0 elements)." + (zerop (hash-table-count hash-table))) + (defsubst hash-table-keys (hash-table) "Return a list of keys in HASH-TABLE." (let ((keys '()))