GNU bug report logs -
#22091
[PATCH 1/2] * lisp/env.el: Add (whereis-command)
Previous Next
Reported by: lu4nx <lx <at> shellcodes.org>
Date: Fri, 4 Dec 2015 07:27:02 UTC
Severity: wishlist
Tags: patch
Fixed in version 25.1
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 22091 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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 <at> gnu.org>;
发送时间: 2015年12月4日(星期五) 下午4:03
收件人: "lux"<lx <at> shellcodes.org>;
抄送: "22091"<22091 <at> 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.
[Message part 2 (text/html, inline)]
[0001-lisp-net-net-utils.el-ifconfig-function-support-ip.patch (application/octet-stream, attachment)]
This bug report was last modified 9 years and 174 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.