emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/helm 93a5ebe549 1/3: Fix issue #1322 with default-process-


From: ELPA Syncer
Subject: [nongnu] elpa/helm 93a5ebe549 1/3: Fix issue #1322 with default-process-coding-system in locate
Date: Thu, 16 Jun 2022 07:02:49 -0400 (EDT)

branch: elpa/helm
commit 93a5ebe54904b89c21a639f85c57b679cd4e8499
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    Fix issue #1322 with default-process-coding-system in locate
---
 helm-locate.el | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/helm-locate.el b/helm-locate.el
index a38e6e1625..222b5e05a0 100644
--- a/helm-locate.el
+++ b/helm-locate.el
@@ -284,9 +284,23 @@ See also `helm-locate'."
                     'face 'helm-locate-finish))))
     (force-mode-line-update)))
 
+(defun helm-locate--default-process-coding-system ()
+  "Fix `default-process-coding-system' in locate for Windows systems."
+  ;; This is an attempt to fix issue #1322.
+  (if (and (eq system-type 'windows-nt)
+           (boundp 'w32-ansi-code-page))
+      (let ((code-page-eol
+             (intern (format "cp%s-%s" w32-ansi-code-page "dos"))))
+        (if (ignore-errors (check-coding-system code-page-eol))
+            (cons code-page-eol code-page-eol)
+          default-process-coding-system))
+    default-process-coding-system))
+
 (defun helm-locate-init ()
   "Initialize async locate process for `helm-source-locate'."
-  (let* ((locate-is-es (string-match "\\`es" helm-locate-command))
+  (let* ((default-process-coding-system
+          (helm-locate--default-process-coding-system))
+         (locate-is-es (string-match "\\`es" helm-locate-command))
          (real-locate (string-match "\\`locate" helm-locate-command))
          (case-sensitive-flag (if locate-is-es "-i" ""))
          (ignore-case-flag (if (or locate-is-es



reply via email to

[Prev in Thread] Current Thread [Next in Thread]