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

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

[elpa] externals/hyperbole 9a94a8f 19/51: Fix hproperty:item-highlight-c


From: Stefan Monnier
Subject: [elpa] externals/hyperbole 9a94a8f 19/51: Fix hproperty:item-highlight-color init error; add regional 'throw'
Date: Sun, 12 Jul 2020 18:10:11 -0400 (EDT)

branch: externals/hyperbole
commit 9a94a8f7862c4e28d1a99c48dda46c934750251c
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>

    Fix hproperty:item-highlight-color init error; add regional 'throw'
---
 Changes            |  19 ++++++++-
 DEMO               |  14 +++++-
 HY-NEWS            |  34 ++++++++++++++-
 hmouse-drv.el      |  68 ++++++++++++++++++-----------
 hsettings.el       |   4 +-
 hui-em-but.el      | 123 ++++++++++++++++++++++++++++++-----------------------
 hui-mouse.el       |   9 ++--
 hui-window.el      |  14 ++++--
 hyrolo.el          |   3 +-
 man/hyperbole.html |  22 +++++++---
 man/hyperbole.info | Bin 519773 -> 520357 bytes
 man/hyperbole.pdf  | Bin 1280066 -> 1280517 bytes
 man/hyperbole.texi |  16 +++++--
 13 files changed, 225 insertions(+), 101 deletions(-)

diff --git a/Changes b/Changes
index 8d18a8f..ddb616f 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,20 @@
+2020-02-06  Bob Weiner  <rsw@gnu.org>
+
+* hui-em-but.el (hproperty:set-face-after-init): Conditionalized settings to 
avoid overriding customizations.
+(hproperty:item-highlight-color): Fixed initialization error.
+(hproperty:set-flash-color): Ensured not setting to nil values.
+(hproperty:flash-face, hproperty:highlight-face): Converted to defcustom 
variables.
+
+2020-02-02  Bob Weiner  <rsw@gnu.org>
+
+* hmouse-drv.el (hkey-drag-to, hkey-drag-item):
+  hui-window.el (hmouse-drag-item-to-display):
+                (hmouse-at-item-p): Fixed to work with ace-window when Action 
Key is not used.
+
+* hmouse-drv.el (hkey-throw): Rewrote to throw active (highlighted) region if 
any.
+                (hkey-insert-region): Added.
+  hui-window.el (hmouse-pulse-region): Added.
+
 2020-02-01  Bob Weiner  <rsw@gnu.org>
 
 * hui-mouse.el (smart-imenu-item-p): Fixed to handle invalid marker positions 
after buffer changes
@@ -40,7 +57,7 @@
     release when first uploading it.
 
 ==============================================================================
-V7.0.8 post-release changes ^^^^:
+V7.0.9 changes ^^^^:
 ==============================================================================
 
 2020-01-20  Bob Weiner  <rsw@gnu.org>
diff --git a/DEMO b/DEMO
index 7dc1899..68363a6 100644
--- a/DEMO
+++ b/DEMO
@@ -1383,14 +1383,24 @@ For even faster keyboard-based drag emulation, use the 
Emacs package
 configured and the suggested M-o key binding is made, the leftmost character or
 two of each window's modeline will show the <window-id> to type to use that
 window as the drag destination. Then whenever point is on an item you want
-displayed in another window, use M-o i <window-id> and watch the magic happen.
+displayed in another window, use M-o i <window-id> to display it there and 
select
+the window.
+
 If you want to display multiple items in different windows, instead use the
 M-o t <window-id> key sequence to @emph{throw} each item to a different window,
-while leaving the same selected window.  To replace the selected window's
+without changing the selected window.  To replace the selected window's
 buffer with that of another window, use M-o r <window-id>.  To instead swap the
 selected window's buffer with that of another window, use M-o m <window-id>.
 Try these commands out and they will speed your work.
 
+You can also throw the active (highlighted) region of text to another
+window.  Simply activate a region and then use M-o t <window-id> just
+like before.  If you don't use region highlighting,
+i.e. transient-mark-mode, then use C-u M-o t <window-id> for the same
+effect.  The buffer in the target window must differ from the one in
+the source window.  With no region active, this command throws
+the source buffer to the target window.
+
 *** Cloning Windows
 
 To clone a window with its buffer to a new frame, simply drag the Action Mouse
diff --git a/HY-NEWS b/HY-NEWS
index 6a1e716..df80691 100644
--- a/HY-NEWS
+++ b/HY-NEWS
@@ -2,6 +2,35 @@
                                 by Bob Weiner
 
 ===========================================================================
