Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I use it? #10

Open
madorian opened this issue Dec 13, 2024 · 1 comment
Open

How do I use it? #10

madorian opened this issue Dec 13, 2024 · 1 comment

Comments

@madorian
Copy link

Is there some guide to get a simple working?

I did

evedel-create-directive and wrote "create an elisp function that adds two numbers"

I then evedel-process-directives and it replied:

Debugger entered--Lisp error: (no-catch --cl-block-execute-- nil)
  throw(--cl-block-execute-- nil)
  (progn (throw '--cl-block-execute-- nil))
  (if (evedel--being-processed-p directive) (progn (throw '--cl-block-execute-- nil)))
  (progn (if (evedel--being-processed-p directive) (progn (throw '--cl-block-execute-- nil))) (if (evedel--directive-empty-p directive) (evedel--process-directive-llm-response "The directive is empty!" (list :context directive)) (gptel-request (evedel--directive-llm-prompt directive) :system (evedel--directive-llm-system-message directive) :dry-run nil :stream nil :in-place nil :callback #'evedel--process-directive-llm-response :context directive) (overlay-put directive 'evedel-directive-status 'processing) (evedel--update-instruction-overlay directive t)))
  (closure (t) (directive) (progn (if (evedel--being-processed-p directive) (progn (throw '--cl-block-execute-- nil))) (if (evedel--directive-empty-p directive) (evedel--process-directive-llm-response "The directive is empty!" (list :context directive)) (gptel-request (evedel--directive-llm-prompt directive) :system (evedel--directive-llm-system-message directive) :dry-run nil :stream nil :in-place nil :callback #'evedel--process-directive-llm-response :context directive) (overlay-put directive 'evedel-directive-status 'processing) (evedel--update-instruction-overlay directive t))))(#<overlay from 1 to 2 in samp.el>)
  funcall((closure (t) (directive) (progn (if (evedel--being-processed-p directive) (progn (throw '--cl-block-execute-- nil))) (if (evedel--directive-empty-p directive) (evedel--process-directive-llm-response "The directive is empty!" (list :context directive)) (gptel-request (evedel--directive-llm-prompt directive) :system (evedel--directive-llm-system-message directive) :dry-run nil :stream nil :in-place nil :callback #'evedel--process-directive-llm-response :context directive) (overlay-put directive 'evedel-directive-status 'processing) (evedel--update-instruction-overlay directive t)))) #<overlay from 1 to 2 in samp.el>)
  (progn (funcall --cl-execute-- directive) (message "Sent directive to gptel for processing"))
  (if directive (progn (funcall --cl-execute-- directive) (message "Sent directive to gptel for processing")) (let* ((toplevel-directives (and t (cl-remove-duplicates (mapcar #'... (evedel--instructions-in ... ... ...)))))) (if toplevel-directives (progn (let ((tail toplevel-directives)) (while tail (let (...) (funcall --cl-execute-- dir) (setq tail ...)))) (message "Sent all directives in current buffer to gptel for...")) nil)))
  (let* ((directive (and t (evedel--topmost-instruction (evedel--highest-priority-instruction (evedel--instructions-at (point) 'directive) t) 'directive)))) (if directive (progn (funcall --cl-execute-- directive) (message "Sent directive to gptel for processing")) (let* ((toplevel-directives (and t (cl-remove-duplicates (mapcar ... ...))))) (if toplevel-directives (progn (let ((tail toplevel-directives)) (while tail (let ... ... ...))) (message "Sent all directives in current buffer to gptel for...")) nil))))
  (if (region-active-p) (let* ((toplevel-directives (and t (cl-remove-duplicates (mapcar #'... (evedel--instructions-in ... ... ...)))))) (if toplevel-directives (progn (let ((tail toplevel-directives)) (while tail (let (...) (funcall --cl-execute-- directive) (setq tail ...)))) (let ((directive-count (length toplevel-directives))) (message "Sent %d directive%s to gptel for processing" directive-count (if (> directive-count 1) "s" "")))) nil)) (let* ((directive (and t (evedel--topmost-instruction (evedel--highest-priority-instruction (evedel--instructions-at ... ...) t) 'directive)))) (if directive (progn (funcall --cl-execute-- directive) (message "Sent directive to gptel for processing")) (let* ((toplevel-directives (and t (cl-remove-duplicates ...)))) (if toplevel-directives (progn (let (...) (while tail ...)) (message "Sent all directives in current buffer to gptel for...")) nil)))))
  (let* ((--cl-execute-- #'(lambda (directive) (progn (if (evedel--being-processed-p directive) (progn ...)) (if (evedel--directive-empty-p directive) (evedel--process-directive-llm-response "The directive is empty!" ...) (gptel-request ... :system ... :dry-run nil :stream nil :in-place nil :callback ... :context directive) (overlay-put directive ... ...) (evedel--update-instruction-overlay directive t)))))) (if (region-active-p) (let* ((toplevel-directives (and t (cl-remove-duplicates (mapcar ... ...))))) (if toplevel-directives (progn (let ((tail toplevel-directives)) (while tail (let ... ... ...))) (let ((directive-count ...)) (message "Sent %d directive%s to gptel for processing" directive-count (if ... "s" "")))) nil)) (let* ((directive (and t (evedel--topmost-instruction (evedel--highest-priority-instruction ... t) 'directive)))) (if directive (progn (funcall --cl-execute-- directive) (message "Sent directive to gptel for processing")) (let* ((toplevel-directives (and t ...))) (if toplevel-directives (progn (let ... ...) (message "Sent all directives in current buffer to gptel for...")) nil))))))
  evedel-process-directives()
  funcall-interactively(evedel-process-directives)
  call-interactively(evedel-process-directives record nil)
  command-execute(evedel-process-directives record)
  counsel-M-x-action("evedel-process-directives")
  ivy-call()
  ivy-read("M-x " ("evedel-process-directives" "evedel-create-directive" "replace-foo-with-kill-ring" "format-all-project-files" "mark-sexp" "mark-outer-sexp" "mark-defun" "ytdl-download" "org-roam-buffer-toggle" "mpc-songs-search" "point-undo" "replace-spadel-at-point" "dogears-back" "move-spadel-backward" "set-created-property-in-region" "gptel" "mpc-playlist-add" "customize-variable" "better-jumper-jump-backward" "crux-rename-buffer-and-file" "eww" "my-ansi-term" "print-highest-sway" "org-journal-new-entry" "package-refresh-contents" "reverse-line" "visual-line-mode" "emacspeak-speak-line" "eval-and-run-at-point" "my-org-agenda-next-day" "chatgpt-shell" "typing-of-emacs" "etm-eww-html-to-org" "org-property-action" "ivy-previous-line-or-history" "replace-symbol-with-kill-ring" "capitalize-penultimate-word-behind-point" "org-edna-mode" "org-roam-db-sync" "my/create-new-note" "my-get-coding-system" "org-insert-subheading" "insert-escaped-kill-ring" "wg-echo-current-workgroup" "my/gptel-new-buffer-with-claude" "helm-org-run-insert-link-to-heading-at-marker" "erc" "repeat" "wg-load" "detour-back" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  call-interactively(counsel-M-x nil nil)
  command-execute(counsel-M-x)

@daedsidog
Copy link
Owner

Your usage is correct. I managed to reproduce your error and fix it with 863e6e5.

Still, the error stemmed from the fact that you kept trying to send a directive that's currently being processed. Does the directive highlighting change for you when you execute evedel-process-directives?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants