From 4b019984497913a770cf9d29f56f64e8bb5e0673 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 17 Apr 2016 18:27:15 -0400 Subject: Filter out anonymous rules from rule lists --- snakemake.el | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'snakemake.el') diff --git a/snakemake.el b/snakemake.el index cc6bc3f..fa200bd 100644 --- a/snakemake.el +++ b/snakemake.el @@ -211,21 +211,25 @@ with DIRECTORY and the Snakefile's modification time." (defun snakemake-all-rules (&optional directory) "Return list of rules for DIRECTORY's Snakefile." (snakemake-with-cache directory ("all-rules") - (split-string - (with-temp-buffer - (if (= 0 (snakemake-insert-output "--nocolor" "--list")) - (buffer-string) - (error "Error finding rules")))))) + (cl-remove-if + (lambda (x) (string-match-p "\\`[0-9]+\\'" x)) + (split-string + (with-temp-buffer + (if (= 0 (snakemake-insert-output "--nocolor" "--list")) + (buffer-string) + (error "Error finding rules"))))))) (defun snakemake-rule-targets (&optional directory) "Return list of target rules for DIRECTORY's Snakefile." (snakemake-with-cache directory ("target-rules") - (split-string - (with-temp-buffer - (if (= 0 (snakemake-insert-output - "--nocolor" "--list-target-rules")) - (buffer-string) - (error "Error finding rule targets")))))) + (cl-remove-if + (lambda (x) (string-match-p "\\`[0-9]+\\'" x)) + (split-string + (with-temp-buffer + (if (= 0 (snakemake-insert-output + "--nocolor" "--list-target-rules")) + (buffer-string) + (error "Error finding rule targets"))))))) (defun snakemake-file-targets (&optional directory) "Return list of output files for DIRECTORY's Snakefile. -- cgit v1.2.3