From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Teemu Likonen Newsgroups: gmane.emacs.help Subject: Convert rectangle's lines to a flat string and put it in the kill ring Date: Sun, 08 Sep 2013 15:39:59 +0300 Message-ID: <87mwnnsd0g.fsf@mithlond.arda> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1378644043 7813 80.91.229.3 (8 Sep 2013 12:40:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Sep 2013 12:40:43 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Sep 08 14:40:46 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VIeIH-000380-UM for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Sep 2013 14:40:46 +0200 Original-Received: from localhost ([::1]:45283 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIeIH-0001iX-30 for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Sep 2013 08:40:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIeHs-0001iQ-Fi for help-gnu-emacs@gnu.org; Sun, 08 Sep 2013 08:40:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VIeHk-0007L6-5k for help-gnu-emacs@gnu.org; Sun, 08 Sep 2013 08:40:20 -0400 Original-Received: from mta-out.inet.fi ([195.156.147.13]:57233 helo=jenni1.inet.fi) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIeHj-0007Cn-Ql for help-gnu-emacs@gnu.org; Sun, 08 Sep 2013 08:40:12 -0400 Original-Received: from mithlond.arda (84.251.134.110) by jenni1.inet.fi (8.5.140.03) id 5163EC560B054EB4 for help-gnu-emacs@gnu.org; Sun, 8 Sep 2013 15:40:03 +0300 Original-Received: from dtw by mithlond.arda with local (Exim 4.80) (envelope-from ) id 1VIeHb-0002SL-6M for help-gnu-emacs@gnu.org; Sun, 08 Sep 2013 15:40:03 +0300 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 195.156.147.13 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:93303 Archived-At: --=-=-= Content-Type: text/plain I'm trying to write a custom rectangle copy command. It should convert rectangle's lines to a flat string like this: "line1|line2|line3", that is, use separator character "|" between lines. The resulting string should be put in the kill ring so that the next yank command would insert it. (defun tl-rectangle-string (beg end) (interactive "r") (let ((list (extract-rectangle beg end))) (kill-new (mapconcat 'substring-no-properties list "|")) (setq deactivate-mark t))) It doesn't work. The next yank command inserts the region between BEG and END, not the generated flat string. "yank + yank-pop" inserts the generated string but I'd like to have it first in the yank list. Any ideas? --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCAAGBQJSLHAgAAoJEHGdadMkU5RQArAQALE0Gq4xgqzfOZrMnf5GPius K67IjKKDOujuvziwHSJq3wRVTGvoy2KdoKSUoklOsINzc51xJJpumzAqV/0a81h1 U0LJzfvC0S8ZZeF1PFG+nLkXCSJNB0ORR98jydOarBXHsGSGVQ2FmKrLXmLJLBI/ Ztk6QU2HnbKbu5E8I5nqdbC88A2oEHcT4DqdQa9LiuVjEmHBn+04aBzNMFhSXdzE p9MHvrfQ7Vc5t5GXOOodDbAxkPTxajkpG1dldYhnlnti8dD4iIiUvQc7If7+ZPE5 f3Zr1l5+5y/e1h5S1IhdHAeidZPUFEOq1pD5blKN/vy6yvbfRJHKkg0jU9949hQZ nh3ovDFz0ZaGFW/9q6QbcJg7x6xkGnIPv49d1LHISPd9aGYR53Nr/eNpKH+iDb0B YOSSob702R/lE7AxgBqUqPrpKq8LMhOq342pHFuONmxCuB75Y+20fcq3JVooUBL2 yY8sMECF9S9XQqEPHbfilzSLknnko0ULWbZZeAyw4qRToYiIS5jM63tUNzr1cZhI 7oSyG0pzTwz+4nhaq1zAdBL2aeUh4x6ngGw/NDEHrTUQj9xe3atyAVFMvMXCIdGF +S/E1kmdQHwpbc1rnF8YVpen+T1V74UDbnveqr+ZX61KuOGbZ9UIZ3t2IVz+wAD5 mGkxO97ddYyXPTpez4gc =I5IE -----END PGP SIGNATURE----- --=-=-=--