GNU bug report logs - #46958
28.0.50; invalid-function error for macros that have function bindings

Previous Next

Package: emacs;

Reported by: Robert Irelan <rirelan <at> gmail.com>

Date: Sat, 6 Mar 2021 03:54:02 UTC

Severity: minor

Tags: wontfix

Found in version 28.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Robert Irelan <rirelan <at> gmail.com>
To: Phil Sainty <psainty <at> orcon.net.nz>
Cc: "Basil L. Contovounesios" <contovob <at> tcd.ie>, Lars Ingebrigtsen <larsi <at> gnus.org>, 46958 <at> debbugs.gnu.org
Subject: bug#46958: 28.0.50; invalid-function error for macros that have function bindings
Date: Sun, 7 Mar 2021 13:38:53 -0800
No, that results in a circular import.

The way this file (not my code, by the way) seems to work is that it
started out as one file, org-fc.el, that contained everything. At
various points, they decided to break out some parts of the file into
separate files like this:

```
;;; org-fc.el

;; ... some definitions, including macro
`org-fc-with-point-at-back-heading' and the other `org-fc' symbols
mentioned in org-fc-type-normal.el

(require 'org-fc-type-normal)

;; ... some more definitions

(provide 'org-fc)
```

```
;;; org-fc-type-normal.el

(defun org-fc-type-normal-init ()
  "Mark headline as card of the normal type."
  (interactive)
  (org-fc--init-card "normal")
  (org-fc-review-data-update '("front")))

(defun org-fc-type-normal-setup (_position)
  "Prepare a normal card for review."
  (interactive)
  ;; Make sure the card is collapsed
  (outline-hide-subtree)
  (when (org-fc-has-back-heading-p)
    (org-show-entry)
    ;; Make sure the back heading is visible
    (org-fc-with-point-at-back-heading
     (org-show-set-visibility 'minimal))))

(defun org-fc-type-normal-flip ()
  "Flip a normal card."
  (interactive)
  (org-show-entry)
  (org-show-children)
  ;; NOTE: the body only runs if the card has a back heading
  (org-fc-with-point-at-back-heading
   (org-show-entry)
   (org-show-children)
   (org-fc-show-latex)))

(org-fc-register-type
 'normal
 'org-fc-type-normal-setup
 'org-fc-type-normal-flip
 'org-fc-noop)

;;; Footer

(provide 'org-fc-type-normal)
```

Note that `org-fc-type-normal.el` doesn't `require` anything from
`org-fc`, but assumes that they have been already defined by the time
`org-fc.el` runs the `require` call.

On Sat, Mar 6, 2021 at 2:39 PM Phil Sainty <psainty <at> orcon.net.nz> wrote:
>
> On 7/03/21 7:28 am, Robert Irelan wrote:
> > The call that's actually failing is located here:
> > https://git.sr.ht/~l3kn/org-fc/tree/711511192c62f6dccc96644dcf0705fda99e753a/item/org-fc-type-normal.el#L41.
>
> It looks like org-fc-type-normal.el should (require 'org-fc)
> at the start.
>
> Does that fix the problem?
>


-- 
Robert Irelan
rirelan <at> gmail.com




This bug report was last modified 2 years and 334 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.