From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.bugs Subject: bug#24639: [PATCH] Send text received by bracketed paste to process Date: Sun, 6 Nov 2016 19:43:05 +0100 Message-ID: <20161106184305.73100-2-p.stephani2@gmail.com> References: <83k2d91wir.fsf@gnu.org> <20161106184305.73100-1-p.stephani2@gmail.com> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1478457955 23380 195.159.176.226 (6 Nov 2016 18:45:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 6 Nov 2016 18:45:55 +0000 (UTC) Cc: Philipp Stephani , 24639@debbugs.gnu.org To: eliz@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 06 19:45:51 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3SRM-000150-R9 for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Nov 2016 19:45:12 +0100 Original-Received: from localhost ([::1]:46259 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3SRP-0000f7-AT for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Nov 2016 13:45:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3SRG-0000d1-No for bug-gnu-emacs@gnu.org; Sun, 06 Nov 2016 13:45:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3SRC-0000sS-RS for bug-gnu-emacs@gnu.org; Sun, 06 Nov 2016 13:45:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59966) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c3SRC-0000sD-OH for bug-gnu-emacs@gnu.org; Sun, 06 Nov 2016 13:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c3SRC-00031j-Fh for bug-gnu-emacs@gnu.org; Sun, 06 Nov 2016 13:45:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Nov 2016 18:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24639 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24639-submit@debbugs.gnu.org id=B24639.147845789511609 (code B ref 24639); Sun, 06 Nov 2016 18:45:02 +0000 Original-Received: (at 24639) by debbugs.gnu.org; 6 Nov 2016 18:44:55 +0000 Original-Received: from localhost ([127.0.0.1]:47132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3SR5-00031B-B1 for submit@debbugs.gnu.org; Sun, 06 Nov 2016 13:44:55 -0500 Original-Received: from mail-wm0-f66.google.com ([74.125.82.66]:33260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3SR3-00030x-BF for 24639@debbugs.gnu.org; Sun, 06 Nov 2016 13:44:53 -0500 Original-Received: by mail-wm0-f66.google.com with SMTP id u144so12860332wmu.0 for <24639@debbugs.gnu.org>; Sun, 06 Nov 2016 10:44:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5D8CApQ9+gOS3B9jpyInF8WK3zHZJLf0dztRHGfu7Xw=; b=TXCRL4mMGe7t1CLbYS6nmauryd7MNmnMoODp5OemqOqt76rLIEC2eL9LVpZtajYyD3 he0Tdhtja9JodAc4hlnGEHAVUxkhMgEXXdrxCHT2tvFi/8vWoqTPSnJykd8NVI64VvPT b5920kDKIevwEms/UETyX7bXxDpu3s61ZmI6+apSZYT36m6gyPUpvdqbnW3DFmKyiLgD sQS3Dt16FdZawryPlhJSdQsFe5R2RfGlt4nGLUzWVxCpww7h1TNR5tK3wpTWHrzBg8El qcAQskAEVPIQXDvAknMCjqIAiA2jbxw7EZdweS/BJlQ7VWfdZvYfLplYs1Q7V03ihEci BAEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5D8CApQ9+gOS3B9jpyInF8WK3zHZJLf0dztRHGfu7Xw=; b=cOURpL4iNIb35XbHAhSIetlopBT58TTTLBuz8XHOCB+w5TDHQRWJyHzxTTmlJKVQ+0 ufwkQ0k1p9DLRk8lniduORPx2X7RcaX+aTUnii2jvq5U6Go/GFqVmWNt4dIRlq6bNR9k +P8aQORFnjTExEcdh66nJ+TCLLWCwgCxzBlZbzppyjrvUOnA38NYyw9fwdFYTqvYXVaf 2APqkx1kmtMrEPv4JyPgurRkm3Hjj1EYFdjqWqaZMTB6aexL7toq6B95Kd7QWtxNBv2H YhxUns8WwzCg37F0H/qX4s0fqTs//oNsijBJ7p53rvZKz1GzpyzRZdNKAK9xm93w02cQ 8POQ== X-Gm-Message-State: ABUngvfWRVfWjpZ0FJteJW+Y5p3EVPMoendG3nY8khjfH+DQ29DCl7lPOYXol5sT/NCY5Q== X-Received: by 10.28.107.21 with SMTP id g21mr3891970wmc.131.1478457887642; Sun, 06 Nov 2016 10:44:47 -0800 (PST) Original-Received: from p.cm.cablesurf.de (46.128.198.151.dynamic.cablesurf.de. [46.128.198.151]) by smtp.gmail.com with ESMTPSA id 125sm8998319wmh.14.2016.11.06.10.44.46 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 06 Nov 2016 10:44:47 -0800 (PST) X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161106184305.73100-1-p.stephani2@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:125391 Archived-At: From: Philipp Stephani Fixes #24639 * term.el (term--xterm-paste): New function. (term-raw-map): Use it. (xterm--pasted-text): Declare function from xterm.el. --- lisp/term.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lisp/term.el b/lisp/term.el index 993e580..18d6775 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -845,6 +845,7 @@ term-raw-map (define-key map [S-insert] 'term-paste) (define-key map [prior] 'term-send-prior) (define-key map [next] 'term-send-next) + (define-key map [xterm-paste] #'term--xterm-paste) map) "Keyboard map for sending characters directly to the inferior process.") @@ -1211,6 +1212,13 @@ term-paste (interactive) (term-send-raw-string (current-kill 0))) +(defun term--xterm-paste () + "Insert the text pasted in an XTerm bracketed paste operation." + (interactive) + (term-send-raw-string (xterm--pasted-text))) + +(declare-function xterm--pasted-text "term/xterm" ()) + ;; Which would be better: "\e[A" or "\eOA"? readline accepts either. ;; For my configuration it's definitely better \eOA but YMMV. -mm ;; For example: vi works with \eOA while elm wants \e[A ... -- 2.10.1