emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/hyperbole 4ace769 17/53: Added brief pulsing/flashing f


From: Robert Weiner
Subject: [elpa] externals/hyperbole 4ace769 17/53: Added brief pulsing/flashing from source line to line in destination buffer.
Date: Wed, 15 Nov 2017 22:47:01 -0500 (EST)

branch: externals/hyperbole
commit 4ace7695e1886b8955a41c2e1a8f16ea3a21b879
Author: Bob Weiner <address@hidden>
Commit: Bob Weiner <address@hidden>

    Added brief pulsing/flashing from source line to line in destination buffer.
    * hui-window.el (pulse): Added require for momentary highlighting of 
buffer/file
        item lines.
                    (hmouse-pulse-line): Added.
                    (hmouse-item-to-window): Added pulses to source and dest. 
lines.
---
 Changes       | 10 +++++++---
 hui-window.el | 25 ++++++++++++++++++-------
 2 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/Changes b/Changes
index 4a91ca2..b4b27ec 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,10 @@
+2017-09-27  Bob Weiner  <address@hidden>
+
+* hui-window.el (pulse): Added require for momentary highlighting of 
buffer/file
+    item lines.
+                (hmouse-pulse-line): Added.
+                (hmouse-item-to-window): Added pulses to source and dest. 
lines.
+
 2017-09-26  Bob Weiner  <address@hidden>
 
 * hmouse-drv.el (action-key-depress): Added action-key-depress-hook.
@@ -27,7 +34,6 @@
   hmouse-drv.el (hmouse-depress-inactive-minibuffer-p): 
   hargs.el (hargs:select-event-window): Updated to handle multiple frames and 
minibuffers.
 
-
 * hui-window.el (hmouse-alist): Extended hmouse-drag-between-windows to
     allow dragging items from a buffer menu or file menu buffer to a 
destination
     window for display.  Helm buffer items are supported as well.
@@ -38,8 +44,6 @@
 * hversion.el (hyperb:version): Start adding a letter at the end of the 
version number for
     significant pre-releases published to git, so we know which version is in 
use.
 
-----
-
 2017-09-25  Bob Weiner  <address@hidden>
 
 * hui-mini.el (hui:menu-item): Improved so that if menu item has no help 
string but its action is a
diff --git a/hui-window.el b/hui-window.el
index bd607ee..f2d6516 100644
--- a/hui-window.el
+++ b/hui-window.el
@@ -43,6 +43,8 @@
 ;;; ************************************************************************
 
 (eval-when-compile (defvar assist-flag nil)) ;; Silences free variable 
compiler warnings
+;; For momentary highlighting of buffer/file item lines.
+(require 'pulse nil t)
 
 ;;; ************************************************************************
 ;;; Public variables
@@ -589,15 +591,21 @@ Ignores minibuffer window."
   ;; (if (fboundp 'fill-region-and-align) (fill-region-and-align (mark) 
(point)))
   )
 
+(defsubst hmouse-pulse-line ()
+  (when (and (featurep 'pulse) (pulse-available-p))
+    (pulse-momentary-highlight-one-line (point) 'next-error)
+    (sit-for 0.3)))
+
 (defun hmouse-item-to-window ()
   "Displays buffer or file menu item at Action Key depress in window of Action 
Key release."
   (let* ((w1 action-key-depress-window)
         (w2 action-key-release-window)
         (buf-name)
-        (w1-ref (when (and w1 w2)
-                  (unwind-protect
-                      (progn (select-window w1)
-                             (cond ((eq major-mode 'Buffer-menu-mode)
+        (w1-ref))
+    (when (and w1 w2)
+      (unwind-protect
+         (progn (select-window w1)
+                (setq w1-ref (cond ((eq major-mode 'Buffer-menu-mode)
                                     (Buffer-menu-buffer t))
                                    ((eq major-mode 'ibuffer-mode)
                                     (ibuffer-current-buffer t))
@@ -605,14 +613,17 @@ Ignores minibuffer window."
                                     ;; Returns item string
                                     (helm-get-selection (current-buffer)))
                                    (t nil)))
-                    (select-window w2)))))
+                (when w1-ref (hmouse-pulse-line)))
+       (select-window w2)))
     (unwind-protect
        (cond ((not w1-ref)
               (error "(hmouse-item-to-window): Last depress was not within a 
window."))
              ((buffer-live-p w1-ref)
-              (set-window-buffer w2 w1-ref))
+              (set-window-buffer w2 w1-ref)
+              (hmouse-pulse-line))
              ((and (stringp w1-ref) (file-readable-p w1-ref))
-              (set-window-buffer w2 (find-file-noselect w1-ref)))
+              (set-window-buffer w2 (find-file-noselect w1-ref))
+              (hmouse-pulse-line))
              (t (error "(hmouse-item-to-window): Cannot find or read `%s'." 
w1-ref)))
       ;; If helm is active, end in the minibuffer window.
       (if (smart-helm-alive-p)



reply via email to

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