diff --git a/helpful.el b/helpful.el index 9516e46..77f47bc 100644 --- a/helpful.el +++ b/helpful.el @@ -2043,17 +2043,17 @@ OBJ may be a symbol or a compiled function object." ((macrop sym) "macro") ((helpful--kbd-macro-p sym) keyboard-macro-button) (t "function"))) + (path (buffer-file-name buf)) (defined (cond (buf - (let ((path (buffer-file-name buf))) - (if path + (if path (format "defined in %s" (helpful--navigate-button (file-name-nondirectory path) path pos)) (format "defined in buffer %s" - (helpful--buffer-button buf pos))))) + (helpful--buffer-button buf pos)))) (primitive-p "defined in C source code") ((helpful--kbd-macro-p sym) nil) @@ -2064,7 +2064,10 @@ OBJ may be a symbol or a compiled function object." 70 (format "%s is %s %s %s%s." (if (symbolp sym) - (helpful--format-symbol sym) + (if path + (helpful--navigate-button + (helpful--format-symbol sym) path pos) + (helpful--format-symbol sym)) "This lambda") (if (string-match-p (rx bos (or "a" "e" "i" "o" "u"))