From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bob Newell Newsgroups: gmane.emacs.help Subject: Re: mark multi regions, kill and yank Date: Mon, 30 Oct 2023 07:11:11 -1000 Organization: Avi Gobbler Publishing Message-ID: <87zg00jas0.cahcbkqxd@xqbyxoy.ajhx.org> References: <87lebkxfml.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35727"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Chrome/6.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 30 18:25:00 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qxW0a-00090D-2D for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 30 Oct 2023 18:25:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qxVzX-0005yM-RH; Mon, 30 Oct 2023 13:23:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qxVzW-0005yD-10 for help-gnu-emacs@gnu.org; Mon, 30 Oct 2023 13:23:54 -0400 Original-Received: from smtp.forwardemail.net ([149.28.215.223]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qxVzP-0004xy-HD for help-gnu-emacs@gnu.org; Mon, 30 Oct 2023 13:23:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bobnewell.net; h=Content-Type: MIME-Version: Message-ID: Date: References: In-Reply-To: Subject: To: From; q=dns/txt; s=fe-148fdb2209; t=1698686503; bh=sLM+xHH23GxyZxvHSIGscqfJ/jnclNUFQZaADrlo5nw=; b=HnQ4rLv2bKxyEXWwiULSqjyGYCPeICfKSJVMtQuI2t7dOFTqfRWcUISjg0VXBarT3cejomAE1 fZpYn7N7uQM4L4vN4U+HLnVGIWbpNCF2d02jZ96u7LU4IiyUzxvBNuHHvIKbzDqNN3+eDgRABvK iOCXOwFfimf9z5g8x4GcmuvFwydFMGQzWHSVrlK0jm1qj84ofXn9w36YAUcMarjn4LldGRDxAmo VR+l1A/Dz42WwdJsip30wnVRAjS3gjSLbTxbVGs8EpiZBO/Jfjv9Lh/zW9vKy1EaHerQgBrED3b Jknnlw5b9M/HBiIvlHTWqT63C5/Nvy77HzSalDfhQYxQ== In-Reply-To: <87lebkxfml.fsf@mat.ucm.es> (Uwe Brauer's message of "Mon, 30 Oct 2023 17:02:42 +0100") X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net Original-X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; bobnewell@bobnewell.net, smtp.forwardemail.net, 149.28.215.223 X-ForwardEmail-ID: 653fe3b0ffd10dc67fa44226 Received-SPF: pass client-ip=149.28.215.223; envelope-from=SRS0=597e=GN=bobnewell.net=bobnewell@fe-bounces.bobnewell.net; helo=smtp.forwardemail.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145423 Archived-At: Uwe Brauer writes: > Hi > > I am looking for a package that allows me > > 1. to mark several regions, > > 2. To kill them > > 3. And then later to yank everything. > I have heard this called "scatter gather." I've been using the following rather trivial code, which isn't fully "scatter gather" but it does 1-3 above in incremental fashion, that is, one region at a time rather than all at once. I realize this is not quite what you want, however it does allow you to yank a concatenated set of copied or killed regions. ;;; A couple of append commands for scatter-gather. Bind to ;;; global keys. Why C-cps and C-cpk? Because it's difficult, ;;; especially in org-mode, to find free keys. (defun append-kill-to-kill-ring () (interactive) (append-next-kill) (kill-region (mark) (point))) (defun append-save-to-kill-ring () (interactive) (append-next-kill) (kill-ring-save (mark) (point))) (global-set-key "\C-cps" 'append-save-to-kill-ring) (global-set-key "\C-cpk" 'append-kill-to-kill-ring) -- Bob Newell Honolulu, Hawai`i - Via GNU/Linux/Emacs/Gnus/BBDB