Convert to use thread-last
While the ->> is nice, perhaps defaulting to emacs-builtin functions is a better idea in general. Besides, it is clearer.
This commit is contained in:
parent
db2d27b66c
commit
14cb05e0fa
1 changed files with 3 additions and 3 deletions
|
@ -68,15 +68,15 @@ I love packages that add functionality but I don’t have to learn anything. How
|
||||||
(ignore-errors
|
(ignore-errors
|
||||||
(let* ((default-directory (projectile-project-root))
|
(let* ((default-directory (projectile-project-root))
|
||||||
(command (format "rg --json '\\(def[^ ]+ %s ' *.org" str))
|
(command (format "rg --json '\\(def[^ ]+ %s ' *.org" str))
|
||||||
(results (->> command
|
(results (thread-last command
|
||||||
shell-command-to-list
|
shell-command-to-list
|
||||||
second
|
second
|
||||||
json-parse-string))
|
json-parse-string))
|
||||||
(file (->> results
|
(file (thread-last results
|
||||||
(gethash "data")
|
(gethash "data")
|
||||||
(gethash "path")
|
(gethash "path")
|
||||||
(gethash "text")))
|
(gethash "text")))
|
||||||
(line (->> results
|
(line (thread-last results
|
||||||
(gethash "data")
|
(gethash "data")
|
||||||
(gethash "line_number"))))
|
(gethash "line_number"))))
|
||||||
(find-file file)
|
(find-file file)
|
||||||
|
|
Loading…
Reference in a new issue