Skip to content

Commit

Permalink
Don't display icons in list-processes and list-environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
seagle0128 committed Sep 22, 2023
1 parent b72d173 commit ccda702
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
13 changes: 1 addition & 12 deletions lisp/init-base.el
Original file line number Diff line number Diff line change
Expand Up @@ -161,23 +161,12 @@

;; Prettify the process list
(with-no-warnings
(add-hook 'process-menu-mode-hook
(lambda ()
(setq tabulated-list-format
(vconcat `(("" ,(if (icons-displayable-p) 2 0)))
tabulated-list-format))))

(defun my-list-processes--prettify ()
"Prettify process list."
(when-let ((entries tabulated-list-entries))
(setq tabulated-list-entries nil)
(dolist (p (process-list))
(when-let* ((val (cadr (assoc p entries)))
(icon (if (icons-displayable-p)
(concat
" "
(nerd-icons-faicon "nf-fa-bolt" :face 'nerd-icons-lblue))
" x"))
(name (aref val 0))
(pid (aref val 1))
(status (aref val 2))
Expand All @@ -190,7 +179,7 @@
(tty (list (aref val 4) 'face 'font-lock-doc-face))
(thread (list (aref val 5) 'face 'font-lock-doc-face))
(cmd (list (aref val 6) 'face 'completions-annotations)))
(push (list p (vector icon name pid status buf-label tty thread cmd))
(push (list p (vector name pid status buf-label tty thread cmd))
tabulated-list-entries)))))
(advice-add #'list-processes--refresh :after #'my-list-processes--prettify)))

Expand Down
8 changes: 0 additions & 8 deletions lisp/init-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,6 @@
(use-package memory-usage)

(use-package list-environment
:hook (list-environment-mode . (lambda ()
(setq tabulated-list-format
(vconcat `(("" ,(if (icons-displayable-p) 1 0)))
tabulated-list-format))
(tabulated-list-init-header)))
:init
(with-no-warnings
(defun my-list-environment-entries ()
Expand All @@ -276,9 +271,6 @@
(key (car kv))
(val (mapconcat #'identity (cdr kv) "=")))
(list key (vector
(if (icons-displayable-p)
(nerd-icons-octicon "nf-oct-key" :height 0.8 :v-adjust 0.1)
"")
`(,key face font-lock-keyword-face)
`(,val face font-lock-string-face)))))
process-environment))
Expand Down

0 comments on commit ccda702

Please sign in to comment.