aboutsummaryrefslogtreecommitdiff
path: root/helpful.el
diff options
context:
space:
mode:
authorWilfred Hughes <me@wilfred.me.uk>2018-10-27 16:30:16 +0100
committerWilfred Hughes <me@wilfred.me.uk>2018-10-27 16:30:16 +0100
commitd37d32e01183143b62d51fb7967883959f48bbeb (patch)
tree83203febfb5341f9e0a09b619d62be977de7b3a7 /helpful.el
parente82cdba6c34bb8f8b80fd62d7afc54e133b5b46e (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.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/helpful.el b/helpful.el
index 8886285..c320cff 100644
--- a/helpful.el
+++ b/helpful.el
@@ -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)