[Cmake-commits] CMake branch, next, updated. v2.8.12.2-7711-g2c5ceb3

Brad King brad.king at kitware.com
Thu Feb 13 09:41:09 EST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  2c5ceb3efebaeb3573a176e25481c9823c94991b (commit)
       via  9d35f7c49a30da474153d8690ba03ce6e8548647 (commit)
       via  7cc21e9ab82883d37e845203f89255a90747489e (commit)
       via  c56854aa0e9ba08140fcf806008ea473b879a1c1 (commit)
      from  6bfa75bcf843e512a18a28063fa8a6edd1633572 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2c5ceb3efebaeb3573a176e25481c9823c94991b
commit 2c5ceb3efebaeb3573a176e25481c9823c94991b
Merge: 6bfa75b 9d35f7c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Feb 13 09:41:08 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Feb 13 09:41:08 2014 -0500

    Merge topic 'emacs-mode-cmake-help' into next
    
    9d35f7c4 cmake-mode.el: Add help for variables/properties/complete. Factorize.
    7cc21e9a cmake-mode.el: Add the ability to retrieve module help.
    c56854aa CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9d35f7c49a30da474153d8690ba03ce6e8548647
commit 9d35f7c49a30da474153d8690ba03ce6e8548647
Author:     Philipp Möller <bootsarehax at googlemail.com>
AuthorDate: Wed Jan 29 17:48:21 2014 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Feb 13 09:38:13 2014 -0500

    cmake-mode.el: Add help for variables/properties/complete. Factorize.

diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el
index 023d98e..c8b9f8b 100644
--- a/Auxiliary/cmake-mode.el
+++ b/Auxiliary/cmake-mode.el
@@ -291,31 +291,47 @@ optional argument topic will be appended to the argument list."
   (cmake-command-run "--help-command-list")
   )
 
