Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agumonkey/5775585 to your computer and use it in GitHub Desktop.
Save agumonkey/5775585 to your computer and use it in GitHub Desktop.
(defun filter-char (f) (car f))
(defun filter-fn (f) (cdr f))
(mapcar (lambda (f) (cons (char-to-string (filter-char f)) (filter-fn f))) eshell-modifier-alist)
;; ->
;; (("E" function (lambda (lst) (mapcar (function (lambda (str) (eshell-stringify (car (eshell-parse-argument str))))) lst)))
;; ("L" function (lambda (lst) (mapcar (quote downcase) lst)))
;; ("U" function (lambda (lst) (mapcar (quote upcase) lst)))
;; ("C" function (lambda (lst) (mapcar (quote capitalize) lst)))
;; ("h" function (lambda (lst) (mapcar (quote file-name-directory) lst)))
;; ("i" eshell-include-members)
;; ("x" eshell-include-members t)
;; ("r" function (lambda (lst) (mapcar (quote file-name-sans-extension) lst)))
;; ("e" function (lambda (lst) (mapcar (quote file-name-extension) lst)))
;; ("t" function (lambda (lst) (mapcar (quote file-name-nondirectory) lst)))
;; ("q" function (lambda (lst) (mapcar (quote eshell-escape-arg) lst)))
;; ("u" function (lambda (lst) (eshell-uniqify-list lst)))
;; ("o" function (lambda (lst) (sort lst (quote string-lessp))))
;; ("O" function (lambda (lst) (nreverse (sort lst (quote string-lessp)))))
;; ("j" eshell-join-members)
;; ("S" eshell-split-members)
;; ("R" quote reverse)
;; ("g" progn (forward-char) (if (eq (char-before) 115) (eshell-pred-substitute t) (error "`g' modifier cannot be used alone")))
;; ("s" eshell-pred-substitute))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment