Mercurial > hg > xemacs-beta
changeset 1978:f32f3ddaf534
[xemacs-hg @ 2004-04-03 20:00:24 by adrian]
[PATCH] xemacs-21.5: Proposed fix for `call-process-region' bug <isgwwgt3.fsf@smtpmail.t-online.de>
author | adrian |
---|---|
date | Sat, 03 Apr 2004 20:00:26 +0000 |
parents | 1a5f3b515d03 |
children | 6a91a3c8f1dc |
files | lisp/ChangeLog lisp/code-process.el |
diffstat | 2 files changed, 19 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Fri Apr 02 21:51:13 2004 +0000 +++ b/lisp/ChangeLog Sat Apr 03 20:00:26 2004 +0000 @@ -1,3 +1,9 @@ +2004-03-23 Adrian Aichner <adrian@xemacs.org> + + * code-process.el (call-process-region): Correct start and end + marker construction, delete regions before and after insertion + point. + 2004-03-22 Stephen J. Turnbull <stephen@xemacs.org> * XEmacs 21.5.17 "chayote" is released.
--- a/lisp/code-process.el Fri Apr 02 21:51:13 2004 +0000 +++ b/lisp/code-process.el Sat Apr 03 20:00:26 2004 +0000 @@ -169,16 +169,22 @@ ;; a temporary file was used to pass the text to call-process. Now that ;; we don't do that, we delete the text afterward; if it's being inserted ;; in the same buffer, make sure we track the insertion, and don't get - ;; any of it in the deleted region if insertion happens at either end - ;; of the region. - (let ((s (and deletep (copy-marker start t))) - (e (and deletep (copy-marker end)))) + ;; any of it in the deleted region. We keep marker s before the + ;; insertion and e afterward. Finally we delete the regions before + ;; and after the insertion. + (let ((s (and deletep (copy-marker (point)))) + (e (and deletep (copy-marker (point) t)))) (let ((retval (apply #'call-process program (list (current-buffer) start end) buffer displayp args))) - ;; If start and end were the same originally, s will be beyond e now - (if (and deletep (> e s)) - (delete-region s e)) + ;; If start and end were the same originally, e will be beyond s now + (when (and deletep (> e s)) + ;; APA: Is it always correct to honor narrowing, which affects + ;; (point-min) and (point-max)? + ;; Delete region before insertion. + (delete-region (point-min) s) + ;; Delete region after insertion. + (delete-region e (point-max))) retval))) (defun start-process (name buffer program &rest program-args)