-(defvar cmake-help-command-history nil "Topic read history.")
-(defvar cmake-help-commands '() "List of available topics for --help-command.")
-(defun cmake-command-list-as-list ()
-  "Run cmake --help-command-list and return a list where each element is a cmake command."
-  (let ((temp-buffer-name "*CMake Commands Temporary*"))
-    (save-window-excursion
-      (cmake-command-run "--help-command-list" nil temp-buffer-name)
-      (with-current-buffer temp-buffer-name
-        (cdr (split-string (buffer-substring-no-properties (point-min) (point-max)) "\n" t)))))
+(defvar cmake-commands '() "List of available topics for --help-command.")
+(defvar cmake-help-command-history nil "Command read history.")
+(defvar cmake-modules '() "List of available topics for --help-module.")
+(defvar cmake-help-module-history nil "Module read history.")
+(defvar cmake-variables '() "List of available topics for --help-variable.")
+(defvar cmake-help-variable-history nil "Variable read history.")
+(defvar cmake-properties '() "List of available topics for --help-property.")
+(defvar cmake-help-property-history nil "Property read history.")
+(defvar cmake-help-complete-history nil "Complete help read history.")
+(defvar cmake-string-to-list-symbol
+  '(("command" cmake-commands cmake-help-command-history)
+    ("module" cmake-modules cmake-help-module-history)
+    ("variable"  cmake-variables cmake-help-variable-history)
+    ("property" cmake-properties cmake-help-property-history)
+    ))
+
+(defun cmake-get-list (listname)
+  "If the value of LISTVAR is nil, run cmake --help-LISTNAME-list
+and store the result as a list in LISTVAR."
+  (let ((listvar (car (cdr (assoc listname cmake-string-to-list-symbol)))))
+    (if (not (symbol-value listvar))
+        (let ((temp-buffer-name "*CMake Temporary*"))
+          (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))))))
+      (symbol-value listvar)
+      ))
   )
 
 (require 'thingatpt)
-;;;###autoload
-(defun cmake-get-command ()
-  "Gets the topic from the minibuffer input.  The default is the word the cursor is on."
+(defun cmake-help-type (type)
   (let* ((default-entry (word-at-point))
+         (history (car (cdr (cdr (assoc type cmake-string-to-list-symbol)))))
          (input (completing-read
-                 "CMake command: " ; prompt
-                 ((lambda ()
-                    (if cmake-help-commands cmake-help-commands
-                      (setq cmake-help-commands (cmake-command-list-as-list))))) ; completions
+                 (format "CMake %s: " type) ; prompt
+                 (cmake-get-list type) ; completions
                  nil ; predicate
                  t   ; require-match
                  default-entry ; initial-input
-                 'cmake-help-command-history ; command history
+                 history
                  )))
     (if (string= input "")
         (error "No argument given")
@@ -324,41 +340,59 @@ optional argument topic will be appended to the argument list."
 
 ;;;###autoload
 (defun cmake-help-command ()
-  "Prints out the help message corresponding to the command the cursor is on."
+  "Prints out the help message for the command the cursor is on."
   (interactive)
-  (cmake-command-run "--help-command" (downcase (cmake-get-command)) "*CMake Help*"))
+  (cmake-command-run "--help-command" (cmake-help-type "command") "*CMake Help*"))
 
-(defvar cmake-help-module-history nil "Module read history.")
-(defvar cmake-help-modules '() "List of available topics for --help-module.")
-
-(defun cmake-module-list ()
-  (let ((temp-buffer-name "*CMake Modules Temporary*"))
-    (save-window-excursion
-      (cmake-command-run "--help-module-list" nil temp-buffer-name)
-      (with-current-buffer temp-buffer-name
-        (cdr (split-string (buffer-substring-no-properties (point-min) (point-max)) "\n" t)))))
-  )
+;;;###autoload
+(defun cmake-help-module ()
+  "Prints out the help message for the module the cursor is on."
+  (interactive)
+  (cmake-command-run "--help-module" (cmake-help-type "module") "*CMake Help*"))
 
-(defun cmake-get-module ()
-  (let ((input (completing-read
-                "CMake module: " ; prompt
-                ((lambda ()
-                   (if cmake-help-modules cmake-help-modules
-                     (setq cmake-help-modules (cmake-module-list))))) ; completions
-                nil ; predicate
-                t   ; require-match
-                nil ; initial-input
-                'cmake-help-module-history ; module history
-                )))
-    (if (string= input "")
-        (error "No argument given")
-      input)
-    ))
+;;;###autoload
+(defun cmake-help-variable ()
+  "Prints out the help message for the variable the cursor is on."
+  (interactive)
+  (cmake-command-run "--help-variable" (cmake-help-type "variable") "*CMake Help*"))
 
-(defun cmake-help-module ()
-  "Prints out the help message corresponding to the given module."
+;;;###autoload
+(defun cmake-help-property ()
+  "Prints out the help message for the property the cursor is on."
   (interactive)
-  (cmake-command-run "--help-module" (cmake-get-module) "*CMake Module Help*"))
+  (cmake-command-run "--help-property" (cmake-help-type "property") "*CMake Help*"))
+
+;;;###autoload
+(defun cmake-help ()
+  "Queries for any of the four available help topics and prints out the approriate page."
+  (interactive)
+  (let* ((default-entry (word-at-point))
+         (command-list (cmake-get-list "command"))
+         (variable-list (cmake-get-list "variable"))
+         (module-list (cmake-get-list "module"))
+         (property-list (cmake-get-list "property"))
+         (all-words (append command-list variable-list module-list property-list))
+         (input (completing-read
+                 "CMake command/module/variable/property: " ; prompt
+                 all-words ; completions
+                 nil ; predicate
+                 t   ; require-match
+                 default-entry ; initial-input
+                 'cmake-help-complete-history
+                 )))
+    (if (string= input "")
+        (error "No argument given")
+      (if (member input command-list)
+          (cmake-command-run "--help-command" input "*CMake Help*")
+        (if (member input variable-list)
+            (cmake-command-run "--help-variable" input "*CMake Help*")
+          (if (member input module-list)
+              (cmake-command-run "--help-module" input "*CMake Help*")
+            (if (member input property-list)
+                (cmake-command-run "--help-property" input "*CMake Help*")
+              (error "Not a know help topic.") ; this really should not happen
+              ))))))
+  )
 
 ;;;###autoload
 (progn

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7cc21e9ab82883d37e845203f89255a90747489e
commit 7cc21e9ab82883d37e845203f89255a90747489e
Author:     Philipp Möller <bootsarehax at googlemail.com>
AuthorDate: Wed Jan 29 16:25:01 2014 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Feb 13 09:35:30 2014 -0500

    cmake-mode.el: Add the ability to retrieve module help.

diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el
index 433710b..023d98e 100644
--- a/Auxiliary/cmake-mode.el
+++ b/Auxiliary/cmake-mode.el
@@ -328,6 +328,37 @@ optional argument topic will be appended to the argument list."
   (interactive)
   (cmake-command-run "--help-command" (downcase (cmake-get-command)) "*CMake Help*"))
 
+(defvar cmake-help-module-history nil "Module read history.")
+(defvar cmake-help-modules '() "List of available topics for --help-module.")
+
+(defun cmake-module-list ()
+  (let ((temp-buffer-name "*CMake Modules Temporary*"))
+    (save-window-excursion
+      (cmake-command-run "--help-module-list" nil temp-buffer-name)
+      (with-current-buffer temp-buffer-name
+        (cdr (split-string (buffer-substring-no-properties (point-min) (point-max)) "\n" t)))))
+  )
+
+(defun cmake-get-module ()
+  (let ((input (completing-read
+                "CMake module: " ; prompt
+                ((lambda ()
+                   (if cmake-help-modules cmake-help-modules
+                     (setq cmake-help-modules (cmake-module-list))))) ; completions
+                nil ; predicate
+                t   ; require-match
+                nil ; initial-input
+                'cmake-help-module-history ; module history
+                )))
+    (if (string= input "")
+        (error "No argument given")
+      input)
+    ))
+
+(defun cmake-help-module ()
+  "Prints out the help message corresponding to the given module."
+  (interactive)
+  (cmake-command-run "--help-module" (cmake-get-module) "*CMake Module Help*"))
 
 ;;;###autoload
 (progn

-----------------------------------------------------------------------

Summary of changes:
 Auxiliary/cmake-mode.el   |  103 ++++++++++++++++++++++++++++++++++++---------
 Source/CMakeVersion.cmake |    2 +-
 2 files changed, 85 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list