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

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

[nongnu] elpa/with-editor 3385ffd 037/140: Revert "Use when-let instead


From: Jonas Bernoulli
Subject: [nongnu] elpa/with-editor 3385ffd 037/140: Revert "Use when-let instead of macros from dash"
Date: Fri, 6 Aug 2021 12:51:15 -0400 (EDT)

branch: elpa/with-editor
commit 3385ffdc6faed5a283e26a7ebf89825c700dd395
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Revert "Use when-let instead of macros from dash"
    
    This reverts commit 8c95e7de363715e8e38bbb4d9eac2dd63ac8b74e.
---
 with-editor.el | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/with-editor.el b/with-editor.el
index be1974c..13e0c6a 100644
--- a/with-editor.el
+++ b/with-editor.el
@@ -82,7 +82,6 @@
 (require 'cl-lib)
 (require 'dash)
 (require 'server)
-(require 'subr-x)
 (require 'tramp)
 (require 'tramp-sh nil t)
 
@@ -109,14 +108,15 @@
 
 (defun with-editor-locate-emacsclient ()
   "Search for a suitable Emacsclient executable."
-  (or (with-editor-locate-emacsclient-1 (with-editor-emacsclient-path) 3)
-      (display-warning 'with-editor (format "\
+  (--if-let (with-editor-locate-emacsclient-1 (with-editor-emacsclient-path) 3)
+      it
+    (display-warning 'with-editor (format "\
 Cannot determine a suitable Emacsclient
 
 Determining an Emacsclient executable suitable for the
 current Emacs instance failed.  For more information
 please see https://github.com/magit/magit/wiki/Emacsclient.";))
-      nil))
+    nil))
 
 (defun with-editor-locate-emacsclient-1 (path depth)
   (let* ((version-lst (-take depth (split-string emacs-version "\\.")))
@@ -140,7 +140,7 @@ please see 
https://github.com/magit/magit/wiki/Emacsclient.";))
              (with-editor-locate-emacsclient-1 path (1- depth))))))
 
 (defun with-editor-emacsclient-version (exec)
-  (when-let (1st-line (car (process-lines exec "--version")))
+  (-when-let (1st-line (car (process-lines exec "--version")))
     (cadr (split-string 1st-line))))
 
 (defun with-editor-emacsclient-path ()
@@ -662,10 +662,10 @@ else like the former."
 (defun with-editor-shell-command-read-args (prompt &optional async)
   (let ((command (read-shell-command
                   prompt nil nil
-                  (when-let (file (or buffer-file-name
-                                      (and (eq major-mode 'dired-mode)
-                                           (dired-get-filename nil t))))
-                    (file-relative-name file)))))
+                  (--when-let (or buffer-file-name
+                                  (and (eq major-mode 'dired-mode)
+                                       (dired-get-filename nil t)))
+                    (file-relative-name it)))))
     (list command
           (if (or async (setq async (string-match-p "&[ \t]*\\'" command)))
               (< (prefix-numeric-value current-prefix-arg) 0)



reply via email to

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