[Utils] Make ‘db-utils’ loadable without requiring ‘dash’
This commit is contained in:
parent
b17958c104
commit
378b608c2b
|
@ -8,8 +8,6 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(require 'dash)
|
|
||||||
|
|
||||||
|
|
||||||
;;; application shortcuts
|
;;; application shortcuts
|
||||||
|
|
||||||
|
@ -169,6 +167,7 @@ the result in the minibuffer."
|
||||||
(read-from-minibuffer "String (hex): "))))
|
(read-from-minibuffer "String (hex): "))))
|
||||||
(cl-assert (not (string-match-p "[^A-Fa-e0-9 \t\n]" hex-string))
|
(cl-assert (not (string-match-p "[^A-Fa-e0-9 \t\n]" hex-string))
|
||||||
"String contains invalid characters.")
|
"String contains invalid characters.")
|
||||||
|
(require 'dash)
|
||||||
(let ((result (->> hex-string
|
(let ((result (->> hex-string
|
||||||
(replace-regexp-in-string "[ \t\n]" "")
|
(replace-regexp-in-string "[ \t\n]" "")
|
||||||
(string-to-list)
|
(string-to-list)
|
||||||
|
@ -189,6 +188,7 @@ might depend on the coding system of the current buffer."
|
||||||
(interactive (list (if (use-region-p)
|
(interactive (list (if (use-region-p)
|
||||||
(buffer-substring-no-properties (region-beginning) (region-end))
|
(buffer-substring-no-properties (region-beginning) (region-end))
|
||||||
(read-from-minibuffer "String (ascii): "))))
|
(read-from-minibuffer "String (ascii): "))))
|
||||||
|
(require 'dash)
|
||||||
(let ((result (->> text-string
|
(let ((result (->> text-string
|
||||||
(--map (format "%2X " it))
|
(--map (format "%2X " it))
|
||||||
(apply #'concat)
|
(apply #'concat)
|
||||||
|
|
Loading…
Reference in New Issue