aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnmol Khirbat2012-03-22 00:41:01 +0800
committerChong Yidong2012-03-22 00:41:01 +0800
commit99fc91fecd99f7b298d1c812cecf9743b3f41b00 (patch)
tree75518881ed2c21e7318e69ff3cbc9d6f52e30c3b
parenta98a6a97d9fd7e9bfbfe503717795302623490b6 (diff)
downloademacs-99fc91fecd99f7b298d1c812cecf9743b3f41b00.tar.gz
emacs-99fc91fecd99f7b298d1c812cecf9743b3f41b00.zip
Handle nil value of ido-completion-buffer.
* lisp/ido.el (ido-set-current-directory, ido-read-internal) (ido-choose-completion-string, ido-completion-help): Handle nil value of ido-completion-buffer. Fixes: debbugs:11008
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/ido.el25
2 files changed, 21 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 50a9e61bf4c..1bde1a36d54 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12012-03-21 Anmol Khirbat <anmol@khirbat.net> (tiny change)
2
3 * ido.el (ido-set-current-directory, ido-read-internal)
4 (ido-choose-completion-string, ido-completion-help): Handle nil
5 value of ido-completion-buffer (Bug#11008).
6
12012-03-21 Sam Steingold <sds@gnu.org> 72012-03-21 Sam Steingold <sds@gnu.org>
2 8
3 * window.el (switch-to-prev-buffer): Do not switch to a visible 9 * window.el (switch-to-prev-buffer): Do not switch to a visible
diff --git a/lisp/ido.el b/lisp/ido.el
index 5813aff0f21..dcaa8f373ce 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1722,8 +1722,9 @@ This function also adds a hook to the minibuffer."
1722 (unless (and ido-enable-tramp-completion 1722 (unless (and ido-enable-tramp-completion
1723 (string-match "\\`/[^/]*@\\'" dir)) 1723 (string-match "\\`/[^/]*@\\'" dir))
1724 (setq dir (ido-final-slash dir t)))) 1724 (setq dir (ido-final-slash dir t))))
1725 (if (get-buffer ido-completion-buffer) 1725 (and ido-completion-buffer
1726 (kill-buffer ido-completion-buffer)) 1726 (get-buffer ido-completion-buffer)
1727 (kill-buffer ido-completion-buffer))
1727 (cond 1728 (cond
1728 ((equal dir ido-current-directory) 1729 ((equal dir ido-current-directory)
1729 nil) 1730 nil)
@@ -1736,8 +1737,9 @@ This function also adds a hook to the minibuffer."
1736 (t 1737 (t
1737 (ido-trace "cd" dir) 1738 (ido-trace "cd" dir)
1738 (setq ido-current-directory dir) 1739 (setq ido-current-directory dir)
1739 (if (get-buffer ido-completion-buffer) 1740 (and ido-completion-buffer
1740 (kill-buffer ido-completion-buffer)) 1741 (get-buffer ido-completion-buffer)
1742 (kill-buffer ido-completion-buffer))
1741 (setq ido-directory-nonreadable (ido-nonreadable-directory-p dir)) 1743 (setq ido-directory-nonreadable (ido-nonreadable-directory-p dir))
1742 (setq ido-directory-too-big (and (not ido-directory-nonreadable) 1744 (setq ido-directory-too-big (and (not ido-directory-nonreadable)
1743 (ido-directory-too-big-p dir))) 1745 (ido-directory-too-big-p dir)))
@@ -1982,8 +1984,9 @@ If INITIAL is non-nil, it specifies the initial input string."
1982 (setq ido-text-init nil)) 1984 (setq ido-text-init nil))
1983 ido-completion-map nil hist)))) 1985 ido-completion-map nil hist))))
1984 (ido-trace "read-from-minibuffer" ido-final-text) 1986 (ido-trace "read-from-minibuffer" ido-final-text)
1985 (if (get-buffer ido-completion-buffer) 1987 (and ido-completion-buffer
1986 (kill-buffer ido-completion-buffer)) 1988 (get-buffer ido-completion-buffer)
1989 (kill-buffer ido-completion-buffer))
1987 1990
1988 (ido-trace "\n_EXIT_" ido-exit) 1991 (ido-trace "\n_EXIT_" ido-exit)
1989 1992
@@ -3837,8 +3840,9 @@ This is to make them appear as if they were \"virtual buffers\"."
3837(defun ido-choose-completion-string (choice &rest ignored) 3840(defun ido-choose-completion-string (choice &rest ignored)
3838 (when (ido-active) 3841 (when (ido-active)
3839 ;; Insert the completion into the buffer where completion was requested. 3842 ;; Insert the completion into the buffer where completion was requested.
3840 (if (get-buffer ido-completion-buffer) 3843 (and ido-completion-buffer
3841 (kill-buffer ido-completion-buffer)) 3844 (get-buffer ido-completion-buffer)
3845 (kill-buffer ido-completion-buffer))
3842 (cond 3846 (cond
3843 ((ido-active t) ;; ido-use-merged-list 3847 ((ido-active t) ;; ido-use-merged-list
3844 (setq ido-current-directory "" 3848 (setq ido-current-directory ""
@@ -3857,7 +3861,8 @@ This is to make them appear as if they were \"virtual buffers\"."
3857 "Show possible completions in a *File Completions* buffer." 3861 "Show possible completions in a *File Completions* buffer."
3858 (interactive) 3862 (interactive)
3859 (setq ido-rescan nil) 3863 (setq ido-rescan nil)
3860 (let ((temp-buf (get-buffer ido-completion-buffer)) 3864 (let ((temp-buf (and ido-completion-buffer
3865 (get-buffer ido-completion-buffer)))
3861 display-it full-list) 3866 display-it full-list)
3862 (if (and (eq last-command this-command) temp-buf) 3867 (if (and (eq last-command this-command) temp-buf)
3863 ;; scroll buffer 3868 ;; scroll buffer
@@ -3876,7 +3881,7 @@ This is to make them appear as if they were \"virtual buffers\"."
3876 (scroll-other-window)) 3881 (scroll-other-window))
3877 (set-buffer buf)) 3882 (set-buffer buf))
3878 (setq display-it t)) 3883 (setq display-it t))
3879 (if display-it 3884 (if (and ido-completion-buffer display-it)
3880 (with-output-to-temp-buffer ido-completion-buffer 3885 (with-output-to-temp-buffer ido-completion-buffer
3881 (let ((completion-list (sort 3886 (let ((completion-list (sort
3882 (cond 3887 (cond