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

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

[nongnu] elpa/editorconfig f5fc0eb099: Fix when-let (again) (#305)


From: ELPA Syncer
Subject: [nongnu] elpa/editorconfig f5fc0eb099: Fix when-let (again) (#305)
Date: Fri, 19 May 2023 04:00:48 -0400 (EDT)

branch: elpa/editorconfig
commit f5fc0eb099d32e5da25c0b7530007dfbeb280834
Author: 10sr <8.slashes@gmail.com>
Commit: GitHub <noreply@github.com>

    Fix when-let (again) (#305)
    
    * Fix compile of editorconfig-core
    
    * Use when-let* instead of when-let
---
 editorconfig-core.el | 7 +++++--
 editorconfig.el      | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/editorconfig-core.el b/editorconfig-core.el
index d5f46fe1c7..999af2c125 100644
--- a/editorconfig-core.el
+++ b/editorconfig-core.el
@@ -68,6 +68,9 @@
 
 (require 'editorconfig-core-handle)
 
+(eval-when-compile
+  (require 'subr-x))
+
 
 (defun editorconfig-core--get-handles (dir confname &optional result)
   "Get list of EditorConfig handlers for DIR from CONFNAME.
@@ -90,7 +93,7 @@ RESULT is used internally and normally should not be used."
 ;;;###autoload
 (defun editorconfig-core-get-nearest-editorconfig (directory)
   "Return path to .editorconfig file that is closest to DIRECTORY."
-  (when-let ((handle (car (last
+  (when-let* ((handle (car (last
                            (editorconfig-core--get-handles directory
                                                            ".editorconfig")))))
     (editorconfig-core-handle-path handle)))
@@ -144,7 +147,7 @@ hash object instead."
     ;; Downcase known boolean values
     (dolist (key '( end_of_line indent_style indent_size insert_final_newline
                     trim_trailing_whitespace charset))
-      (when-let ((val (gethash key result)))
+      (when-let* ((val (gethash key result)))
         (puthash key (downcase val) result)))
 
     ;; Add indent_size property
diff --git a/editorconfig.el b/editorconfig.el
index 92ffe1e44b..d657261945 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -910,7 +910,7 @@ To disable EditorConfig in some buffers, modify
   "Find the closest .editorconfig file for current file."
   (interactive)
   (eval-and-compile (require 'editorconfig-core))
-  (when-let ((file (editorconfig-core-get-nearest-editorconfig
+  (when-let* ((file (editorconfig-core-get-nearest-editorconfig
                     default-directory)))
     (find-file file)))
 



reply via email to

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