From: Lars Ingebrigtsen Date: Wed, 27 Apr 2016 17:52:46 +0000 (+0200) Subject: Avoid having `C-x h' mark the prompt part of the minibuffer X-Git-Url: https://code.delx.au/gnu-emacs/commitdiff_plain/aeb613ea95b7970e66d663ec5cba54e9ec0528fa 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). --- diff --git a/etc/NEWS b/etc/NEWS index ef2b4b01f6..da68ed597d 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 971f600673..7573789ad5 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.