Last active
November 30, 2015 02:31
-
-
Save tkhoa2711/f3d9c1cb04597f03ee76 to your computer and use it in GitHub Desktop.
Emacs and system process
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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