Changeset - 928d509157ec
[Not reviewed]
1.2.0 master
0 1 0
Yuriy Pitomets - 10 years ago 2014-11-02 20:22:33
pitometsu@gmail.com
Use ido only when ido-mode enabled.
1 file changed with 16 insertions and 8 deletions:
0 comments (0 inline, 0 general) First comment
src/workgroups2.el
Show inline comments
 
@@ -2439,9 +2439,9 @@ If you want, restore them manually and try again."
 
  (let ((workgroup (wg-current-workgroup)))
 
    (wg-restore-wconfig-undoably
 
     (wg-workgroup-get-saved-wconfig
 
      (ido-completing-read "Saved wconfig: "
 
                           (mapcar 'wg-wconfig-name (wg-workgroup-saved-wconfigs workgroup))
 
                           nil t)
 
      (wg-completing-read "Saved wconfig: "
 
                          (mapcar 'wg-wconfig-name (wg-workgroup-saved-wconfigs workgroup))
 
                          nil t)
 
      workgroup))))
 

	
 
(defun wg-kill-saved-wconfig ()
 
@@ -3049,6 +3049,14 @@ If BUF's file doesn't exist, call `wg-restore-default-buffer'"
 

	
 
;;; buffer object utils
 

	
 
(defun wg-completing-read (prompt choices &optional pred require-match initial-input history default)
 
  "Do a completing read.  Use `ido-mode` if enabled."
 
  (if ido-mode
 
      (ido-completing-read prompt choices pred require-match
 
                           initial-input history default)
 
    (completing-read prompt choices pred require-match
 
                     initial-input history default)))
 

	
 
(defun wg-buffer-uid (buffer-or-name)
 
  "Return BUFFER-OR-NAME's buffer-local value of `wg-buffer-uid'."
 
  (buffer-local-value 'wg-buffer-uid (wg-get-buffer buffer-or-name)))
 
@@ -3468,8 +3476,8 @@ Or scream unless NOERROR."
 
(defun wg-read-workgroup-name (&optional require-match)
 
  "Read a workgroup name from `wg-workgroup-names'.
 
REQUIRE-MATCH to match."
 
  (ido-completing-read "Workgroup: " (wg-workgroup-names) nil require-match nil nil
 
                       (awhen (wg-current-workgroup t) (wg-workgroup-name it))))
 
  (wg-completing-read "Workgroup: " (wg-workgroup-names) nil require-match nil nil
 
                      (awhen (wg-current-workgroup t) (wg-workgroup-name it))))
 

	
 
(defun wg-new-default-workgroup-name ()
 
  "Return a new, unique, default workgroup name."
 
@@ -3488,9 +3496,9 @@ REQUIRE-MATCH to match."
 
(defun wg-read-saved-wconfig-name (workgroup &optional prompt require-match)
 
  "Read the name of a saved wconfig, completing on the names of
 
WORKGROUP's saved wconfigs."
 
  (ido-completing-read (or prompt "Saved wconfig name: ")
 
                       (wg-workgroup-saved-wconfig-names workgroup)
 
                       nil require-match))
 
  (wg-completing-read (or prompt "Saved wconfig name: ")
 
                      (wg-workgroup-saved-wconfig-names workgroup)
 
                      nil require-match))
 

	
 
(defun wg-read-saved-wconfig (workgroup)
 
  "Read the name of and return one of WORKGROUP's saved wconfigs."
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now