From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: barry@python.org Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#1496: 23.0.60; comint-delete-output should copy region to the kill ring Date: Thu, 4 Dec 2008 18:37:10 -0500 (EST) Message-ID: <20081204233711.3FD4C90809F@mission.wooz.org> Reply-To: barry@python.org, 1496@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1228473245 10639 80.91.229.12 (5 Dec 2008 10:34:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Dec 2008 10:34:05 +0000 (UTC) To: emacs-pretest-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 05 11:35:09 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L8Y1c-0008VO-Ff for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Dec 2008 11:35:09 +0100 Original-Received: from localhost ([127.0.0.1]:35102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L8Y0R-0003Fl-Mp for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Dec 2008 05:33:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L8OaH-0007LT-Rz for bug-gnu-emacs@gnu.org; Thu, 04 Dec 2008 19:30:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L8OaH-0007Kn-0C for bug-gnu-emacs@gnu.org; Thu, 04 Dec 2008 19:30:17 -0500 Original-Received: from [199.232.76.173] (port=48055 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L8OaG-0007KW-Gd for bug-gnu-emacs@gnu.org; Thu, 04 Dec 2008 19:30:16 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:43339) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L8OaG-0006N1-0i for bug-gnu-emacs@gnu.org; Thu, 04 Dec 2008 19:30:16 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB50UD2F019363; Thu, 4 Dec 2008 16:30:13 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id mB50K3YG016002; Thu, 4 Dec 2008 16:20:03 -0800 X-Loop: don@donarmstrong.com Resent-From: barry@python.org Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 05 Dec 2008 00:20:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1496 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122843612015739 (code B ref -1); Fri, 05 Dec 2008 00:20:03 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 5 Dec 2008 00:15:20 +0000 Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB50FE9p015447 for ; Thu, 4 Dec 2008 16:15:15 -0800 Original-Received: from mx10.gnu.org ([199.232.76.166]:39281) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L8OLF-0007W0-DL for emacs-pretest-bug@gnu.org; Thu, 04 Dec 2008 19:14:45 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L8OLg-0004Xm-UD for emacs-pretest-bug@gnu.org; Thu, 04 Dec 2008 19:15:14 -0500 Original-Received: from 216-15-33-230.c3-0.slvr-ubr2.lnh-slvr.md.static.cable.rcn.com ([216.15.33.230]:50617 helo=mail.wooz.org) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L8OLg-0004XS-KJ for emacs-pretest-bug@gnu.org; Thu, 04 Dec 2008 19:15:12 -0500 Original-Received: from mission.wooz.org (mission.wooz.org [192.168.11.17]) by mail.wooz.org (Postfix) with ESMTP id 7BF70E3CBF for ; Thu, 4 Dec 2008 18:37:11 -0500 (EST) Original-Received: by mission.wooz.org (Postfix, from userid 1000) id 3FD4C90809F; Thu, 4 Dec 2008 18:37:11 -0500 (EST) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-Greylist: delayed 2278 seconds by postgrey-1.27 at monty-python; Thu, 04 Dec 2008 19:15:10 EST X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Thu, 04 Dec 2008 19:30:17 -0500 X-Mailman-Approved-At: Fri, 05 Dec 2008 05:33:50 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:22973 gmane.emacs.pretest.bugs:23463 Archived-At: comint-delete-output uses delete-region instead of kill-region because the latter sets this-command. Still, comint-delete-output should copy the killed region to the kill ring so that it can be conveniently yanked into other buffers. A use case: I use bzr diff in a shell buffer to get the changes in my working directory. I'd like to copy that output directly into an email or a pastebin buffer. With comint-delete-output's current behavior I can't use C-c C-o because the output is thrown away. By adding a call to copy-region-as-kill, I can now go to my mail buffer and hit C-y to paste the diff output. Here's a better definition of comint-delete-output: (defun comint-delete-output () "Delete all output from interpreter since last input. Does not delete the prompt." (interactive) (let ((proc (get-buffer-process (current-buffer))) (replacement nil) (inhibit-read-only t)) (save-excursion (let ((pmark (progn (goto-char (process-mark proc)) (forward-line 0) (point-marker)))) ;; Add the text to the kill ring. (copy-region-as-kill comint-last-input-end pmark) (delete-region comint-last-input-end pmark) (goto-char (process-mark proc)) (setq replacement (concat "*** output flushed ***\n" (buffer-substring pmark (point)))) (delete-region pmark (point)))) ;; Output message and put back prompt (comint-output-filter proc replacement))) The only difference is the addition of the comment and the call to copy-region-as-kill. In GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+ Version 2.14.3) of 2008-10-13 on rothera, modified by Debian (emacs-snapshot package, version 1:20081013-1) Windowing system distributor `The X.Org Foundation', version 11.0.10502000 configured using `configure '--build' 'i486-linux-gnu' '--host' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.60/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.60/site-lisp:/usr/share/emacs/site-lisp' '--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Elisp Minor modes in effect: shell-dirtrack-mode: t delete-selection-mode: t icomplete-mode: t show-paren-mode: t savehist-mode: t rcirc-track-minor-mode: t global-whitespace-mode: t desktop-save-mode: t tooltip-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: x r e p o r t Recent messages: Undo! Quit [2 times] Loading vc-svn...done Mark saved where search started if: End of buffer Mark set Press C-c C-c when you are done editing. Enter a change comment. Type C-c C-c when done