Function: eca-jobs--kill-at-point

eca-jobs--kill-at-point is an interactive and natively compiled function defined in eca-jobs.el.

Signature

(eca-jobs--kill-at-point)

Documentation

Kill the background job at point.

Key Bindings

eca-jobs-mode-map k

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-jobs.el
(defun eca-jobs--kill-at-point ()
  "Kill the background job at point."
  (interactive)
  (if-let* ((session (ignore-errors (eca-session)))
            (job-id (get-text-property (point) 'eca-job-id)))
      (when (y-or-n-p (format "Kill job %s? " job-id))
        (eca-api-request-async session
                               :method "jobs/kill"
                               :params (list :job-id job-id)
                               :success-callback
                               (lambda (result)
                                 (if (plist-get result :killed)
                                     (message "Job %s killed" job-id)
                                   (message "Job %s was not running" job-id)))
                               :error-callback
                               (lambda (_err)
                                 (user-error "Failed to kill job %s" job-id))))
    (user-error "No running job at point")))