Subject: bug#36107: Global Buttons Stop Functioning When Current Working Directory Changes (Forgot the Subject!)

From: Eric Bemiller <[email-masked]>
Date: Thu, 6 Jun 2019 21:26:47 +0000

Boy is this weird -- okay.

So, the version I'm getting from the package manager in Emacs doesn't
have 'hypb:functionp` defined in `hypb.el`.

I went and downloaded the archive version of 7.0.3 from the FTP
(ftp://ftp.gnu.org/gnu/hyperbole/), and looked in that version of
`hypb.el` -- and, what do you know, the function is there, and set to
autoload as you described.

I then deleted the version of Hyperbole in my site lisp, and reinstalled
it using the install instructions on the Hyperbole site. Checked the
newly installed version, and `hypb:functionp` still wasn't there.

So, I then loaded hyperbole using the code from the Archive version
rather than from the package manager (just unzipped it to a directory
and set the load path there), and eval'd the original patch you sent:
everything works correctly -- and the button problem appears to be
fixed?

Robert Weiner <[email-masked]> writes:

> hypb:functionp is defined in the hypb.el file in the Hyperbole
> directory or:
>
> "${hyperb:dir}/hypb.el"
>
> Bob
>
>
> On Thu, Jun 6, 2019 at 9:29 AM Eric Bemiller <[email-masked]>
> wrote:
>
>    
>     Hmm. I followed the instructions, and still have the error.
>    
>     I went looking for `hypb:functionp` and didn't find anything
>     either --
>     though, obvs, I don't know the codebase, so it could be defined
>     somewhere non-obvious, or I may be totally missing something.
>     Doesn't
>     come up in {M-x describe-function}, wasn't listed in
>     `hyperbole-autoloads.el`, and didn't turn up when I searched in
>     the code
>     directory with `ag`.
>    
>     I've been doing this testing on my normal init, but it doesn't
>     come up
>     in a vanilla Emacs with just Hyperbole loaded either.
>    
>     Robert Weiner <[email-masked]> writes:
>    
>     > Strange as hypb:functionp is marked to be autoloaded and should
>     be in
>     > hyperbole-autoloads.el.  Check if it is or not.  Load it
>     manually and
>     > then test:
>     >
>     >    {M-x load-lib RET hypb RET}
>     >
>     > On Thu, Jun 6, 2019 at 7:58 AM <[email-masked]> wrote:
>     >
>     >   
>     >     Thanks for looking at it!
>     >   
>     >     Got an error with that code, though -- here's what I did:
>     >   
>     >     1. Loaded Emacs. Hyperbole auto-loaded.
>     >   
>     >     2. Invoked the "Notes" global button -- just to make sure
>     >     Hyperbole was
>     >        running and good to go.
>     >   
>     >     3. Evaluated provided code
>     >   
>     >     4. Invoked "Notes" global button again and this is what the
>     >     debugger
>     >        gave me:
>     >   
>     >     Debugger entered--Lisp error: (void-function
>     hypb:functionp)
>     >       (hypb:functionp display-executables)
>     >       (cond ((stringp display-executables) (funcall
>     hrule:action
>     >     (quote exec-window-cmd) (hpath:command-string
>     display-executables
>     >     filename)) nil) ((hypb:functionp display-executables)
>     (funcall
>     >     display-executables filename) t) ((and (listp
>     >     display-executables) display-executables) (setq executable
>     >     (hpath:find-executable display-executables)) (if executable
>     >     (funcall hrule:action (quote exec-window-cmd)
>     >     (hpath:command-string executable filename)) (error "
>     (hpath:find):
>     >     No available executable from: %s" display-executables))) (t
>     (setq
>     >     path (hpath:validate path)) (if (null display-where) (setq
>     >     display-where hpath:display-where)) (funcall (car (cdr (or
>     (assq
>     >     display-where hpath:display-where-alist) (assq (quote
>     >     other-window) hpath:display-where-alist)))) path) (if (or
>     hash
>     >     anchor) (hpath:to-markup-anchor hash anchor)) t))
>     >       (let ((display-executables (hpath:find-program path))
>     >     executable) (cond ((stringp display-executables) (funcall
>     >     hrule:action (quote exec-window-cmd) (hpath:command-string
>     >     display-executables filename)) nil) ((hypb:functionp
>     >     display-executables) (funcall display-executables filename)
>     t)
>     >     ((and (listp display-executables) display-executables)
>     (setq
>     >     executable (hpath:find-executable display-executables)) (if
>     >     executable (funcall hrule:action (quote exec-window-cmd)
>     >     (hpath:command-string executable filename)) (error "
>     (hpath:find):
>     >     No available executable from: %s" display-executables))) (t
>     (setq
>     >     path (hpath:validate path)) (if (null display-where) (setq
>     >     display-where hpath:display-where)) (funcall (car (cdr (or
>     (assq
>     >     display-where hpath:display-where-alist) (assq ...
>     >     hpath:display-where-alist)))) path) (if (or hash anchor)
>     >     (hpath:to-markup-anchor hash anchor)) t)))
>     >       (cond (modifier (cond ((eq modifier 33) (funcall
>     hrule:action
>     >     (quote exec-shell-cmd) filename)) ((eq modifier 38)
>     (funcall
>     >     hrule:action (quote exec-window-cmd) filename)) ((eq
>     modifier 45)
>     >     (load filename))) nil) (t (let ((display-executables
>     >     (hpath:find-program path)) executable) (cond ((stringp
>     >     display-executables) (funcall hrule:action (quote
>     >     exec-window-cmd) (hpath:command-string display-executables
>     >     filename)) nil) ((hypb:functionp display-executables)
>     (funcall
>     >     display-executables filename) t) ((and (listp
>     >     display-executables) display-executables) (setq executable
>     >     (hpath:find-executable display-executables)) (if executable
>     >     (funcall hrule:action (quote exec-window-cmd)
>     >     (hpath:command-string executable filename)) (error "
>     (hpath:find):
>     >     No available executable from: %s" display-executables))) (t
>     (setq
>     >     path (hpath:validate path)) (if (null display-where) (setq
>     >     display-where hpath:display-where)) (funcall (car (cdr
>     ...))
>     >     path) (if (or hash anchor) (hpath:to-markup-anchor hash
>     anchor))
>     >     t)))))
>     >       (let ((case-fold-search t) modifier loc default-directory
>     >     anchor hash path) (if (string-match hpath:prefix-regexp
>     filename)
>     >     (setq modifier (aref filename 0) filename (substring
>     filename
>     >     (match-end 0)))) (setq path (hpath:substitute-value (if
>     >     (string-match hpath:markup-link-anchor-regexp filename)
>     (progn
>     >     (setq hash t anchor (match-string 3 filename)) (substring
>     >     filename 0 (match-end 1))) filename)) loc (hattr:get (quote
>     >     hbut:current) (quote loc)) default-directory
>     (file-name-directory
>     >     (if (stringp loc) loc default-directory)) filename
>     >     (hpath:absolute-to path default-directory)) (let
>     >     ((remote-filename (hpath:remote-p path))) (or modifier
>     >     remote-filename (file-exists-p filename) (error "
>     (hpath:find): \
>     >     "%s\" does not exist" filename)) (or modifier
>     remote-filename
>     >     (file-readable-p filename) (error "(hpath:find): \"%s\" is
>     not
>     >     readable" filename)) (if (and remote-filename (not
>     >     (file-directory-p remote-filename))) (progn (copy-file
>     >     remote-filename (setq path (concat hpath:tmp-prefix
>     >     (file-name-nondirectory remote-filename))) t t) (setq
>     filename
>     >     (cond (anchor (concat remote-filename "#" anchor)) (hash
>     (concat
>     >     remote-filename "#")) (t path)))))) (cond (modifier (cond
>     ((eq
>     >     modifier 33) (funcall hrule:action (quote exec-shell-cmd)
>     >     filename)) ((eq modifier 38) (funcall hrule:action (quote
>     >     exec-window-cmd) filename)) ((eq modifier 45) (load
>     filename)))
>     >     nil) (t (let ((display-executables (hpath:find-program
>     path))
>     >     executable) (cond ((stringp display-executables) (funcall
>     >     hrule:action (quote exec-window-cmd) (hpath:command-string
>     >     display-executables filename)) nil) ((hypb:functionp
>     >     display-executables) (funcall display-executables filename)
>     t)
>     >     ((and (listp display-executables) display-executables)
>     (setq
>     >     executable (hpath:find-executable display-executables)) (if
>     >     executable (funcall hrule:action ... ...) (error "
>     (hpath:find):
>     >     No available executable from: %s" display-executables))) (t
>     (setq
>     >     path (hpath:validate path)) (if (null display-where) (setq
>     >     display-where hpath:display-where)) (funcall (car ...)
>     path) (if
>     >     (or hash anchor) (hpath:to-markup-anchor hash anchor))
>     t))))))
>     >       hpath:find("../Org/Notes.org")
>     >       #f(compiled-function (path &optional point) (interactive
>     #f
>     >     (compiled-function () #<bytecode 0x1ff0aed>)) #<bytecode
>     >     0x1ee53dd>)("../Org/Notes.org")
>     >       apply(#f(compiled-function (path &optional point)
>     (interactive
>     >     #f(compiled-function () #<bytecode 0x23136a5>)) #<bytecode
>     >     0x1ee53dd>) "../Org/Notes.org")
>     >       eval((apply action args))
>     >       actype:act(actypes::link-to-file "../Org/Notes.org")
>     >       apply(actype:act actypes::link-to-file "../Org/
>     Notes.org")
>     >       hbut:act(hbut:current)
>     >       gbut:act("Notes")
>     >       funcall-interactively(gbut:act "Notes")
>     >       call-interactively(gbut:act)
>     >       hui:menu-act(hyperbole nil nil nil)
>     >       hyperbole(nil nil nil nil)
>     >       funcall-interactively(hyperbole nil nil nil nil)
>     >       call-interactively(hyperbole nil nil)
>     >       command-execute(hyperbole)
>     >
>     >
>     >