Subject: Re: bug#37723: Apropos Hyperbole key series in DEMO is not pressing final return
From: Robert Weiner <[email-masked]>
To: "Kevin J. McCarthy" <[email-masked]>
Cc: [email-masked], Lidell Mats <[email-masked]>
Date: Sun, 13 Oct 2019 12:34:11 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

On Sat, Oct 12, 2019 at 11:44 PM Kevin J. McCarthy <[email-masked]> wrote:

> I use:  Editor:      GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+
> Version 3.24.4)
>
>          Hyperbole:   7.0.7
>          Sys Type:    x86_64-pc-linux-gnu
>          OS Type:     gnu/linux
>          Window Sys:  x
>          News Reader: Gnus v5.13
>
> This might be quirks of my environment, but I'm reporting various little
> issues just in case.
>
> In the DEMO, under
> * Implicit Buttons
> ** Key Series Buttons
>
> The multiline key series:  {M-x apropos
> RET hyperbole RET} is not pressing the final return for me.  The prompt
>    Search for symbol (word list or regexp): hyperbole
> is in the minibuffer and I need to press return myself.
>
> If I put it on one line the behavior is the same:
> {M-x apropos RET hyperbole RET}
>

Good catch, Kevin.  There was a bug in a function that trims whitespace
from pathname arguments that was doing this to non-pathname arguments like
we have here.  If you replace the following function in hpath.el and
re-byte-compile and reload the file, this should work properly.

(defun hpath:absolute-to (path &optional default-dirs)
  "Return PATH as an absolute path relative to one directory from optional
DEFAULT-DIRS or `default-directory'.
Return PATH unchanged when it is 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."
  (cond ((not (and (stringp path)
                   (hpath:is-p (hpath:trim path) nil t)))
         path)
        ((progn (setq path (hpath:trim 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))
             (or (file-exists-p rtn) (setq rtn nil)))
           (or rtn path)))))

This issue is now resolved and is being closed.

Bob