Skip to content

Commit a37a39c

Browse files
committed
Also make symbol actionable to open in source file
1 parent 03756fa commit a37a39c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

helpful.el

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,17 +2043,17 @@ OBJ may be a symbol or a compiled function object."
20432043
((macrop sym) "macro")
20442044
((helpful--kbd-macro-p sym) keyboard-macro-button)
20452045
(t "function")))
2046+
(path (buffer-file-name buf))
20462047
(defined
20472048
(cond
20482049
(buf
2049-
(let ((path (buffer-file-name buf)))
2050-
(if path
2050+
(if path
20512051
(format
20522052
"defined in %s"
20532053
(helpful--navigate-button
20542054
(file-name-nondirectory path) path pos))
20552055
(format "defined in buffer %s"
2056-
(helpful--buffer-button buf pos)))))
2056+
(helpful--buffer-button buf pos))))
20572057
(primitive-p
20582058
"defined in C source code")
20592059
((helpful--kbd-macro-p sym) nil)
@@ -2064,7 +2064,10 @@ OBJ may be a symbol or a compiled function object."
20642064
70
20652065
(format "%s is %s %s %s%s."
20662066
(if (symbolp sym)
2067-
(helpful--format-symbol sym)
2067+
(if path
2068+
(helpful--navigate-button
2069+
(helpful--format-symbol sym) path pos)
2070+
(helpful--format-symbol sym))
20682071
"This lambda")
20692072
(if (string-match-p
20702073
(rx bos (or "a" "e" "i" "o" "u"))

0 commit comments

Comments
 (0)