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

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

[elpa] externals/hyperbole 91a98666da 3/3: Add hui-gbut-modify-link-to-f


From: ELPA Syncer
Subject: [elpa] externals/hyperbole 91a98666da 3/3: Add hui-gbut-modify-link-to-file-button test and fix pathname buts
Date: Sun, 6 Feb 2022 10:57:34 -0500 (EST)

branch: externals/hyperbole
commit 91a98666da4ee93e38b820f4876f58065ea0739a
Author: Kathy <rsw@gnu.org>
Commit: Kathy <rsw@gnu.org>

    Add hui-gbut-modify-link-to-file-button test and fix pathname buts
---
 ChangeLog                 |  30 ++++++++++++-
 HY-NEWS                   |  16 ++++---
 hbut.el                   |  24 +++++------
 hmouse-drv.el             |   6 ++-
 hpath.el                  | 108 ++++++++++++++++++++++++----------------------
 hsmail.el                 |  17 +++++---
 hui-mini.el               |   4 +-
 hui.el                    |   3 +-
 kotl/kmenu.el             |   4 +-
 man/hyperbole.html        |   8 ++--
 man/hyperbole.info        | Bin 578802 -> 578958 bytes
 man/hyperbole.pdf         | Bin 1332461 -> 1332445 bytes
 man/hyperbole.texi        |   9 ++--
 test/demo-tests.el        |   8 ++--
 test/hactypes-tests.el    |   7 ++-
 test/hib-kbd-tests.el     |   7 ++-
 test/hibtypes-tests.el    |  11 ++---
 test/hmouse-drv-tests.el  |   6 +--
 test/hpath-tests.el       |   8 ++--
 test/hui-tests.el         |  43 ++++++++++++++++--
 test/hy-test-helpers.el   |   4 +-
 test/hyrolo-tests.el      |   6 +--
 test/kotl-mode-tests.el   |   6 +--
 test/kotl-orgtbl-tests.el |   6 +--
 test/smart-org-tests.el   |   3 +-
 25 files changed, 209 insertions(+), 135 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1d0f2f928d..7c845b3946 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,39 @@
