From: Mark Wooding Date: Tue, 5 May 2009 10:18:43 +0000 (+0100) Subject: un-backslashify-selection: Handy X hack. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/34a5ea4e12b23b6fc6573768a512070891cc8c43?ds=inline;hp=-c 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.) --- 34a5ea4e12b23b6fc6573768a512070891cc8c43 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