Hot answers tagged

24 votes

Does emacs have a process viewer (resource manager) or equivalent?

The question was asked in 2016. Now in 2019, there exists M-x proced: Mode for displaying system processes and sending signals to them. Proced makes an Emacs buffer containing a listing of the ...
user1404316's user avatar
13 votes

Does emacs have a process viewer (resource manager) or equivalent?

In addition to the other answers, the original poster may wish to consider using the built-in profiling feature: https://www.gnu.org/software/emacs/manual/html_node/elisp/Profiling.html To begin ...
lawlist's user avatar
  • 19.1k
11 votes

Exiting emacs without confirmation to kill running processes

Emacs 26.1 added the confirm-kill-processes variable. To disable confirmation to kill processes on Emacs exit, add to your init file: (setq confirm-kill-processes nil) Documentation: Non-nil if ...
rduplain's user avatar
  • 261
9 votes

Does emacs have a process viewer (resource manager) or equivalent?

You may want to check list-processes: list-processes is an interactive compiled Lisp function in ‘simple.el’. (list-processes &optional QUERY-ONLY BUFFER) Display a list of all ...
GergelyPolonkai's user avatar
8 votes

Kill process buffer without confirmation?

Or the simpler one would be : (setq kill-buffer-query-functions nil) Inspired from abo-abo config
azzamsa's user avatar
  • 634
8 votes

Does emacs have a process viewer (resource manager) or equivalent?

Check out helm-top. It lists all the things you want, and has actions to send signals to the processes.
John Kitchin's user avatar
  • 11.8k
7 votes

Does emacs have a process viewer (resource manager) or equivalent?

I like htop and so I also use it in emacs. However the interactive part doesn't work this way. (defun htop () (interactive) (if (get-buffer "*htop*") (switch-to-buffer "*htop*") (ansi-...
bertfred's user avatar
  • 1,729
6 votes
Accepted

Pass an argument to a sentinel

