From 77d4a5f8cfed3462f697f0755275bbfd31a434ed Mon Sep 17 00:00:00 2001 From: Sun Ziping Date: Thu, 17 Mar 2022 02:13:11 +0800 Subject: [PATCH] fixed according to alamaison/emacs-cmake-project#17 --- cmake-project.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmake-project.el b/cmake-project.el index 6f6491c..248da18 100644 --- a/cmake-project.el +++ b/cmake-project.el @@ -178,14 +178,15 @@ prevent a fatal Flymake shutdown." (defun cmake-project--available-generators () (let ((help-text (shell-command-to-string "cmake --help")) (regexp (concat - "The following generators are available on this platform:\n" + "The following generators are available on this platform.*\n" "\\([^\\']*\\)\\'")) (out)) (string-match regexp help-text) (let ((gens-chunk (match-string 1 help-text))) (while (string-match - "\\s-+\\([^=\n]+?\\)\\s-*=[^\n]+?\n\\([^\\']*\\)\\'" gens-chunk) - (setq out (add-to-list 'out (match-string 1 gens-chunk) 1)) + "\\s-+\\([^=\n]+?\\)\\n?\\s-*=[^\n]+?\n\\([^\\']*\\)\\'" gens-chunk) + (if (not (string-match "\\s*" gens-chunk)) + (setq out (add-to-list 'out (match-string 1 gens-chunk) 1))) (setq gens-chunk (match-string 2 gens-chunk))) out)))