all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#11008: 24.0.94; ido-mode: Setting ido-completion-buffer to nil is broken
@ 2012-03-13  7:58 Anmol Khirbat
  2012-03-13 16:56 ` Leo
  2012-03-21 16:41 ` Chong Yidong
  0 siblings, 2 replies; 4+ messages in thread
From: Anmol Khirbat @ 2012-03-13  7:58 UTC (permalink / raw)
  To: 11008

[-- Attachment #1: Type: text/plain, Size: 1520 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Fix for (setq ido-completion-buffer nil) --]
[-- Type: text/x-patch, Size: 2593 bytes --]

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-21 16:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-13  7:58 bug#11008: 24.0.94; ido-mode: Setting ido-completion-buffer to nil is broken Anmol Khirbat
2012-03-13 16:56 ` Leo
2012-03-14 10:32   ` Leo
2012-03-21 16:41 ` Chong Yidong

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.