+2022-02-06  Bob Weiner  <rsw@gnu.org>
+
+* hpath.el (hpath:absolute-to, hpath:call): Add checks to ensure
+    path is a string.
+           (hpath:at-p): Call to 'hpath:mswindows-to-posix' may
+    have abbreviated a path, so expand it back here for improved
+    matching to path found in the buffer previously.
+
+* hmouse-drv.el (hkey-execute): Ensure Emacs debug variables are
+    enabled when 'hkey-debug' is enabled.
+
+* hsmail.el (mail-yank-original, message--yank-original-internal,
+             mail-send-hook): Finish updating these and ready for testing.
+
+* HY-NEWS:
+  man/hyperbole.texi (Inserting and Importing): Add kimport:file
+    minibuffer menu binding.
+
+* test/*-tests.el: Simplify by requiring "hy-test-helpers" rather than
+    loading it with a complex call in every module.
+
+* test/hui-tests.el (hui-gbut-modify-link-to-file-button): Add this
+    debugged global button creation and modification test.
+
 2022-02-05  Mats Lidell  <matsl@gnu.org>
 
 * hargs.el (hargs:find-tag-default): Remove own implementation for
-    find-tag-default and find-tag--default and rely on implementation in
+    'find-tag-default' and 'find-tag--default' and rely on implementation in
     Emacs.
 
 2022-02-05  Bob Weiner  <rsw@gnu.org>
 
+* HY-NEWS (Minibuffer Menu Changes): Mention new Kotl/Format menu.
+  man/hyperbole.texi (Inserting and Importing): Add {C-h h k f f}
+    kimport:file minibuffer menu binding and relabel its menu items.
+
 * hypb.el (hypb:straight-package-plist): Add and use in tests.
           (hypb:installation-type): Support all install types.
   test/hypb-tests.el (hypb:installation-type-test): Support all install types.
diff --git a/HY-NEWS b/HY-NEWS
index 549c9bf5cd..2cae1fdf92 100644
--- a/HY-NEWS
+++ b/HY-NEWS
@@ -146,9 +146,10 @@
 
 ** KOUTLINER  (See "(hyperbole)Koutliner").
 
-  *** Export Koutlines to Collapsible Web Pages: The {M-x kexport:display RET}
-      command creates and displays a web-based expandable/collapsible outline
-      from the Koutline in the current buffer.  See "(hyperbole)Exporting".
+  *** Export Koutlines to Collapsible Web Pages: {C-h h k f d} or
+      {M-x kexport:display RET} command creates and displays a web-based
+      expandable/collapsible outline from the Koutline in the current buffer.
+      See "(hyperbole)Exporting" and the new Koutliner Format submenu.
 
   *** Org Table Support: Org table editing now automatically works in the
       Koutliner via Org table minor mode.  Use {M-x orgtbl-mode RET} to
@@ -239,14 +240,19 @@
 ** MENUS
 
   *** Minibuffer Menu Changes:
-        + Items Activated by First Capital Letter: Used to be by the first
+        - Items Activated by First Capital Letter: Used to be by the first
           letter.  This allows more flexibility in naming, e.g.
           where two items start with the same first letter.
 
-        + {X} exits Hyperbole mode: This disables the Hyperbole minor mode
+        - {X} exits Hyperbole mode: This disables the Hyperbole minor mode
           completely and exits from the menu.  {C-h h} re-enables the
           global minor mode and display the top-level Hyperbole menu.
 
+        - Koutliner Formatting Menus: Full set of commands to import
+          text and outline files to Koutlines and to export Koutlines
+         to HTML for web viewing.  See "(hyperbole)Inserting and Importing"
+          and "(hyperbole)Exporting".
+
 
 ** SMART (ACTION AND ASSIST) KEYS  (See "(hyperbole)Smart Keys").
 
diff --git a/hbut.el b/hbut.el
index 13671b820d..9a2a8a4dfa 100644
--- a/hbut.el
+++ b/hbut.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    18-Sep-91 at 02:57:09
-;; Last-Mod:      5-Feb-22 at 11:42:05 by Bob Weiner
+;; Last-Mod:      5-Feb-22 at 23:17:58 by Bob Weiner
 ;;
 ;; Copyright (C) 1991-2021  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -364,17 +364,17 @@ button is found in the current buffer."
                                          buf-lbl 
(buffer-substring-no-properties start end))
                                    (equal buf-lbl curr-label))
                           ;; Utilize any action-key-depress-prev-point
-                          (progn (setq mark (marker-position (mark-marker)))
-                                 (setq prev-point (and 
action-key-depress-prev-point
-                                                       (marker-position 
action-key-depress-prev-point)))
-                                 (setq start (if (and prev-point mark (<= 
prev-point mark))
-                                                 prev-point
-                                               (region-beginning))
-                                       end (if (and prev-point mark (> 
prev-point mark))
-                                               prev-point
-                                             (region-end))
-                                       buf-lbl (buffer-substring-no-properties 
start end))
-                                 (equal buf-lbl curr-label))))
+                          (setq mark (marker-position (mark-marker)))
+                          (setq prev-point (and action-key-depress-prev-point
+                                                (marker-position 
action-key-depress-prev-point)))
+                          (setq start (if (and prev-point mark (<= prev-point 
mark))
+                                          prev-point
+                                        (region-beginning))
+                                end (if (and prev-point mark (> prev-point 
mark))
+                                        prev-point
+                                      (region-end))
+                                buf-lbl (buffer-substring-no-properties start 
end))
+                          (equal buf-lbl curr-label)))
                    nil)
                   ((progn (when start (goto-char start))
                           (looking-at (regexp-quote curr-label)))
diff --git a/hmouse-drv.el b/hmouse-drv.el
index e5152c6d47..d801e1c46e 100644
--- a/hmouse-drv.el
+++ b/hmouse-drv.el
@@ -880,7 +880,11 @@ Return non-nil iff a non-nil predicate is found."
            ;; of matching predicate but before hkey-action is executed.
            (when hkey-debug
              (hkey-debug pred pred-value hkey-action))
-           (eval hkey-action))
+           (if hkey-debug
+               (let ((debug-on-error t)
+                     (debug-on-quit t))
+                 (eval hkey-action))
+             (eval hkey-action)))
        (setq hkey-forms (cdr hkey-forms))))
     pred-value))
 
diff --git a/hpath.el b/hpath.el
index 8ccb55b8a7..ec63000aef 100644
--- a/hpath.el
+++ b/hpath.el
@@ -681,35 +681,37 @@ Return PATH unchanged when it is absolute, a buffer name, 
not a valid path,
 or when DEFAULT-DIRS is invalid.  DEFAULT-DIRS when non-nil may be a single
 directory or a list of directories.  The first one in which PATH is found is
 used."
-  (hpath:call
-   (lambda (path non-exist)
-     (when (stringp path)
-       (setq path (hpath:trim path)))
-     (cond ((not (and (stringp path)
-                     (not (hypb:object-p path))
-                     (setq path (hpath:expand path))
-                     (not (get-buffer path))
-                     (not (file-name-absolute-p path))
-                      (hpath:is-p path nil non-exist)))
-            path)
-           ((not (cond ((null default-dirs)
-                       (setq default-dirs (cons default-directory nil)))
-                       ((stringp default-dirs)
-                       (setq default-dirs (cons default-dirs nil)))
-                       ((listp default-dirs))
-                       (t nil)))
-            path)
-           (t
-            (let ((rtn) dir)
-              (while (and default-dirs (null rtn))
-               (setq dir (expand-file-name
-                           (file-name-as-directory (car default-dirs)))
-                      rtn (expand-file-name path dir)
-                      default-dirs (cdr default-dirs))
-               (unless (file-exists-p rtn)
-                 (setq rtn nil)))
-              (or rtn path)))))
-   path 'allow-spaces))
+  (if (not (stringp path))
+      path
+    (hpath:call
+     (lambda (path non-exist)
+       (when (stringp path)
+        (setq path (hpath:trim path)))
+       (cond ((not (and (stringp path)
+                       (not (hypb:object-p path))
+                       (setq path (hpath:expand path))
+                       (not (get-buffer path))
+                       (not (file-name-absolute-p path))
+                       (hpath:is-p path nil non-exist)))
+              path)
+             ((not (cond ((null default-dirs)
+                         (setq default-dirs (cons default-directory nil)))
+                        ((stringp default-dirs)
+                         (setq default-dirs (cons default-dirs nil)))
+                        ((listp default-dirs))
+                        (t nil)))
+              path)
+             (t
+              (let ((rtn) dir)
+               (while (and default-dirs (null rtn))
+                 (setq dir (expand-file-name
+                             (file-name-as-directory (car default-dirs)))
+                       rtn (expand-file-name path dir)
+                       default-dirs (cdr default-dirs))
+                 (unless (file-exists-p rtn)
+                   (setq rtn nil)))
+               (or rtn path)))))
+     path 'allow-spaces)))
 
 (defun hpath:tramp-file-name-regexp ()
   "Return a modified `tramp-file-name-regexp' for matching to the beginning of 
a remote file name.
@@ -887,7 +889,7 @@ paths are allowed.  Absolute pathnames must begin with a 
`/' or `~'."
               ;; list; ignore if so
               (unless (and (string-match "\\`\\s-*\\([^;       ]+\\)" subpath)
                            (executable-find (match-string 1 subpath)))
-                subpath)
+                (expand-file-name subpath))
             "."))
          ((hpath:is-p path type non-exist))
          ;; Local file URLs
@@ -910,28 +912,30 @@ Make any existing path within a file buffer absolute 
before returning."
   (setq path (hbut:key-to-label (hbut:label-to-key path)))
   (let* ((orig-path path)
         (expanded-path)
-        (prefix (car (delq nil (list (when (string-match hpath:prefix-regexp 
path)
-                                       (prog1 (match-string 0 path)
-                                         (setq path (substring path (match-end 
0)))))
-                                     (when (string-match "\\`file://" path)
-                                       (setq path (substring path (match-end 
0)))
-                                       nil)
-                                     (when (string-match hpath:prefix-regexp 
path)
-                                       (prog1 (match-string 0 path)
-                                         (setq path (substring path (match-end 
0)))))))))
-        (suffix (apply #'concat (nreverse (list (when (string-match 
hpath:line-and-column-regexp path)
-                                                  (prog1 (match-string 0 path)
-                                                    (setq path (substring path 
0 (match-beginning 0)))))
-                                                (if (string-match-p 
hpath:variable-regexp path)
-                                                    ;; Path may be a link 
reference with a suffix component
-                                                    ;; following a comma or # 
symbol, so temporarily strip
-                                                    ;; these, if any, before 
expanding any embedded variables.
-                                                    (when (string-match "[ 
\t\n\r]*[#,]" path)
-                                                      (prog1 (substring path 
(1- (match-end 0)))
-                                                        (setq path (substring 
path 0 (match-beginning 0)))))
-                                                  (when (string-match 
hpath:markup-link-anchor-regexp path)
-                                                    (prog1 (concat "#" 
(match-string 3 path))
-                                                      (setq path (substring 
path 0 (match-beginning 2)))))))))))
+        (prefix (when (stringp path)
+                  (car (delq nil (list (when (string-match hpath:prefix-regexp 
path)
+                                         (prog1 (match-string 0 path)
+                                           (setq path (substring path 
(match-end 0)))))
+                                       (when (string-match "\\`file://" path)
+                                         (setq path (substring path (match-end 
0)))
+                                         nil)
+                                       (when (string-match hpath:prefix-regexp 
path)
+                                         (prog1 (match-string 0 path)
+                                           (setq path (substring path 
(match-end 0))))))))))
+        (suffix (when (stringp path)
+                  (apply #'concat (nreverse (list (when (string-match 
hpath:line-and-column-regexp path)
+                                                    (prog1 (match-string 0 
path)
+                                                      (setq path (substring 
path 0 (match-beginning 0)))))
+                                                  (if (string-match-p 
hpath:variable-regexp path)
+                                                      ;; Path may be a link 
reference with a suffix component
+                                                      ;; following a comma or 
# symbol, so temporarily strip
+                                                      ;; these, if any, before 
expanding any embedded variables.
+                                                      (when (string-match "[ 
\t\n\r]*[#,]" path)
+                                                        (prog1 (substring path 
(1- (match-end 0)))
+                                                          (setq path 
(substring path 0 (match-beginning 0)))))
+                                                    (when (string-match 
hpath:markup-link-anchor-regexp path)
+                                                      (prog1 (concat "#" 
(match-string 3 path))
+                                                        (setq path (substring 
path 0 (match-beginning 2))))))))))))
     (if (or (null path) (string-empty-p path))
        (setq expanded-path ""
              path "")
diff --git a/hsmail.el b/hsmail.el
index cb67ab519f..428511cdae 100644
--- a/hsmail.el
+++ b/hsmail.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:     9-May-91 at 04:50:20
-;; Last-Mod:      5-Feb-22 at 11:15:20 by Bob Weiner
+;; Last-Mod:      5-Feb-22 at 22:13:05 by Bob Weiner
 ;;
 ;; Copyright (C) 1991-2022  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -11,6 +11,7 @@
 ;; This file is part of GNU Hyperbole.
 
 ;;; Commentary:
+;;    Works with both "message.el" and older "sendmail.el" settings.
 
 ;;; Code:
 ;;; ************************************************************************
@@ -19,6 +20,7 @@
 
 (require 'message)
 (require 'hypb)                         ;For `hypb:supercite-p'.
+(require 'sendmail)
 
 (defvar inhibit-hyperbole-messaging) ;; From "hsettings.el".
 
@@ -37,6 +39,8 @@ for a comment.")
 
 ;; Used by 'message-send' in Emacs "message.el".
 (add-hook 'message-send-hook  #'smail:widen)
+;; Used by 'mail-send' in Emacs "sendmail.el".
+(add-hook 'mail-send-hook  #'smail:widen)
 
 ;; For compatibility with Supercite and GNU Emacs.
 ;; message-mode defines message-yank-prefix - mail-yank-prefix removed
@@ -140,7 +144,7 @@ Put point before the text and mark after.
 
 Normally indent each nonblank line ARG spaces (default 3).
 However, if ‘mail-yank-prefix’ is non-nil, insert that prefix
-on each line.
+on each line when `mail-indent-citation' is called.
 
 Apply `mail-citation-hook', `mail-yank-hook' or `mail-yank-hooks'
 to text (in decreasing order of precedence).
@@ -203,8 +207,8 @@ Use (setq sc-nuke-mail-headers 'all) to have them removed."
                    (mail-yank-clear-headers
                     start (marker-position (mark-marker))))
                (goto-char start)
-               (let ((message-indentation-spaces (if arg (prefix-numeric-value 
arg)
-                                                   message-indentation-spaces))
+               (let ((mail-indentation-spaces (if arg (prefix-numeric-value 
arg)
+                                                mail-indentation-spaces))
                      ;; Avoid error in Transient Mark mode
                      ;; on account of mark's being inactive.
                      (mark-even-if-inactive t))
@@ -224,7 +228,7 @@ Use (setq sc-nuke-mail-headers 'all) to have them removed."
                         (run-hooks 'mail-yank-hook))
                        ((and (boundp 'mail-yank-hooks) mail-yank-hooks)
                         (run-hooks 'mail-yank-hooks))
-                       (t (funcall message-indent-citation-function))))
+                       (t (mail-indent-citation))))
                (goto-char (min (point-max) (mark t)))
                (set-mark opoint)
                (delete-region (point)  ; Remove trailing blank lines.
@@ -241,8 +245,7 @@ Use (setq sc-nuke-mail-headers 'all) to have them removed."
                (unless (eolp)
                  (insert ?\n))))
          ;; Hyperbole addition
-         (with-current-buffer message-reply-buffer
-           (hmail:msg-narrow))))))
+         (hmail:msg-narrow)))))
 
 ;;; ************************************************************************
 ;;; Private variables
diff --git a/hui-mini.el b/hui-mini.el
index 8ef5a57789..26679fbc6b 100644
--- a/hui-mini.el
+++ b/hui-mini.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    15-Oct-91 at 20:13:17
-;; Last-Mod:      5-Feb-22 at 16:48:59 by Bob Weiner
+;; Last-Mod:      5-Feb-22 at 22:33:19 by Bob Weiner
 ;;
 ;; Copyright (C) 1991-2022  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -733,8 +733,8 @@ constructs.  If not given, the top level Hyperbole menu is 
used."
        '(kotl-format .
         (("Format>")
            ("Display-in-Browser"      kexport:display  "Export and display 
current Koutline in default web browser")
+            ("File-Import-to-Koutline" kimport:file     "Import a buffer/file 
into a new or existing Koutline.")
            ("Html-Export-Other"       kexport:html     "Prompt for a Koutline 
buffer/file and output HTML file; export it.")
-            ("Import-to-Koutline"      kimport:file     "Import a buffer/file 
into a new or existing Koutline.")
            ("Koutline-Export-to-Html" kexport:koutline "Export current 
Koutline and save as an HTML file for web usage.")))
        '(msg .
         (("Msg>")
diff --git a/hui.el b/hui.el
index 2074a46c19..3a214a5172 100644
--- a/hui.el
+++ b/hui.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    19-Sep-91 at 21:42:03
-;; Last-Mod:      5-Feb-22 at 13:05:28 by Bob Weiner
+;; Last-Mod:      6-Feb-22 at 00:49:59 by Bob Weiner
 ;;
 ;; Copyright (C) 1991-2021  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -439,6 +439,7 @@ modification   Signal an error when no such button is 
found."
            (hattr:set 'hbut:current 'args (hargs:actype-get actype t))
            (hattr:set 'hbut:current 'action
                       (and hui:ebut-prompt-for-action (hui:action actype)))
+           ;; Ensure ebut:operate is given but-buf as the current buffer
            (set-buffer but-buf)
            (save-excursion
              (ebut:operate lbl new-lbl))
diff --git a/kotl/kmenu.el b/kotl/kmenu.el
index ae61707f01..b8e926ce83 100644
--- a/kotl/kmenu.el
+++ b/kotl/kmenu.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    28-Mar-94 at 11:22:09
-;; Last-Mod:      5-Feb-22 at 16:24:59 by Bob Weiner
+;; Last-Mod:      5-Feb-22 at 22:33:45 by Bob Weiner
 ;;
 ;; Copyright (C) 1994-2021  Free Software Foundation, Inc.
 ;; See the "../HY-COPY" file for license information.
@@ -164,9 +164,9 @@
     ["Write (Save as)"     kfile:write                    t]
     "----"
     ["Display-This-Koutline-in-Web-Browser" kexport:display t]
+    ["Import-File-to-Koutline"              kimport:file    t]
     ["Export-Other-Koutline-to-HTML"        kexport:html    t]
     ["Export-This-Koutline-to-HTML"         kexport:koutline  t]
-    ["Import-to-Koutline"                   kimport:file    t]
     "----"
     ["Quit"                (id-tool-quit '(kill-buffer nil))  t]))
 
diff --git a/man/hyperbole.html b/man/hyperbole.html
index 5abe083b84..2c7ba42799 100644
--- a/man/hyperbole.html
+++ b/man/hyperbole.html
@@ -5905,12 +5905,13 @@ as described later in this section.
 entire file into the current cell following point.
 </p>
 <span id="index-kimport_003afile"></span>
+<span id="index-C_002dh-h-k-f-f"></span>
 <p>The outliner supports conversion of three types of files into koutline
 files.  You can import a file into an existing koutline,
 following the tree at point, or can create a new koutline from the
-imported file contents.  <kbd>{M-x kimport:file <span 
class="key">RET</span>}</kbd> selects the
-importation type based on the buffer or filename suffix of the file to
-import.
+imported file contents.  <kbd>{C-h h k f f}</kbd> or <kbd>{M-x kimport:file 
<span class="key">RET</span>}</kbd>
+selects the importation type based on the buffer or filename suffix of the
+file to import.
 </p>
 <span id="index-kotl_002dmode-1"></span>
 <p>If you want to convert a buffer from some other mode into a koutline and
@@ -12724,6 +12725,7 @@ Next: <a href="#Function" accesskey="n" 
rel="next">Function</a>, Previous: <a hr
 <tr><td></td><td valign="top"><a href="#index-C_002dh-h-i-l"><code>C-h h i 
l</code></a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Implicit-Buttons">Implicit Buttons</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-C_002dh-h-k-e"><code>C-h h k 
e</code></a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Koutliner">Koutliner</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-C_002dh-h-k-f-d"><code>C-h h k f 
d</code></a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Exporting">Exporting</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-C_002dh-h-k-f-f"><code>C-h h k f 
f</code></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-C_002dh-h-k-f-h"><code>C-h h k f 
h</code></a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Exporting">Exporting</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-C_002dh-h-k-f-k"><code>C-h h k f 
k</code></a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Exporting">Exporting</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-C_002dh-h-m-c"><code>C-h h m 
c</code></a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Smart-Key-Debugging">Smart Key Debugging</a></td></tr>
diff --git a/man/hyperbole.info b/man/hyperbole.info
index 931dbd08b6..47207efae8 100644
Binary files a/man/hyperbole.info and b/man/hyperbole.info differ
diff --git a/man/hyperbole.pdf b/man/hyperbole.pdf
index 9148b81814..ccf9ad2a7f 100644
Binary files a/man/hyperbole.pdf and b/man/hyperbole.pdf differ
diff --git a/man/hyperbole.texi b/man/hyperbole.texi
index 9eccc4a48b..167040a3c2 100644
--- a/man/hyperbole.texi
+++ b/man/hyperbole.texi
@@ -7,7 +7,7 @@
 @c Author:       Bob Weiner
 @c
 @c Orig-Date:     6-Nov-91 at 11:18:03
-@c Last-Mod:      5-Feb-22 at 16:55:30 by Bob Weiner
+@c Last-Mod:      5-Feb-22 at 22:38:23 by Bob Weiner
 
 @c %**start of header (This is for running Texinfo on a region.)
 @setfilename hyperbole.info
@@ -4954,12 +4954,13 @@ Use @bkbd{M-x kimport:insert-file-contents @key{RET}} 
to insert an
 entire file into the current cell following point.
 
 @findex kimport:file
+@kindex C-h h k f f
 The outliner supports conversion of three types of files into koutline
 files.  You can import a file into an existing koutline,
 following the tree at point, or can create a new koutline from the
-imported file contents.  @bkbd{M-x kimport:file @key{RET}} selects the
-importation type based on the buffer or filename suffix of the file to
-import.
+imported file contents.  @bkbd{C-h h k f f} or @bkbd{M-x kimport:file 
@key{RET}}
+selects the importation type based on the buffer or filename suffix of the
+file to import.
 
 @findex kotl-mode
 If you want to convert a buffer from some other mode into a koutline and
diff --git a/test/demo-tests.el b/test/demo-tests.el
index 9862849526..d94ac71f24 100644
--- a/test/demo-tests.el
+++ b/test/demo-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <matsl@gnu.org>
 ;;
 ;; Orig-Date:    30-Jan-21 at 12:00:00
-;; Last-Mod:     30-Jan-22 at 03:11:47 by Bob Weiner
+;; Last-Mod:      6-Feb-22 at 03:30:00 by Bob Weiner
 ;;
 ;; Copyright (C) 2021  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -26,10 +26,8 @@
 (require 'eww)
 (require 'compile)
 (require 'el-mock)
+(require 'hy-test-helpers "test/hy-test-helpers")
 
-(load (expand-file-name "hy-test-helpers"
-                        (file-name-directory (or load-file-name
-                                                 default-directory))))
 (declare-function hy-test-helpers:consume-input-events "hy-test-helpers")
 (declare-function hy-test-helpers:should-last-message "hy-test-helpers")
 (declare-function hyrolo-demo-quit "hyrolo-demo.el")
@@ -63,7 +61,7 @@
       (progn
         (hypb:display-file-with-logo (expand-file-name "DEMO" hyperb:dir))
         (goto-char (point-min))
-        (re-search-forward " \* Koutl")
+        (re-search-forward " \\* Koutl")
         (action-key)
         (should (bolp))
         (should (looking-at "^* Koutliner")))
diff --git a/test/hactypes-tests.el b/test/hactypes-tests.el
index d21ce41069..fb7738b009 100644
--- a/test/hactypes-tests.el
+++ b/test/hactypes-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <matsl@gnu.org>
 ;;
 ;; Orig-Date:    30-Jan-21 at 12:00:00
-;; Last-Mod:     24-Jan-22 at 00:38:11 by Bob Weiner
+;; Last-Mod:      6-Feb-22 at 00:56:35 by Bob Weiner
 ;;
 ;; Copyright (C) 2021  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -18,9 +18,8 @@
 
 (require 'ert)
 (require 'hactypes)
-(load (expand-file-name "hy-test-helpers"
-                        (file-name-directory (or load-file-name
-                                                 default-directory))))
+(require 'hy-test-helpers "test/hy-test-helpers")
+
 (declare-function hy-test-helpers:should-last-message "hy-test-helpers")
 
 (ert-deftest display-boolean-true-test ()
diff --git a/test/hib-kbd-tests.el b/test/hib-kbd-tests.el
index 9fb2b2e465..97789ea175 100644
--- a/test/hib-kbd-tests.el
+++ b/test/hib-kbd-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <matsl@gnu.org>
 ;;
 ;; Orig-Date:    30-Jan-21 at 12:00:00
-;; Last-Mod:     24-Jan-22 at 00:38:30 by Bob Weiner
+;; Last-Mod:      6-Feb-22 at 00:55:55 by Bob Weiner
 ;;
 ;; Copyright (C) 2021  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -18,9 +18,8 @@
 
 (require 'ert)
 (require 'hib-kbd)
-(load (expand-file-name "hy-test-helpers"
-                        (file-name-directory (or load-file-name
-                                                 default-directory))))
+(require 'hy-test-helpers "test/hy-test-helpers")
+
 (declare-function hy-test-helpers:consume-input-events "hy-test-helpers")
 (declare-function hy-test-helpers:should-last-message "hy-test-helpers")
 
diff --git a/test/hibtypes-tests.el b/test/hibtypes-tests.el
index 7311e1ae87..538131e93e 100644
--- a/test/hibtypes-tests.el
+++ b/test/hibtypes-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <matsl@gnu.org>
 ;;
 ;; Orig-Date:    20-Feb-21 at 23:45:00
-;; Last-Mod:     24-Jan-22 at 00:38:50 by Bob Weiner
+;; Last-Mod:      6-Feb-22 at 00:56:55 by Bob Weiner
 ;;
 ;; Copyright (C) 2021  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -20,10 +20,8 @@
 (require 'hib-kbd)
 (require 'info)
 (require 'el-mock)
+(require 'hy-test-helpers "test/hy-test-helpers")
 
-(load (expand-file-name "hy-test-helpers"
-                        (file-name-directory (or load-file-name
-                                                 default-directory))))
 (declare-function hy-test-helpers:consume-input-events "hy-test-helpers")
 (declare-function hy-test-helpers:should-last-message "hy-test-helpers")
 
@@ -189,9 +187,12 @@
         (insert "\"/var/lib:/bar:/tmp:/foo\"")
         (goto-char 16)
         (ibtypes::pathname)
+       (when (car (hattr:get 'hbut:current 'args))
+         (set-buffer (find-file-noselect (car (hattr:get 'hbut:current 
'args)))))
         (should (string= "tmp" (buffer-name)))
         (should (eq major-mode 'dired-mode)))
-    (kill-buffer "tmp")))
+    (when (get-buffer "tmp")
+      (kill-buffer (get-buffer "tmp")))))
 
 ;; Function in buffer XEmac functionality. Is there somethign similar in Emacs?
 
diff --git a/test/hmouse-drv-tests.el b/test/hmouse-drv-tests.el
index e08bed9164..145e7f3c26 100644
--- a/test/hmouse-drv-tests.el
+++ b/test/hmouse-drv-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <matsl@gnu.org>
 ;;
 ;; Orig-Date:    28-Feb-21 at 22:52:00
-;; Last-Mod:     24-Jan-22 at 00:39:17 by Bob Weiner
+;; Last-Mod:      6-Feb-22 at 00:58:06 by Bob Weiner
 ;;
 ;; Copyright (C) 2021  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -20,10 +20,8 @@
 (require 'ert)
 (require 'hbut)
 (require 'el-mock)
+(require 'hy-test-helpers "test/hy-test-helpers")
 
-(load (expand-file-name "hy-test-helpers"
-                        (file-name-directory (or load-file-name
-                                                 default-directory))))
 (declare-function hy-test-helpers:consume-input-events "hy-test-helpers")
 
 (ert-deftest hbut-defal ()
diff --git a/test/hpath-tests.el b/test/hpath-tests.el
index d1d9f7656d..9cddd8c01f 100644
--- a/test/hpath-tests.el
+++ b/test/hpath-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <matsl@gnu.org>
 ;;
 ;; Orig-Date:    28-Feb-21 at 23:26:00
-;; Last-Mod:     30-Jan-22 at 16:36:14 by Bob Weiner
+;; Last-Mod:      6-Feb-22 at 00:56:13 by Bob Weiner
 ;;
 ;; Copyright (C) 2021  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -18,10 +18,8 @@
 
 (require 'ert)
 (require 'hpath)
+(require 'hy-test-helpers "test/hy-test-helpers")
 
-(load (expand-file-name "hy-test-helpers"
-                        (file-name-directory (or load-file-name
-                                                 default-directory))))
 (declare-function hy-test-helpers:action-key-should-call-hpath:find 
"hy-test-helpers")
 
 (defconst hpath--should-exist-paths
@@ -114,7 +112,7 @@
   (with-temp-buffer
     (insert "\":foo:bar:emacs\"")
     (goto-char 8)
-    (should (string= (hpath:at-p) "bar"))))
+    (should (string= (hpath:at-p) (expand-file-name "bar")))))
 
 (ert-deftest 
hpath:path-at-point-in-path-variable-shorter-than-three-colons-returns-nil-test 
()
   "Do not identify path variables with less than three colons."
diff --git a/test/hui-tests.el b/test/hui-tests.el
index b442b3a43f..f8fa933d92 100644
--- a/test/hui-tests.el
+++ b/test/hui-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <matsl@gnu.org>
 ;;
 ;; Orig-Date:    30-Jan-21 at 12:00:00
-;; Last-Mod:      5-Feb-22 at 11:39:04 by Bob Weiner
+;; Last-Mod:      6-Feb-22 at 00:59:55 by Bob Weiner
 ;;
 ;; Copyright (C) 2021  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -19,13 +19,48 @@
 (require 'ert)
 (require 'with-simulated-input)
 (require 'el-mock)
+(require 'hy-test-helpers "test/hy-test-helpers")
 (require 'hui)
 
-(load (expand-file-name "hy-test-helpers"
-                        (file-name-directory (or load-file-name
-                                                 default-directory))))
 (declare-function hy-test-helpers:consume-input-events "hy-test-helpers")
 
+(ert-deftest hui-gbut-modify-link-to-file-button ()
+  "A global button with action type link-to-file shall be possible to edit."
+  (skip-unless (not noninteractive))
+  (let* ((enable-recursive-minibuffers t)
+        (old-home (getenv "HOME"))
+         (default-directory "/tmp")
+         (hbmap:dir-user (make-temp-file "HHHHhyperbole" t))
+         (hbmap:dir-filename (expand-file-name  "HBMAP" hbmap:dir-user))
+         (gbut-file-buffer (find-file (gbut:file)))
+         ;; (linked-file 
"/var/folders/8s/b7pm6fms2nsc1x2651dpvrd00000gq/T/HHHH86evcO")
+         (linked-file (make-temp-file "HHHH")))
+    (unwind-protect
+       (progn
+         (write-region "" nil linked-file) ;; Ensure linked file has been 
created
+          (let ((create-gbut (format "C-h h g c abcd RET link-to-file RET %s 
RET y" linked-file))
+               (modify-gbut (format "C-h h g e abcd RET RET RET M-: 
(delete-minibuffer-contents) RET %s RET y" linked-file)))
+            (setenv "HOME" "/tmp")
+            ;; Create using keys
+            (hact 'kbd-key create-gbut)
+            (hy-test-helpers:consume-input-events)
+            ;; Create using program
+            ;; (gbut:ebut-program "abcd" 'link-to-file linked-file)
+
+            (set-buffer gbut-file-buffer)
+           (forward-char 2)
+            (should (eq (hattr:get (hbut:at-p) 'actype) 
'actypes::link-to-file))
+
+           (goto-char (point-max))
+            (hact 'kbd-key modify-gbut)
+            (hy-test-helpers:consume-input-events)
+
+           (goto-char (+ (point-min) 2))
+            (should (eq (hattr:get (hbut:at-p) 'actype) 
'actypes::link-to-file))
+           t))
+      (setenv "HOME" old-home)
+      (delete-directory hbmap:dir-user t)
+      (save-some-buffers t))))
 
 (ert-deftest hui-ibut-label-create ()
   "Create a label for an implicit button."
diff --git a/test/hy-test-helpers.el b/test/hy-test-helpers.el
index 196d122d49..3bdee969ad 100644
--- a/test/hy-test-helpers.el
+++ b/test/hy-test-helpers.el
@@ -37,7 +37,9 @@
   (let ((was-called nil))
     (cl-letf (((symbol-function 'hpath:find)
                (lambda (filename)
-                (setq was-called (should (or (string= str filename) (string= 
str (expand-file-name filename))))))))
+                (if (not (and (stringp str) (stringp filename)))
+                    (should (eq t (message "str = %s; filename = %s" str 
filename)))
+                  (setq was-called (should (or (string= str filename) (string= 
str (expand-file-name filename)))))))))
       (action-key)
       (should was-called))))
 
diff --git a/test/hyrolo-tests.el b/test/hyrolo-tests.el
index 7af116ed2e..4ff64e3dbe 100644
--- a/test/hyrolo-tests.el
+++ b/test/hyrolo-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <matsl@gnu.org>
 ;;
 ;; Orig-Date:    19-Jun-21 at 22:42:00
-;; Last-Mod:     24-Jan-22 at 00:41:23 by Bob Weiner
+;; Last-Mod:      6-Feb-22 at 00:58:33 by Bob Weiner
 ;;
 ;; Copyright (C) 2021  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -20,10 +20,8 @@
 (require 'hact)
 (require 'hyrolo)
 (require 'hyrolo-demo)
+(require 'hy-test-helpers "test/hy-test-helpers")
 
-(load (expand-file-name "hy-test-helpers"
-                        (file-name-directory (or load-file-name
-                                                 default-directory))))
 (declare-function hy-test-helpers:consume-input-events "hy-test-helpers")
 (declare-function hy-test-helpers:should-last-message "hy-test-helpers")
 
diff --git a/test/kotl-mode-tests.el b/test/kotl-mode-tests.el
index 3f312af748..5752a06100 100644
--- a/test/kotl-mode-tests.el
+++ b/test/kotl-mode-tests.el
@@ -5,7 +5,7 @@
 ;; Author:       Mats Lidell <matsl@gnu.org>
 ;;
 ;; Orig-Date:    18-May-21 at 22:14:10
-;; Last-Mod:     24-Jan-22 at 00:41:52 by Bob Weiner
+;; Last-Mod:      6-Feb-22 at 00:57:24 by Bob Weiner
 ;;
 ;; Copyright (C) 2021  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -20,10 +20,8 @@
 
 (require 'ert)
 (require 'kotl-mode "kotl/kotl-mode")
+(require 'hy-test-helpers "test/hy-test-helpers")
 
-(load (expand-file-name "hy-test-helpers"
-                        (file-name-directory (or load-file-name
-                                                 default-directory))))
 (declare-function hy-test-helpers:consume-input-events "hy-test-helpers")
 
 (defmacro setup-kotl-mode-example-test (&rest body)
diff --git a/test/kotl-orgtbl-tests.el b/test/kotl-orgtbl-tests.el
index ba4d8e7ae7..d1eaebeed8 100644
--- a/test/kotl-orgtbl-tests.el
+++ b/test/kotl-orgtbl-tests.el
@@ -5,7 +5,7 @@
 ;; Author:       Mats Lidell <matsl@gnu.org>
 ;;
 ;; Orig-Date:     2-Nov-21 at 17:04:30
-;; Last-Mod:     24-Jan-22 at 00:42:02 by Bob Weiner
+;; Last-Mod:      6-Feb-22 at 00:55:05 by Bob Weiner
 ;;
 ;; Copyright (C) 2021  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -20,10 +20,8 @@
 
 (require 'ert)
 (require 'kotl-mode "kotl/kotl-mode")
+(require 'hy-test-helpers "test/hy-test-helpers")
 
-(load (expand-file-name "hy-test-helpers"
-                        (file-name-directory (or load-file-name
-                                                 default-directory))))
 (declare-function hy-test-helpers:consume-input-events "hy-test-helpers")
 
 (ert-deftest kotl-orgtbl-enabled-uses-kotl-mode-delete-char-outside-of-table ()
diff --git a/test/smart-org-tests.el b/test/smart-org-tests.el
index b9d0f0d437..ed5ece0e69 100644
--- a/test/smart-org-tests.el
+++ b/test/smart-org-tests.el
@@ -5,7 +5,7 @@
 ;; Author:       Mats Lidell <matsl@gnu.org>
 ;;
 ;; Orig-Date:    23-Apr-21 at 22:21:00
-;; Last-Mod:     24-Jan-22 at 00:42:19 by Bob Weiner
+;; Last-Mod:      6-Feb-22 at 00:57:50 by Bob Weiner
 ;;
 ;; Copyright (C) 2021  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -22,6 +22,7 @@
 (require 'hui-mouse)
 (require 'hact)
 (require 'el-mock)
+(require 'hy-test-helpers "test/hy-test-helpers")
 
 (declare-function hy-test-helpers:hypb-function-should-call-hpath:find 
"hy-test-helpers")
 



reply via email to

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