You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ec565e4
Browse filesBrowse the repository at this point in the historyBrowse files
Kang Tu
committed
Add y-or-n-p opt-in before inserting prompt into buffer
Copy file name to clipboardExpand all lines: ai-code-doc.el
+7-6Lines changed: 7 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -30,16 +30,17 @@
30
30
("Derive DDD Context for Repo". ai-code-derive-ddd-context)
31
31
("Derive Test Context Document". ai-code-derive-test-context)
32
32
("Derive Unit Test to Help Understand the Topic". ai-code-derive-topic-unit-tests))
33
-
;; DONE: add an option: Derive Unit Test to Help Understand the topic. Given the current repo and a user entered topic, generate unit-tests to help the user understand code related to the topic. These tests should be written in one or more unit-test class. Tests / Class should be organized in a way to help user understand the code related to the topic gradually, from very basic to advance, from common use case to edge case. Make sure the test code is easy to understand and well commented. The tests should be runnable. The purpose is to let user understand the code related to the topic by reading and running the tests.
34
33
"Choices for `ai-code-derive-architecture-document'.")
35
34
36
35
(defunai-code--doc-emit-prompt (titleprompt)
37
36
"Insert PROMPT under a TITLE headline at point, or send it to the AI.
38
-
In `ai-code-prompt-mode' the prompt is written into the current buffer
39
-
under the cursor, as an Org section at the level of the surrounding
40
-
section, and no AI request is made. Everywhere else PROMPT is handed to
41
-
`ai-code--insert-prompt' as usual."
42
-
(if (derived-mode-p'ai-code-prompt-mode)
37
+
In `ai-code-prompt-mode' the user is asked whether to write the prompt
38
+
into the current buffer, as an Org section at the level of the
39
+
surrounding section, in which case no AI request is made. When the
40
+
answer is no, and everywhere outside `ai-code-prompt-mode', PROMPT is
41
+
handed to `ai-code--insert-prompt' as usual."
42
+
(if (and (derived-mode-p'ai-code-prompt-mode)
43
+
(y-or-n-p"Insert prompt into this buffer instead of sending it to the AI? "))
0 commit comments