Function: trashed-get-trash-size-sentinel

trashed-get-trash-size-sentinel is a natively compiled function defined in trashed.el.

Signature

(trashed-get-trash-size-sentinel PROCESS EVENT)

Documentation

Get total Trash Can size and display it in buffer name when du completed.

PROCESS is the process which ran du command started by trashed-get-trash-size. EVENT is ignored.

Source Code

;; Defined in /nix/store/7ppdacjhnynz276lxxnfw8sdz6r2k6h2-emacs-packages-deps/share/emacs/site-lisp/elpa/trashed-20230811.157/trashed.el
(defun trashed-get-trash-size-sentinel (process event)
  "Get total Trash Can size and display it in buffer name when du completed.
PROCESS is the process which ran du command started by `trashed-get-trash-size'.
EVENT is ignored."
  (let* ((pbuf (process-buffer process))
         (sizestr (with-current-buffer pbuf
                    (goto-char (point-min))
                    (if (and (string-match "finished" event)
                             (re-search-forward "[^	]+" nil t))
                        (match-string 0)))))
    (kill-buffer pbuf)
    (if (and sizestr (buffer-live-p trashed-buffer))
        (progn
          (setq trashed-trash-can-size (string-to-number sizestr))
          (with-current-buffer trashed-buffer
            (trashed-display-trash-can-size))))))