From aeb613ea95b7970e66d663ec5cba54e9ec0528fa Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 27 Apr 2016 19:52:46 +0200 Subject: [PATCH] Avoid having `C-x h' mark the prompt part of the minibuffer * lisp/simple.el (mark-whole-buffer): Don't mark the prompt part of the minibuffer (bug#2589). --- etc/NEWS | 4 ++++ lisp/simple.el | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index ef2b4b01f60..da68ed597db 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -56,6 +56,10 @@ affected by this, as SGI stopped supporting IRIX in December 2013. * Changes in Emacs 25.2 +--- +** `C-x h' (`mark-whole-buffer') will now avoid marking the prompt +part of minibuffers. + --- ** `find-library' now takes a prefix argument to pop to a different window. diff --git a/lisp/simple.el b/lisp/simple.el index 971f6006732..7573789ad5c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1075,7 +1075,9 @@ that uses or sets the mark." (interactive) (push-mark (point)) (push-mark (point-max) nil t) - (goto-char (point-min))) + ;; This is really `point-min' in most cases, but if we're in the + ;; minibuffer, this is at the end of the prompt. + (goto-char (minibuffer-prompt-end))) ;; Counting lines, one way or another. -- 2.39.2