fix(mu4e): do not set coding-system-for-read globally

`+mu4e-lock-pid-info` had unintentional side effects: it changed
`coding-system-for-read` globally.

Fix: #5788
This commit is contained in:
Hanno Perrey 2021-11-18 19:11:55 +01:00 committed by GitHub
parent 3d91c9aff7
commit 2b1cb2620a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,9 +16,9 @@
"Get info on the PID refered to in `+mu4e-lock-file' in the form (pid . process-attributes) "Get info on the PID refered to in `+mu4e-lock-file' in the form (pid . process-attributes)
If the file or process do not exist, the lock file is deleted an nil returned." If the file or process do not exist, the lock file is deleted an nil returned."
(when (file-exists-p +mu4e-lock-file) (when (file-exists-p +mu4e-lock-file)
(let* ((pid (string-to-number (let* ((coding-system-for-read 'utf-8)
(pid (string-to-number
(with-temp-buffer (with-temp-buffer
(setq coding-system-for-read 'utf-8)
(insert-file-contents +mu4e-lock-file) (insert-file-contents +mu4e-lock-file)
(buffer-string)))) (buffer-string))))
(process (process-attributes pid))) (process (process-attributes pid)))