From 34a5ea4e12b23b6fc6573768a512070891cc8c43 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Tue, 5 May 2009 11:18:43 +0100 Subject: [PATCH] un-backslashify-selection: Handy X hack. Now I'm using Emacs for reading email again, there's a small problem. Long URLs are broken across lines with a backslash/newline pair. This makes them a bit tricky to paste into Iceweasel or whatever. un-backslashify-selection reads the selection, kills the backslashes, and rewrites the selection. This command is bound to M5-F7, so pasting is fairly painless. (An extension is the right answer, but that's way more work.) --- e16-bindings | 1 + setup | 1 + un-backslashify-selection | 11 +++++++++++ 3 files changed, 13 insertions(+) create mode 100755 un-backslashify-selection diff --git a/e16-bindings b/e16-bindings index 3677955..1a4b870 100644 --- a/e16-bindings +++ b/e16-bindings @@ -33,6 +33,7 @@ KeyDown S5 Down area move 0 1 KeyDown S5 Up area move 0 -1 KeyDown S5 Left area move -1 0 KeyDown S5 Right area move 1 0 +KeyDown 5 F7 exec un-backslashify-selection KeyDown 5 F8 exec xatom set XINIT_COMMAND :terminal KeyDown 5 F9 exec xatom set XINIT_COMMAND :ask-run KeyDown 5 F10 exec xatom set XINIT_COMMAND :ask-command diff --git a/setup b/setup index da1d071..0d39cdb 100755 --- a/setup +++ b/setup @@ -197,6 +197,7 @@ scripts=" hyperspec" [ "$xstuff" ] && scripts="$scripts xinitcmd + un-backslashify-selection xshutdown" echo "Installing scripts..." mkdir -p $HOME$sub/bin diff --git a/un-backslashify-selection b/un-backslashify-selection new file mode 100755 index 0000000..5bb279c --- /dev/null +++ b/un-backslashify-selection @@ -0,0 +1,11 @@ +#! /bin/sh + +xsel -o | sed ' + s:\\::g + H +$ !d + + x + s:\ +::g +' | xsel -i -- 2.11.0