bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#22091: �ظ���bug#22091: [PATCH 1/2] * lisp/env.el: Add (whereis-comma


From: lux
Subject: bug#22091: »Ø¸´£ºbug#22091: [PATCH 1/2] * lisp/env.el: Add (whereis-command)
Date: Fri, 4 Dec 2015 16:17:57 +0800

I'm sorry, his is new patch, thank you Glenn Morris:

diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el
index c6d40b6..0a4693f 100644
--- a/lisp/net/net-utils.el
+++ b/lisp/net/net-utils.el
@@ -87,7 +87,9 @@ These options can be used to limit how many ICMP packets are emitted."
 (defcustom ifconfig-program
   (if (eq system-type 'windows-nt)
       "ipconfig"
-    "ifconfig")
+    (if (executable-find "ifconfig")
+        "ifconfig"
+      "ip"))
   "Program to print network configuration information."
   :group 'net-utils
   :type  'string)
@@ -97,8 +99,10 @@ These options can be used to limit how many ICMP packets are emitted."
 
 (defcustom ifconfig-program-options
   (list
-   (if (eq system-type 'windows-nt)
-       "/all" "-a"))
+   (cond ((eq system-type 'windows-nt) "/all")
+         ((and (executable-find "ip")
+               (not (executable-find "ifconfig"))) "addr")
+         (t "-a")))
   "Options for the ifconfig program."
   :group 'net-utils
   :type  '(repeat string))
-- 
2.5.0



------------------ ???????? ------------------
??????: "Glenn Morris";<rgm@gnu.org>;
????????: 2015??12??4??(??????) ????4:03
??????: "lux"<lx@shellcodes.org>;
????: "22091"<22091@debbugs.gnu.org>;
????: bug#22091: [PATCH 1/2] * lisp/env.el: Add (whereis-command)

lu4nx wrote:

> +(defun whereis-command (command)
> +  (let ((paths (split-string (getenv "PATH") ":")))
> +    (remove-if-not
> +     (lambda (path)
> +       (file-exists-p (format "%s/%s" path command)))
> +     paths)))

You use a CL function without requiring CL.
But 'executable-find' already exists anyway, so this isn't needed.

Also, you sent 4 or 5 identical copies of each of your mails in rapid
succession (filtered out by list moderation). Please fix your mailer.


Attachment: 0001-lisp-net-net-utils.el-ifconfig-function-support-ip.patch
Description: Binary data


reply via email to

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