emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r116245: Make help-at-point stuff also look just bef


From: Daniel Colascione
Subject: [Emacs-diffs] trunk r116245: Make help-at-point stuff also look just before point
Date: Sun, 02 Feb 2014 22:21:53 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116245
revision-id: address@hidden
parent: address@hidden
committer: Daniel Colascione <address@hidden>
branch nick: trunk
timestamp: Sun 2014-02-02 14:21:33 -0800
message:
  Make help-at-point stuff also look just before point
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/help-at-pt.el             
helpatpt.el-20091113204419-o5vbwnq5f7feedwu-2952
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-02-02 16:28:52 +0000
+++ b/lisp/ChangeLog    2014-02-02 22:21:33 +0000
@@ -1,3 +1,8 @@
+2014-02-02  Daniel Colascione  <address@hidden>
+
+       * help-at-pt.el (help-at-pt-string,help-at-pt-maybe-display): Also
+       try to display local help from just before point.
+
 2014-02-02  Alan Mackenzie  <address@hidden>
 
        c-parse-state.  Don't "append-lower-brace-pair" in certain

=== modified file 'lisp/help-at-pt.el'
--- a/lisp/help-at-pt.el        2014-01-01 07:43:34 +0000
+++ b/lisp/help-at-pt.el        2014-02-02 22:21:33 +0000
@@ -61,13 +61,18 @@
 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 @@
                (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)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]