From: Anmol Khirbat <anmol@khirbat.net>
To: 11008@debbugs.gnu.org
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 [thread overview]
Message-ID: <m2ehsxdjas.fsf@morpheus.lan> (raw)
[-- 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
next reply other threads:[~2012-03-13 7:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-13 7:58 Anmol Khirbat [this message]
2012-03-13 16:56 ` bug#11008: 24.0.94; ido-mode: Setting ido-completion-buffer to nil is broken Leo
2012-03-14 10:32 ` Leo
2012-03-21 16:41 ` Chong Yidong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2ehsxdjas.fsf@morpheus.lan \
--to=anmol@khirbat.net \
--cc=11008@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.