diff options
| author | Kenjiro NAKAYAMA | 2013-12-22 17:40:35 -0500 |
|---|---|---|
| committer | Ted Zlatanov | 2013-12-22 17:40:35 -0500 |
| commit | 56890ecdb898f5261d6a1d8420dc5daef8efa2d0 (patch) | |
| tree | 1eccc72b77d2e922c51cb1ea87cf90927b60a095 | |
| parent | 1f87a56cc78b25d96fedd0f49a93cbe5b33dedec (diff) | |
| download | emacs-56890ecdb898f5261d6a1d8420dc5daef8efa2d0.tar.gz emacs-56890ecdb898f5261d6a1d8420dc5daef8efa2d0.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | 2013-12-22 Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com> | ||
| 2 | |||
| 3 | * net/eww.el (eww-tag-select): Add text-property to jump to next | ||
| 4 | select field. | ||
| 5 | (eww) : Add non-supported ftp error. | ||
| 6 | |||
| 1 | 2013-12-22 Dmitry Gutov <dgutov@yandex.ru> | 7 | 2013-12-22 Dmitry Gutov <dgutov@yandex.ru> |
| 2 | 8 | ||
| 3 | * progmodes/ruby-mode.el (ruby--electric-indent-p): Improve the | 9 | * 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'." | |||
| 144 | If the input doesn't look like an URL or a domain name, the | 144 | If the input doesn't look like an URL or a domain name, the |
| 145 | word(s) will be searched for via `eww-search-prefix'." | 145 | word(s) will be searched for via `eww-search-prefix'." |
| 146 | (interactive "sEnter URL or keywords: ") | 146 | (interactive "sEnter URL or keywords: ") |
| 147 | (cond ((string-match-p "\\`file:" url)) | 147 | (cond ((string-match-p "\\`file://" url)) |
| 148 | (t | 148 | ((string-match-p "\\`ftp://" url) |
| 149 | (if (and (= (length (split-string url)) 1) | 149 | (user-error "FTP is not supported.")) |
| 150 | (or (> (length (split-string url "\\.")) 1) | 150 | (t |
| 151 | (string-match eww-local-regex url))) | 151 | (if (and (= (length (split-string url)) 1) |
| 152 | (progn | 152 | (or (> (length (split-string url "\\.")) 1) |
| 153 | (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url) | 153 | (string-match eww-local-regex url))) |
| 154 | (setq url (concat "http://" url))) | 154 | (progn |
| 155 | ;; some site don't redirect final / | 155 | (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url) |
| 156 | (when (string= (url-filename (url-generic-parse-url url)) "") | 156 | (setq url (concat "http://" url))) |
| 157 | (setq url (concat url "/")))) | 157 | ;; some site don't redirect final / |
| 158 | (setq url (concat eww-search-prefix | 158 | (when (string= (url-filename (url-generic-parse-url url)) "") |
| 159 | (replace-regexp-in-string " " "+" url)))))) | 159 | (setq url (concat url "/")))) |
| 160 | (setq url (concat eww-search-prefix | ||
| 161 | (replace-regexp-in-string " " "+" url)))))) | ||
| 160 | (url-retrieve url 'eww-render (list url))) | 162 | (url-retrieve url 'eww-render (list url))) |
| 161 | 163 | ||
| 162 | ;;;###autoload (defalias 'browse-web 'eww) | 164 | ;;;###autoload (defalias 'browse-web 'eww) |
| @@ -847,6 +849,8 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.") | |||
| 847 | (put-text-property start (point) 'eww-form menu) | 849 | (put-text-property start (point) 'eww-form menu) |
| 848 | (add-face-text-property start (point) 'eww-form-select) | 850 | (add-face-text-property start (point) 'eww-form-select) |
| 849 | (put-text-property start (point) 'keymap eww-select-map) | 851 | (put-text-property start (point) 'keymap eww-select-map) |
| 852 | (unless (= start (point)) | ||
| 853 | (put-text-property start (1+ start) 'help-echo "select field")) | ||
| 850 | (shr-ensure-paragraph)))) | 854 | (shr-ensure-paragraph)))) |
| 851 | 855 | ||
| 852 | (defun eww-select-display (select) | 856 | (defun eww-select-display (select) |