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:
Howard Abrams 2022-05-13 09:47:31 -07:00
parent db2d27b66c
commit 14cb05e0fa

View file

@ -68,15 +68,15 @@ I love packages that add functionality but I dont have to learn anything. How
(ignore-errors
(let* ((default-directory (projectile-project-root))
(command (format "rg --json '\\(def[^ ]+ %s ' *.org" str))
(results (->> command
(results (thread-last command
shell-command-to-list
second
json-parse-string))
(file (->> results
(file (thread-last results
(gethash "data")
(gethash "path")
(gethash "text")))
(line (->> results
(line (thread-last results
(gethash "data")
(gethash "line_number"))))
(find-file file)