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

From: Robert Weiner <[email-masked]>
Date: Thu, 6 Jun 2019 08:57:02 -0400

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)
>