From 56890ecdb898f5261d6a1d8420dc5daef8efa2d0 Mon Sep 17 00:00:00 2001 From: Kenjiro NAKAYAMA Date: Sun, 22 Dec 2013 17:40:35 -0500 Subject: [PATCH] eww: jump to next select field easier and better ftp error * net/eww.el (eww-tag-select): Add text-property to jump to next select field. (eww) : Add non-supported ftp error. --- lisp/ChangeLog | 6 ++++++ lisp/net/eww.el | 30 +++++++++++++++++------------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d303bc215d8..fe564a9c8a2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-12-22 Kenjiro NAKAYAMA + + * net/eww.el (eww-tag-select): Add text-property to jump to next + select field. + (eww) : Add non-supported ftp error. + 2013-12-22 Dmitry Gutov * progmodes/ruby-mode.el (ruby--electric-indent-p): Improve the diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 15bb2c09a3a..89a7eb9e050 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -144,19 +144,21 @@ See also `eww-form-checkbox-selected-symbol'." If the input doesn't look like an URL or a domain name, the word(s) will be searched for via `eww-search-prefix'." (interactive "sEnter URL or keywords: ") - (cond ((string-match-p "\\`file:" url)) - (t - (if (and (= (length (split-string url)) 1) - (or (> (length (split-string url "\\.")) 1) - (string-match eww-local-regex url))) - (progn - (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url) - (setq url (concat "http://" url))) - ;; some site don't redirect final / - (when (string= (url-filename (url-generic-parse-url url)) "") - (setq url (concat url "/")))) - (setq url (concat eww-search-prefix - (replace-regexp-in-string " " "+" url)))))) + (cond ((string-match-p "\\`file://" url)) + ((string-match-p "\\`ftp://" url) + (user-error "FTP is not supported.")) + (t + (if (and (= (length (split-string url)) 1) + (or (> (length (split-string url "\\.")) 1) + (string-match eww-local-regex url))) + (progn + (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url) + (setq url (concat "http://" url))) + ;; some site don't redirect final / + (when (string= (url-filename (url-generic-parse-url url)) "") + (setq url (concat url "/")))) + (setq url (concat eww-search-prefix + (replace-regexp-in-string " " "+" url)))))) (url-retrieve url 'eww-render (list url))) ;;;###autoload (defalias 'browse-web 'eww) @@ -847,6 +849,8 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.") (put-text-property start (point) 'eww-form menu) (add-face-text-property start (point) 'eww-form-select) (put-text-property start (point) 'keymap eww-select-map) + (unless (= start (point)) + (put-text-property start (1+ start) 'help-echo "select field")) (shr-ensure-paragraph)))) (defun eww-select-display (select) -- 2.39.2