branch: externals/hyperbole
commit 2c67943e47c3fe036879b3a2e280b8a3221170bd
Author: Bob Weiner <r...@gnu.org>
Commit: Bob Weiner <r...@gnu.org>

    Fix a few warnings/bugs pointed out by the byte-compiler
---
 ChangeLog     | 22 ++++++++++++++++++++++
 hbut.el       | 40 +++++++++++++++++++++-------------------
 hmouse-tag.el |  6 +++---
 hsys-org.el   |  8 ++++----
 hsys-xref.el  |  8 +++++++-
 hui.el        |  6 +++---
 hycontrol.el  | 23 ++++++++++-------------
 hypb.el       |  7 ++++---
 8 files changed, 74 insertions(+), 46 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 35b0fe694f..5f8290e22d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2024-01-14  Bob Weiner  <r...@gnu.org>
+
+* hypb.el (require 'org): Add to define 'org-show-all'.  Fix typo
+    missing leading h in 'hsys-org-enable-smart-keys'.
+
+* hsys-org.el (hsys-org-fix-version): Remove unused 'org-dir-version'.
+
+* hsys-xref.el (smart-emacs-lisp-mode-p): Declare this function.
+
+* hycontrol.el (hycontrol-windows-grid-buffer-list): Remove use of
+    free variable, 'mode', since this is never called when a specific
+    'major-mode' is set.
+
+* hsys-org.el (package): Add (require 'package).
+
+* hmouse-tag.el (smart-tags-display): Fix missed rename of
+    'hsys-xref-item-buffer' and 'hsys-xref-item-position'.
+
+* hui.el (hui:ebut-act, hui:ebut-act): Fix 'hui:hbut-operate' call
+    to use 'hbut:act' which takes a button argument as opposed to
+    'ebut:act' and 'ibut:act' which each take a label argument.
+
 2024-01-13  Mats Lidell  <ma...@gnu.org>
 
 * test/hbut-tests.el (ebut-program-link-to-directory): Remove test in
diff --git a/hbut.el b/hbut.el
index 678a01cdad..61835a9513 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:      7-Jan-24 at 20:13:36 by Bob Weiner
+;; Last-Mod:     14-Jan-24 at 11:55:14 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -2331,29 +2331,31 @@ move to the first occurrence of the button."
 (defun    ibut:operate (&optional new-name edit-flag)
   "Insert/modify an ibutton based on `hbut:current' in current buffer.
 
-This is for internal Hyperbole use only.  Use `ibut:program' and `ibut:create'
-(an alias of `defib'), if programming applications with Hyperbole.
+This is for internal Hyperbole use only.  Use `ibut:program' and
+`ibut:create' (an alias of `defib'), if programming applications
+with Hyperbole.
 
-IMPORTANT:
-Caller must either call `hbut:at-p' or manually set the attributes of
-`hbut:current' prior to invoking this function, i.e. there must be an
-ibutton stored in memory in `hbut:current prior to invocation.  If point
-is on an existing Hyperbole button, `edit-flag' must be set to t; otherwise,
-this may create a new ibutton inserted within the prior one, making the
-prior one unusable.
+IMPORTANT: Caller must either call `hbut:at-p' or manually set
+the attributes of `hbut:current' prior to invoking this function,
+i.e. there must be an ibutton stored in memory in `hbut:current
+prior to invocation.  If point is on an existing Hyperbole
+button, `edit-flag' must be set to t; otherwise, this may create
+a new ibutton inserted within the prior one, making the prior one
+unusable.
 
-Optional non-nil NEW-NAME is new name to give button.  With optional
-EDIT-FLAG non-nil, modify an existing in-buffer ibutton rather
-than creating a new one.
+Optional non-nil NEW-NAME is new name to give button.  With
+optional EDIT-FLAG non-nil, modify an existing in-buffer ibutton
+rather than creating a new one.
 
-If NEW-NAME is nil, use the active region text as the button name, if any;
-if no such region, then create/modify an unnamed implicit button.
+If NEW-NAME is nil, use the active region text as the button
+name, if any; if no such region, then create/modify an unnamed
+implicit button.
 
-Return instance string appended to name to form a per-buffer unique
-name; nil if name is already unique or no name.  Signal an error when no
-such button is found in the current buffer.
+Return instance string appended to name to form a per-buffer
+unique name; nil if name is already unique or no name.  Signal an
+error when no such button is found in the current buffer.
 
-Summary of operations based on inputs (name arg comes from \\='hbut:current 
attrs):
+Summary of operations based on inputs (name arg from \\='hbut:current attrs):
 
|----+------+----------+--------+------+-----------------------------------------------|
 |  # | name | new-name | region | edit | operation                             
        |
 
|----+------+----------+--------+------+-----------------------------------------------|
diff --git a/hmouse-tag.el b/hmouse-tag.el
index 29bf64d525..0809b898bf 100644
--- a/hmouse-tag.el
+++ b/hmouse-tag.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    24-Aug-91
-;; Last-Mod:     13-Jan-24 at 01:29:42 by Bob Weiner
+;; Last-Mod:     14-Jan-24 at 11:58:31 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -1443,8 +1443,8 @@ See the \"${hyperb:dir}/smart-clib-sym\" script for more 
information."
                (setq find-tag-result (funcall func tag)))
           (cond ((or (eq (type-of find-tag-result) 'xref-item)
                      (vectorp find-tag-result))
-                 (hpath:display-buffer (xref-item-buffer find-tag-result))
-                 (goto-char (xref-item-position find-tag-result)))
+                 (hpath:display-buffer (hsys-xref-item-buffer find-tag-result))
+                 (goto-char (hsys-xref-item-position find-tag-result)))
                 (t
                  ;; Emacs with some unknown version of tags.
                  ;; Signals an error if tag is not found which is caught by
diff --git a/hsys-org.el b/hsys-org.el
index 910b0682d9..c797f0228f 100644
--- a/hsys-org.el
+++ b/hsys-org.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:     2-Jul-16 at 14:54:14
-;; Last-Mod:     13-Jan-24 at 19:50:40 by Bob Weiner
+;; Last-Mod:     14-Jan-24 at 12:07:26 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -35,6 +35,7 @@
 (require 'org)
 (require 'org-element)
 (require 'org-fold nil t)
+(require 'package)
 ;; Avoid any potential library name conflict by giving the load directory.
 (require 'set (expand-file-name "set" hyperb:dir))
 
@@ -162,14 +163,13 @@ Return t if Org is reloaded, else nil."
        org-list-allow-alphabetical nil)
   (let ((org-dir (ignore-errors (org-find-library-dir "org")))
        (org-install-dir
-        (ignore-errors (org-find-library-dir "org-loaddefs")))
-       org-dir-version)
+        (ignore-errors (org-find-library-dir "org-loaddefs"))))
     (cond ((and org-dir org-install-dir (string-equal org-dir org-install-dir)
                ;; Still may have a situation where the Org version matches the
                ;; builtin Org but the directories are for a newer Org
                ;; package version.
                (if (string-match "[\\/]org-\\([0-9.]+-?[a-z]*\\)" org-dir)
-                   (string-equal (setq org-dir-version (match-string 1 
org-dir))
+                   (string-equal (match-string 1 org-dir) ;; org-dir version
                                  (remove ?- (org-release)))
                  t))
           ;; Just require these libraries used for testing to ensure
diff --git a/hsys-xref.el b/hsys-xref.el
index e02fff0609..7eaec94400 100644
--- a/hsys-xref.el
+++ b/hsys-xref.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    24-Aug-91
-;; Last-Mod:     13-Jan-24 at 15:55:13 by Bob Weiner
+;; Last-Mod:     14-Jan-24 at 12:05:01 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -22,6 +22,12 @@
 
 (require 'xref)
 
+;;; ************************************************************************
+;;; Public declarations
+;;; ************************************************************************
+
+(declare-function smart-emacs-lisp-mode-p "hmouse-tag")
+
 ;;; ************************************************************************
 ;;; Public functions
 ;;; ************************************************************************
diff --git a/hui.el b/hui.el
index 3d64713b7a..b7a2ee34b5 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:     13-Jan-24 at 18:55:34 by Bob Weiner
+;; Last-Mod:     14-Jan-24 at 12:07:46 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -296,7 +296,7 @@ Default is the current button."
                                          (ebut:label-p 'as-label) 'ebut))))
            (t
             (hypb:error "(ebut-act): No explicit buttons in buffer."))))))
-  (hui:hbut-operate #'ebut:act "Activate explicit button: " but))
+  (hui:hbut-operate #'hbut:act "Activate explicit button: " but))
 
 (defun hui:ebut-create (&optional start end)
   "Interactively create an explicit Hyperbole button.
@@ -942,7 +942,7 @@ Default is any implicit button at point."
                                          (ibut:label-p 'as-label) 'ibut))))
            (t
             (hypb:error "(ibut-act): No named implicit buttons in 
buffer."))))))
-  (hui:hbut-operate #'ibut:act "Activate named implicit button: " ibut))
+  (hui:hbut-operate #'hbut:act "Activate named implicit button: " ibut))
 
 (defun hui:ibut-create (&optional start end)
   "Interactively create an implicit Hyperbole button at point.
diff --git a/hycontrol.el b/hycontrol.el
index 2bfee03b39..38d29dbb7f 100644
--- a/hycontrol.el
+++ b/hycontrol.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:     1-Jun-16 at 15:35:36
-;; Last-Mod:     25-Nov-23 at 16:47:02 by Mats Lidell
+;; Last-Mod:     14-Jan-24 at 14:53:56 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -1603,15 +1603,12 @@ Enabled if `hycontrol-invert-mode-line-flag' is 
non-nil."
 (defun hycontrol-windows-grid-buffer-list ()
   "Return buffer list for grid.
 Buffers are either any marked items in Dired, Buffer Menu or
-IBuffer mode or the existing frame's buffer list.  If selecting
-buffers by major-mode, then ignore any marked items."
-  (if (and (boundp 'mode) (symbolp mode))
-      (buffer-list (selected-frame))
-    ;; Get the list of marked items if in an item list buffer and
-    ;; convert items to buffers.
-    ;; Return either non-nil items or frame's full buffer list.
-    (or (hycontrol-windows-grid-marked-items)
-       (buffer-list (selected-frame)))))
+IBuffer mode or the existing frame's buffer list."
+  ;; Get the list of marked items if in an item list buffer and
+  ;; convert items to buffers.
+  ;; Return either non-nil items or frame's full buffer list.
+  (or (hycontrol-windows-grid-marked-items)
+      (buffer-list (selected-frame))))
 
 ;;; Split selected frame into a grid of windows given by row and
 ;;; column count, displaying different buffers in each window.
@@ -1926,7 +1923,7 @@ See documentation of `hycontrol-windows-grid' for further 
details."
               (setq hycontrol-arg 1))
       (error (set-window-configuration wconfig)
             (and hycontrol-help-flag (or hycontrol-frames-mode 
hycontrol-windows-mode)
-                (pop-to-buffer (messages-buffer)))
+                 (pop-to-buffer (messages-buffer)))
             (error "(HyDebug): Grid Size: %d; %s" arg err)))
     ;; No error, save prior frame configuration for easy return
     (hhist:add hist-elt)
@@ -1936,8 +1933,8 @@ See documentation of `hycontrol-windows-grid' for further 
details."
 (defun hycontrol-delete-other-windows ()
   "Confirm and then delete all other windows in the selected frame."
   (interactive)
-  (if (y-or-n-p "Delete all windows in this frame other than the selected 
one?")
-      (delete-other-windows)))
+  (when (y-or-n-p "Delete all windows in this frame other than the selected 
one?")
+    (delete-other-windows)))
 
 (defun hycontrol-window-maximize-lines ()
   "Grow window to its maximum possible number of lines without removing 
windows."
diff --git a/hypb.el b/hypb.el
index 4cd751a9ad..d4c1c4f37c 100644
--- a/hypb.el
+++ b/hypb.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:     6-Oct-91 at 03:42:38
-;; Last-Mod:     12-Jan-24 at 08:20:56 by Bob Weiner
+;; Last-Mod:     14-Jan-24 at 10:47:40 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -19,7 +19,8 @@
 ;;; Other required Elisp libraries
 ;;; ************************************************************************
 
-(eval-and-compile (mapc #'require '(compile hversion hact locate cl-lib)))
+;; Load Org here for `org-show-all'.
+(eval-and-compile (mapc #'require '(compile hversion hact locate cl-lib org)))
 
 ;;; ************************************************************************
 ;;; Public declarations
@@ -1096,7 +1097,7 @@ If FILE is not an absolute path, expand it relative to 
`hyperb:dir'."
 
     ;; Ensure Smart Keys do not defer to Org mode when running tests 
noninteractively
     (when noninteractive
-      (setq sys-org-enable-smart-keys t))
+      (setq hsys-org-enable-smart-keys t))
 
     (when (and existing-buf noninteractive)
       ;; Likely are running tests when running non-interactively, so

Reply via email to