about summary refs log tree commit diff stats
path: root/lisp/acdw.el
diff options
context:
space:
mode:
authorCase Duckworth2022-01-18 17:18:06 -0600
committerCase Duckworth2022-01-18 17:18:06 -0600
commitefc08126f7119569112b336f0cd73eefdf9737b5 (patch)
tree5356cbf6626cb72f7f0c69dbbf4fa35ee6955fc6 /lisp/acdw.el
parentModify org-file-apps after loading org (diff)
downloademacs-efc08126f7119569112b336f0cd73eefdf9737b5.tar.gz
emacs-efc08126f7119569112b336f0cd73eefdf9737b5.zip
Um
Diffstat (limited to 'lisp/acdw.el')
-rw-r--r--lisp/acdw.el24
1 files changed, 24 insertions, 0 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index 17741ab..a96e6a7 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.
253UNIT 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