diff options
| author | Wilfred Hughes <me@wilfred.me.uk> | 2018-10-27 16:30:16 +0100 |
|---|---|---|
| committer | Wilfred Hughes <me@wilfred.me.uk> | 2018-10-27 16:30:16 +0100 |
| commit | d37d32e01183143b62d51fb7967883959f48bbeb (patch) | |
| tree | 83203febfb5341f9e0a09b619d62be977de7b3a7 /helpful.el | |
| parent | e82cdba6c34bb8f8b80fd62d7afc54e133b5b46e (diff) | |
Use syntax-ppss to find the outer sexp
beginning-of-defun just uses open-paren-in-column-0-is-defun-start,
which fooled functions like face-attribute where the docstring
contains a open paren at the start of the line.
Fixes #170
Diffstat (limited to 'helpful.el')
| -rw-r--r-- | helpful.el | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1411,9 +1411,10 @@ along with its position. Moves point in BUF." (with-current-buffer buf (goto-char pos) - (let* ((ppss (syntax-ppss))) - (unless (zerop (syntax-ppss-depth ppss)) - (beginning-of-defun))) + (let* ((ppss (syntax-ppss)) + (outer-sexp-posns (nth 9 ppss))) + (when outer-sexp-posns + (goto-char (car outer-sexp-posns)))) (list (point) (-take 2 (read buf))))) (defun helpful--count-values (items) |
