From: Leo Liu Date: Wed, 23 Oct 2013 12:15:31 +0000 (+0800) Subject: * ido.el (ido-tidy): Handle read-only text. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1178 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c744a3b9f71c899c44d47d7fe8bced5a73f538dd;p=emacs.git * ido.el (ido-tidy): Handle read-only text. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ba2046e15b4..a3a94cf6a69 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2013-10-23 Leo Liu + + * ido.el (ido-tidy): Handle read-only text. + 2013-10-23 Glenn Morris * Makefile.in (abs_srcdir, abs_lisp): New, set by configure. diff --git a/lisp/ido.el b/lisp/ido.el index e7216f595ea..9a17c0ca61f 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -4707,19 +4707,18 @@ Modified from `icomplete-completions'." (cancel-timer ido-auto-merge-timer) (setq ido-auto-merge-timer nil)) - (if (ido-active) - (if (and (boundp 'ido-eoinput) - ido-eoinput) - - (if (> ido-eoinput (point-max)) - ;; Oops, got rug pulled out from under us - reinit: - (setq ido-eoinput (point-max)) - (let ((buffer-undo-list t)) - (delete-region ido-eoinput (point-max)))) - - ;; Reestablish the local variable 'cause minibuffer-setup is weird: - (make-local-variable 'ido-eoinput) - (setq ido-eoinput 1)))) + (when (ido-active) + (if (bound-and-true-p ido-eoinput) + (if (> ido-eoinput (point-max)) + ;; Oops, got rug pulled out from under us - reinit: + (setq ido-eoinput (point-max)) + (let ((inhibit-read-only t) + (buffer-undo-list t)) + (delete-region ido-eoinput (point-max)))) + + ;; Reestablish the local variable 'cause minibuffer-setup is weird: + (make-local-variable 'ido-eoinput) + (setq ido-eoinput 1)))) (defun ido-summary-buffers-to-end () ;; Move the summaries to the end of the buffer list.