helpful

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

commit a47f99a0558d0a005d49f92daa2b69e00bdb3175
parent c8271d7c06ebe73f1cf5c0bc8ac1c27091a4eb87
Author: Wilfred Hughes <me@wilfred.me.uk>
Date:   Sun, 10 Dec 2017 11:01:46 +0000

Ensure helpful--dissassembly passes the symbol

We can use the buffer-local variable, but it's inconsistent and
error-prone.

Diffstat:
Mhelpful.el | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/helpful.el b/helpful.el @@ -162,17 +162,19 @@ This allows us to distinguish strings from symbols." (define-button-type 'helpful-disassemble-button 'action #'helpful--disassemble 'follow-link t + 'symbol nil 'help-echo "Show disassembled bytecode") -(defun helpful--disassemble (_button) +(defun helpful--disassemble (button) "Disassemble the current symbol." - (disassemble helpful--sym)) + (disassemble (button-get button 'symbol))) -(defun helpful--disassemble-button () +(defun helpful--disassemble-button (symbol) "Return a button that disassembles the current symbol." (with-temp-buffer (insert-text-button "Disassemble" + 'symbol symbol :type 'helpful-disassemble-button) (buffer-string))) @@ -664,7 +666,7 @@ state of the current symbol." (if (or (not helpful--callable-p) primitive-p) "" (concat - (helpful--disassemble-button) + (helpful--disassemble-button helpful--sym) " ")) (helpful--forget-button helpful--sym helpful--callable-p)