xenodium / chatgpt-shell

A multi-llm Emacs shell (ChatGPT, Claude, Gemini, Ollama, Perplexity) + editing integrations
https://lmno.lol/alvaro
GNU General Public License v3.0
866 stars 77 forks source link

moves macros above defuns that call them #124

Closed djliden closed 1 year ago

djliden commented 1 year ago

See #122

Addresses an issue where invoking chatgpt-shell resulted in error shell-maker-start: Invalid function: shell-maker--with-temp-buffer-if

Moving the new macros to the top of the file solves the issue. I think this is related to byte-compilation:

In order for compilation of macro calls to work, the macros must already be defined in Lisp when the calls to them are compiled. The compiler has a special feature to help you do this: if a file being compiled contains a defmacro form, the macro is defined temporarily for the rest of the compilation of that file.

https://www.gnu.org/software/emacs/manual/html_node/elisp/Compiling-Macros.html

jaeyeom commented 1 year ago

Thank you. I was also digging into this error yesterday and could learn about macros. :)