Joost Kremers <joostkrem...@fastmail.fm> writes:

The `declare-function` call says that `forth-proc` can be found in `gforth.el`, so the fact that you have `forth-mode.el` installed is (probably) irrelevant. What you need is the file `gforth.el`. Where it comes from is irrelevant, it just needs to be on Emacs' `load-path`. (And it needs to actually provide `forth-proc`, of course, and make it
autoloadable, but I assume that's the case.)

What I don't understand, though, is why there's no `(require 'gforth)` in `ob-forth.el`. It seems that `forth-proc` is essential for running Forth
source blocks, so a `require` seems in order.

The point is that `declare-function` is usually only used to declare functions that are optional, meaning that `ob-forth.el` should check if
it's available and gracefully handle the case where it's not.

What is the best way forward here?

What does the documentation for `ob-forth.el` say? Does it say `gforth.el` needs to be installed? Otherwise perhaps ask the Org mailing list or the
ob-forth maintainer directly?

No one is maintaining ob-forth.el.

I found gforth.el in emacs/site-lisp and confirm that forth-proc is there.

Here is the relevant part of ob-forth.el:

;; Requires the gforth forth compiler and `forth-mode' (see below).
   ;; https://www.gnu.org/software/gforth/

   ;;; Requirements:

;; Session evaluation requires the gforth forth compiler as well as ;; `forth-mode' which is distributed with gforth (in gforth.el).

   ;;; Code:

   (require 'org-macs)
   (org-assert-version)

   (require 'ob)
   (require 'org-macs)

   (declare-function forth-proc "ext:gforth" ())

It does not (require 'gforth), but strangely (to me) requires org-macs twice.

Perhaps ob-forth.el is broken?

All the best,
Tom

--
Thomas S. Dye
https://tsdye.online/tsdye

Reply via email to