[Cmake-commits] CMake branch, next, updated. v2.8.12.2-7340-g8030c07

Brad King brad.king at kitware.com
Wed Jan 29 10:23:33 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  8030c076ca17f32857e47359316b29902169ff1b (commit)
       via  3af47e34b6c4427a7a781806600892d081bf9b1e (commit)
       via  2a1314150e8fa2b7e8354e4ecffccf3439ab2d28 (commit)
      from  a3d4bcde637c5974d292e147edb279a45b4a78b7 (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=8030c076ca17f32857e47359316b29902169ff1b
commit 8030c076ca17f32857e47359316b29902169ff1b
Merge: a3d4bcd 3af47e3
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 29 10:23:32 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jan 29 10:23:32 2014 -0500

    Merge topic 'emacs-mode-enhance' into next
    
    3af47e34 cmake-mode.el: Add auto-completion to cmake-help-command
    2a131415 cmake-mode.el: Clean up cmake-command-run and add buffername argument


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3af47e34b6c4427a7a781806600892d081bf9b1e
commit 3af47e34b6c4427a7a781806600892d081bf9b1e
Author:     Philipp Möller <bootsarehax at googlemail.com>
AuthorDate: Wed Jan 29 15:19:06 2014 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 29 10:23:25 2014 -0500

    cmake-mode.el: Add auto-completion to cmake-help-command

diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el
index 2304615..433710b 100644
--- a/Auxiliary/cmake-mode.el
+++ b/Auxiliary/cmake-mode.el
@@ -281,7 +281,6 @@ optional argument topic will be appended to the argument list."
       (select-window (display-buffer buffer 'not-this-window))
       (cmake-mode)
       (toggle-read-only t))
-    (setq resize-mini-windows resize-mini-windows-save)
     )
   )
 
@@ -293,18 +292,30 @@ optional argument topic will be appended to the argument 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)))))
+  )
 
 (require 'thingatpt)
 ;;;###autoload
-(defun cmake-get-topic (type)
+(defun cmake-get-command ()
   "Gets the topic from the minibuffer input.  The default is the word the cursor is on."
-  (interactive)
   (let* ((default-entry (word-at-point))
-         (input (read-string
-                 (format "CMake %s (default %s): " type default-entry) ; prompt
-                 nil ; initial input
+         (input (completing-read
+                 "CMake command: " ; prompt
+                 ((lambda ()
+                    (if cmake-help-commands cmake-help-commands
+                      (setq cmake-help-commands (cmake-command-list-as-list))))) ; completions
+                 nil ; predicate
+                 t   ; require-match
+                 default-entry ; initial-input
                  'cmake-help-command-history ; command history
-                 default-entry ; default-value
                  )))
     (if (string= input "")
         (error "No argument given")
@@ -315,7 +326,7 @@ optional argument topic will be appended to the argument list."
 (defun cmake-help-command ()
   "Prints out the help message corresponding to the command the cursor is on."
   (interactive)
-  (cmake-command-run "--help-command" (downcase (cmake-get-topic "command")) "*CMake Help*"))
+  (cmake-command-run "--help-command" (downcase (cmake-get-command)) "*CMake Help*"))
 
 
 ;;;###autoload

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2a1314150e8fa2b7e8354e4ecffccf3439ab2d28
commit 2a1314150e8fa2b7e8354e4ecffccf3439ab2d28
Author:     Philipp Möller <bootsarehax at googlemail.com>
AuthorDate: Tue Jan 28 22:57:49 2014 +0100
Commit:     Philipp Möller <bootsarehax at googlemail.com>
CommitDate: Wed Jan 29 16:11:40 2014 +0100

    cmake-mode.el: Clean up cmake-command-run and add buffername argument

diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el
index 119168d..2304615 100644
--- a/Auxiliary/cmake-mode.el
+++ b/Auxiliary/cmake-mode.el
@@ -266,38 +266,22 @@ the indentation.  Otherwise it retains the same position on the line"
 
 
 ;;;###autoload
-(defun cmake-command-run (type &optional topic)
+(defun cmake-command-run (type &optional topic buffer)
   "Runs the command cmake with the arguments specified.  The
 optional argument topic will be appended to the argument list."
   (interactive "s")
-  (let* ((bufname (concat "*CMake" type (if topic "-") topic "*"))
-         (buffer  (get-buffer bufname))
+  (let* ((bufname (if buffer buffer (concat "*CMake" type (if topic "-") topic "*")))
+         (buffer  (if (get-buffer bufname) (get-buffer bufname) (generate-new-buffer bufname)))
+         (command (concat cmake-mode-cmake-executable " " type " " topic))
+         ;; Turn of resizing of mini-windows for shell-command.
+         (resize-mini-windows nil)
          )
-    (if buffer
-        (display-buffer buffer 'not-this-window)
-      ;; Buffer doesn't exist.  Create it and fill it
-      (let ((buffer (generate-new-buffer bufname))
-            (command (concat cmake-mode-cmake-executable " " type " " topic))
-            )
-        (message "Running %s" command)
-        ;; We don't want the contents of the shell-command running to the
-        ;; minibuffer, so turn it off.  A value of nil means don't automatically
-        ;; resize mini-windows.
-        (setq resize-mini-windows-save resize-mini-windows)
-        (setq resize-mini-windows nil)
-        (shell-command command buffer)
-        ;; Save the original window, so that we can come back to it later.
-        ;; save-excursion doesn't seem to work for this.
-        (setq window (selected-window))
-        ;; We need to select it so that we can apply special modes to it
-        (select-window (display-buffer buffer 'not-this-window))
-        (cmake-mode)
-        (toggle-read-only t)
-        ;; Restore the original window
-        (select-window window)
-        (setq resize-mini-windows resize-mini-windows-save)
-        )
-      )
+    (shell-command command buffer)
+    (save-selected-window
+      (select-window (display-buffer buffer 'not-this-window))
+      (cmake-mode)
+      (toggle-read-only t))
+    (setq resize-mini-windows resize-mini-windows-save)
     )
   )
 
@@ -327,12 +311,11 @@ optional argument topic will be appended to the argument list."
       input))
   )
 
-
 ;;;###autoload
 (defun cmake-help-command ()
   "Prints out the help message corresponding to the command the cursor is on."
   (interactive)
-  (cmake-command-run "--help-command" (downcase (cmake-get-topic "command"))))
+  (cmake-command-run "--help-command" (downcase (cmake-get-topic "command")) "*CMake Help*"))
 
 
 ;;;###autoload

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

Summary of changes:
 Auxiliary/cmake-mode.el |   66 +++++++++++++++++++++--------------------------
 1 file changed, 30 insertions(+), 36 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list