X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=blobdiff_plain;f=elopher.el;h=4617d08387e5d18e5444a1363bf79cc7bdefe0de;hb=82186e0784e0baed9f6b6f8d84da34a5cd1d5963;hp=217ef983605585f3e07a6764e35127d4a6821df2;hpb=c695f0cfa7b424e174cb736ef44efd1980acff41;p=elpher.git diff --git a/elopher.el b/elopher.el index 217ef98..4617d08 100644 --- a/elopher.el +++ b/elopher.el @@ -306,7 +306,7 @@ The result is stored as a string in the variable elopher-selector-string." ;; Text retrieval -(defvar elopher-url-regex "\\(https?\\|gopher\\)://\\([a-z.\-]+\\)\\(?3::[0-9]+\\)?\\(?4:/[^ \r\n\t(),]*\\)") +(defvar elopher-url-regex "\\(https?\\|gopher\\)://\\([a-zA-Z0-9.\-]+\\)\\(?3::[0-9]+\\)?\\(?4:/[^ \r\n\t(),]*\\)") (defun elopher-buttonify-urls (string) "Turn substrings which look like urls in STRING into clickable buttons." @@ -532,11 +532,13 @@ The result is stored as a string in the variable elopher-selector-string." (interactive) (let ((button (button-at (point)))) (if button - (elopher-visit-node (button-get button 'elopher-node) - #'elopher-get-node-download) + (let ((node (button-get button 'elopher-node))) + (if node + (elopher-visit-node (button-get button 'elopher-node) + #'elopher-get-node-download) + (message "Can only download gopher links, not general URLs."))) (message "No link selected.")))) - ;;; Mode and keymap ;;