diff options
| author | Wilfred Hughes <me@wilfred.me.uk> | 2018-03-02 22:22:06 +0000 |
|---|---|---|
| committer | Wilfred Hughes <me@wilfred.me.uk> | 2018-03-02 22:22:06 +0000 |
| commit | 656ff91eb6094bbd5a78dcd6ef1e9ccb4d257a4d (patch) | |
| tree | f7030b729725c6ca3557efbca11879fc6e20cdc7 /helpful.el | |
| parent | 4abe04870467beb8a5a798773e1f145f65298e59 (diff) | |
Fix references to top-level forms
Previoiusly helpful--outer-sexp assumed point was inside a form, so
returned the wrong sexp for top-level forms.
Diffstat (limited to 'helpful.el')
| -rw-r--r-- | helpful.el | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1098,10 +1098,14 @@ from parent keymaps." (defun helpful--outer-sexp (buf pos) "Find position POS in BUF, and return the name of the outer sexp, -along with its position." +along with its position. + +Moves point in BUF." (with-current-buffer buf (goto-char pos) - (beginning-of-defun) + (let* ((ppss (syntax-ppss))) + (unless (zerop (syntax-ppss-depth ppss)) + (beginning-of-defun))) (list (point) (-take 2 (read buf))))) (defun helpful--count-values (items) |
