From unknown Mon Aug 18 04:42:24 2025 X-Loop: don@donarmstrong.com Subject: bug#1496: 23.0.60; comint-delete-output should copy region to the kill ring Reply-To: barry@python.org, 1496@debbugs.gnu.org Resent-From: barry@python.org Resent-To: bug-submit-list@lists.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: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122843612015739 (code B ref -1); Fri, 05 Dec 2008 00:20:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.9 required=4.0 tests=BAYES_00,FOURLA, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 5 Dec 2008 00:15:20 +0000 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 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 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 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 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) Received: by mission.wooz.org (Postfix, from userid 1000) id 3FD4C90809F; Thu, 4 Dec 2008 18:37:11 -0500 (EST) To: emacs-pretest-bug@gnu.org From: barry@python.org Message-Id: <20081204233711.3FD4C90809F@mission.wooz.org> Date: Thu, 4 Dec 2008 18:37:10 -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 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 From unknown Mon Aug 18 04:42:24 2025 X-Loop: don@donarmstrong.com Subject: bug#1496: 23.0.60; comint-delete-output should copy region to the kill ring Reply-To: Stefan Monnier , 1496@debbugs.gnu.org Resent-From: Stefan Monnier Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 11 Dec 2008 16:30: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: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122901268618105 (code B ref -1); Thu, 11 Dec 2008 16:30:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.0000 Tokens: new, 20; hammy, 86; neutral, 53; spammy, 1. spammytokens:0.997-1--H*Ad:U*1496 hammytokens:0.000-+--23.0.60, 0.000-+--23060, 0.000-+--H*M:fsf, 0.000-+--H*UA:Emacs, 0.000-+--H*u:Emacs X-Spam-Status: No, score=-9.1 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 11 Dec 2008 16:24:46 +0000 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 mBBGOhre018097 for ; Thu, 11 Dec 2008 08:24:44 -0800 Received: from mx10.gnu.org ([199.232.76.166]:55317) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LAoKb-0006kW-87 for emacs-pretest-bug@gnu.org; Thu, 11 Dec 2008 11:24:05 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LAoLC-0001sM-63 for emacs-pretest-bug@gnu.org; Thu, 11 Dec 2008 11:24:42 -0500 Received: from ironport2-out.pppoe.ca ([206.248.154.182]:15906 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LAoLB-0001sG-Uq for emacs-pretest-bug@gnu.org; Thu, 11 Dec 2008 11:24:42 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkcFAKvNQElFxIVh/2dsb2JhbACBbMtbgnmBLA X-IronPort-AV: E=Sophos;i="4.33,753,1220241600"; d="scan'208";a="30926155" Received: from 69-196-133-97.dsl.teksavvy.com (HELO pastel.home) ([69.196.133.97]) by ironport2-out.teksavvy.com with ESMTP; 11 Dec 2008 11:24:35 -0500 Received: by pastel.home (Postfix, from userid 20848) id 221CE86F6; Thu, 11 Dec 2008 11:24:35 -0500 (EST) From: Stefan Monnier To: barry@python.org Cc: 1496@debbugs.gnu.org, emacs-pretest-bug@gnu.org Message-ID: References: <20081204233711.3FD4C90809F@mission.wooz.org> Date: Thu, 11 Dec 2008 11:24:35 -0500 In-Reply-To: <20081204233711.3FD4C90809F@mission.wooz.org> (barry@python.org's message of "Thu, 4 Dec 2008 18:37:10 -0500 (EST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. > comint-delete-output uses delete-region instead of kill-region because the > latter sets this-command. I do not know if it's the reason for it, but I think your suggestion is about right, except that if the command kills the output, it should be called comint-kill-output rather than comint-delete-output. Stefan From unknown Mon Aug 18 04:42:24 2025 X-Loop: don@donarmstrong.com Subject: bug#1496: 23.0.60; comint-delete-output should copy region to the kill ring Reply-To: Barry Warsaw , 1496@debbugs.gnu.org Resent-From: Barry Warsaw Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 11 Dec 2008 16:55: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: Received: via spool by 1496-submit@emacsbugs.donarmstrong.com id=B1496.122901414026317 (code B ref 1496); Thu, 11 Dec 2008 16:55:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.0000 Tokens: new, 71; hammy, 76; neutral, 53; spammy, 2. spammytokens:0.997-1--H*r:sk:1496@em, 0.899-5--H*m:python hammytokens:0.000-+--23.0.60, 0.000-+--23060, 0.000-+--stefan, 0.000-+--Stefan, 0.000-+--H*f:sk:emacsbu X-Spam-Status: No, score=-9.3 required=4.0 tests=AWL,BAYES_00,FVGT_m_MULTI_ODD, HAS_BUG_NUMBER,IMPRONONCABLE_2,MURPHY_WRONG_WORD1,MURPHY_WRONG_WORD2, PGPSIGNATURE autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1496) by emacsbugs.donarmstrong.com; 11 Dec 2008 16:49:00 +0000 Received: from mail.wooz.org (216-15-33-230.c3-0.slvr-ubr2.lnh-slvr.md.static.cable.rcn.com [216.15.33.230]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBBGmu0h026307 for <1496@emacsbugs.donarmstrong.com>; Thu, 11 Dec 2008 08:48:58 -0800 Received: from snowdog.wooz.org (snowdog.wooz.org [192.168.11.202]) by mail.wooz.org (Postfix) with ESMTPSA id 472EEE3922; Thu, 11 Dec 2008 11:48:56 -0500 (EST) Cc: 1496@debbugs.gnu.org, emacs-pretest-bug@gnu.org Message-Id: <5C47C6C8-BB87-4BE3-9B21-FCFE478E8C25@python.org> From: Barry Warsaw To: Stefan Monnier In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Date: Thu, 11 Dec 2008 11:48:55 -0500 References: <20081204233711.3FD4C90809F@mission.wooz.org> X-Pgp-Agent: GPGMail d53 (v53, Leopard) X-Mailer: Apple Mail (2.929.2) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Dec 11, 2008, at 11:24 AM, Stefan Monnier wrote: >> comint-delete-output uses delete-region instead of kill-region >> because the >> latter sets this-command. > > I do not know if it's the reason for it, but I think your suggestion > is > about right, except that if the command kills the output, it should be > called comint-kill-output rather than comint-delete-output. Yes, that's a better name for it, thanks. I remember reading a comment somewhere that that was the reason for using delete-region instead of kill-region, but I could be misremembering. Cheers - -Barry -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iQCVAwUBSUFEd3EjvBPtnXfVAQKLFgP+KPFvYZ9znlSvgRs6M+3w7/1/FBh/8mgJ qXzaRmmQN803tNFoQN6fx30+z516/m/Oy1Hhx5UFvjrxdS/7mOpXsBr5gd6sPc6n 1lwYY1Fhv//vONfavTIcUV7VopBTERyDIxxOHwO2WyuePVIUq2L37IySF5APQUqz Q1nnyxsmO3s= =K/F4 -----END PGP SIGNATURE----- From unknown Mon Aug 18 04:42:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#1496: 23.0.60; comint-delete-output should copy region to the kill ring Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Jul 2021 15:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 1496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: barry@python.org Cc: 1496@debbugs.gnu.org Received: via spool by 1496-submit@debbugs.gnu.org id=B1496.16267076521052 (code B ref 1496); Mon, 19 Jul 2021 15:15:01 +0000 Received: (at 1496) by debbugs.gnu.org; 19 Jul 2021 15:14:12 +0000 Received: from localhost ([127.0.0.1]:59801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5UyC-0000Gu-9A for submit@debbugs.gnu.org; Mon, 19 Jul 2021 11:14:12 -0400 Received: from quimby.gnus.org ([95.216.78.240]:46154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5UyB-0000Ge-3g for 1496@debbugs.gnu.org; Mon, 19 Jul 2021 11:14:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=pPo2sM3hFw6l3kGkxaYyMzslAK64LoewJcFYd9NSphs=; b=gS4DQfxTp06BrFx0fP86IC3CGY HYtws3vbjBOa2WIzORdDuAIlLqJ8+plBHeLNUvsW/DmioxU1fbCgnspVynRXAi7A6yT/PxkhvnhfV Lw5uifbaJw3Dp5eu6RUeARausUD9SGGUQBwnzO6YH5+9rTgq/uWYOwV9Vv5bJ6Z/m4hY=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5Uy2-00087s-Hq; Mon, 19 Jul 2021 17:14:05 +0200 From: Lars Ingebrigtsen References: <20081204233711.3FD4C90809F@mission.wooz.org> X-Now-Playing: Colored Music's _Individual Beauty_: "Night Paradise" Date: Mon, 19 Jul 2021 17:14:02 +0200 In-Reply-To: <20081204233711.3FD4C90809F@mission.wooz.org> (barry@python.org's message of "Thu, 4 Dec 2008 18:37:10 -0500 (EST)") Message-ID: <87lf62mj45.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: barry@python.org writes: > 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 [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) barry@python.org writes: > 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. (I'm going through old bug reports that unfortunately wasn't resolved at the time.) I think that sounds like useful functionality, to I've now made `C-u C-c C-o' save the output on the kill ring (before deleting it) in Emacs 28. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 19 11:14:17 2021 Received: (at control) by debbugs.gnu.org; 19 Jul 2021 15:14:18 +0000 Received: from localhost ([127.0.0.1]:59804 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5UyH-0000HD-Iw for submit@debbugs.gnu.org; Mon, 19 Jul 2021 11:14:17 -0400 Received: from quimby.gnus.org ([95.216.78.240]:46170) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5UyG-0000Gl-6w for control@debbugs.gnu.org; Mon, 19 Jul 2021 11:14:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=1Qc6QNvrgxAEQuCW58S7jbTsb9dZXKBewxq/Qzy2MS8=; b=nCjrYBmdG+YWBjeEVy5xpYbdwZ POkEyJm05Y0qre7VHxE/c1n3TV2VemB5CTMktXzhdi78F5o7NYyJ6hNyGvGRhDySKshAd28jB3Gdl 1NDmiiDK2RUrCd+WdGN64lh4haQ1Gapx866y6hKd7PAy7GF8girPSrTk+AHX6gOHPrTM=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5Uy8-00087z-Bu for control@debbugs.gnu.org; Mon, 19 Jul 2021 17:14:10 +0200 Date: Mon, 19 Jul 2021 17:14:07 +0200 Message-Id: <87k0lmmj40.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #1496 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 1496 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 1496 28.1 quit