Skip to content

Instantly share code, notes, and snippets.

@tkhoa2711
Last active November 30, 2015 02:31
Show Gist options
  • Save tkhoa2711/f3d9c1cb04597f03ee76 to your computer and use it in GitHub Desktop.
Save tkhoa2711/f3d9c1cb04597f03ee76 to your computer and use it in GitHub Desktop.
Emacs and system process
(defun system-process-running-p (regex-str)
"Check whether there is a system process running whom name matches REGEX-STR."
(dolist (pid (list-system-processes))
(let ((attrs (process-attributes pid)))
(if (string-match-p regex-str
(cdr (assoc 'comm attrs)))
(return t)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment