Klimi's new dotfiles with stow.
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

54 wiersze
2.1 KiB

4 lat temu
  1. ;;; cider-compat.el --- Functions from newer Emacs versions for compatibility -*- lexical-binding: t -*-
  2. ;; Copyright © 2012-2013 Tim King, Phil Hagelberg, Bozhidar Batsov
  3. ;; Copyright © 2013-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors
  4. ;;
  5. ;; This program is free software: you can redistribute it and/or modify
  6. ;; it under the terms of the GNU General Public License as published by
  7. ;; the Free Software Foundation, either version 3 of the License, or
  8. ;; (at your option) any later version.
  9. ;; This program is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;; You should have received a copy of the GNU General Public License
  14. ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. ;; This file is not part of GNU Emacs.
  16. ;;; Commentary:
  17. ;; Everything here was copied from subr-x for compatibility with
  18. ;; Emacs 25.1.
  19. ;;; Code:
  20. (eval-and-compile
  21. (unless (fboundp 'if-let*)
  22. (defmacro if-let* (bindings then &rest else)
  23. "Process BINDINGS and if all values are non-nil eval THEN, else ELSE.
  24. Argument BINDINGS is a list of tuples whose car is a symbol to be
  25. bound and (optionally) used in THEN, and its cadr is a sexp to be
  26. evalled to set symbol's value."
  27. (declare (indent 2)
  28. (debug ([&or (&rest (symbolp form)) (symbolp form)] form body)))
  29. `(let* ,(internal--build-bindings bindings)
  30. (if ,(car (internal--listify (car (last bindings))))
  31. ,then
  32. ,@else))))
  33. (unless (fboundp 'when-let*)
  34. (defmacro when-let* (bindings &rest body)
  35. "Process BINDINGS and if all values are non-nil eval BODY.
  36. Argument BINDINGS is a list of tuples whose car is a symbol to be
  37. bound and (optionally) used in BODY, and its cadr is a sexp to be
  38. evalled to set symbol's value."
  39. (declare (indent 1) (debug if-let*))
  40. `(if-let* ,bindings ,(macroexp-progn body)))))
  41. (provide 'cider-compat)
  42. ;;; cider-compat.el ends here