From mboxrd@z Thu Jan 1 00:00:00 1970 From: Friedrich Delgado Friedrichs Subject: Binding a key to org-store-link in a shell (non-eshell) Date: Sun, 18 Oct 2009 14:01:05 +0200 Message-ID: <20091018120105.GA30519@taupan.ath.cx> Reply-To: friedel@nomaden.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0913100897==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MzURp-0003OZ-Hy for emacs-orgmode@gnu.org; Sun, 18 Oct 2009 08:01:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MzURk-0003M4-QR for emacs-orgmode@gnu.org; Sun, 18 Oct 2009 08:01:17 -0400 Received: from [199.232.76.173] (port=48930 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MzURk-0003Lj-Jt for emacs-orgmode@gnu.org; Sun, 18 Oct 2009 08:01:12 -0400 Received: from dudelab.org ([212.12.33.202]:13837 helo=mail.dudelab.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MzURj-0004hM-GX for emacs-orgmode@gnu.org; Sun, 18 Oct 2009 08:01:12 -0400 Received: from abrasax.taupan.ath.cx (p5DE8A50A.dip.t-dialin.net [93.232.165.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Friedrich Delgado Friedrichs", Issuer "User CA" (verified OK)) by mail.dudelab.org (Postfix) with ESMTP id A5C9B228148 for ; Sun, 18 Oct 2009 14:01:17 +0200 (CEST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Emacs-orgmode mailing list --===============0913100897== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mYCpIKhGyMATD0i+" Content-Disposition: inline --mYCpIKhGyMATD0i+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! I usually prefer to use a regular shell in screen, and today I wanted to press my n remember keybinding on the shell, which already works in mutt and emacs (and also via bookmarklet, shortcut 'a', in firefox). I use zsh, I'm not a zsh expert (still a newbie after a couple of years), but I managed to cook up the following: In my .zshrc: # bind n to org-store-link bindkey -s "\e[20~n" 'emacsclient org-protocol://store-link://file:`uriesca= pepwd.pl`\n' And I have a little perl program in my $PATH, because doing it all with per= l -e demanded too many levels of quoting which confused me and zsh alike: uriescapepwd.pl: #!/usr/bin/perl -w use URI::Escape qw/ uri_escape uri_escape_utf8 /; use Cwd qw/getcwd abs_path/; $pwd =3D abs_path(getcwd); print uri_escape_utf8($pwd); Now I press n on the shell prompt and the following happens: friedel@abrasax:~/anon-vc/org-mode> emacsclient org-protocol://store-link:/= /file:`uriescapepwd.pl` Waiting for Emacs... And I can press Ctrl-l in an org mode buffer to insert that link. Good enough for me ;) Questions: - Are there any zsh veterans here who know a cleaner, nicer, more zsh-y way of doing this? - Any bash (or tcsh, ksh) user wants to jump in and provide their equivale= nt? - Any idea how to do this without perl, just with emacs and the shell? Have a nice sunday! FDF --=20 Friedrich Delgado Friedrichs TauPan on Ircnet and Freenode ;) --mYCpIKhGyMATD0i+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkrbA3UACgkQCTmCEtF2zECEZgCffCmYdndNalGbakF4Q/yvJy5G cooAn0wKN7NV0yRl2Uakv68751MxlV5L =Ra8j -----END PGP SIGNATURE----- --mYCpIKhGyMATD0i+-- --===============0913100897== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0913100897==--