From 214f9df8449df631089c1107fef163037224514c Mon Sep 17 00:00:00 2001 From: N V <44036031+progfolio@users.noreply.github.com> Date: Fri, 22 May 2020 23:51:52 -0400 Subject: [PATCH] (fix): org-roam--list-files strip ANSI color codes (#689) Prevent shell commands from passing ANSI color codes through to callers. see: #688 --- org-roam.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org-roam.el b/org-roam.el index 8042b98..f4e70cb 100644 --- a/org-roam.el +++ b/org-roam.el @@ -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 ()