The classic method is to use buffer-local variables in the buffer associated with the process. (defvar faustine-process-source-buffer nil "Source buffer from which the current process is generating ...
Gilles 'SO- stop being evil''s user avatar
6 votes
Accepted

How to determine which program is running inside an emacs shell buffer?

Here's a simple function that gets the pid of the process running in the current buffer and then calls the pstree command to get the process tree of that process: (defun iproc () (interactive) (...
NickD's user avatar
  • 29.3k
5 votes

Possible to "detach" a child process?

Currently the best way to achieve this (although it does not work for Windows) is by using the command call-process with the destination argument set to 0 (see https://www.gnu.org/software/emacs/...
dalanicolai's user avatar
  • 7,785
5 votes
Accepted

Possible to "detach" a child process?

here's solution, shorting @abo-abo's answer. (cond ((string-equal system-type "windows-nt") ; Windows // ... ) ((string-equal system-type "gnu/linux") (start-process "my-...
Xah Lee's user avatar
  • 1,756
5 votes
Accepted

Print process output line by line

Emacs can invoke processes either synchronously or asynchronously. In the former case, the calling program has to wait for the process to terminate before processing the entire output in one go (...
Basil's user avatar
  • 12.3k
5 votes
Accepted

How to attach/connect two subprocesses?

For two processes A and B mutually killing each other you can use the following approach: Start the first process just with start-process and remember its process (as lisp object). Start the second ...
Tobias's user avatar
  • 33.1k
5 votes
Accepted

Set environment variables for spawned subprocesses

setenv-internal and setenv change the list stored in process-environment (as local or special variable) by side-effects. It does not help if you assign the list (pointer) to a local variable process-...
Tobias's user avatar
  • 33.1k
5 votes
Accepted

Send content of region or current line to a tmp file, then execute shell script with filename as argument

If your ~/dotfiles/rundo.sh accepts stdin as input, like many other commands such as grep/wc/bash/python, to run a command with the region as stdin, simply run M-| ~/dotfiles/rundo.sh (M-| runs shell-...
xuchunyang's user avatar
  • 14.5k
5 votes
Accepted

Get process id for the Emacs own process

If I do understand correctly you could use (emacs-pid)
Muihlinn's user avatar
  • 2,604
4 votes

How to find what process won't die?

You might try at the command line: kill -USR2 pid where pid is the emacs process that is stuck. Sometimes this leads to a traceback that might tell you what is going on.
John Kitchin's user avatar
  • 11.8k
4 votes
Accepted

Exiting emacs without confirmation to kill running processes

Following my own suggestion (second comment on the question), here's an answer which avoids the prompting altogether: (require 'auto-answer) (let ((auto-answer '(("\\`Active processes exist; kill ...
YoungFrog's user avatar
  • 3,526
4 votes

How can I run an async process in the background without popping up a buffer?

There's no need to change how you run an asynchronous command. Emacs has a generic ability to allow you to control where or whether any buffer will pop-up, by modifying a single data structure, the ...
user1404316's user avatar
4 votes

Discard stderr in start-process

Emacs 25 introduced the function make-process for creating asynchronous processes, which is lower-level than start-process. In particular, you can separate stderr from stdout by passing a buffer or ...
Basil's user avatar
  • 12.3k
4 votes
Accepted

How does one create back and forth communication to a process

The functionality used by comint mode is start-process, so I think you might like to start with that. You send data to the process with process-send-string, and the process's output is "automatically"...
Stefan's user avatar
  • 26.3k
4 votes

Pass an argument to a sentinel

I'm not sure what you mean by "pass arguments in a quoted function call", but if you're referring to the 'mdoc-sentinel argument to set-process-sentinel, that is not a function call, you are just ...
Peder Klingenberg's user avatar
4 votes
Accepted

Interpolate environment variables in string

I think you're looking for the function substitute-env-vars: substitute-env-vars is a compiled Lisp function in ‘env.el’. (substitute-env-vars STRING &optional WHEN-UNDEFINED) Substitute ...
Basil's user avatar
  • 12.3k
4 votes
Accepted

Asynchronous version of shell-command-on-region?

Something in this spirit should do the trick. I tried it with espeak under Ubuntu; I guess it would work with say as well. (defun my-read-words-on-region () "Send the region to `espeak'." (...
Nsukami _'s user avatar
  • 6,461
4 votes

Differences between cmdproxy.exe and cmd.exe

I just found this: Proxy shell designed for use with Emacs on Windows 95 and NT. [...] The main function is simply to process the "-c string" option in the way /bin/sh does, since the standard ...
antonio's user avatar
  • 1,802
4 votes
Accepted

Looking for a better way to test whether the current Emacs process is running under GNU Screen

Skip all the pid stuff, and just check the STY environment variable. If it is set, then emacs is running inside screen.
db48x's user avatar
  • 17.7k
4 votes
Accepted

Why does `eshell` not create an active process In Emacs while `shell` and `term` do?

As mentioned in the manual page on Processes, the term process refers to an OS process. Emacs runs in a process, but can invoke other external processes and manage them as subprocesses. When you run M-...
Trevor's user avatar
  • 56
3 votes
Accepted

Help with `call-process-region`: Searching for program: no such file or directory

The 3rd argument to call-process-region is an executable file name, not a whole command, so you should call it like this: (call-process-region (point-min) (point-max) "python" nil nil nil "/Users/...
npostavs's user avatar
  • 9,163
3 votes

Kill process buffer without confirmation?

This will not affect the global variable scope (let ((kill-buffer-query-functions nil)) (kill-buffer "*Python*"))
Talespin_Kit's user avatar
3 votes

How to make shell-command run using shell profile and current directory hooks (ex. direnv)

nowadays you would likely want to use https://github.com/wbolster/emacs-direnv it works similar to the hook that direnv installs in your shell. the emacs environment is updated on request (or ...
wouter bolsterlee's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible