I'm looking at the magit source code, and there's this make-magit-section function that doesn't seem to found anywhere in the project (grep doesn't return any results).

describe-function says that it's defined in magit.el and that it has a compiler macro make-magit-section--cmacro. This macro has no results in grep as well.

Here's the one place it is being used in the magit repo https://github.com/magit/magit/blob/next/magit-section.el#L635

Where could this function be defined?

1 Answer 1


It is defined using cl-defstruct (here).

  • Oh, so make-magit-section is a constructor function that is defined behind the scenes by (cl-defstruct magit-section ...).
    – john2x
    May 24, 2015 at 4:23
  • 2
    It might help to describe how you found it. (Especially for cl-defstruct.)
    – Drew
    May 29, 2015 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.