summaryrefslogtreecommitdiff
path: root/emacsmail.sh
diff options
context:
space:
mode:
Diffstat (limited to 'emacsmail.sh')
-rw-r--r--emacsmail.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/emacsmail.sh b/emacsmail.sh
new file mode 100644
index 0000000..a815997
--- /dev/null
+++ b/emacsmail.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+# emacs-mailto-handler
+
+mailto=$1
+mailto="mailto:${mailto#mailto:}"
+mailto=$(printf '%s\n' "$mailto" | sed -e 's/[\"]/\\&/g')
+elisp_expr="(mailto-compose-mail \"$mailto\")"
+
+emacsclient -a "" -c -n --eval "$elisp_expr" \
+ '(set-window-dedicated-p (selected-window) t)'