]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/subr-x.el
Update copyright year to 2016
[gnu-emacs] / lisp / emacs-lisp / subr-x.el
index 76473b39a77fd07da2d5927917d89b6c22e814b3..e8d1939865f78dd1648c38924c42d9c22d901fa7 100644 (file)
@@ -1,6 +1,6 @@
 ;;; subr-x.el --- extra Lisp functions  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2013-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2016 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: convenience
@@ -47,7 +47,7 @@ last.  FORMS are the expressions to be threaded."
     (_ (car forms))))
 
 (defmacro thread-first (&rest forms)
-  "Thread FORMS elements as the first argument of their succesor.
+  "Thread FORMS elements as the first argument of their successor.
 Example:
     (thread-first
       5
@@ -64,7 +64,7 @@ threading."
   `(internal--thread-argument t ,@forms))
 
 (defmacro thread-last (&rest forms)
-  "Thread FORMS elements as the last argument of their succesor.
+  "Thread FORMS elements as the last argument of their successor.
 Example:
     (thread-last
       5
@@ -118,9 +118,10 @@ threading."
   "Process BINDINGS and if all values are non-nil eval THEN, else ELSE.
 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
-evaled to set symbol's value.  In the special case you only want
+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
@@ -134,11 +135,15 @@ to bind a single value, BINDINGS can just be a plain tuple."
   "Process BINDINGS and if all values are non-nil eval BODY.
 Argument BINDINGS is a list of tuples whose car is a symbol to be
 bound and (optionally) used in BODY, and its cadr is a sexp to be
-evaled to set symbol's value.  In the special case you only want
+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 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 '()))
@@ -159,7 +164,7 @@ to bind a single value, BINDINGS can just be a plain tuple."
   "Join all STRINGS using SEPARATOR."
   (mapconcat 'identity strings separator))
 
-(define-obsolete-function-alias 'string-reverse 'reverse "24.5")
+(define-obsolete-function-alias 'string-reverse 'reverse "25.1")
 
 (defsubst string-trim-left (string)
   "Remove leading whitespace from STRING."