From: Tim Vaughan Date: Wed, 29 May 2019 08:17:17 +0000 (+0200) Subject: Optionally buttinofy URLs in "i" type dir entries. X-Git-Tag: v1.1.1~13 X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=elpher.git;a=commitdiff_plain;h=5ce47dc02e9a2591a7673d9c9fc3ed1e465f81fc Optionally buttinofy URLs in "i" type dir entries. --- diff --git a/elpher.el b/elpher.el index b977a8c..a8f8edd 100644 --- a/elpher.el +++ b/elpher.el @@ -163,6 +163,11 @@ Otherwise, use the system browser via the BROWSE-URL function." :type '(boolean)) +(defcustom elpher-buttonify-urls-in-directories nil + "If non-nil, turns URLs matched in \"i\" item types in directories +into clickable buttons." + :type '(boolean)) + (defcustom elpher-cache-images nil "If non-nil, cache images in memory in the same way as other content." :type '(boolean)) @@ -173,7 +178,6 @@ Otherwise, a list containing the selector, host and port of a directory to use as the start page." :type '(list string string integer)) - ;;; Model ;; @@ -334,8 +338,11 @@ content and cursor position fields of the node." selector host port))) (pcase type (?i (elpher-insert-margin) ;; Information - (insert (propertize display-string - 'face 'elpher-info))) + (insert (propertize + (if elpher-buttonify-urls-in-directories + (elpher-buttonify-urls display-string) + display-string) + 'face 'elpher-info))) (?h (elpher-insert-margin "W") ;; Web link (let ((url (elt (split-string selector "URL:") 1))) (insert-text-button display-string