bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#11008: 24.0.94; ido-mode: Setting ido-completion-buffer to nil is br


From: Anmol Khirbat
Subject: bug#11008: 24.0.94; ido-mode: Setting ido-completion-buffer to nil is broken
Date: Tue, 13 Mar 2012 00:58:03 -0700

Hi,

According to the documentation, the variable ido-completion-buffer may
be set to nil to prevent completion buffers from popping up.  However,
if this variable is set to nil, it becomes impossible to switch buffers
or visit files.

Recipe:

1. emacs -Q

2. enable ido
(ido-mode t)
(setq ido-completion-buffer nil)

3. Try to switch buffers or visit a file
C-x b RET (or C-x C-f RET)
The error "Wrong type argument: stringp, nil" flashes in the minibuffer
and nothing happens.

I have included a patch to lisp/ido.el that should fix the problem by
preventing (get-buffer nil) from being called.

Regards,
Anmol

In GNU Emacs 24.0.94.5 (x86_64-apple-darwin11.3.0, NS apple-appkit-1138.32)
of 2012-03-12 on morpheus.lan
Windowing system distributor `Apple', version 10.3.1138
Configured using:
`configure '--with-ns''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

diff --git a/lisp/ido.el b/lisp/ido.el
index 5813aff..98afa74 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1722,7 +1722,7 @@ This function also adds a hook to the minibuffer."
     (unless (and ido-enable-tramp-completion
                 (string-match "\\`/[^/]*@\\'" dir))
       (setq dir (ido-final-slash dir t))))
-  (if (get-buffer ido-completion-buffer)
+  (if (and ido-completion-buffer (get-buffer ido-completion-buffer))
       (kill-buffer ido-completion-buffer))
   (cond
    ((equal dir ido-current-directory)
@@ -1736,7 +1736,7 @@ This function also adds a hook to the minibuffer."
    (t
     (ido-trace "cd" dir)
     (setq ido-current-directory dir)
-    (if (get-buffer ido-completion-buffer)
+    (if (and ido-completion-buffer (get-buffer ido-completion-buffer))
        (kill-buffer ido-completion-buffer))
     (setq ido-directory-nonreadable (ido-nonreadable-directory-p dir))
     (setq ido-directory-too-big (and (not ido-directory-nonreadable)
@@ -1982,7 +1982,7 @@ If INITIAL is non-nil, it specifies the initial input 
string."
                                        (setq ido-text-init nil))
                                      ido-completion-map nil hist))))
       (ido-trace "read-from-minibuffer" ido-final-text)
-      (if (get-buffer ido-completion-buffer)
+      (if (and ido-completion-buffer (get-buffer ido-completion-buffer))
          (kill-buffer ido-completion-buffer))
 
       (ido-trace "\n_EXIT_" ido-exit)
@@ -3837,7 +3837,7 @@ This is to make them appear as if they were \"virtual 
buffers\"."
 (defun ido-choose-completion-string (choice &rest ignored)
   (when (ido-active)
     ;; Insert the completion into the buffer where completion was requested.
-    (if (get-buffer ido-completion-buffer)
+    (if (and ido-completion-buffer (get-buffer ido-completion-buffer))
        (kill-buffer ido-completion-buffer))
     (cond
      ((ido-active t) ;; ido-use-merged-list
@@ -3857,7 +3857,7 @@ This is to make them appear as if they were \"virtual 
buffers\"."
   "Show possible completions in a *File Completions* buffer."
   (interactive)
   (setq ido-rescan nil)
-  (let ((temp-buf (get-buffer ido-completion-buffer))
+  (let ((temp-buf (and ido-completion-buffer (get-buffer 
ido-completion-buffer)))
        display-it full-list)
     (if (and (eq last-command this-command) temp-buf)
        ;; scroll buffer
@@ -3876,7 +3876,7 @@ This is to make them appear as if they were \"virtual 
buffers\"."
            (scroll-other-window))
          (set-buffer buf))
       (setq display-it t))
-    (if display-it
+    (if (and ido-completion-buffer display-it)
        (with-output-to-temp-buffer ido-completion-buffer
          (let ((completion-list (sort
                                  (cond

reply via email to

[Prev in Thread] Current Thread [Next in Thread]