(fix): org-roam--list-files strip ANSI color codes (#689)

Prevent shell commands from passing ANSI color codes through to callers.

see: #688
This commit is contained in:
N V
2020-05-22 23:51:52 -04:00
committed by GitHub
parent 4f5a82e291
commit 214f9df844

View File

@ -38,6 +38,7 @@
(require 'org-element)
(require 'ob-core) ;for org-babel-parse-header-arguments
(require 'org-ref nil t) ; To detect cite: links
(require 'ansi-color) ; org-roam--list-files strip ANSI color codes
(require 'cl-lib)
(require 'dash)
(require 'f)
@ -353,7 +354,8 @@ Use external shell commands if defined in `org-roam-list-files-commands'."
(if path
(let ((fn (intern (concat "org-roam--list-files-" exe))))
(unless (fboundp fn) (user-error "%s is not an implemented search method" fn))
(funcall fn path (format "\"%s\"" dir)))
(mapcar #'ansi-color-filter-apply
(funcall fn path (format "\"%s\"" dir))))
(org-roam--list-files-elisp dir))))
(defun org-roam--list-all-files ()