From 03d5640cee297cf8fbf91d651dd3cfb30720260f Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia-Ripoll Date: Fri, 4 Dec 2020 16:45:09 +0100 Subject: [PATCH] Do not use shell commands to extract version number Avoid using 'head', 'sed' or other POSIX commands to extract the version number when Emacs can do it. This allows installing just 'mu', without the extra unix tools in a Windows environment. --- mu4e/mu4e-proc.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mu4e/mu4e-proc.el b/mu4e/mu4e-proc.el index e0bb620e..8063f428 100644 --- a/mu4e/mu4e-proc.el +++ b/mu4e/mu4e-proc.el @@ -243,9 +243,9 @@ backslashes and double-quotes." "Cannot find mu, please set `mu4e-mu-binary' to the mu executable path")) ;; sanity-check 2 - (let ((version (shell-command-to-string - (format "%s --version | head -1 | sed 's/.*version //' | tr -d '\n'" - mu4e-mu-binary)))) + (let ((version (let ((s (shell-command-to-string (concat mu4e-mu-binary " --version")))) + (and (string-match "version \\([.0-9]+\\)" s) + (match-string 1 s))))) (unless (string= version mu4e-mu-version) (mu4e-error (concat