summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-12-29 15:46:44 +0100
committerGravatar Tom Willemse2013-12-29 15:46:44 +0100
commit6c7fbd2d9d2eb6daa8adeeef4229c9ace20ef7b1 (patch)
treef5287429bfe08e68099c6ca916fa906c4ffa4796
parentc2f32bd6075d05bfd50de052e8477769aa2cb226 (diff)
downloademacs-6c7fbd2d9d2eb6daa8adeeef4229c9ace20ef7b1.tar.gz
emacs-6c7fbd2d9d2eb6daa8adeeef4229c9ace20ef7b1.zip
Make URLs clickable in eshell
-rw-r--r--.emacs.d/init.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index 93f7c20..6ac9ea5 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -1382,6 +1382,18 @@ If no direction is given, don't split."
(electric-indent-mode -1)
+(defun oni:eshell-handle-url ()
+ (save-excursion
+ (goto-char eshell-last-output-start)
+ (while (re-search-forward
+ "http://[^ \n]+" eshell-last-output-end :noerror)
+ (make-button (match-beginning 0) (match-end 0)
+ 'action (lambda (button)
+ (browse-url (button-label button)))))))
+
+(stante-after esh-mode
+ (add-to-list 'eshell-output-filter-functions #'oni:eshell-handle-url))
+
(provide 'init)
;;; init.el ends here