Mu4e: Replace shell-commands with call-process

Shell-process actually initialises a shell, which is completely
unnecessary here.
This commit is contained in:
TEC 2021-04-15 00:50:34 +08:00
parent 874f140a67
commit eebe2859cf
No known key found for this signature in database
GPG key ID: 779591AFDB81F06C
2 changed files with 4 additions and 5 deletions

View file

@ -36,10 +36,9 @@ clicked."
(list :width (list :width
(format "%.1fpx" (format "%.1fpx"
(/ (string-to-number (/ (string-to-number
(shell-command-to-string
;; TODO change to use 'file' ;; TODO change to use 'file'
(format "identify -format %%w %s" (doom-call-process "identify" "-format" "%w"
(substring img-uri 7)))) ; 7=(length "file://") (substring img-uri 7))) ; 7=(length "file://")
(plist-get org-format-latex-options :scale)))) (plist-get org-format-latex-options :scale))))
(list :style (format "transform: scale(%.3f)" (list :style (format "transform: scale(%.3f)"
(/ 1.0 (plist-get org-format-latex-options :scale)))))) (/ 1.0 (plist-get org-format-latex-options :scale))))))

View file

@ -44,7 +44,7 @@ If STRICT only accept an unset lock file."
"Check `+mu4e-lock-file', and if another process is responsible for it, abort starting. "Check `+mu4e-lock-file', and if another process is responsible for it, abort starting.
Else, write to this process' PID to the lock file" Else, write to this process' PID to the lock file"
(unless (+mu4e-lock-available) (unless (+mu4e-lock-available)
(shell-command (format "touch %s" +mu4e-lock-request-file)) (call-process "touch" nil nil nil +mu4e-lock-request-file)
(message "Lock file exists, requesting that it be given up") (message "Lock file exists, requesting that it be given up")
(sleep-for 0.1) (sleep-for 0.1)
(delete-file +mu4e-lock-request-file)) (delete-file +mu4e-lock-request-file))