branch: externals/hyperbole commit 7adb441c0e42f27423168ffea39517901e45c26a Author: bw <r...@gnu.org> Commit: bw <r...@gnu.org>
kotl-mode - fix kill and yank commands not moving to valid pos first Fix improper use of `hkey-value' as tag when it was not a string. --- ChangeLog | 15 +++++++++++-- hmouse-tag.el | 4 ++-- kotl/kotl-mode.el | 63 ++++++++++++++++++++++++++++++++----------------------- 3 files changed, 52 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index d01e670f6f..e43bec5b07 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ +2023-12-29 Bob Weiner <r...@gnu.org> + +* hmouse-tag.el (smart-lisp-find-tag): Fix issue where 'hkey-value' was used + as tag when it was not a string, causing failures on known function lookups. + 2023-12-28 Bob Weiner <r...@gnu.org> +* kotl/kotl-mode.el (kotl-mode:pre-self-insert-command): Add these kotl-mode + commands: kill-line, kill-region, kill-sentence, kill-or-copy-region, yank, + yank-from-kill-ring, yank-pop, and yank-rectangle. + (kotl-mode:to-valid-position-commands): Make list of commands + modifiable. + * hypb-ert.el (hypb-ert-def-at-p): Add support for `ert-deftest-async' from the "ert-async.el" package. @@ -42,13 +53,13 @@ 2023-12-26 Bob Weiner <r...@gnu.org> -* hpath.el (hpath:to-markup-anchor): If referent-regexp starts with '^', add +* hpath.el (hpath:to-markup-anchor): If 'referent-regexp' starts with '^', add "[ \t]*" instead of "[ \t]+" to the expression in case it matches the whole line. * hui.el (hui:link-possible-types): Change outline heading line link to trigger only for outline, org and kotl modes when point is anywhere on the heading line. Include non-zero column in pathname so returns to the original point. Produce a - link-to-string-match type. + 'link-to-string-match' type. hbut.el (ibut:insert-text): Change 'actypes::link-to-string-match' to use a pathname format ibut rather than a <link-to-string-match> action button when the occurrence number is 1. diff --git a/hmouse-tag.el b/hmouse-tag.el index 9677a8feb3..e67c427f40 100644 --- a/hmouse-tag.el +++ b/hmouse-tag.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 24-Aug-91 -;; Last-Mod: 28-Dec-23 at 11:16:10 by Bob Weiner +;; Last-Mod: 29-Dec-23 at 00:52:05 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -699,7 +699,7 @@ Use `hpath:display-buffer' to show definition or documentation." "Show doc for" "Find"))) current-prefix-arg)) (unless (stringp tag) - (setq tag (or hkey-value (smart-lisp-at-tag-p t)))) + (setq tag (if (stringp hkey-value) hkey-value (smart-lisp-at-tag-p t)))) (let* ((elisp-flag (smart-emacs-lisp-mode-p)) (tag-sym (intern-soft tag))) (cond ((and show-doc elisp-flag) diff --git a/kotl/kotl-mode.el b/kotl/kotl-mode.el index 4972c6b5dc..8292b2071e 100644 --- a/kotl/kotl-mode.el +++ b/kotl/kotl-mode.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 6/30/93 -;; Last-Mod: 25-Dec-23 at 23:33:09 by Bob Weiner +;; Last-Mod: 29-Dec-23 at 02:05:41 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -38,18 +38,11 @@ ;;; Public variables ;;; ************************************************************************ -(defvar kotl-mode-map nil - "Keymap containing koutliner editing and viewing commands.") - -(defvar kotl-previous-mode nil - "Default mode of koutline buffers prior to invocation of kotl-mode.") - -(defcustom kotl-mode:shrink-region-flag nil - "*Non-nil means Koutliner commands automatically shrink the region. -The region is shrinked within the visible bounds of a single cell -before editing it. The region then falls within the first -visible cell that was part of the region or that followed it. -Default value is nil." +(defcustom kotl-mode:indent-tabs-mode t + "*Non-nil means {\\[kotl-mode:tab-command]} may insert literal tab characters. +Tab characters are inserted rather than space characters when +`kotl-mode:tab-flag' is non-nil. Default value is t. The value +of this variable is local to each Koutline buffer." :type 'boolean :group 'hyperbole-koutliner) @@ -61,6 +54,15 @@ during such operations, regardless of the value of this flag." :type 'boolean :group 'hyperbole-koutliner) +(defcustom kotl-mode:shrink-region-flag nil + "*Non-nil means Koutliner commands automatically shrink the region. +The region is shrinked within the visible bounds of a single cell +before editing it. The region then falls within the first +visible cell that was part of the region or that followed it. +Default value is nil." + :type 'boolean + :group 'hyperbole-koutliner) + (defcustom kotl-mode:tab-flag nil "*Non-nil means {\\[kotl-mode:tab-command]} inserts a literal tab character and {\\[kotl-mode:untab-command]} deletes backward. Nil means {\\[kotl-mode:tab-command]} demotes the current tree and @@ -68,13 +70,25 @@ Nil means {\\[kotl-mode:tab-command]} demotes the current tree and :type 'boolean :group 'hyperbole-koutliner) -(defcustom kotl-mode:indent-tabs-mode t - "*Non-nil means {\\[kotl-mode:tab-command]} may insert literal tab characters. -Tab characters are inserted rather than space characters when -`kotl-mode:tab-flag' is non-nil. Default value is t. The value -of this variable is local to each Koutline buffer." - :type 'boolean - :group 'hyperbole-koutliner) +(defvar kotl-mode:to-valid-position-commands + '(kotl-mode:orgtbl-self-insert-command + kotl-mode:kill-or-copy-region + kotl-mode:kill-line + kotl-mode:kill-region + kotl-mode:kill-sentence + kotl-mode:yank + kotl-mode:yank-pop + orgtbl-self-insert-command + self-insert-command + yank-from-kill-ring + yank-rectangle) + "List of command symbols to move to a valid Koutline position before executing.") + +(defvar kotl-mode-map nil + "Keymap containing koutliner editing and viewing commands.") + +(defvar kotl-previous-mode nil + "Default mode of koutline buffers prior to invocation of kotl-mode.") ;; Define these newer Emacs variables if Emacs has not already done so. (defvar yank-window-start nil) @@ -1364,8 +1378,8 @@ Leave point at original location but return the tree's new start point." More precisely, reinsert the most recent kill, which is the stretch of killed text most recently killed OR yanked. Put point at the end, and set mark at the beginning without activating it. -With just \\[universal-argument] as argument, put point at beginning, and mark at end. -With argument N, reinsert the Nth most recent kill. +With just \\[universal-argument] as argument, put point at beginning, +and mark at end. With argument N, reinsert the Nth most recent kill. When this command inserts text into the buffer, it honors the `yank-handled-properties' and `yank-excluded-properties' @@ -3390,10 +3404,7 @@ newlines at end of tree." Mouse may have moved point outside of an editable area. `kotl-mode' adds this function to `pre-command-hook'." (when (and - (memq this-command '(kotl-mode:orgtbl-self-insert-command - ;; kotl-mode:self-insert-command - orgtbl-self-insert-command - self-insert-command)) + (memq this-command kotl-mode:to-valid-position-commands) (not (kview:valid-position-p)) ;; Prevent repeatedly moving point to valid position when moving trees ;; (not (hyperb:stack-frame '(kcell-view:to-label-end)))