helpful

a fork of Wilfred's helpful
git clone https://git.trogloxene.org/helpful.git
Log | Files | Refs | README

commit 0de7c15eb74b23b00a3321a3728b6aabdd4039fb
parent c818ea5b33439fb523d247cdf010dd5744e6feb3
Author: Nick Drozd <nicholasdrozd@gmail.com>
Date:   Fri, 28 Sep 2018 12:12:43 -0500

Add .rs file extension to helpful--primitive-p

This makes it possible to show variables defined in Rust in Remacs.

In general I don't like the idea of modifying Elisp to accomodate
Remacs, but in this case it seems to be necessary because the "c" is
hardcoded. An alternative approach would be to check whether the file
is an Elisp file, but that would require exhaustively enumerating
possibilities: .el, .el.gz, .elc, and maybe more that I don't know
about. This way seems easier, if less elegant.

Diffstat:
Mhelpful.el | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/helpful.el b/helpful.el @@ -1487,7 +1487,9 @@ POSITION-HEADS takes the form ((123 (defun foo)) (456 (defun bar)))." (let ((filename (find-lisp-object-file-name sym 'defvar))) (or (eq filename 'C-source) (and (stringp filename) - (equal (file-name-extension filename) "c"))))))) + (let ((ext (file-name-extension filename))) + (or (equal ext "c") + (equal ext "rs"))))))))) (defun helpful--sym-value (sym buf) "Return the value of SYM in BUF."