From 9dc384f6627fed111b53d5f9a05af1a86db9ae54 Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Tue, 15 Mar 2016 09:39:58 -0400 Subject: [PATCH] cmake-mode.el: Fix help completion item lists with CMake >= 3.0 (#16019) We run `cmake --help-*-list` to get a list of items for completion. Since CMake < 3.0 always printed "cmake version ..." on the first line of the output we have previously ignored the first line. However, CMake 3.0 and above do not print the version line so we should not ignore the first line or we miss one item. Ideally we should filter the first line out if it is "cmake version ..." in order to support CMake < 3.0 cleanly, but at worst the version line will show up as a completion option so simply including the first line is good enough for now. --- Auxiliary/cmake-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el index 08ac4905e..d74dba020 100644 --- a/Auxiliary/cmake-mode.el +++ b/Auxiliary/cmake-mode.el @@ -304,7 +304,8 @@ and store the result as a list in LISTVAR." (save-window-excursion (cmake-command-run (concat "--help-" listname "-list") nil temp-buffer-name) (with-current-buffer temp-buffer-name - (set listvar (cdr (split-string (buffer-substring-no-properties (point-min) (point-max)) "\n" t)))))) + ; FIXME: Ignore first line if it is "cmake version ..." from CMake < 3.0. + (set listvar (split-string (buffer-substring-no-properties (point-min) (point-max)) "\n" t))))) (symbol-value listvar) )) )