diff options
author | Case Duckworth | 2022-01-18 18:16:32 -0600 |
---|---|---|
committer | Case Duckworth | 2022-01-18 18:16:32 -0600 |
commit | 81c6f178545fcb3e581dd249de1ef22521f7c376 (patch) | |
tree | 07581afc1e9bffb6a547981afb21a1bd9ee17f5b /lisp/acdw.el | |
parent | Ahh (diff) | |
parent | Um (diff) | |
download | emacs-81c6f178545fcb3e581dd249de1ef22521f7c376.tar.gz emacs-81c6f178545fcb3e581dd249de1ef22521f7c376.zip |
Hm.
Diffstat (limited to 'lisp/acdw.el')
-rw-r--r-- | lisp/acdw.el | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index 28ea108..34d1bc4 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el | |||
@@ -248,5 +248,29 @@ With optional ARG (\\[universal-argument]), just split." | |||
248 | (interactive "P") | 248 | (interactive "P") |
249 | (+split-window-then :below arg)) | 249 | (+split-window-then :below arg)) |
250 | 250 | ||
251 | (defun +bytes (number unit) | ||
252 | "Convert NUMBER UNITs to bytes. | ||
253 | UNIT can be one of :kb, :mb, :gb, :tb, :pb, :eb, :zb, :yb; :kib, :mib, :gib, | ||
254 | :tib, :pib, :eib, :zib, :yib." | ||
255 | (* number (pcase unit | ||
256 | ;; Base 10 units | ||
257 | (:kb 1000) | ||
258 | (:mb (* 1000 1000)) | ||
259 | (:gb (* 1000 1000 1000)) | ||
260 | (:tb (* 1000 1000 1000 1000)) | ||
261 | (:pb (* 1000 1000 1000 1000 1000)) | ||
262 | (:eb (* 1000 1000 1000 1000 1000 1000)) | ||
263 | (:zb (* 1000 1000 1000 1000 1000 1000 1000)) | ||
264 | (:yb (* 1000 1000 1000 1000 1000 1000 1000 1000)) | ||
265 | ;; Base 2 units | ||
266 | (:kib 1024) | ||
267 | (:mib (* 1024 1024)) | ||
268 | (:gib (* 1024 1024 1024)) | ||
269 | (:tib (* 1024 1024 1024 1024)) | ||
270 | (:pib (* 1024 1024 1024 1024 1024)) | ||
271 | (:eib (* 1024 1024 1024 1024 1024 1024)) | ||
272 | (:zib (* 1024 1024 1024 1024 1024 1024 1024)) | ||
273 | (:yib (* 1024 1024 1024 1024 1024 1024 1024 1024))))) | ||
274 | |||
251 | (provide 'acdw) | 275 | (provide 'acdw) |
252 | ;;; acdw.el ends here | 276 | ;;; acdw.el ends here |