From f4ff7fda38aab66bbbb40068577041d35f86b649 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 27 Mar 2020 03:03:37 -0400 Subject: [PATCH] Fix #2756: inhibited shift-selection on C-a/C-e --- core/autoload/text.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/autoload/text.el b/core/autoload/text.el index ae91e71e7..83a547132 100644 --- a/core/autoload/text.el +++ b/core/autoload/text.el @@ -117,7 +117,7 @@ in some cases." ;;; Commands (defun doom--bol-bot-eot-eol (&optional pos) - (save-excursion + (save-mark-and-excursion (when pos (goto-char pos)) (let* ((bol (if visual-line-mode @@ -157,6 +157,9 @@ beginning of the line. The opposite of `doom/forward-to-last-non-comment-or-eol'." (interactive "d") (let ((pt (or point (point)))) + (when (and shift-select-mode this-command-keys-shift-translated) + (set-mark pt) + (activate-mark)) (cl-destructuring-bind (bol bot _eot _eol) (doom--bol-bot-eot-eol pt) (cond ((> pt bot) @@ -179,6 +182,9 @@ beginning of the line. The opposite of true end of the line. The opposite of `doom/backward-to-bol-or-indent'." (interactive "d") (let ((pt (or point (point)))) + (when (and shift-select-mode this-command-keys-shift-translated) + (set-mark pt) + (activate-mark)) (cl-destructuring-bind (_bol _bot eot eol) (doom--bol-bot-eot-eol pt) (cond ((< pt eot)