diff options
author | Bozhidar Batsov <bozhidar@batsov.com> | 2016-04-24 09:23:39 -0700 |
---|---|---|
committer | Bozhidar Batsov <bozhidar@batsov.com> | 2016-04-24 09:23:39 -0700 |
commit | 6ae64216162b636c1c24e3ca5d322cb16fe7ef64 (patch) | |
tree | 8bd6a7e278de6470b0f63f0b0288315160e10089 /cider-common.el | |
parent | 9991c35d14133739301dfe054a732a00c82a8ae2 (diff) |
Allow the ns displayed by eldoc to be tailored via cider-eldoc-ns-function
Diffstat (limited to 'cider-common.el')
-rw-r--r-- | cider-common.el | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cider-common.el b/cider-common.el index cb3b7c8a..e074316f 100644 --- a/cider-common.el +++ b/cider-common.el @@ -236,5 +236,21 @@ existing file ending with URL has been found." (16 t) ; empty empty (_ nil)))) +(defun cider-abbreviate-ns (namespace) + "Return a string that abbreviates NAMESPACE." + (when namespace + (let* ((names (reverse (split-string namespace "\\."))) + (lastname (car names))) + (concat (mapconcat (lambda (s) (concat (substring s 0 1) ".")) + (reverse (cdr names)) + "") + lastname)))) + +(defun cider-last-ns-segment (namespace) + "Return the last segment of NAMESPACE." + (when namespace + (car (reverse (split-string namespace "\\."))))) + + (provide 'cider-common) ;;; cider-common.el ends here |