summaryrefslogtreecommitdiff
path: root/emenu.el
diff options
context:
space:
mode:
Diffstat (limited to 'emenu.el')
-rw-r--r--emenu.el28
1 files changed, 25 insertions, 3 deletions
diff --git a/emenu.el b/emenu.el
index 6293cf0..85a4bb7 100644
--- a/emenu.el
+++ b/emenu.el
@@ -1,8 +1,30 @@
+;; emenu.el --- An emacs dmenu clone -*- lexical-binding t -*-
+
+;; Copyright © 2022 Erik Oosting
+
+;; Author: Erik Oosting <crazazy@tilde.cafe>
+;; Keywords: application-launcher, misc
+;; URL: https://crazazy.tilde.cafe/emenu.git/log.html
+
+;;; License:
+;; This file comes with the MIT license, and without any warranty whatsoever
+;; You can do with this stuff whatever you want to, but just remember
+;; to put me in the footnote :D. Would be nice at least
+
+;;; Commentary:
+;; This is basically what dmenu does, but then in emacs. There is a function 'all-commands'
+;; that gets you all the commands that are on your system. If you instead want to use emenu
+;; on a different list of strings, you can just pass that list to emenu itself and it will
+;; let you select something yourself
+
(require 'cl-seq)
(require 'ido)
-(defun all-commands ()
- "does a completing read of all the programs accessible to you in $PATH"
+(defun emenu--all-commands ()
+ "returns a list of all the programs accessible to you in $PATH"
+ ;; This ls-output part was mostly created by phundrak because he found my shell-piping implementation
+ ;; inelegant. If something has to change about this chances are this is going to return to shell
+ ;; scripting again
(let ((ls-output (mapcan (lambda (path)
(when (file-readable-p path)
(cl-remove-if (lambda (file)
@@ -26,7 +48,7 @@
(call-process
(ido-completing-read "Command: " (or
command-list
- (all-commands)))
+ (emenu--all-commands)))
nil
0)
(keyboard-quit))