Skip to content

Commit 69fec16

Browse files
tninjaKang Tu
andauthored
Chore: Show detail error msg for missing function, clarify installation (#73)
* show detail error msg * Clarify Claude Code installation method in README --------- Co-authored-by: Kang Tu <kang_tu@apple.com>
1 parent fc0194d commit 69fec16

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

README.org

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ An Emacs interface for AI-assisted software development. *The purpose is to prov
4848
- `org`: Org-mode support
4949
- `magit`: Git integration
5050
- `transient`: For the menu system
51-
- Claude Code (`[[https://github.com/stevemolitor/claude-code.el][claude-code.el]]`)
51+
- Claude Code (`[[https://github.com/stevemolitor/claude-code.el][claude-code.el]]`), (use straight to install, NOT MELPA version)
5252
- eat / vterm need to be installed to support various AI coding CLI backends.
5353

5454
*** Optional Dependencies

ai-code-backends.el

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,13 @@ Sets `ai-code-cli-*' defaliases and updates `ai-code-cli'."
168168
(when (and feature (not (featurep feature)))
169169
(user-error "Backend '%s' is not available. Please install the package providing '%s' and try again."
170170
label (symbol-name feature)))
171-
(unless (and (fboundp start) (fboundp switch) (fboundp send))
172-
(user-error "Backend '%s' is not available (missing functions). Please install the package providing '%s'."
173-
label (symbol-name feature)))
171+
(let ((missing-fns (seq-filter (lambda (fn) (not (fboundp fn)))
172+
(list start switch send))))
173+
(when missing-fns
174+
(user-error "Backend '%s' is not available (missing functions: %s). Please install the package providing '%s'."
175+
label
176+
(mapconcat #'symbol-name missing-fns ", ")
177+
(symbol-name feature))))
174178
(defalias 'ai-code-cli-start start)
175179
(defalias 'ai-code-cli-switch-to-buffer switch)
176180
(defalias 'ai-code-cli-send-command send)

0 commit comments

Comments
 (0)