]> code.delx.au - gnu-emacs/commitdiff
Avoid having `C-x h' mark the prompt part of the minibuffer
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 27 Apr 2016 17:52:46 +0000 (19:52 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 27 Apr 2016 17:52:46 +0000 (19:52 +0200)
* lisp/simple.el (mark-whole-buffer): Don't mark the prompt
part of the minibuffer (bug#2589).

etc/NEWS
lisp/simple.el

index ef2b4b01f60449ff167f02f73512457d5bf1e181..da68ed597dbbd7ad9d7e89c66ba300dc2a1208a5 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -56,6 +56,10 @@ affected by this, as SGI stopped supporting IRIX in December 2013.
 \f
 * 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.
index 971f60067324800c71215e3d36e985ad847a7ba7..7573789ad5c509acce3a2e6198947052bcff65d5 100644 (file)
@@ -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)))
 \f
 
 ;; Counting lines, one way or another.