From 2395f2b919f44cae22b2ca99cd779e69d79f710a Mon Sep 17 00:00:00 2001 From: Daniel Colascione Date: Tue, 1 Apr 2014 13:48:02 -0700 Subject: [PATCH] Prevent assertion failure when trying to complete the prompt --- lisp/ChangeLog | 5 +++++ lisp/minibuffer.el | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 52a974fa21e..dca32ba7011 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-04-01 Daniel Colascione + + * minibuffer.el (minibuffer-complete): Prevent assertion failure + when trying to complete the prompt. + 2014-03-31 Leo Liu * emacs-lisp/eldoc.el (eldoc-print-current-symbol-info): Refactor diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index bbb7114610d..8e84a2fd307 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1092,9 +1092,10 @@ If no characters can be completed, display a list of possible completions. If you repeat this command after it displayed such a list, scroll the window of possible completions." (interactive) - (completion-in-region (minibuffer-prompt-end) (point-max) - minibuffer-completion-table - minibuffer-completion-predicate)) + (when (<= (minibuffer-prompt-end) (point)) + (completion-in-region (minibuffer-prompt-end) (point-max) + minibuffer-completion-table + minibuffer-completion-predicate))) (defun completion--in-region-1 (beg end) ;; If the previous command was not this, -- 2.11.4.GIT