+*                                   V7.0.9
+===========================================================================
+
+  ACE WINDOW PACKAGE INTEGRATION - fast window and buffer switching
+
+    - After installing the ace-window package and loading Hyperbole, execute
+      (hkey-ace-window-setup "\M-o") to enable the following capabilities:
+
+    - The hkey-throw command bound to {M-o t} now throws the active 
(highlighted)
+      region, if any, into the target window's buffer, rather than replacing 
its
+      buffer with the source window buffer.  If you don't use region 
highlighting,
+      i.e. transient-mark-mode, then use {C-u M-o t} for the same effect.  The
+      buffer in the target window must differ from the one in the source 
window.
+      With no region active, this command stillthrows the source buffer to the
+      target window.
+
+  GLOSSARY
+
+    - Added Action Button, Elink, Ilink, Glink definitions.
+
+  PROGRAMMING
+
+    - If using Emacs imenu package, the Action Key will look up in-buffer
+      identifier references with imenu.  If imenu's index is rendered invalid
+      due to large changes in a buffer, Hyperbole will now automatically 
rebuild
+      the index to have correct pointers.  (Does not require use of the
+      imenu-auto-rescan setting.
+
+===========================================================================
 *                                   V7.0.8
 ===========================================================================
 
@@ -80,7 +109,7 @@
       example of implicit button labels.
 
     - Glossary: Updated Implicit Button and Global Button entries with
-      changes.  Added Action Button, Elink, Ilink, Glink definitions.
+      changes.
 
 
   KOUTLINER
@@ -162,6 +191,9 @@
 
   ACE WINDOW PACKAGE INTEGRATION - fast window and buffer switching
 
+    - After installing the ace-window package and loading Hyperbole, execute
+      (hkey-ace-window-setup "\M-o") to enable the following capabilities:
+
     - Selected Window Buffer Replace: Added the ability to 'replace' the
       selected window's buffer with the buffer of another window.  Use
       {M-o r <window-id>}.  To swap the buffers between the same two windows,
diff --git a/hmouse-drv.el b/hmouse-drv.el
index 631d8f2..9c63a04 100644
--- a/hmouse-drv.el
+++ b/hmouse-drv.el
@@ -366,7 +366,7 @@ magic happen."
   (push '(?i hkey-drag-item "Hyperbole: Drag Item") aw-dispatch-alist)
   ;; Ace-window includes ?m as the swap windows key, so it is not added here.
   (push '(?r hkey-replace "Hyperbole: Replace Here") aw-dispatch-alist)
-  (push '(?t hkey-throw   "Hyperbole: Throw To") aw-dispatch-alist)
+  (push '(?t hkey-throw   "Hyperbole: Throw") aw-dispatch-alist)
   (ace-window-display-mode 1))
 
 ;;;###autoload
@@ -437,7 +437,7 @@ Works only when running under a window system, not from a 
dumb terminal."
        at-item-flag)
     (unless (window-live-p start-window)
       (setq start-window (selected-window)))
-    (cond ((and (setq at-item-flag (hmouse-at-item-p))
+    (cond ((and (setq at-item-flag (hmouse-at-item-p start-window))
                (window-live-p release-window))
           (hkey-drag release-window)
           ;; Leave release-window selected
@@ -446,7 +446,7 @@ Works only when running under a window system, not from a 
dumb terminal."
          (at-item-flag
           (error "(hkey-drag-item): No listing item at point"))
          (t ;; No item at point or selected release is invalid
-          (error "(hkey-drag-item): Invalid final window, %s" 
release-window)))))
+          (error "(hkey-drag-item): No item at point or invalid final window, 
%s" release-window)))))
 
 ;;;###autoload
 (defun hkey-drag-to (release-window)
@@ -470,7 +470,7 @@ Works only when running under a window system, not from a 
dumb terminal."
                          action-key-depress-window))))
     (unless (window-live-p start-window)
       (setq start-window (selected-window)))
-    (if (and (hmouse-at-item-p) (window-live-p release-window))
+    (if (and (hmouse-at-item-p start-window) (window-live-p release-window))
        (progn (hkey-drag release-window)
               ;; Leave release-window selected
               (when (window-live-p release-window)
@@ -525,23 +525,25 @@ Leave TO-WINDOW as the selected window."
 ;;     (display-window-until release-window (current-buffer))))
 
 ;;;###autoload
-(defun hkey-throw (release-window)
-  "Throw either a displayable item at point or the current buffer for display 
in RELEASE-WINDOW.
+(defun hkey-throw (release-window &optional throw-region-flag)
+  "Throw one of: the active (highlighted) region, a displayable item at point 
or the current buffer for display in RELEASE-WINDOW.
+With optional prefix arg THROW-REGION-FLAG, throw the current region
+even if not active.
 The selected window does not change."
-  (interactive
-   (list (let ((mode-line-text (concat " Ace - " (nth 2 (assq ?t 
aw-dispatch-alist)))))
-          (aw-select mode-line-text))))
+  (interactive (list (ace-window nil) current-prefix-arg))
   (let ((depress-frame (selected-frame))
        (display-delay (if (boundp 'temp-display-delay)
                           temp-display-delay
                         0.5)))
-    (if (cadr (assq major-mode hmouse-drag-item-mode-forms))
-       ;; Throw the item at point
+       ;; Throw either the region or the item at point and keep selected-window
        (let ((action-key-depress-window (selected-window))
              (action-key-release-window release-window)
              (action-key-depress-args))
          (hypb:save-selected-window-and-input-focus
-          (hmouse-item-to-window)
+          (unless (hkey-insert-region action-key-depress-window release-window 
throw-region-flag display-delay)
+            (if (cadr (assq major-mode hmouse-drag-item-mode-forms))
+                (hmouse-item-to-window)
+              (set-window-buffer release-window (current-buffer))))
           (unless (eq depress-frame (window-frame release-window))
             ;; Force redisplay or item buffer won't be displayed here.
             (redisplay t)
@@ -549,19 +551,35 @@ The selected window does not change."
             ;; input-focus is returned to the depress-frame.
             (raise-frame (window-frame release-window))
             ;; Don't use sit-for here because it can be interrupted early.
-            (sleep-for display-delay)
-            )))
-      ;; Throw the current buffer
-      (set-window-buffer release-window (current-buffer))
-      (unless (eq depress-frame (window-frame release-window))
-       ;; Force redisplay or item buffer won't be displayed here.
-       (redisplay t)
-       ;; Show the frame thrown to before it is covered when
-       ;; input-focus is returned to the depress-frame.
-       (raise-frame (window-frame release-window))
-       ;; Don't use sit-for here because it can be interrupted early.
-       (sleep-for display-delay)
-       (select-frame-set-input-focus depress-frame)))))
+            (sleep-for display-delay))))))
+
+(defun hkey-insert-region (depress-window release-window throw-region-flag 
display-delay)
+  "Throw any active (highlighted) region from DEPRESS-WINDOW to RELEASE-WINDOW.
+If THROW-REGION-FLAG is non-nil, the region is thrown even if not
+active, unless the buffers in DEPRESS-WINDOW and RELEASE-WINDOW are
+the same, then the region is not thrown.
+Highlight the thrown region for DISPLAY-DELAY seconds.
+
+Return t if thrown, else nil."
+  (when (or (use-region-p) throw-region-flag)
+    (if (> (region-end) (region-beginning))
+       ;; Non-empty region
+       (if (eq (window-buffer depress-window) (window-buffer release-window))
+           (user-error "(hkey-insert-region): Can't throw region from and to 
the same buffer")
+         (let* ((orig-buf (current-buffer))
+                (orig-start (region-beginning))
+                (orig-end (region-end))
+                (len (- orig-end orig-start))
+                insert-start
+                insert-end)
+           (select-window release-window 'mark-for-redisplay)
+           (setq insert-start (point)
+                 insert-end (+ insert-start len))
+           (insert-buffer-substring orig-buf orig-start orig-end)
+           (hmouse-pulse-region insert-start insert-end)
+           (sit-for display-delay)
+           t))
+      (user-error "(hkey-insert-region): Can't throw an empty region"))))
 
 ;;;###autoload
 (defun hkey-buffer-to (from-window to-window)
diff --git a/hsettings.el b/hsettings.el
index 909b4f2..8ffaa7b 100644
--- a/hsettings.el
+++ b/hsettings.el
@@ -175,7 +175,7 @@ this variable to nil by adding (hyperbole-toggle-messaging 
1)
 to your personal Emacs initialization file, prior to loading
 Hyperbole, and then restart Emacs."
   :type 'boolean
-  :initialize 'custom-initialize-set
+  :initialize #'custom-initialize-set
   :set (lambda (symbol value)
         ;; Invert value to produce ARG for hyperbole-toggle-messaging.
         (hyperbole-toggle-messaging (if value 0 1)))
@@ -209,7 +209,7 @@ The first character of each web-service-name must be unique.
 This custom option is used in the Hyperbole Find/Web menu where
 the %s in the url-with-%s-parameter is replaced with an interactively
 obtained search string."
-  :initialize 'custom-initialize-default
+  :initialize #'custom-initialize-default
   :set (lambda (_option value)
         (setq hyperbole-web-search-alist value)
         (hyperbole-update-menus))
diff --git a/hui-em-but.el b/hui-em-but.el
index a8329ed..62db858 100644
--- a/hui-em-but.el
+++ b/hui-em-but.el
@@ -1,10 +1,10 @@
-;; hui-em-but.el --- GNU Emacs button highlighting and flashing support
+;;; hui-em-but.el --- GNU Emacs button highlighting and flashing support
 ;;
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    21-Aug-92
 ;;
-;; Copyright (C) 1992-2019  Free Software Foundation, Inc.
+;; Copyright (C) 1992-2020  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
 ;;
 ;; This file is part of GNU Hyperbole.
@@ -16,7 +16,10 @@
 
 ;;; Code:
 
-(unless noninteractive
+(when noninteractive
+  ;; Don't load this library
+  (with-current-buffer " *load*"
+    (goto-char (point-max))))
 
 ;;; ************************************************************************
 ;;; Other required Elisp libraries
@@ -24,6 +27,7 @@
 
 (require 'custom) ;; For defface.
 (require 'hbut)
+(eval-when-compile (require 'hyrolo))
 
 (defun hproperty:background ()
   "Return default background color for current frame."
@@ -64,7 +68,22 @@
   "Color with which to highlight list/menu selections.
 Call (hproperty:set-item-highlight <color>) to change value."
   :type 'color
-  :initialize (lambda (_symbol _value) (hproperty:foreground))
+  :initialize #'custom-initialize-default
+  :group 'hyperbole-buttons)
+
+(defcustom hproperty:flash-face (defface hbut-flash nil "Hyperbole face for 
flashing hyper-buttons."
+                                 :group 'hyperbole-buttons)
+  "Hyperbole face for flashing hyper-buttons."
+  :type 'face
+  :initialize #'custom-initialize-default
+  :group 'hyperbole-buttons)
+
+(defcustom hproperty:highlight-face (defface hproperty:highlight-face nil
+                                     "Item highlighting face.  Use 
(hproperty:set-item-highlight) to set."
+                                     :group 'hyperbole-buttons)
+  "Item highlighting face.  Use (hproperty:set-item-highlight) to set."
+  :type 'face
+  :initialize #'custom-initialize-default
   :group 'hyperbole-buttons)
 
 ;;; ************************************************************************
@@ -314,18 +333,20 @@ highlighted."
     (set-face-foreground
      hproperty:but-face (or color (car (hproperty:list-cycle 
hproperty:color-ptr hproperty:good-colors))))
     (hproperty:set-flash-color)
-    (sit-for 0)        ;; Force display update
+    (redisplay t)
     t))
 
 (defun hproperty:set-flash-color ()
   "Set button flashing colors based upon current color set."
   (when (display-color-p)
-    (set-face-foreground hproperty:flash-face (if hproperty:but-face
-                                                 (face-background 
hproperty:but-face)
-                                               (hproperty:background)))
-    (set-face-background hproperty:flash-face (if hproperty:but-face
-                                                 (face-foreground 
hproperty:but-face)
-                                               (hproperty:but-color)))))
+    (set-face-foreground hproperty:flash-face
+                        (if (and hproperty:but-face (face-background 
hproperty:but-face))
+                            (face-background hproperty:but-face)
+                          (hproperty:background)))
+    (set-face-background hproperty:flash-face
+                        (if (and hproperty:but-face (face-foreground 
hproperty:but-face))
+                            (face-foreground hproperty:but-face)
+                          (hproperty:but-color)))))
 
 (defun hproperty:but-p (&optional pos)
   "Return non-nil at point or optional POS iff face is eq to 
hproperty:but-face."
@@ -349,28 +370,23 @@ highlighted."
        (if (not prev) (hproperty:but-add start end hproperty:but-face))
       (setq start (point)))
     (setq b (and (hproperty:but-p start) hproperty:but-face))
-    (if (setq a b)
-       (unwind-protect
-           (progn
-             (hproperty:set-but-face start hproperty:flash-face)
-             (sit-for (/ hproperty:but-flash-time 5000.0))) ;; Force display 
update
-         (hproperty:set-but-face start a)
-         (sit-for 0))) ;; Force display update
-    (if (and ibut (not prev)) (hproperty:but-delete start))))
+    (when (setq a b)
+      (unwind-protect
+         (progn
+           (hproperty:set-but-face start hproperty:flash-face)
+           (sit-for (/ hproperty:but-flash-time 5000.0))) ;; Force display 
update
+       (hproperty:set-but-face start a)
+       (redisplay t)))
+    (and ibut (not prev) (hproperty:but-delete start))))
 
 (defun hproperty:set-item-highlight (&optional background foreground)
   "Setup or reset item highlight face using optional BACKGROUND and 
FOREGROUND."
   (make-local-variable 'hproperty:item-face)
-  (if (stringp background) (setq hproperty:item-highlight-color background))
-  (if (not hproperty:highlight-face)
-      (progn
-       (setq hproperty:highlight-face
-             (defface hproperty:highlight-face nil
-  "Item highlighting face.  Use (hproperty:set-item-highlight) to set."
-                        :group 'hyperbole-buttons))
-       (set-face-foreground hproperty:highlight-face (or foreground
-                                                         
(hproperty:background)))
-       (set-face-underline hproperty:highlight-face nil)))
+  (when (stringp background) (setq hproperty:item-highlight-color background))
+  (unless hproperty:highlight-face
+    (set-face-foreground hproperty:highlight-face (or foreground
+                                                     (hproperty:background)))
+    (set-face-underline hproperty:highlight-face nil))
 
   (let ((update-hyrolo-highlight-flag
         (and (boundp 'hyrolo-highlight-face)
@@ -378,8 +394,8 @@ highlighted."
                  (and (fboundp 'internal-facep) (internal-facep 
hyrolo-highlight-face)))
              (or (null (face-foreground hyrolo-highlight-face))
                  (face-equal hproperty:highlight-face 
hyrolo-highlight-face)))))
-    (if (not (equal (face-background hproperty:highlight-face)
-                   hproperty:item-highlight-color))
+    (unless (equal (face-background hproperty:highlight-face)
+                  hproperty:item-highlight-color)
        (set-face-background hproperty:highlight-face
                             hproperty:item-highlight-color))
     (and background (not (equal (face-background
@@ -394,19 +410,18 @@ highlighted."
 
 (defun hproperty:select-item (&optional pnt)
   "Select item in current buffer at optional position PNT using 
hproperty:item-face."
-  (if pnt (goto-char pnt))
+  (when pnt (goto-char pnt))
   (skip-chars-forward " \t")
   (skip-chars-backward "^ \t\n\r")
   (let ((start (point)))
     (save-excursion
       (skip-chars-forward "^ \t\n\r")
-      (hproperty:but-add start (point) hproperty:item-face)
-      ))
+      (hproperty:but-add start (point) hproperty:item-face)))
   (sit-for 0))  ;; Force display update
 
 (defun hproperty:select-line (&optional pnt)
   "Select line in current buffer at optional position PNT using 
hproperty:item-face."
-  (if pnt (goto-char pnt))
+  (when pnt (goto-char pnt))
   (save-excursion
     (beginning-of-line)
     (hproperty:but-add (point) (progn (end-of-line) (point)) 
hproperty:item-face))
@@ -424,27 +439,31 @@ highlighted."
 (setq hproperty:but hproperty:but-face)
 
 (defun hproperty:set-face-after-init ()
-  (set-face-foreground hproperty:but-face (hproperty:but-color))
-  (set-face-background hproperty:but-face (hproperty:background))
-  (when (or (not hproperty:highlight-face)
-           (equal (face-background hproperty:highlight-face) 
(hproperty:background))
-           (equal (face-foreground hproperty:highlight-face) 
(hproperty:foreground)))
-    ;; Reverse foreground and background colors for default block-style 
highlighting.
-    (hproperty:set-item-highlight (hproperty:foreground) 
(hproperty:background)))
-  (hproperty:set-flash-color))
-
-(defvar hproperty:flash-face
-  (progn (defface hbut-flash nil "Hyperbole face for flashing hyper-buttons."
-          :group 'hyperbole-buttons)
-        'hbut-flash)
-  "Hyperbole face for flashing hyper-buttons.")
+  "Hyperbole button and highlighting face initializations; must be invoked 
after customizations are loaded."
+  (when (featurep 'hui-em-but)
+    (when (or (not hproperty:but-face)
+             (and (equal (face-background hproperty:but-face) 
(hproperty:background))
+                  (member (face-foreground hproperty:but-face) (list 
(hproperty:foreground)
+                                                                     
(hproperty:but-color)))))
+      (set-face-foreground hproperty:but-face (hproperty:but-color))
+      (set-face-background hproperty:but-face (hproperty:background)))
+    (when (or (not hproperty:highlight-face)
+             (and (equal (face-background hproperty:highlight-face) 
(hproperty:background))
+                  (equal (face-foreground hproperty:highlight-face) 
(hproperty:foreground))))
+      ;; Reverse foreground and background colors for default block-style 
highlighting.
+      (hproperty:set-item-highlight (hproperty:foreground) 
(hproperty:background)))
+    (when (and (member (face-background hproperty:flash-face)
+                      (list (face-background hproperty:but-face)
+                            (hproperty:background)))
+              (member (face-foreground hproperty:flash-face)
+                      (list (face-foreground hproperty:but-face)
+                            (hproperty:foreground))))
+      (hproperty:set-flash-color))))
 
 (defvar hproperty:item-button nil
   "Button used to highlight an item in a listing buffer.")
 (make-variable-buffer-local 'hproperty:item-button)
 (defvar hproperty:item-face nil "Item marking face.")
-(defvar hproperty:highlight-face nil
-  "Item highlighting face.  Use (hproperty:set-item-highlight) to set.")
 
 (provide 'hui-em-but)
 
@@ -452,6 +471,4 @@ highlighted."
     (hproperty:set-face-after-init)
   (add-hook 'after-init-hook #'hproperty:set-face-after-init))
 
-)
-
 ;;; hui-em-but.el ends here
diff --git a/hui-mouse.el b/hui-mouse.el
index fa289ac..294a1e1 100644
--- a/hui-mouse.el
+++ b/hui-mouse.el
@@ -1230,13 +1230,14 @@ NO-RECURSE-FLAG non-nil prevents infinite recursions."
       (when index-item
        (setq index-position (when (markerp (cdr index-item))
                               (marker-position (cdr index-item))))
-       (if (and (eq index-position 1) (not no-recurse-flag))
+       (if (eq index-position 1)
            ;; If index position is 1, this means the index markers have
            ;; become out of date after buffer edits (likely imenu-auto-rescan
            ;; is nil), so do a single rescan to try to fix this.
-           (progn (setq imenu--index-alist nil)
-                  (imenu--make-index-alist t)
-                  (smart-imenu-item-p index-key variable-flag t))
+           (unless no-recurse-flag
+             (setq imenu--index-alist nil)
+             (imenu--make-index-alist t)
+             (smart-imenu-item-p index-key variable-flag t))
          index-position)))))
 
 ;;; ************************************************************************
diff --git a/hui-window.el b/hui-window.el
index 737c3e9..8e1d4aa 100644
--- a/hui-window.el
+++ b/hui-window.el
@@ -247,10 +247,12 @@ drag release window.")
 ;;; Public functions
 ;;; ************************************************************************
 
-(defun hmouse-at-item-p ()
+(defun hmouse-at-item-p (start-window)
   "Return t if point is on an item draggable by Hyperbole, otherwise nil."
-  (let* ((buf (and (window-live-p action-key-depress-window) (window-buffer 
action-key-depress-window)))
-        (mode (and buf (buffer-local-value 'major-mode buf))))
+  (let* ((buf (when (window-live-p start-window)
+               (window-buffer start-window)))
+        (mode (when buf
+                (buffer-local-value 'major-mode buf))))
     (and buf (with-current-buffer buf
               ;; Point must be on an item, not after one
               (not (looking-at "\\s-*$")))
@@ -522,7 +524,7 @@ not on an item, then nil.
 
 See `hmouse-drag-item-mode-forms' for how to allow for draggable
 items in other modes."
-  (when (hmouse-at-item-p)
+  (when (hmouse-at-item-p action-key-depress-window)
     (hmouse-item-to-window new-window)
     t))
 
@@ -811,6 +813,10 @@ With optional boolean NEW-WINDOW non-nil, sensibly split 
the release window befo
     (recenter)
     (pulse-momentary-highlight-one-line (point) 'next-error)))
 
+(defun hmouse-pulse-region (start end)
+  (when (and hmouse-pulse-flag (featurep 'pulse) (pulse-available-p))
+    (pulse-momentary-highlight-region start end 'next-error)))
+
 (defun hmouse-item-to-window (&optional new-window)
   "Display buffer or file menu item of Action Key depress at the location of 
Action Key release.
 
diff --git a/hyrolo.el b/hyrolo.el
index 26701ec..da9be5c 100644
--- a/hyrolo.el
+++ b/hyrolo.el
@@ -1531,7 +1531,8 @@ String search expressions are converted to regular 
expressions.")
   )
 
 ;; Prompt user to rename old personal rolo file to new name, if necessary.
-(or noninteractive (call-interactively 'hyrolo-rename))
+(unless noninteractive
+  (call-interactively 'hyrolo-rename))
 
 (provide 'hyrolo)
 
diff --git a/man/hyperbole.html b/man/hyperbole.html
index 2b96e9d..4dc6014 100644
--- a/man/hyperbole.html
+++ b/man/hyperbole.html
@@ -2004,12 +2004,11 @@ the drags performed by <code>hkey-operate</code>).  If 
you already have a key bo
 for <code>ace-window</code>, then just ensure it is initialized by calling
 <code>(hkey-ace-window-setup)</code> without a key argument.
 </p>
-<span id="index-link-creation-from-keyboard"></span>
-<span id="index-keyboard-link-creation"></span>
 <span id="index-M_002do-i-_003cwindow_002did_003e"></span>
 <span id="index-M_002do-m-_003cwindow_002did_003e"></span>
 <span id="index-M_002do-r-_003cwindow_002did_003e"></span>
 <span id="index-M_002do-t-_003cwindow_002did_003e"></span>
+<span id="index-insert-item"></span>
 <span id="index-drag-item"></span>
 <span id="index-replace-window-buffer"></span>
 <span id="index-swap-window-buffers"></span>
@@ -2017,6 +2016,7 @@ for <code>ace-window</code>, then just ensure it is 
initialized by calling
 <span id="index-buffer-replace"></span>
 <span id="index-buffers-swap"></span>
 <span id="index-item-drag"></span>
+<span id="index-item-insert"></span>
 <span id="index-item-throw"></span>
 <p>After setup, the leftmost character or two of each window&rsquo;s modeline 
will show
 the ID to type to use that window as the drag destination.  Then whenever point
@@ -2030,6 +2030,16 @@ the selected window&rsquo;s buffer with that of another 
window, use
 <em>swap</em> the selected window&rsquo;s buffer with that of another window,
 use <kbd>{M-o m &lt;id-of-window-to-swap-with&gt;}</kbd>.
 </p>
+<span id="index-throw-region"></span>
+<span id="index-region-throw"></span>
+<p>You can also throw the active (highlighted) region of text to another
+window.  Simply activate a region and then use <kbd>{M-o
+t &lt;window-id&gt;}</kbd>.  If you don&rsquo;t use region highlighting,
+i.e. <code>transient-mark-mode</code>, then use <kbd>{C-u M-o
+t &lt;window-id&gt;}</kbd> for the same effect.  The buffer in the target 
window
+must differ from the one in the source window.  With no region active,
+this command throws the source buffer to the target window.
+</p>
 <p>In summary:
 </p><dl compact="compact">
 <dt>M-o i &lt;window&gt;</dt>
@@ -2046,7 +2056,7 @@ trigger an error
 </p>
 </dd>
 <dt>M-o t &lt;window&gt;</dt>
-<dd><p>throw listing item at point or current buffer to &lt;window&gt;
+<dd><p>throw region, listing item at point, or current buffer to &lt;window&gt;
 </p></dd>
 </dl>
 
@@ -12949,6 +12959,7 @@ Previous: <a href="#Function" accesskey="p" 
rel="prev">Function</a>, Up: <a href
 <tr><td></td><td valign="top"><a href="#index-Info-node">Info 
node</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Implicit-Button-Types">Implicit Button Types</a></td></tr>
 <tr><td></td><td valign="top"><a 
href="#index-InfoDock">InfoDock</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Glossary">Glossary</a></td></tr>
 <tr><td></td><td valign="top"><a 
href="#index-initialization-file">initialization 
file</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Autonumbering">Autonumbering</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-insert-item">insert 
item</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Keyboard-Drags">Keyboard Drags</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-inserting-tabs">inserting 
tabs</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Relocating-and-Copying">Relocating and Copying</a></td></tr>
 <tr><td></td><td valign="top"><a 
href="#index-insertion">insertion</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Inserting-and-Importing">Inserting and Importing</a></td></tr>
 <tr><td></td><td valign="top"><a 
href="#index-installation">installation</a>:</td><td>&nbsp;</td><td 
valign="top"><a href="#Installation">Installation</a></td></tr>
@@ -12975,6 +12986,7 @@ Previous: <a href="#Function" accesskey="p" 
rel="prev">Function</a>, Up: <a href
 <tr><td></td><td valign="top"><a 
href="#index-isearch">isearch</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Invisible-Text-Searches">Invisible Text Searches</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-issue-tracking">issue 
tracking</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Implicit-Button-Types">Implicit Button Types</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-item-drag">item 
drag</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Keyboard-Drags">Keyboard Drags</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-item-insert">item 
insert</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Keyboard-Drags">Keyboard Drags</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-item-throw">item 
throw</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Keyboard-Drags">Keyboard Drags</a></td></tr>
 <tr><td colspan="4"> <hr></td></tr>
 <tr><th id="Concept-Index_cp_letter-J">J</th><td></td><td></td></tr>
@@ -13001,7 +13013,6 @@ Previous: <a href="#Function" accesskey="p" 
rel="prev">Function</a>, Up: <a href
 <tr><td></td><td valign="top"><a href="#index-key-bindings_002c-toggle-1">key 
bindings, toggle</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Global-Key-Bindings">Global Key Bindings</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-key-sequence">key 
sequence</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Implicit-Button-Types">Implicit Button Types</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-keyboard-drags">keyboard 
drags</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Keyboard-Drags">Keyboard Drags</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-keyboard-link-creation">keyboard 
link creation</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Keyboard-Drags">Keyboard Drags</a></td></tr>
 <tr><td></td><td valign="top"><a 
href="#index-keyboard_002c-jump-to-window">keyboard, jump to 
window</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Keyboard-Drags">Keyboard Drags</a></td></tr>
 <tr><td></td><td valign="top"><a 
href="#index-keypad">keypad</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#HyControl">HyControl</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-kill-and-yank">kill and 
yank</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Thing-Selection">Thing 
Selection</a></td></tr>
@@ -13045,7 +13056,6 @@ Previous: <a href="#Function" accesskey="p" 
rel="prev">Function</a>, Up: <a href
 <tr><td></td><td valign="top"><a href="#index-link-action-types">link action 
types</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Action-Types">Action 
Types</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-link-button">link 
button</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Explicit-Buttons">Explicit Buttons</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-link-creation">link 
creation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#By-Dragging">By 
Dragging</a></td></tr>
-<tr><td></td><td valign="top"><a 
href="#index-link-creation-from-keyboard">link creation from 
keyboard</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Keyboard-Drags">Keyboard Drags</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-link-display">link 
display</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Referent-Display">Referent Display</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-link-to-explicit-button">link to 
explicit button</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Implicit-Button-Types">Implicit Button Types</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-link-to-global-button">link to 
global button</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Implicit-Button-Types">Implicit Button Types</a></td></tr>
@@ -13304,6 +13314,7 @@ Previous: <a href="#Function" accesskey="p" 
rel="prev">Function</a>, Up: <a href
 <tr><td></td><td valign="top"><a href="#index-referent-display">referent 
display</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Referent-Display">Referent Display</a></td></tr>
 <tr><td></td><td valign="top"><a 
href="#index-refilling">refilling</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Filling">Filling</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-region-selection">region 
selection</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Smart-Key-Thing-Selection">Smart Key Thing Selection</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-region-throw">region 
throw</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Keyboard-Drags">Keyboard Drags</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-region_002c-active">region, 
active</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Smart-Mouse-Drags-within-a-Window">Smart Mouse Drags within a 
Window</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-relative-autonumber">relative 
autonumber</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Koutliner">Koutliner</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-relative-identifier">relative 
identifier</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Autonumbering">Autonumbering</a></td></tr>
@@ -13436,6 +13447,7 @@ Previous: <a href="#Function" accesskey="p" 
rel="prev">Function</a>, Up: <a href
 <tr><td></td><td valign="top"><a 
href="#index-thing-1">thing</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Smart-Key-_002d-Delimited-Things">Smart Key - Delimited 
Things</a></td></tr>
 <tr><td></td><td valign="top"><a 
href="#index-things">things</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Smart-Key-Thing-Selection">Smart Key Thing Selection</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-throw-item">throw 
item</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Keyboard-Drags">Keyboard Drags</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-throw-region">throw 
region</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Keyboard-Drags">Keyboard Drags</a></td></tr>
 <tr><td></td><td valign="top"><a 
href="#index-thumbnails">thumbnails</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Smart-Key-_002d-Image-Thumbnails">Smart Key - Image 
Thumbnails</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-toc-action-type">toc action 
type</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Action-Types">Action 
Types</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-toc-implicit-button-type">toc 
implicit button type</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Implicit-Button-Types">Implicit Button Types</a></td></tr>
diff --git a/man/hyperbole.info b/man/hyperbole.info
index 79da4d4..c3aee12 100644
Binary files a/man/hyperbole.info and b/man/hyperbole.info differ
diff --git a/man/hyperbole.pdf b/man/hyperbole.pdf
index 246b9bb..e415b2e 100644
Binary files a/man/hyperbole.pdf and b/man/hyperbole.pdf differ
diff --git a/man/hyperbole.texi b/man/hyperbole.texi
index 0ab2669..758dbfe 100644
--- a/man/hyperbole.texi
+++ b/man/hyperbole.texi
@@ -1490,12 +1490,11 @@ the drags performed by @code{hkey-operate}).  If you 
already have a key bound
 for @code{ace-window}, then just ensure it is initialized by calling
 @code{(hkey-ace-window-setup)} without a key argument.
 
-@cindex link creation from keyboard
-@cindex keyboard link creation
 @kindex M-o i <window-id>
 @kindex M-o m <window-id>
 @kindex M-o r <window-id>
 @kindex M-o t <window-id>
+@cindex insert item
 @cindex drag item
 @cindex replace window buffer
 @cindex swap window buffers
@@ -1503,6 +1502,7 @@ for @code{ace-window}, then just ensure it is initialized 
by calling
 @cindex buffer replace
 @cindex buffers swap
 @cindex item drag
+@cindex item insert
 @cindex item throw
 After setup, the leftmost character or two of each window's modeline will show
 the ID to type to use that window as the drag destination.  Then whenever point
@@ -1516,6 +1516,16 @@ the selected window's buffer with that of another 
window, use
 @emph{swap} the selected window's buffer with that of another window,
 use @bkbd{M-o m <id-of-window-to-swap-with>}.
 
+@cindex throw region
+@cindex region throw
+You can also throw the active (highlighted) region of text to another
+window.  Simply activate a region and then use @bkbd{M-o
+t <window-id>}.  If you don't use region highlighting,
+i@.e@. @code{transient-mark-mode}, then use @bkbd{C-u M-o
+t <window-id>} for the same effect.  The buffer in the target window
+must differ from the one in the source window.  With no region active,
+this command throws the source buffer to the target window.
+
 In summary:
 @table @asis
 @item M-o i <window>
@@ -1529,7 +1539,7 @@ swap the buffers in the selected window and <window>
 replace the selected (current) window's buffer with that of <window>
 
 @item M-o t <window>
-throw listing item at point or current buffer to <window>
+throw region, listing item at point, or current buffer to <window>
 @end table
 
 @c -------



reply via email to

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