unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22091: [PATCH 1/2] * lisp/env.el: Add (whereis-command)
@ 2015-12-04  6:25 lu4nx
  2015-12-04  6:25 ` bug#22091: [PATCH 2/2] * lisp/net/net-utils.el: (ifconfig) function support `ip` command lu4nx
  2015-12-04  8:03 ` bug#22091: [PATCH 1/2] * lisp/env.el: Add (whereis-command) Glenn Morris
  0 siblings, 2 replies; 5+ messages in thread
From: lu4nx @ 2015-12-04  6:25 UTC (permalink / raw)
  To: 22091; +Cc: lu4nx

---
 lisp/env.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lisp/env.el b/lisp/env.el
index 3966ab1..a16f534 100644
--- a/lisp/env.el
+++ b/lisp/env.el
@@ -218,6 +218,13 @@ in the environment list of the selected frame."
       (message "%s" (if value value "Not set")))
     value))
 
+(defun whereis-command (command)
+  (let ((paths (split-string (getenv "PATH") ":")))
+    (remove-if-not
+     (lambda (path)
+       (file-exists-p (format "%s/%s" path command)))
+     paths)))
+
 (provide 'env)
 
 ;;; env.el ends here
-- 
2.5.0








^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-12-05  0:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-04  6:25 bug#22091: [PATCH 1/2] * lisp/env.el: Add (whereis-command) lu4nx
2015-12-04  6:25 ` bug#22091: [PATCH 2/2] * lisp/net/net-utils.el: (ifconfig) function support `ip` command lu4nx
2015-12-04  8:03 ` bug#22091: [PATCH 1/2] * lisp/env.el: Add (whereis-command) Glenn Morris
2015-12-04  8:17   ` bug#22091: �ظ���bug#22091: " lux
2015-12-05  0:53     ` bug#22091: " Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).