diff --git a/lisp/ido.el b/lisp/ido.el index a4c26b52c98..be1cba62f27 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -2895,7 +2895,8 @@ With \\[universal-argument], pop all element." "Insert file name of current buffer. If repeated, insert text from buffer instead." (interactive "P") - (let* ((bfname (buffer-file-name ido-entry-buffer)) + (let* ((bfname (or (buffer-file-name ido-entry-buffer) + (buffer-name ido-entry-buffer))) (name (and bfname (file-name-nondirectory bfname)))) (when name (setq ido-text-init