branch: externals/hyperbole
commit 1cf5f3dc07382ba24a887231a7a87cc334356c89
Author: Bob Weiner <[email protected]>
Commit: Bob Weiner <[email protected]>
Allow Action Key to expand a tree when point is on the ellipsis
---
Changes | 8 ++++++++
hui-mouse.el | 2 +-
kotl/kotl-mode.el | 15 +++++++++------
3 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/Changes b/Changes
index 4570f3e..41f9b71 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,11 @@
+2020-07-29 Bob Weiner <[email protected]>
+
+* kotl/kotl-mode.el (kotl-mode:eolp): Added optional 'next-char-visible' arg.
+ (kotl-mode:action-key, kotl-mode:assist-key):
+ hui-mouse.el (hkey-alist): In kotl-mode, matched to eol only if following
+ char is not invisible. This allows Action Key to expand a tree when point
+ is on the ellipsis (invisible portion of tree).
+
2020-07-28 Bob Weiner <[email protected]>
* kotl/kotl-mode.el (kotl-mode): Set outline-regexp so outline-on-heading-p and
diff --git a/hui-mouse.el b/hui-mouse.el
index ac3285e..a0c41d6 100644
--- a/hui-mouse.el
+++ b/hui-mouse.el
@@ -149,7 +149,7 @@ Its default value is #'smart-scroll-down."
;;
;; If at the end of a line (eol), invoke the associated Smart Key handler
EOL handler.
((if (eq major-mode 'kotl-mode)
- (and (not (kotl-mode:eobp)) (kotl-mode:eolp))
+ (and (not (kotl-mode:eobp)) (kotl-mode:eolp t))
(smart-eolp)) .
((funcall action-key-eol-function) . (funcall assist-key-eol-function)))
;;
diff --git a/kotl/kotl-mode.el b/kotl/kotl-mode.el
index 36874b4..523ffd4 100644
--- a/kotl/kotl-mode.el
+++ b/kotl/kotl-mode.el
@@ -1918,12 +1918,15 @@ If at tail cell already, do nothing and return nil."
(kotl-mode:bocp))))
(point)))
-(defun kotl-mode:eolp ()
- "Return t if point is at the end of a visible line or the end of the buffer."
+(defun kotl-mode:eolp (&optional next-char-visible)
+ "Return t if point is at the end of a visible line or the end of the buffer.
+With optional NEXT-CHAR-VISIBLE, return t only if the following char is
visible."
(or (eobp)
(and (eolp)
- (or (not (kview:char-invisible-p))
- (not (kview:char-invisible-p (1- (point)))))
+ (if next-char-visible
+ (not (kview:char-invisible-p))
+ (or (not (kview:char-invisible-p))
+ (not (kview:char-invisible-p (1- (point))))))
t)))
(defun kotl-mode:first-cell-p ()
@@ -1965,7 +1968,7 @@ If key is pressed:
a windowful."
(interactive)
(cond ((kotl-mode:eobp) (kotl-mode:show-all))
- ((kotl-mode:eolp) (funcall action-key-eol-function))
+ ((kotl-mode:eolp t) (funcall action-key-eol-function))
((not (kview:valid-position-p))
(if (markerp action-key-depress-prev-point)
(progn (select-window
@@ -2000,7 +2003,7 @@ If assist-key is pressed:
a windowful."
(interactive)
(cond ((kotl-mode:eobp) (kotl-mode:overview))
- ((kotl-mode:eolp) (funcall assist-key-eol-function))
+ ((kotl-mode:eolp t) (funcall assist-key-eol-function))
((not (kview:valid-position-p))
(if (markerp assist-key-depress-prev-point)
(progn (select-window