PageRenderTime 59ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/elpa-local/28.1/smartparens-20220204.1134/smartparens-clojure.el

https://github.com/MassimoLauria/dotemacs
Emacs Lisp | 56 lines | 11 code | 5 blank | 40 comment | 1 complexity | 79f42b20d1848e1720c80d51a35de9fb MD5 | raw file
Possible License(s): GPL-3.0, CC-BY-4.0, BSD-3-Clause
  1. ;;; smartparens-clojure.el --- Additional configuration for Clojure mode. -*- lexical-binding: t; -*-
  2. ;;
  3. ;; Author: Vitalie Spinu <spinuvit@gmail.com>
  4. ;; Maintainer: Matus Goljer <matus.goljer@gmail.com>
  5. ;; Created: 14 July 2016
  6. ;; Keywords: abbrev convenience editing
  7. ;; URL: https://github.com/Fuco1/smartparens
  8. ;;
  9. ;; This file is not part of GNU Emacs.
  10. ;;
  11. ;;; License:
  12. ;;
  13. ;; This file is part of Smartparens.
  14. ;;
  15. ;; Smartparens is free software; you can redistribute it and/or modify
  16. ;; it under the terms of the GNU General Public License as published by
  17. ;; the Free Software Foundation, either version 3 of the License, or
  18. ;; (at your option) any later version.
  19. ;;
  20. ;; Smartparens is distributed in the hope that it will be useful,
  21. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. ;; GNU General Public License for more details.
  24. ;;
  25. ;; You should have received a copy of the GNU General Public License
  26. ;; along with Smartparens. If not, see <http://www.gnu.org/licenses/>.
  27. ;;
  28. ;;; Commentary:
  29. ;;
  30. ;; This file provides some additional configuration for Clojure mode. To use
  31. ;; it, simply add:
  32. ;;
  33. ;; (require 'smartparens-clojure)
  34. ;;
  35. ;; into your configuration. You can use this in conjunction with the
  36. ;; default config or your own configuration.
  37. ;;
  38. ;;; Code:
  39. (require 'smartparens)
  40. (defvar sp-clojure-prefix "\\(?:[@`'#~,_?^]+\\)"
  41. "Prefix used in `sp-sexp-prefix' for clojure modes.")
  42. (dolist (mode '(clojure-mode clojurescript-mode clojurec-mode cider-repl-mode))
  43. (add-to-list 'sp-sexp-prefix `(,mode regexp ,sp-clojure-prefix)))
  44. ;; Match "`" with "`" in strings and comments
  45. (sp-with-modes sp-clojure-modes
  46. (sp-local-pair "`" "`"
  47. :when '(sp-in-string-p
  48. sp-in-comment-p)
  49. :unless '(sp-lisp-invalid-hyperlink-p)))
  50. (provide 'smartparens-clojure)
  51. ;;; smartparens-clojure.el ends here