From 3574d3781da7dd0237053aaa00f7820498ce5dcc Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Sat, 21 Aug 1999 19:31:34 +0000 Subject: [PATCH] (backward-kill-paragraph): Don't move point into mini-buffer prompt. (backward-kill-sentence): Ditto. --- lisp/textmodes/paragraphs.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index 0c9c2e0c702..6f958ce5aac 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el @@ -323,7 +323,12 @@ negative arg -N means kill backward to Nth start of paragraph." With arg N, kill back to Nth start of paragraph; negative arg -N means kill forward to Nth end of paragraph." (interactive "*p") - (kill-region (point) (progn (backward-paragraph arg) (point)))) + (let ((start (point)) + (end (progn (backward-paragraph arg) (point))) + (prompt-end (minibuffer-prompt-end))) + (when (> end prompt-end) + (goto-char (setq end prompt-end))) + (kill-region start end))) (defun transpose-paragraphs (arg) "Interchange this (or next) paragraph with previous one." @@ -393,7 +398,12 @@ With arg, repeat; negative arg -N means kill back to Nth start of sentence." "Kill back from point to start of sentence. With arg, repeat, or kill forward to Nth end of sentence if negative arg -N." (interactive "*p") - (kill-region (point) (progn (backward-sentence arg) (point)))) + (let ((start (point)) + (end (progn (backward-sentence arg) (point))) + (prompt-end (minibuffer-prompt-end))) + (when (> end prompt-end) + (goto-char (setq end prompt-end))) + (kill-region start end))) (defun mark-end-of-sentence (arg) "Put mark at end of sentence. Arg works as in `forward-sentence'." -- 2.39.5