[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 099bdae 2/6: Keyboard drags; Treemacs item dr
From: |
Robert Weiner |
Subject: |
[elpa] externals/hyperbole 099bdae 2/6: Keyboard drags; Treemacs item drags; Ace-Window item throws and HyRolo Google Contacts improvements |
Date: |
Wed, 22 Nov 2017 17:56:13 -0500 (EST) |
branch: externals/hyperbole
commit 099bdae1a82ed9be0b587d3f1a436f55a2914b77
Author: Bob Weiner <address@hidden>
Commit: Bob Weiner <address@hidden>
Keyboard drags; Treemacs item drags; Ace-Window item throws and HyRolo
Google Contacts improvements
Enabled keyboard-based drag emulation and associated help with {C-h A}.
Made HyRolo support of Google Contacts usable by eliminating repeated login
requests.
Added item drags for Treemacs file viewer package.
Added {i} key to Ace-Window package operations to display an item in a
specific window.
* hmouse-drv.el (hkey-ace-window-setup): Setup keyboard-based display of
items in windows specified by
short ids. See its doc string for how to use.
(hkey-drag, hkey-drag-jump): Added for mouse drag emulation
via keyboard from a single
function that uses the selected window point for depress location and
the parameter RELEASE-WINDOW
for the window and its point for release. hkey-drag-jump is useful as
a command in the ace-window
package's aw-dispatch-alist, e.g. {i} for insert item, because it
leaves RELEASE-WINDOW selected.
* hui-select.el (hui-select-ignore-quoted-sexp-modes): Added so major modes
to ignore for syntactic pair
selection can be customized.
(hui-select-at-delimited-thing-p): Changed to not trigger
when on an Emacs button.
* hui-window.el (hmouse-drag-between-frames): Replaced calls to
window-valid-p with window-live-p.
(hmouse-drag-window-side, hmouse-drag-between-windows,
hmouse-drag-same-window,
hmouse-drag-outside-all-windows, hmouse-drag-item-to-display,
hmouse-item-to-window): Added window-live-p checks for cases
where a window has
been deleted between depress and release.
* hmouse-drv.el (hmouse-window-at-absolute-pixel-position): Updated to
support keyboard drag emulation.
(hkey-help): Changed hkey-forms to use hmouse-alist instead
of hkey-alist so mouse
drags are accounted for when emulating drags from the keyboard and then
invoking {C-h A} for help.
hui-window.el (hmouse-drag-outside-all-windows): Triggered only if an
action/assist-key press has
occurred, e.g. could be called by hkey-help when no press has occurred.
(hmouse-x-coord, hmouse-y-coord): Removed error when there
is no valid coordinate and
returned nil instead to support keyboard drag emulation help.
2017-11-20 Bob Weiner <address@hidden>
* hmouse-drv.el (hkey-absolute-pixel-position): Added and used in
Action/Assist Key functions.
(hmouse-set-point): Fixed hkey-operate bug by wrapping
final (posn-at-point) in
a list with an event type symbol so if called from a keyboard event,
returns a proper format
event.
(hkey-operate): Changed so output messages only when called
interactively.
* hui-treemacs.el: Added for Smart Key support of the Treemacs file manager.
(smart-treemacs): Added.
(smart-treemacs-modeline): Added to allow toggling of
Treemacs display on
Action Key clicks on buffer id of modeline.
hui-mouse.el (hkey-alist, action-key-modeline-buffer-id-function): Added
Smart Key treemacs
package support.
hui-window.el (action-key-modeline): Updated to call
action-key-modeline-buffer-id-function.
hactypes.el (link-to-buffer-tmp): Added optional 2nd parameter of POINT
to display.
2017-11-19 Bob Weiner <address@hidden>
* hui-window.el (hmouse-item-to-window): Added support for
hmouse-drag-item-mode-forms sending
a sequence of (buffer position) rather than just buffer.
(hmouse-drag-item-mode-forms): Added support for dragging
items from the treemacs
hierachical file viewer package.
2017-11-17 Bob Weiner <address@hidden>
* hyrolo.el (hyrolo-initialize-file-list): Fixed to set hyrolo-file-list.
(hyrolo-retrieve-google-contacts): Updated to cache Google
passphrase whenever Google contacts
are used so the user is not prompted for his passphrase on every HyRolo
search.
man/hyperbole.texi (HyRolo Settings): Updated Google Contacts settings
handling to document this caching.
* man/im/C-hh.png - Added showing Hyperbole mini-buffer menu prefix key
binding.
2017-11-16 Bob Weiner <address@hidden>
* hywconfig.el (hywconfig-delete-pop): Fixed bug that removed the ring
entry before using it to restore
the window configuration.
==============================================================================
V7.0.1 changes ^^^^:
==============================================================================
---
Changes | 71 +++++++++++++++++-
HY-ANNOUNCE | 104 ++++++++++++-------------
MANIFEST | 1 +
Makefile | 8 +-
hactypes.el | 12 ++-
hmouse-drv.el | 122 ++++++++++++++++++++++++------
hmouse-sh.el | 7 ++
hui-mouse.el | 22 ++++--
hui-select.el | 35 +++++----
hui-treemacs.el | 217 +++++++++++++++++++++++++++++++++++++++++++++++++++++
hui-window.el | 90 ++++++++++++----------
hyrolo.el | 31 ++++----
man/hyperbole.texi | 13 ++--
man/im/C-hh.png | Bin 0 -> 898836 bytes
14 files changed, 578 insertions(+), 155 deletions(-)
diff --git a/Changes b/Changes
index e690708..808c4f4 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,72 @@
+2017-11-21 Bob Weiner <address@hidden>
+
+* hmouse-drv.el (hkey-ace-window-setup): Setup keyboard-based display of items
in windows specified by
+ short ids. See its doc string for how to use.
+ (hkey-drag, hkey-drag-jump): Added for mouse drag emulation
via keyboard from a single
+ function that uses the selected window point for depress location and the
parameter RELEASE-WINDOW
+ for the window and its point for release. hkey-drag-jump is useful as a
command in the ace-window
+ package's aw-dispatch-alist, e.g. {i} for insert item, because it leaves
RELEASE-WINDOW selected.
+
+* hui-select.el (hui-select-ignore-quoted-sexp-modes): Added so major modes to
ignore for syntactic pair
+ selection can be customized.
+ (hui-select-at-delimited-thing-p): Changed to not trigger when
on an Emacs button.
+
+* hui-window.el (hmouse-drag-between-frames): Replaced calls to window-valid-p
with window-live-p.
+ (hmouse-drag-window-side, hmouse-drag-between-windows,
hmouse-drag-same-window,
+ hmouse-drag-outside-all-windows, hmouse-drag-item-to-display,
+ hmouse-item-to-window): Added window-live-p checks for cases
where a window has
+ been deleted between depress and release.
+
+* hmouse-drv.el (hmouse-window-at-absolute-pixel-position): Updated to support
keyboard drag emulation.
+ (hkey-help): Changed hkey-forms to use hmouse-alist instead of
hkey-alist so mouse
+ drags are accounted for when emulating drags from the keyboard and then
invoking {C-h A} for help.
+ hui-window.el (hmouse-drag-outside-all-windows): Triggered only if an
action/assist-key press has
+ occurred, e.g. could be called by hkey-help when no press has occurred.
+ (hmouse-x-coord, hmouse-y-coord): Removed error when there is
no valid coordinate and
+ returned nil instead to support keyboard drag emulation help.
+
+2017-11-20 Bob Weiner <address@hidden>
+
+* hmouse-drv.el (hkey-absolute-pixel-position): Added and used in
Action/Assist Key functions.
+ (hmouse-set-point): Fixed hkey-operate bug by wrapping final
(posn-at-point) in
+ a list with an event type symbol so if called from a keyboard event,
returns a proper format
+ event.
+ (hkey-operate): Changed so output messages only when called
interactively.
+
+* hui-treemacs.el: Added for Smart Key support of the Treemacs file manager.
+ (smart-treemacs): Added.
+ (smart-treemacs-modeline): Added to allow toggling of
Treemacs display on
+ Action Key clicks on buffer id of modeline.
+ hui-mouse.el (hkey-alist, action-key-modeline-buffer-id-function): Added
Smart Key treemacs
+ package support.
+ hui-window.el (action-key-modeline): Updated to call
action-key-modeline-buffer-id-function.
+ hactypes.el (link-to-buffer-tmp): Added optional 2nd parameter of POINT to
display.
+
+2017-11-19 Bob Weiner <address@hidden>
+
+* hui-window.el (hmouse-item-to-window): Added support for
hmouse-drag-item-mode-forms sending
+ a sequence of (buffer position) rather than just buffer.
+ (hmouse-drag-item-mode-forms): Added support for dragging
items from the treemacs
+ hierachical file viewer package.
+
+2017-11-17 Bob Weiner <address@hidden>
+
+* hyrolo.el (hyrolo-initialize-file-list): Fixed to set hyrolo-file-list.
+ (hyrolo-retrieve-google-contacts): Updated to cache Google
passphrase whenever Google contacts
+ are used so the user is not prompted for his passphrase on every HyRolo
search.
+ man/hyperbole.texi (HyRolo Settings): Updated Google Contacts settings
handling to document this caching.
+
+* man/im/C-hh.png - Added showing Hyperbole mini-buffer menu prefix key
binding.
+
+2017-11-16 Bob Weiner <address@hidden>
+
+* hywconfig.el (hywconfig-delete-pop): Fixed bug that removed the ring entry
before using it to restore
+ the window configuration.
+
+==============================================================================
+V7.0.1 changes ^^^^:
+==============================================================================
+
2017-11-15 Bob Weiner <address@hidden>
* hversion.el: Updated to 7.0.0 for major release.
@@ -1303,7 +1372,7 @@ Python (case-sensitive).
hvar.el (var:append): Removed improper function quoting of variable.
==============================================================================
-V6.0.3 changes ^^^^:
+V7.0.0 changes ^^^^:
==============================================================================
2016-08-08 Bob Weiner <address@hidden>
diff --git a/HY-ANNOUNCE b/HY-ANNOUNCE
index 58e3b03..57dd3cc 100644
--- a/HY-ANNOUNCE
+++ b/HY-ANNOUNCE
@@ -1,40 +1,42 @@
-To: address@hidden, address@hidden, address@hidden
-ANNOUNCE: GNU Hyperbole 7, a.k.a the Git Ready for Action Release
+To: address@hidden, address@hidden, address@hidden, address@hidden,
address@hidden
+ANNOUNCE: GNU Hyperbole 7, a.k.a the Git Ready for Action Release, is now
available
-This is the main public release of GNU Hyperbole for 2017. It offers many
-new productivity-enhancing features including Git and Github object links
-as summarized here:
+This is the main public release of GNU Hyperbole for 2017 and it is
+bursting with new features and further quality improvements. New
+capabilities, including Git and Github object links, are summarized
+here:
https://git.savannah.gnu.org/cgit/hyperbole.git/plain/HY-NEWS
-A short explanation of Hyperbole is included below. For more detail
-or how to obtain and install it, see:
+A short explanation of Hyperbole is included below. For more
+detail or how to obtain and install it, see:
- https://www.gnu.org/software/hyperbole
+ https://www.gnu.org/s/hyperbole
For a list of use cases, see:
- https://www.gnu.org/software/hyperbole/HY-WHY.html
+ https://www.gnu.org/s/hyperbole/HY-WHY.html
For what users think about Hyperbole, see:
- https://www.gnu.org/software/hyperbole/hyperbole.html#user-quotes
+ https://www.gnu.org/s/hyperbole/hyperbole.html#user-quotes
----
-GNU Hyperbole (pronounced Ga-new Hi-per-bo-lee), or just Hyperbole, is an
-amazing, programmable hypertextual information management system
-implemented as a GNU Emacs package and extensively documented. Hyperbole
-has been greatly expanded and updated for use with the latest Emacs 26
-releases; it supports GNU Emacs 24.4 or above.
+GNU Hyperbole (pronounced Ga-new Hi-per-bo-lee), or just Hyperbole,
+is an amazing, programmable hypertextual information management
+system implemented as a GNU Emacs package and extensively
+documented. Hyperbole has been greatly expanded and updated for
+use with the latest Emacs 26 releases; it supports GNU Emacs 24.4
+or above.
-Hyperbole can boost your day-to-day productivity with Emacs and your
-ability to manage information stored across many different machines on the
-internet. People who get used to Hyperbole often find they prefer never to
-use Emacs without it.
+Hyperbole can boost your day-to-day productivity with Emacs and
+your ability to manage information stored across many different
+machines on the internet. People who get used to Hyperbole often
+find they prefer never to use Emacs without it.
-Hyperbole includes its own easy-to-use hypertextual buttons and links that
-can be created without the need for any markup language.
+Hyperbole includes its own easy-to-use hypertextual buttons and
+links that can be created without the need for any markup language.
It also comes out-of-the-box with:
@@ -44,32 +46,33 @@ It also comes out-of-the-box with:
- a powerful multi-level auto-numbered outliner
- - and two very smart context-dependent mouse and keyboard keys that
- simplify operations in many editing and browsing modes. All features
- are aimed at making textual information management and display fast and
- easy.
+ - and two very smart context-dependent mouse and keyboard keys
+ that simplify operations in many editing and browsing modes.
+ All features are aimed at making textual information management
+ and display fast and easy.
-Bob Weiner designed and programmed GNU Hyperbole. He and Mats Lidell
-maintain it with the Free Software Foundation. It includes an interactive
-demo to introduce you to its features as well as a detailed reference manual,
-as explained here:
+Bob Weiner designed and programmed GNU Hyperbole. He and Mats
+Lidell maintain it with the Free Software Foundation. It includes
+an interactive demo to introduce you to its features as well as a
+detailed reference manual, as explained here:
- https://www.gnu.org/software/hyperbole/hyperbole.html#invocation-and-doc
+ https://www.gnu.org/s/hyperbole/hyperbole.html#invocation-and-doc
----
-Please give Hyperbole a try. It's free, man. It adapts to your needs.
-It connects everything. It rewires your brain. It speeds your web
-searches for `carpal tunnel syndrome'. It makes you feel like the
-sun is out on a gray winter day :-)
+Please give Hyperbole a try. It's free, man. It adapts to your
+needs. It connects everything. It rewires your brain. It speeds
+your web searches for `carpal tunnel syndrome'. It makes you feel
+like the sun is out on a gray winter day :-)
-But wait, there's more and this part is serious. For a limited time,
-to encourage use and feedback, the first 30 people who try out the
-Hyperbole DEMO or read the Hyperbole Manual and send a few thoughtful
-sentences to <rsw at gnu dot org> will receive either of their choice of
-the following as yet unpublished single file Emacs Lisp libraries:
+But wait, there's more and this part is serious. For a limited
+time, to encourage use and feedback, the first 30 people who try
+out the Hyperbole DEMO or read the Hyperbole Manual and send a few
+thoughtful sentences to <rsw at gnu dot org> will receive either of
+their choice of the following as yet unpublished single file Emacs
+Lisp libraries:
-;; rsw-linecol.el: User-editable mode-line column and line number display
formats
+;; rsw-linecol.el: User-editable mode-line col/line number formats
;;
;; GNU Emacs buries the formatting of mode-line line and column
;; numbers in a way that makes it virtually impossible for a user
@@ -79,18 +82,17 @@ the following as yet unpublished single file Emacs Lisp
libraries:
or
-;; rsw-chrome-macos.el: Open a URL or file in Google Chrome and reuse an
existing
-;; tab/window if already displayed.
+;; rsw-chrome-macos.el: Open a URL in Google Chrome and reuse an
+;; existing tab/window if already displayed.
;;
-;; This library resolves the many problems of sending URLs to Google Chrome
-;; on MacOS. It properly sends # hash in-file links (these are
-;; typically stripped when Chrome is called as a MacOS application).
-;; It reuses any tab already displaying any matching URL that is sent
-;; and it does this even if the ultimately displayed URL goes through
-;; several redirects before display.
+;; This library resolves the many problems of sending URLs to
+;; Google Chrome on MacOS. It properly sends # hash in-file links
+;; (these are typically stripped when Chrome is called as a MacOS
+;; application). It reuses any tab already displaying any
+;; matching URL that is sent and it does this even if the
+;; ultimately displayed URL goes through several redirects before
+;; display.
Enjoy,
-Bob and Mats
-
-
+Bob Weiner and Mats Lidell
diff --git a/MANIFEST b/MANIFEST
index 33c8ef2..afd6d16 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -40,6 +40,7 @@ hui-menu.el - Menubar menu of GNU Hyperbole commands
hui-mini.el - Single line command menus for GNU Hyperbole
hui-mouse.el - Use key or mouse key for many functions, e.g. GNU
Hyperbole menus
hui-select.el - Select delimited or larger and larger syntax-driven
regions in a buffer
+hui-treemacs.el - Hyperbole Smart Key support for the Treemacs file
manager package
hui-window.el - Smart Mouse Key window and modeline depress/release
actions
hui-xe-but.el - XEmacs button highlighting and flashing support
hui.el - GNU Hyperbole button and hyperlink user interface
diff --git a/Makefile b/Makefile
index 6f774c2..de877d5 100644
--- a/Makefile
+++ b/Makefile
@@ -150,7 +150,7 @@ EL_COMPILE = hact.el hactypes.el hargs.el hbdata.el
hbmap.el hbut.el \
hmouse-drv.el hmouse-key.el hmouse-mod.el hmouse-sh.el
hmouse-tag.el \
hpath.el hrmail.el hsettings.el hsmail.el hsys-org.el hsys-www.el
htz.el \
hycontrol.el hui-jmenu.el hui-menu.el hui-mini.el hui-mouse.el
hui-select.el \
- hui-window.el hui.el hvar.el hversion.el hvm.el hypb.el
hyperbole.el \
+ hui-treemacs.el hui-window.el hui.el hvar.el hversion.el hvm.el
hypb.el hyperbole.el \
hyrolo-demo.el hyrolo-logic.el hyrolo-menu.el hyrolo.el
hywconfig.el set.el
EL_KOTL = kotl/kexport.el kotl/kfile.el kotl/kfill.el kotl/kimport.el
kotl/klabel.el \
@@ -165,7 +165,7 @@ ELC_COMPILE = hactypes.elc hibtypes.elc hib-debbugs.elc
hib-doc-id.elc hib-kbd.
hmouse-drv.elc hmouse-key.elc hmouse-mod.elc hmouse-sh.elc
hmouse-tag.elc \
hpath.elc hrmail.elc hsettings.elc hsmail.elc hsys-org.elc
hsys-www.elc htz.elc \
hycontrol.elc hui-jmenu.elc hui-menu.elc hui-mini.elc
hui-mouse.elc hui-select.elc \
- hui-window.elc hui.elc hvar.elc hversion.elc hvm.elc hypb.elc
hyperbole.elc \
+ hui-treemacs.elc hui-window.elc hui.elc hvar.elc hversion.elc
hvm.elc hypb.elc hyperbole.elc \
hyrolo-demo.elc hyrolo-logic.elc hyrolo-menu.elc hyrolo.elc
hywconfig.elc set.elc
ELC_KOTL = kotl/kexport.elc kotl/kfile.elc kotl/kfill.elc kotl/kimport.elc
kotl/klabel.elc \
@@ -292,11 +292,11 @@ git-push:
# git, ELPA will automatically check and build its Hyperbole archive, allowing
users to
# update their packages of Hyperbole. ELPA does this twice a day now.
elpa: package
- cd $(elpa_hypb_dir) && git pull
http://git.sv.gnu.org:/srv/git/hyperbole.git master \
+ cd $(elpa_hypb_dir) && git pull
http://git.savannah.gnu.org/r/hyperbole.git master \
&& git tag -s hyperbole-$(HYPB_VERSION) && git push
elpa-test: package
- cd $(elpa_hypb_dir) && git pull
http://git.sv.gnu.org:/srv/git/hyperbole.git master
+ cd $(elpa_hypb_dir) && git pull
http://git.savannah.gnu.org/r/hyperbole.git master
# Send compressed tarball for uploading to GNU ftp site; this must be done
from the directory
# containing the tarball to upload.
diff --git a/hactypes.el b/hactypes.el
index 7145949..bfe03fc 100644
--- a/hactypes.el
+++ b/hactypes.el
@@ -229,13 +229,19 @@ For example: To: address@hidden")))
(t (hpath:find buf-str-or-file)))
(hypb:error "(hyp-source): Non-string argument: %s" buf-str-or-file)))
-(defact link-to-buffer-tmp (buffer)
- "Displays a BUFFER.
+(defact link-to-buffer-tmp (buffer &optional point)
+ "Displays a BUFFER scrolled to optional POINT.
+If POINT is given, the buffer is displayed with POINT at the top of
+the window.
+
This type of link generally can only be used within a single editor session.
Use `link-to-file' instead for a permanent link."
(interactive "bBuffer to link to: ")
(if (or (stringp buffer) (bufferp buffer))
- (hpath:display-buffer buffer)
+ (and (hpath:display-buffer buffer)
+ (integerp point)
+ (progn (goto-char (min (point-max) point))
+ (recenter 0)))
(hypb:error "(link-to-buffer-tmp): Not a current buffer: %s" buffer)))
(defact link-to-directory (directory)
diff --git a/hmouse-drv.el b/hmouse-drv.el
index cccc888..30663ad 100644
--- a/hmouse-drv.el
+++ b/hmouse-drv.el
@@ -4,7 +4,7 @@
;;
;; Orig-Date: 04-Feb-90
;;
-;; Copyright (C) 1989-2016 Free Software Foundation, Inc.
+;; Copyright (C) 1989-2017 Free Software Foundation, Inc.
;; See the "HY-COPY" file for license information.
;;
;; This file is part of GNU Hyperbole.
@@ -16,6 +16,7 @@
;;; Other required Elisp libraries
;;; ************************************************************************
+(eval-when-compile (require 'hui-window)) ;; for `hmouse-drag-item-to-display'
(require 'hypb)
;; Quiet byte compiler warnings for these free variables.
@@ -127,6 +128,12 @@ This permits the Smart Keys to behave as paste keys.")
;;; Hyperbole context-sensitive key driver functions
;;; ************************************************************************
+(defun hkey-absolute-pixel-position ()
+ "Return the display terminal absolute pixel position of the mouse (if in a
mouse event) or the selected window's point."
+ (if (mouse-event-p last-input-event)
+ (mouse-absolute-pixel-position)
+ (window-absolute-pixel-position)))
+
;;; Smart Key Depress Functions
(defun action-key-depress (&rest args)
(interactive)
@@ -139,7 +146,7 @@ This permits the Smart Keys to behave as paste keys.")
action-key-depress-args (hmouse-set-point args)
action-key-depress-window (or (hmouse-depress-inactive-minibuffer-p
args)
(selected-window))
- action-key-depress-position (mouse-absolute-pixel-position)
+ action-key-depress-position (hkey-absolute-pixel-position)
action-key-release-args nil
action-key-release-window nil
action-key-release-prev-point nil)
@@ -156,7 +163,7 @@ This permits the Smart Keys to behave as paste keys.")
assist-key-depress-args (hmouse-set-point args)
assist-key-depress-window (or (hmouse-depress-inactive-minibuffer-p
args)
(selected-window))
- assist-key-depress-position (mouse-absolute-pixel-position)
+ assist-key-depress-position (hkey-absolute-pixel-position)
assist-key-release-args nil
assist-key-release-window nil
assist-key-release-prev-point nil)
@@ -190,7 +197,7 @@ Any ARGS will be passed to `hmouse-function'."
;; Make this a no-op if some local mouse key binding overrode the global
;; action-key-depress command invocation.
(when action-key-depressed-flag
- (setq action-key-release-position (mouse-absolute-pixel-position))
+ (setq action-key-release-position (hkey-absolute-pixel-position))
(let ((hkey-alist hmouse-alist))
(setq action-key-depressed-flag nil)
(cond (action-key-cancelled
@@ -214,7 +221,7 @@ Any ARGS will be passed to `hmouse-function'."
;; Make this a no-op if some local mouse key binding overrode the global
;; assist-key-depress command invocation.
(when assist-key-depressed-flag
- (setq assist-key-release-position (mouse-absolute-pixel-position))
+ (setq assist-key-release-position (hkey-absolute-pixel-position))
(let ((hkey-alist hmouse-alist))
(setq assist-key-depressed-flag nil)
(cond (assist-key-cancelled
@@ -321,6 +328,71 @@ bound to a valid function."
(hypb:format-quote (format "%s" hkey-action))
(current-buffer) major-mode (minibuffer-depth))))
+;;;###autoload
+(defun hkey-drag (release-window)
+ "Emulate Smart Mouse Key drag from selected window to RELEASE-WINDOW.
+The drag action determines the final selected window.
+
+Optional prefix ARG non-nil means emulate Assist Key rather than the
+Action Key.
+
+Only works when running under a window system, not from a dumb terminal."
+ ;; Cancel any partial drag that may have been recorded.
+ (if current-prefix-arg
+ (setq assist-key-depressed-flag nil)
+ (setq action-key-depressed-flag nil))
+ (hkey-operate current-prefix-arg)
+ (when (window-live-p release-window)
+ (select-window release-window))
+ (hkey-operate current-prefix-arg))
+
+;;;###autoload
+(defun hkey-drag-jump (release-window)
+ "Emulate Smart Mouse Key drag from selected window to RELEASE-WINDOW.
+If an item is dragged to RELEASE-WINDOW, then RELEASE-WINDOW is selected;
+otherwise, the drag action determines the selected window.
+
+Optional prefix ARG non-nil means emulate Assist Key rather than the
+Action Key.
+
+Only works when running under a window system, not from a dumb terminal."
+ (if (and (hmouse-drag-item-to-display) (window-live-p release-window))
+ (progn (hkey-drag release-window)
+ ;; Leave release window selected
+ (when (window-live-p release-window)
+ (select-window release-window)))
+ ;; Leave hkey-drag to choose selected window
+ (hkey-drag release-window)))
+
+(defun hkey-ace-window-setup ()
+ "Setup keyboard-based display of items in windows specified by short ids.
+
+The ace-window package, (see "https://elpa.gnu.org/packages/ace-window.html"),
+assigns short ids to each Emacs window and lets you jump to or
+operate upon a specific window by giving its letter. Hyperbole
+can insert an operation into ace-window that allows you to
+display items such as dired or buffer menu items in a specific
+window.
+
+To enable this feature, in your Emacs initialization file after
+Hyperbole is initialized, call:
+
+ (hkey-ace-window-setup)
+
+and then bind the function `ace-window' to a key of your choice, say
+{M-o}:
+
+ (global-set-key "\M-o" 'ace-window)
+
+Then whenever point is on an item you want displayed in another
+window, use {M-o i <id-of-window-to-display-item-in>} and watch the
+magic happen."
+ (require 'ace-window)
+ (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
+ aw-dispatch-always t)
+ (push '(?i hkey-drag-jump "Hyperbole Display Item") aw-dispatch-alist)
+ (ace-window-display-mode 1))
+
(defun hkey-execute (assist-flag)
"Evaluate Action Key form (or Assist Key form with ASSIST-FLAG non-nil) for
first non-nil predicate from `hkey-alist'.
Non-nil ASSIST-FLAG means evaluate second form, otherwise evaluate first form.
@@ -344,7 +416,7 @@ Return non-nil iff a non-nil predicate is found."
With optional ASSIST-FLAG non-nil, display help for the Assist Key command.
Return non-nil iff associated help documentation is found."
(interactive "P")
- (let ((hkey-forms hkey-alist)
+ (let ((hkey-forms hmouse-alist)
hkey-form pred-value call calls cmd-sym doc)
(while (and (null pred-value) (setq hkey-form (car hkey-forms)))
(or (setq pred-value (eval (car hkey-form)))
@@ -543,20 +615,22 @@ Only works when running under a window system, not from a
dumb terminal."
(if arg
(if assist-key-depressed-flag
(progn (assist-mouse-key)
- (message "Assist Key released."))
+ (when (called-interactively-p 'interactive)
+ (message "Assist Key released.")))
(assist-key-depress)
- (message
- "Assist Key depressed; go to release point and hit {%s %s}."
- (substitute-command-keys "\\[universal-argument]")
- (substitute-command-keys "\\[hkey-operate]")
- ))
+ (when (called-interactively-p 'interactive)
+ (message
+ "Assist Key depressed; go to release point and hit {%s %s}."
+ (substitute-command-keys "\\[universal-argument]")
+ (substitute-command-keys "\\[hkey-operate]"))))
(if action-key-depressed-flag
(progn (action-mouse-key)
- (message "Action Key released."))
+ (when (called-interactively-p 'interactive)
+ (message "Action Key released.")))
(action-key-depress)
- (message "Action Key depressed; go to release point and hit {%s}."
- (substitute-command-keys "\\[hkey-operate]"))
- )))
+ (when (called-interactively-p 'interactive)
+ (message "Action Key depressed; go to release point and hit {%s}."
+ (substitute-command-keys "\\[hkey-operate]"))))))
(defun hkey-summarize (&optional current-window)
"Display smart key operation summary in help buffer.
@@ -614,8 +688,11 @@ With optional ARG, override them iff ARG is positive."
spacing))
(defun hmouse-window-at-absolute-pixel-position (&optional position
release-flag)
- "Return the top-most Emacs window at optional POSITION ((x . y) in absolute
pixels) or mouse position.
-If POSITION is not in a window, return nil. Considers all windows on
+ "Return the top-most Emacs window at optional POSITION ((x . y) in absolute
pixels).
+If POSITION is nil, use mouse position if last input event was a mouse
+event, otherwise, use the position of point in the selected window.
+
+If the position used is not in a window, return nil. Considers all windows on
the same display as the selected frame.
If optional RELEASE-FLAG is non-nil, this is part of a Smart Key
@@ -623,11 +700,14 @@ release computation, so optimize window selection based
on the depress
window already computed.
If the selected frame is a graphical macOS window and
-`hmouse-verity-release-window-flag' is non-nil, then return the
+`hmouse-verify-release-window-flag' is non-nil, then return the
top-most Emacs window only if it is the top-most application window at
the position (not below another application's window)."
(interactive)
- (setq position (or position (mouse-absolute-pixel-position)))
+ (setq position (or position
+ (if (mouse-event-p last-input-event)
+ (mouse-absolute-pixel-position)
+ (hkey-absolute-pixel-position))))
;; Proper top-to-bottom listing of frames is available only in Emacs
;; 26 and above. For prior versions, the ordering of the frames
;; returned is not guaranteed, so the frame whose window is returned
@@ -846,7 +926,7 @@ return current point as a marker."
(+ (nth 1 args) (nth 0 (window-edges win)))
(+ (nth 2 args) (nth 1 (window-edges win))))))
(t args)))
- (posn-at-point)))
+ (list 'keyboard-drag (posn-at-point))))
(defun hmouse-set-point-at (set-point-arg-list)
"Set point to cursor position using SET-POINT-ARG-LIST and returns t.
diff --git a/hmouse-sh.el b/hmouse-sh.el
index b93e6a0..64fceee 100644
--- a/hmouse-sh.el
+++ b/hmouse-sh.el
@@ -560,6 +560,13 @@ With optional MIDDLE-KEY-ONLY-FLAG non-nil, binds only the
middle mouse key."
(interactive)
(cond ;; GNU Emacs
(hyperb:emacs-p
+ ;; Unbind Emacs push-button mouse keys since Hyperbole handles them.
+ (define-key button-map [mouse-2] nil)
+ (define-key button-map [mode-line mouse-2] nil)
+ (define-key button-map [header-line mouse-2] nil)
+ ;; Remove push-button help echo string for mouse-2 key.
+ (put 'default-button 'help-echo nil)
+ ;;
;; In Info-mode, Emacs uses key-translation-map to link mouse-1 to
;; do whatever mouse-2 does but because Hyperbole uses both down
;; and up bindings on mouse2, this does work. So we rebind
diff --git a/hui-mouse.el b/hui-mouse.el
index 123ca16..5f84b4a 100644
--- a/hui-mouse.el
+++ b/hui-mouse.el
@@ -67,6 +67,13 @@ Set it to #'hkey-summarize if you want it to display a
summary of Smart Key beha
:type 'function
:group 'hyperbole-keys)
+(defcustom action-key-modeline-buffer-id-function #'dired-jump
+ "*Function to call when the Action Mouse Key is clicked on the buffer id
portion of a modeline.
+Its default value is #'dired-jump; set it to #'smart-treemacs-modeline
+to use the Treemacs file manager package instead."
+ :type 'function
+ :group 'hyperbole-keys)
+
(defcustom action-key-eol-function #'smart-scroll-up
"*Function run by the Action Key at the end of a line.
Its default value is #'smart-scroll-up."
@@ -88,6 +95,9 @@ Its default value is #'smart-scroll-down."
(defvar hkey-alist
'(
+ ((eq major-mode 'treemacs-mode) .
+ ((smart-treemacs) . (smart-treemacs)))
+ ;;
;; Handle Emacs push buttons in buffers
((and (fboundp 'button-at) (button-at (point))) .
((push-button nil (mouse-event-p last-command-event))
@@ -133,9 +143,12 @@ Its default value is #'smart-scroll-down."
(smart-eolp)) .
((funcall action-key-eol-function) . (funcall assist-key-eol-function)))
;;
- ;; The Smart Menu system provides menus within Emacs on a dumb terminal.
- ;; It is a part of InfoDock, but may also be obtained as a separate
- ;; package. It is not included with Hyperbole.
+ ;; The Smart Menu system is an attractive in-buffer menu system
+ ;; that works on any display system that supports Emacs. It
+ ;; predates Emacs' menu systems; it is a part of InfoDock.
+ ;; It is not included with Hyperbole.
+ ;;
+ ;; This selects or gives help for a menu item.
((eq major-mode 'smart-menu-mode) .
((smart-menu-select) . (smart-menu-help)))
;;
@@ -146,8 +159,7 @@ Its default value is #'smart-scroll-down."
((hbut:at-p) .
((hui:hbut-act 'hbut:current) . (hui:hbut-help 'hbut:current)))
;;
- ;; The Smart Menu system is an attractive in-buffer menu system
- ;; that predates Emacs menu systems; it is included in InfoDock.
+ ;; This potentially displays a Smart Menu.
((and (fboundp 'smart-menu-choose-menu)
(setq hkey-value (and hkey-always-display-menu
(smart-menu-choose-menu)))
diff --git a/hui-select.el b/hui-select.el
index 6abc237..6474acf 100644
--- a/hui-select.el
+++ b/hui-select.el
@@ -136,7 +136,13 @@
(append '(altmath-mode asm-mode csh-mode eiffel-mode ksh-mode
math-mode miranda-mode python-mode pascal-mode sather-mode)
hui-select-text-modes)
- "*List of language major modes which use mostly indentation to define
syntactic structure."
+ "*List of language major modes that use indentation mostly to define
syntactic structure."
+ :type '(repeat (function :tag "Mode"))
+ :group 'hyperbole-commands)
+
+(defcustom hui-select-ignore-quoted-sexp-modes
+ '(debugger-mode emacs-lisp-mode lisp-mode lisp-interaction-mode slime-mode
cider-mode)
+ "*List of language major modes in which to ignore quoted sexpressions for
syntactic matches."
:type '(repeat (function :tag "Mode"))
:group 'hyperbole-commands)
@@ -586,17 +592,20 @@ If an error occurs during syntax scanning, it returns
nil."
(defun hui-select-at-delimited-thing-p ()
"Returns non-nil if point is at a markup pair, list, array/vector, set,
comment or string, else nil.
-The non-nil value returned is the function to call to select that syntactic
unit."
- (setq hkey-value (hui-select-delimited-thing-call #'hui-select-at-p))
- (cond ((eq hkey-value 'hui-select-punctuation)
- (if (hui-select-comment (point))
- (setq hkey-value #'hui-select-comment)
- ;; Else here used to be `hkey-value' but then we are returning a
- ;; value for any punctuation character without knowing if
- ;; it is part of a delimited thing. Nil should be the
- ;; right thing here but need to test this.
- nil))
- (t hkey-value)))
+The non-nil value returned is the function to call to select that syntactic
unit.
+
+Ignores any match if on an Emacs button and instead returns nil."
+ (unless (button-at (point))
+ (setq hkey-value (hui-select-delimited-thing-call #'hui-select-at-p))
+ (cond ((eq hkey-value 'hui-select-punctuation)
+ (if (hui-select-comment (point))
+ (setq hkey-value #'hui-select-comment)
+ ;; Else here used to be `hkey-value' but then we are returning a
+ ;; value for any punctuation character without knowing if
+ ;; it is part of a delimited thing. Nil should be the
+ ;; right thing here.
+ nil))
+ (t hkey-value))))
(defun hui-select-delimited-thing ()
"Selects a markup pair, list, array/vector, set, comment or string at point
and returns t, else nil."
@@ -692,7 +701,7 @@ mail and news reply modes."
(defun hui-select-delimited-thing-call (func)
"Selects a markup pair, list, vector/array, set, comment or string at point
and returns non-nil, else nil.
The non-nil value returned is the function to call to select that syntactic
unit."
- (unless (and (memq major-mode '(emacs-lisp-mode lisp-mode
lisp-interaction-mode slime-mode cider-mode))
+ (unless (and (memq major-mode hui-select-ignore-quoted-sexp-modes)
;; Ignore quoted identifier sexpressions, like #'function
(char-after) (memq (char-after) '(?# ?\')))
(let ((hui-select-char-p)
diff --git a/hui-treemacs.el b/hui-treemacs.el
new file mode 100644
index 0000000..d90b2b9
--- /dev/null
+++ b/hui-treemacs.el
@@ -0,0 +1,217 @@
+;;; hui-treemacs.el --- Hyperbole Smart Key support for the Treemacs file
manager package
+;;
+;; Author: Bob Weiner
+;;
+;; Orig-Date: 19-Nov-17
+;;
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+;; See the "HY-COPY" file for license information.
+;;
+;; This file is part of GNU Hyperbole.
+
+;;; Commentary:
+
+;;; Code:
+;;; ************************************************************************
+;;; Other required Elisp libraries
+;;; ************************************************************************
+
+(eval-when-compile (require 'treemacs nil t))
+
+;;; ************************************************************************
+;;; smart-treemacs functions
+;;; ************************************************************************
+
+;;;###autoload
+(defun smart-treemacs ()
+ "Uses a single key or mouse key to manipulate directory entries.
+
+Invoked via a key press when in treemacs-mode. It assumes that its
+caller has already checked that the key was pressed in an appropriate buffer
+and has moved the cursor there.
+
+If key is pressed:
+ (1) on an entry icon, the treemacs TAB command is run to expand and
+ collapse the entry;
+ (2) elsewhere within an entry line, the item is displayed for editing,
+ normally in another window;
+ (3) on the first line of the buffer (other than the end of line),
+ dired is run on the current directory of this Treemacs;
+ (4) at the end of the first or last line of the buffer,
+ this Treemacs invocation is quit."
+
+ (interactive)
+ (cond ((first-line-p)
+ (if (eolp)
+ (treemacs-toggle)
+ (hact 'link-to-directory default-directory)))
+ ((and (last-line-p) (eolp))
+ (treemacs-toggle))
+ (t (let ((over-icon (and (treemacs--current-button)
+ (= (point) (- (button-start
(treemacs--current-button)) 2))))
+ (result (treemacs-node-buffer-and-position)))
+ (if (and (not over-icon) result (or (bufferp result) (listp
result)))
+ (if (listp result)
+ (hact 'link-to-buffer-tmp (seq-elt result 0) (seq-elt
result 1))
+ ;; (bufferp result)
+ (hact 'link-to-buffer-tmp result))
+ (treemacs-push-button current-prefix-arg))))))
+
+;;;###autoload
+(defun smart-treemacs-modeline ()
+ "Toggle display of Treemacs file viewer based on Smart Action Key click on a
modeline.
+
+When pressed on the Treemacs buffer modeline or Treemacs is displaying
+the default directory of the buffer modeline clicked upon, then
+quit/hide the Treemacs window. Otherwise, display the Treemacs window
+with the default directory of the buffer modeline clicked upon.
+
+Suitable for use as a value of `action-key-modeline-buffer-id-function'."
+ (if (fboundp 'treemacs)
+ (progn
+ (require 'treemacs)
+ (cond
+ ;; Clicked on Treemacs buffer id
+ ((if action-key-depress-window
+ (treemacs--is-treemacs-window? action-key-depress-window)
+ (string-match " Treemacs " (format-mode-line mode-line-format)))
+ ;; Quit/hide treemacs.
+ (treemacs-toggle))
+ ;;
+ ;; Treemacs is visible and displaying the same dir as
+ ;; the default dir of the clicked on modeline.
+ ((and (treemacs--buffer-exists?)
+ (string-equal (expand-file-name default-directory)
+ (with-current-buffer (treemacs--buffer-exists?)
+ default-directory)))
+ ;; Quit/hide treemacs.
+ (treemacs-toggle))
+ ;;
+ ;; Otherwise, invoke treemacs on the default dir of the clicked on
modeline.
+ (t (treemacs))))
+ (error "(smart-treemacs-modeline): Treemacs package is not installed")))
+
+;;; ************************************************************************
+;;; treemacs function updates
+;;; ************************************************************************
+
+;; Add this defsubst in treemacs-tags.el
+(defsubst treemacs--imenu-tag-noselect (file tag-path)
+ "Return a list of the source buffer for FILE and the position of the tag
from TAG-PATH."
+ (let ((tag (car tag-path))
+ (path (cdr tag-path)))
+ (condition-case e
+ (progn
+ (find-file-noselect file)
+ (let ((index (treemacs--get-imenu-index file)))
+ (dolist (path-item path)
+ (setq index (cdr (assoc path-item index))))
+ (-let [(buf pos) (treemacs--pos-from-marker
+ (cdr (--first
+ (equal (car it) tag)
+ index)))]
+ ;; some imenu implementations, like markdown, will only provide
+ ;; a raw buffer position (an int) to move to
+ (list (or buf (get-file-buffer file)) pos))))
+ (error
+ (treemacs--log "Something went wrong when finding tag '%s': %s"
+ (propertize tag 'face 'treemacs-tags-face)
+ e)))))
+
+;; Add this in treemacs-tags.el
+(defun treemacs--tag-noselect (btn)
+ "Return list of tag source buffer and position for BTN for future display."
+ (require 'hmouse-tag) ;; from GNU Hyperbole, adds xref convenience functions
used herein
+ (-let [(tag-buf tag-pos)
+ (treemacs--with-button-buffer btn
+ (-> btn (button-get 'marker)
(treemacs--pos-from-marker)))]
+ (if tag-buf
+ (list tag-buf tag-pos)
+ (-pcase treemacs-goto-tag-strategy
+ [`refetch-index
+ (let (file tag-path)
+ (with-current-buffer (marker-buffer btn)
+ (setq file (treemacs--nearest-path btn)
+ tag-path (treemacs--tags-path-of btn)))
+ (treemacs--imenu-tag-noselect file tag-path))]
+ [`call-xref
+ (let ((xref (xref-definition
+ (treemacs--with-button-buffer btn
+ (treemacs--get-label-of
btn)))))
+ (when xref
+ (list (xref-item-buffer xref) (xref-item-position xref))))]
+ [`issue-warning
+ (treemacs--log "Tag '%s' is located in a buffer that does not exist."
+ (propertize (treemacs--with-button-buffer btn
(treemacs--get-label-of btn)) 'face 'treemacs-tags-face))]
+ [_ (error "[Treemacs] '%s' is an invalid value for
treemacs-goto-tag-strategy" treemacs-goto-tag-strategy)]))))
+
+;; Replace this macro in treemacs-impl.el
+(cl-defmacro treemacs--execute-button-action
+ (&key save-window ensure-window-split split-function window dir-action
file-action tag-action no-match-explanation)
+ "Infrastructure macro for setting up actions on different button states.
+Fetches the currently selected button and verifies it's in the correct state
+based on the given state actions.
+If it isn't it will log NO-MATCH-EXPLANATION, if it is it selects WINDOW (or
+`next-window' if none is given) and splits it with SPLIT-FUNCTION if given.
+DIR-ACTION, FILE-ACTION, and TAG-ACTION are inserted into a `pcase' statement
+matching the buttons state.
+If ENSURE-WINDOW-SPLIT is t treemacs will vertically split the window if
+treemacs is the only window to make sure a buffer is opened next to it, not
+under or below it."
+ (let ((valid-states (list)))
+ (when dir-action
+ (push 'dir-node-open valid-states)
+ (push 'dir-node-closed valid-states))
+ (when file-action
+ (push 'file-node-open valid-states)
+ (push 'file-node-closed valid-states))
+ (when tag-action
+ (push 'tag-node valid-states))
+ `(-when-let (btn (treemacs--current-button))
+ (treemacs--without-following
+ (let* ((state (button-get btn 'state))
+ (current-window (selected-window)))
+ (if (not (memq state ',valid-states))
+ (treemacs--log "%s" ,no-match-explanation)
+ (progn
+ ,@(if ensure-window-split
+ `((when (one-window-p)
+ (save-selected-window
+ (split-window nil nil (if (eq 'left
treemacs-position) 'right 'left))))))
+ (select-window (or ,window (next-window (selected-window) nil
nil)))
+ ,@(if split-function
+ `((funcall ,split-function)
+ (other-window 1)))
+ ;; Return the result of the action
+ (prog1 (pcase state
+ ,@(when dir-action
+ `(((or `dir-node-open `dir-node-closed)
+ ,dir-action)))
+ ,@(when file-action
+ `(((or `file-node-open `file-node-closed)
+ ,file-action)))
+ ,@(when tag-action
+ `((`tag-node
+ ,tag-action)))
+ (_ (error "No match achieved even though button's state
%s was part of the set of valid states %s"
+ state ',valid-states)))
+ (when ,save-window
+ (select-window current-window))))))))))
+
+;; Add to treemacs-interface.el.
+;;;###autoload
+(defun treemacs-node-buffer-and-position (&optional arg)
+ "Return source buffer or list of buffer and position for the current node
for future display.
+Stay in the selected window and ignore any prefix argument ARG."
+ (interactive "P")
+ (let ((treemacs--no-messages t))
+ (treemacs--execute-button-action
+ :file-action (find-file-noselect (treemacs--safe-button-get btn
'abs-path))
+ :dir-action (find-file-noselect (treemacs--safe-button-get btn 'abs-path))
+ :tag-action (treemacs--tag-noselect btn)
+ :window (selected-window)
+ :save-window t
+ :ensure-window-split nil
+ :no-match-explanation "")))
+
+(provide 'hytreemacs)
diff --git a/hui-window.el b/hui-window.el
index d8dd4ad..30303d8 100644
--- a/hui-window.el
+++ b/hui-window.el
@@ -127,7 +127,11 @@ of screen control commands."
;; release window.
(prog1 (current-buffer)
(hmouse-pulse-buffer)
- (bury-buffer))))))
+ (bury-buffer))))
+ (treemacs-mode (if (fboundp 'treemacs-node-buffer-and-position)
+ (treemacs-node-buffer-and-position))
+ (error "(hmouse-item-to-window): %s the treemacs package
for item dragging support"
+ (if (fboundp 'treemacs) "Update" "Install")))))
"List of (major-mode lisp-form) lists.
The car of an item must be a major-mode symbol. The cadr of an item
is a Lisp form to evaluate to get the item name at point (typically a
@@ -451,12 +455,12 @@ Signals an error if the buffer is read-only."
"Returns non-nil if last Action Key depress and release were in different
frames.
If free variable `assist-flag' is non-nil, uses Assist Key."
(if assist-flag
- (and (window-valid-p assist-key-depress-window)
- (window-valid-p assist-key-release-window)
+ (and (window-live-p assist-key-depress-window)
+ (window-live-p assist-key-release-window)
(not (eq (window-frame assist-key-depress-window)
(window-frame assist-key-release-window))))
- (and (window-valid-p action-key-depress-window)
- (window-valid-p action-key-release-window)
+ (and (window-live-p action-key-depress-window)
+ (window-live-p action-key-release-window)
(not (eq (window-frame action-key-depress-window)
(window-frame action-key-release-window))))))
@@ -464,27 +468,31 @@ If free variable `assist-flag' is non-nil, uses Assist
Key."
"Returns non-nil if last Action Key depress and release were in different
windows.
If free variable `assist-flag' is non-nil, uses Assist Key."
(if assist-flag
- (and assist-key-depress-window assist-key-release-window
+ (and (window-live-p assist-key-depress-window)
+ (window-live-p assist-key-release-window)
(not (eq assist-key-depress-window
assist-key-release-window)))
- (and action-key-depress-window action-key-release-window
+ (and (window-live-p action-key-depress-window)
+ (window-live-p action-key-release-window)
(not (eq action-key-depress-window action-key-release-window)))))
(defun hmouse-drag-same-window ()
"Returns non-nil if last Action Key depress and release were in the same
window.
If free variable `assist-flag' is non-nil, uses Assist Key."
(if assist-flag
- (and assist-key-depress-window assist-key-release-window
+ (and (window-live-p assist-key-depress-window)
+ (window-live-p assist-key-release-window)
(eq assist-key-depress-window assist-key-release-window))
- (and action-key-depress-window action-key-release-window
+ (and (window-live-p action-key-depress-window)
+ (window-live-p action-key-release-window)
(eq action-key-depress-window action-key-release-window))))
(defun hmouse-drag-outside-all-windows ()
"Returns non-nil if last Action Key release was outside of an Emacs window.
If free variable `assist-flag' is non-nil, uses Assist Key."
- (null (if assist-flag
- assist-key-release-window
- action-key-release-window)))
+ (if assist-flag
+ (and (window-live-p assist-key-depress-window) (not
assist-key-release-window))
+ (and (window-live-p action-key-depress-window) (not
action-key-release-window))))
(defun hmouse-drag-item-to-display (&optional new-window)
"Depress on a buffer name in Buffer-menu/ibuffer mode or on a file/directory
in dired mode and release where the item is to be displayed.
@@ -501,7 +509,7 @@ not on an item, then nil.
See `hmouse-drag-item-mode-forms' for how to allow for draggable
items in other modes."
- (let* ((buf (and action-key-depress-window (window-buffer
action-key-depress-window)))
+ (let* ((buf (and (window-live-p action-key-depress-window) (window-buffer
action-key-depress-window)))
(mode (and buf (cdr (assq 'major-mode (buffer-local-variables buf))))))
(when (and buf (with-current-buffer buf
;; Point must be on an item, not after one
@@ -621,9 +629,9 @@ If free variable `assist-flag' is non-nil, uses Assist Key."
action-key-release-args))
(wd (smart-window-of-coords depress-args))
(wr (smart-window-of-coords release-args))
- (right-side-ln (and wd (1- (nth 2 (window-edges wd)))))
- (last-press-x (and wd depress-args (hmouse-x-coord
depress-args)))
- (last-release-x (and wr release-args (hmouse-x-coord
release-args))))
+ (right-side-ln (and (window-live-p wd) (1- (nth 2 (window-edges
wd)))))
+ (last-press-x (and (window-live-p wd) depress-args
(hmouse-x-coord depress-args)))
+ (last-release-x (and (window-live-p wr) release-args
(hmouse-x-coord release-args))))
(and last-press-x last-release-x right-side-ln
(/= last-press-x last-release-x)
(not (<= (abs (- right-side-ln (frame-width))) 5))
@@ -826,8 +834,9 @@ item, this moves the menu buffer itself to the release
location."
;; create a new frame and window.
(w2 (or action-key-release-window (frame-selected-window
(hycontrol-make-frame))))
(buf-name)
- (w1-ref))
- (when (and w1 w2)
+ (w1-ref)
+ (pos))
+ (when (and (window-live-p w1) (window-live-p w2))
(unwind-protect
(progn (select-window w1)
(if (eq (posn-area (event-start action-key-depress-args))
'header-line)
@@ -844,18 +853,25 @@ item, this moves the menu buffer itself to the release
location."
(when (and new-window action-key-release-window)
(hmouse-split-window))))
(unwind-protect
- (cond ((not w1-ref)
- (if (not (window-live-p w1))
- (error "(hmouse-item-to-window): Action Mouse Key item drag
must start in a live window")
- (error "(hmouse-item-to-window): No item to display at start
of Action Mouse Key drag")))
- ((buffer-live-p w1-ref)
- (set-window-buffer w2 w1-ref)
- (set-buffer w1-ref)
- (hmouse-pulse-buffer))
- ((and (stringp w1-ref) (file-readable-p w1-ref))
- (set-window-buffer w2 (set-buffer (find-file-noselect w1-ref)))
- (hmouse-pulse-buffer))
- (t (error "(hmouse-item-to-window): Cannot find or read `%s'"
w1-ref)))
+ (progn
+ (when (and w1-ref (not (stringp w1-ref)) (sequencep w1-ref))
+ ;; w1-ref is a list or vector of `buffer' and `position' elements.
+ (setq pos (seq-elt w1-ref 1)
+ w1-ref (seq-elt w1-ref 0)))
+ (cond ((not w1-ref)
+ (if (not (window-live-p w1))
+ (error "(hmouse-item-to-window): Action Mouse Key item
drag must start in a live window")
+ (error "(hmouse-item-to-window): No item to display at start
of Action Mouse Key drag")))
+ ((buffer-live-p w1-ref)
+ (set-window-buffer w2 w1-ref)
+ (set-buffer w1-ref))
+ ((and (stringp w1-ref) (file-readable-p w1-ref))
+ (set-window-buffer w2 (set-buffer (find-file-noselect
w1-ref))))
+ (t (error "(hmouse-item-to-window): Cannot find or read `%s'"
w1-ref)))
+ (if pos
+ (progn (goto-char pos)
+ (hmouse-pulse-line))
+ (hmouse-pulse-buffer)))
;; If helm is active, end in the minibuffer window.
(if (smart-helm-alive-p)
(smart-helm-to-minibuffer)))))
@@ -881,7 +897,7 @@ If the Action Key is:
(if w (select-window w))
(cond ((hmouse-modeline-click)
(cond ((hmouse-emacs-at-modeline-buffer-id-p)
- (dired-jump))
+ (funcall action-key-modeline-buffer-id-function))
((hmouse-release-left-edge) (bury-buffer))
((hmouse-release-right-edge)
(if (eq major-mode 'Info-mode)
@@ -935,8 +951,7 @@ If the Assist Key is:
(or (and (eventp event) (eq (posn-area (event-start event)) 'mode-line))
;; If drag release was to an unselected frame mode-line, on
;; click-to-focus systems, the release event will not include
- ;; the mode-line area when release was on the mode-line, so
- ;; manually compute if that was the location.
+ ;; the mode-line area, so manually compute if that was the location.
(let* ((w (smart-window-of-coords event))
;; Do all calculations in pixels if possible.
(line-height (if w (frame-char-height (window-frame w))))
@@ -1210,7 +1225,7 @@ of the Smart Key."
)))
(defun hmouse-x-coord (args)
- "Returns x coordinate in characters from window system dependent ARGS."
+ "Returns x coordinate in characters from window system dependent ARGS or
nil."
(let ((x (if (markerp args)
(save-excursion
(hypb:goto-marker args)
@@ -1231,10 +1246,10 @@ of the Smart Key."
("xterm" . (car args))
("next" . (nth 1 args))
)))))))
- (if (integerp x) x (error "(hmouse-x-coord): invalid X coord: %s" x))))
+ (if (integerp x) x)))
(defun hmouse-y-coord (args)
- "Returns y coordinate in frame lines from window system dependent ARGS."
+ "Returns y coordinate in frame lines from window system dependent ARGS or
nil."
(let ((y (eval (cdr (assoc (hyperb:window-system)
'(("emacs" . (progn (if (eventp args) (setq args
(event-start args)))
(cond ((posnp args)
@@ -1250,8 +1265,7 @@ of the Smart Key."
("xterm" . (nth 1 args))
("next" . (nth 2 args))
))))))
- (if (integerp y) y (error "(hmouse-y-coord): invalid Y coord: %s" y))))
-
+ (if (integerp y) y)))
;;; ************************************************************************
;;; Private variables
diff --git a/hyrolo.el b/hyrolo.el
index f8b6fc3..00e3f39 100644
--- a/hyrolo.el
+++ b/hyrolo.el
@@ -79,7 +79,7 @@ executable must be found as well (for Oauth security)."
;;;###autoload
(defun hyrolo-initialize-file-list ()
- "Initialize the list of files to use for HyRolo searches."
+ "Initialize the list of files used for HyRolo searches."
(interactive)
(let* ((gcontacts (if (hyrolo-google-contacts-p)
google-contacts-buffer-name))
(ms "c:/_rolo.otl")
@@ -89,9 +89,10 @@ executable must be found as well (for Oauth security)."
(list ms bbdb-file gcontacts)
(list "~/.rolo.otl" bbdb-file gcontacts))
(if hyperb:microcruft-os-p (list ms gcontacts) (list
unix gcontacts))))))
- (when (called-interactively-p 'interactive)
- (message "HyRolo Search List: %S" list))
- list))
+ (setq hyrolo-file-list list)
+ (when (called-interactively-p 'interactive)
+ (message "HyRolo Search List: %S" list))
+ list))
(defvar hyrolo-file-list (hyrolo-initialize-file-list)
"*List of files containing rolo entries.
@@ -990,8 +991,8 @@ Returns number of matching entries found."
;; Derived from google-contacts.el.
(defun hyrolo-google-contacts-insert-generic-list (items title &optional
get-value)
"Insert a text for rendering ITEMS with TITLE.
-Use GET-VALUE to get the value from the cdr of the item,
-otherwise just put the cdr of item."
+Use GET-VALUE fuction to retrieve the value from the cdr of the item,
+otherwise just use the cdr of the item."
(when items
(insert "\n" (google-contacts-margin-element) (concat title ":\n"))
(dolist (item items)
@@ -1008,15 +1009,19 @@ otherwise just put the cdr of item."
(list (read-string "Look for: " (car google-contacts-history)
'google-contacts-history)
current-prefix-arg))
- (let ((buffer (google-contacts-make-buffer))
- (token (google-contacts-oauth-token))
- (google-contacts-expire-time (if force-refresh 0
google-contacts-expire-time))
- (inhibit-read-only t))
+ ;; Without this first let binding, the user would be prompted for
+ ;; his passphrase on every hyrolo search. This way it is cached.
+ (let* ((plstore-cache-passphrase-for-symmetric-encryption t)
+ (buffer (google-contacts-make-buffer))
+ (token (google-contacts-oauth-token))
+ (google-contacts-expire-time (if force-refresh 0
google-contacts-expire-time))
+ (inhibit-read-only t))
(with-current-buffer buffer
(setq google-contacts-query-string query-string)
- (hyrolo-google-contacts-insert-data (xml-get-children
(google-contacts-data query-string token)
- 'entry)
- token "* "))))
+ (hyrolo-google-contacts-insert-data
+ (xml-get-children (google-contacts-data query-string token)
+ 'entry)
+ token "* "))))
;;; ************************************************************************
;;; Public functions
diff --git a/man/hyperbole.texi b/man/hyperbole.texi
index 5c5e513..5cfdd71 100644
--- a/man/hyperbole.texi
+++ b/man/hyperbole.texi
@@ -4992,6 +4992,7 @@ For finding matches within only BBDB, there are the
commands
@code{hyrolo-bbdb-fgrep} (string finding) and @code{hyrolo-bbdb-grep}
(regular expression finding). They may be bound to keys if desired.
address@hidden contacts, Google
@cindex Google Contacts
@cindex Gmail Contacts
If you use Google/Gmail Contacts, you can configure the HyRolo to
@@ -5006,8 +5007,9 @@ Contacts to your searches.
When you next do a search, you will be prompted for your Google
Contacts password and may also have to enter an authorization code
-that will be displayed on your screen. After authorization, you may
-at times be re-prompted for your password.
+that will be displayed on your screen. After authorization, your
+your information will be cached so that you are not prompted for
+it again within this Emacs session.
@findex hyrolo-google-contacts-fgrep
@findex hyrolo-google-contacts-grep
@@ -5017,10 +5019,9 @@ For finding matches within only Google Contacts, there
are the commands
may be bound to keys if desired.
@vindex hyrolo-google-contacts-flag
-Because Google can require frequent reauthorization to search your
-contacts, there is a flag, @code{hyrolo-google-contacts-flag}, which
-when set to @samp{nil} disables searching of your Google Contacts.
-
+If you ever need to disable Google Contacts usage, there is a
+flag, @code{hyrolo-google-contacts-flag}, which when set to @samp{nil}
+disables searching of your Google Contacts.
@noindent
Below are the rest of the settings available with HyRolo:
diff --git a/man/im/C-hh.png b/man/im/C-hh.png
new file mode 100644
index 0000000..c6e5bb3
Binary files /dev/null and b/man/im/C-hh.png differ
- [elpa] externals/hyperbole updated (9b2d75a -> 34a3fe5), Robert Weiner, 2017/11/22
- [elpa] externals/hyperbole 9169c75 1/6: Updated Hyperbole git archive pointer for elpa merging use, Robert Weiner, 2017/11/22
- [elpa] externals/hyperbole 5cc7ac8 5/6: Fixed small issues in error reporting and released version 7.0.1, Robert Weiner, 2017/11/22
- [elpa] externals/hyperbole 658ca9e 4/6: Fixed issue where Hyperbole improperly bound {q} for quit in with-temp-buffer buffers., Robert Weiner, 2017/11/22
- [elpa] externals/hyperbole 099bdae 2/6: Keyboard drags; Treemacs item drags; Ace-Window item throws and HyRolo Google Contacts improvements,
Robert Weiner <=
- [elpa] externals/hyperbole e99098c 3/6: Documented latest changes and allowed for small movements in Smart Mouse Key modeline clicks, Robert Weiner, 2017/11/22
- [elpa] externals/hyperbole 34a3fe5 6/6: 7.0.1 Merge branch 'master' of http://git.savannah.gnu.org/r/hyperbole into externals/hyperbole, Robert Weiner, 2017/11/22