Initial Query

In emacs lisp how do I silence "Process python-process finished"

LLM Generation

Query

In emacs lisp how do I silence "Process python-process finished"

Output

In Emacs Lisp, to silence the "Process python-process finished" message, you can use one of these approaches: 1. Using `set-process-sentinel`:

1
2
3
4
5
(set-process-sentinel 
 (get-process "python-process")
 (lambda (proc event)
   (when (string= event "finished\n")
     (delete-process proc))))
2. Using `comint-mode` hook:
1
2
(add-hook 'comint-output-filter-functions
          'comint-strip-ctrl-m)
3. If you want to completely suppress the message:
1
2
3
4
(advice-add 'comint-write-output :around 
            (lambda (orig-fun &rest args)
              (let ((inhibit-message t))
                (apply orig-fun args))))
4. Another approach using `advice-add`:
1
2
3
4
(advice-add 'process-sentinel :override 
            (lambda (proc msg) 
              (unless (string-match "exited abnormally" msg)
                (delete-process proc))))
Choose the method that best fits your specific use case and Emacs setup. The first method is often the most straightforward and explicit.

Substring Evaluation

Testing if the previous output contains the string set-process-sentinel: True

Initial Query

In emacs lisp how do I silence "Process python-process finished"

LLM Generation

Query

In emacs lisp how do I silence "Process python-process finished"

Output

In Emacs Lisp, you can silence the "Process python-process finished" message by setting `comint-process-echoes` to `nil` or by using `(setq compilation-always-kill-buffer t)`. Here are a few approaches: 1. For comint-based processes:

1
(setq comint-process-echoes nil)
2. For compilation buffers:
1
(setq compilation-always-kill-buffer t)
3. You can also create a custom advice to suppress specific messages:
1
2
3
4
(defadvice display-message-or-buffer (around no-python-process-message activate)
  (unless (and (stringp message) 
               (string-match "Process.*finished" message))
    ad-do-it))
4. Another approach using `(inhibit-message)`:
1
2
3
4
5
(defun my-suppress-process-finish-message (orig-fun &rest args)
  (let ((inhibit-message t))
    (apply orig-fun args)))

(advice-add 'display-message-or-buffer :around #'my-suppress-process-finish-message)
Choose the method that best fits your specific use case and Emacs configuration.

Substring Evaluation

Testing if the previous output contains the string set-process-sentinel: False

Initial Query

In emacs lisp how do I silence "Process python-process finished"

LLM Generation

Query

In emacs lisp how do I silence "Process python-process finished"

Output

In Emacs Lisp, you can silence the "Process python-process finished" message by configuring the `comint-process-echoes` variable or by using advice. Here are a few approaches: 1. Set `comint-process-echoes`:

1
(setq comint-process-echoes t)
2. Use advice to suppress the message:
1
2
3
4
(advice-add 'comint-output-filter-function :around
            (lambda (orig-fun &rest args)
              (let ((inhibit-message t))
                (apply orig-fun args))))
3. Directly modify the process sentinel:
1
2
3
4
5
(set-process-sentinel 
 (get-process "python-process")
 (lambda (proc event)
   (when (string= event "finished\n")
     (message ""))))
Choose the method that best fits your specific use case. The first option is the most straightforward and generally works well for most scenarios.

Substring Evaluation

Testing if the previous output contains the string set-process-sentinel: True

Initial Query

In emacs lisp how do I silence "Process python-process finished"

LLM Generation

Query

In emacs lisp how do I silence "Process python-process finished"

Output

In Emacs Lisp, you can silence the "Process python-process finished" message by setting the `comint-process-echoes` variable to `t` or by using advice to filter out the message. Here are a few approaches: 1. Set `comint-process-echoes`:

1
(setq comint-process-echoes t)
2. Use `advice-add` to filter the message:
1
2
3
4
5
(defun my-advice-ignore-process-exit (orig-func &rest args)
  (let ((inhibit-message t))
    (apply orig-func args)))

(advice-add 'comint-output-filter-function :around #'my-advice-ignore-process-exit)
3. Modify the `comint-output-filter-function`:
1
2
3
4
5
(defun my-comint-filter (str)
  (let ((filtered-str (replace-regexp-in-string "Process .+ finished\n" "" str)))
    filtered-str))

(add-hook 'comint-output-filter-functions #'my-comint-filter)
Choose the method that best fits your specific use case.

Substring Evaluation

Testing if the previous output contains the string set-process-sentinel: False

Initial Query

In emacs lisp how do I silence "Process python-process finished"

LLM Generation

Query

In emacs lisp how do I silence "Process python-process finished"

Output

In Emacs Lisp, you can silence the "Process python-process finished" message by setting the `comint-process-echoes` variable to `t` or by using advice to suppress the message. Here are a few approaches: 1. Set `comint-process-echoes`:

1
(setq comint-process-echoes t)
2. Using `advice-add` to suppress the message:
1
2
3
4
(advice-add 'compilation-filter :around
            (lambda (orig-fun proc string)
              (unless (string-match "Process .+ finished" string)
                (funcall orig-fun proc string))))
3. Advice specifically for Python process:
1
2
3
4
(advice-add 'python-shell-filter-process-output :around
            (lambda (orig-fun proc string)
              (unless (string-match "Process python-process finished" string)
                (funcall orig-fun proc string))))
4. Using a custom filter function:
1
2
3
(defun my-filter-process-output (proc string)
  (unless (string-match "Process .+ finished" string)
    (comint-output-filter proc string)))
Choose the method that best fits your specific use case and Emacs setup.

Substring Evaluation

Testing if the previous output contains the string set-process-sentinel: False