From: Chris Hanson Date: Thu, 31 Jan 2008 02:18:57 +0000 (+0000) Subject: Fix xscheme-prompt-for-expression-exit with patch from debian X-Git-Tag: 20090517-FFI~368 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=610b753d27eaccd30377ed6be6a8a4bd203ad90c;p=mit-scheme.git Fix xscheme-prompt-for-expression-exit with patch from debian Bug#375858. --- diff --git a/etc/xscheme.el b/etc/xscheme.el index 97ff9ce73..d4e41dd6a 100644 --- a/etc/xscheme.el +++ b/etc/xscheme.el @@ -1216,9 +1216,19 @@ the remaining input.") (defun xscheme-prompt-for-expression-exit () (interactive) - (if (eq (xscheme-region-expression-p (point-min) (point-max)) 'one) - (exit-minibuffer) - (error "input must be a single, complete expression"))) + (let ( + ;; In Emacs 21, during a minibuffer read the minibuffer + ;; contains the prompt as buffer text and that text is + ;; read only. So we can no longer assume that (point-min) + ;; is where the user-entered text starts and we must avoid + ;; modifying that prompt text. The value we want instead + ;; of (point-min) is (minibuffer-prompt-end). + (point-min (if (fboundp 'minibuffer-prompt-end) + (minibuffer-prompt-end) + (point-min)))) + (if (eq (xscheme-region-expression-p point-min (point-max)) 'one) + (exit-minibuffer) + (error "input must be a single, complete expression")))) (defun xscheme-region-expression-p (start end) (save-excursion