summaryrefslogtreecommitdiff
path: root/lisp/help-at-pt.el
diff options
context:
space:
mode:
authorDaniel Colascione <dancol@dancol.org>2014-02-02 14:21:33 -0800
committerDaniel Colascione <dancol@dancol.org>2014-02-02 14:21:33 -0800
commit709085b93dab36c23e36502242a1e40806f8d1cf (patch)
tree99478a854ea0abe7bc3e0da431a9f8f3e9f1b5e7 /lisp/help-at-pt.el
parent99f7b0a6d66398d87368448346de104fe8b6531b (diff)
downloademacs-709085b93dab36c23e36502242a1e40806f8d1cf.tar.gz
Make help-at-point stuff also look just before point
Diffstat (limited to 'lisp/help-at-pt.el')
-rw-r--r--lisp/help-at-pt.el27
1 files changed, 19 insertions, 8 deletions
diff --git a/lisp/help-at-pt.el b/lisp/help-at-pt.el
index 15db502062c..7f424f7f3ac 100644
--- a/lisp/help-at-pt.el
+++ b/lisp/help-at-pt.el
@@ -61,13 +61,18 @@ property, or nil, is returned.
If KBD is non-nil, `kbd-help' is used instead, and any
`help-echo' property is ignored. In this case, the return value
can also be t, if that is the value of the `kbd-help' property."
- (let* ((prop (if kbd 'kbd-help 'help-echo))
- (pair (get-char-property-and-overlay (point) prop))
- (val (car pair))
- (ov (cdr pair)))
- (if (functionp val)
- (funcall val (selected-window) (if ov ov (current-buffer)) (point))
- (eval val))))
+ (save-excursion
+ (let* ((prop (if kbd 'kbd-help 'help-echo))
+ (pair (get-char-property-and-overlay (point) prop))
+ (pair (if (car pair) pair
+ (unless (bobp)
+ (backward-char)
+ (get-char-property-and-overlay (point) prop))))
+ (val (car pair))
+ (ov (cdr pair)))
+ (if (functionp val)
+ (funcall val (selected-window) (if ov ov (current-buffer)) (point))
+ (eval val)))))
;;;###autoload
(defun help-at-pt-kbd-string ()
@@ -235,7 +240,13 @@ properties, to enable buffer local values."
(catch 'found
(dolist (prop help-at-pt-display-when-idle)
(if (get-char-property (point) prop)
- (throw 'found t))))))
+ (throw 'found t)))
+ (unless (bobp)
+ (save-excursion
+ (backward-char)
+ (dolist (prop help-at-pt-display-when-idle)
+ (if (get-char-property (point) prop)
+ (throw 'found t))))))))
(or (not (current-message))
(string= (current-message) "Quit"))
(display-local-help t)))