Fork me on GitHub
#emacs
<
2017-10-27
>
ag21:10:37

does anyone know how to grab fully qualified name of the current symbol under cursor?

dpsutton21:10:01

in emacs lisp?

ag21:10:28

or filepath/function-name

ag21:10:49

in clj/cljs

ag21:10:39

I guess I can use concat of (cider-current-ns) and ... something else that gets me the name of the current function, which would be?

ag21:10:45

okay, this does the trick:

(defun get-current-clj-fn ()
  (interactive)
  (concat
   (cider-current-ns)
   "/"
   (helm-cmd--get-current-function-name)))
for those who don't use helm, here's the src code:
(defun helm-cmd--get-current-function-name ()
  (save-excursion
    (beginning-of-defun)
    (cadr (split-string (buffer-substring-no-properties
                         (point-at-bol) (point-at-eol))))))

ag21:10:18

Slight improvement:

(defun get-current-clj-fn ()
  (interactive)
  (message (kill-new (concat (cider-current-ns) "/" (helm-cmd--get-current-function-name)))))