1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-09 21:20:45 -08:00

eww improvements

* net/eww.el (eww): Work more correctly for file: URLs.
(eww-detect-charset): Allow quoted charsets.
(eww-yank-page-url): New command and keystroke.
This commit is contained in:
Ivan Kanis 2013-06-24 15:42:07 +02:00 committed by Lars Magne Ingebrigtsen
parent 46f749821a
commit b89fc1569b
2 changed files with 15 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2013-06-24 Ivan Kanis <ivan@kanis.fr>
* net/eww.el (eww): Work more correctly for file: URLs.
(eww-detect-charset): Allow quoted charsets.
(eww-yank-page-url): New command and keystroke.
2013-06-24 Daiki Ueno <ueno@gnu.org>
* epg.el (epg-make-context): Check if PROTOCOL is valid; embed the

View file

@ -116,8 +116,9 @@ word(s) will be searched for via `eww-search-prefix'."
(> (length (split-string url "\\.")) 1))
(unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url)
(setq url (concat "http://" url)))
(setq url (concat eww-search-prefix
(replace-regexp-in-string " " "+" url))))
(unless (string-match-p "^file:" url)
(setq url (concat eww-search-prefix
(replace-regexp-in-string " " "+" url)))))
(url-retrieve url 'eww-render (list url)))
;;;###autoload
@ -189,7 +190,7 @@ word(s) will be searched for via `eww-search-prefix'."
(pt (point)))
(or (and html-p
(re-search-forward
"<meta[\t\n\r ]+[^>]*charset=\"?\\([^\t\n\r \"/>]+\\)" nil t)
"<meta[\t\n\r ]+[^>]*charset=\"?\\([^\t\n\r \"/>]+\\)[\\\"'.*]" nil t)
(goto-char pt)
(match-string 1))
(and (looking-at
@ -330,6 +331,7 @@ word(s) will be searched for via `eww-search-prefix'."
(define-key map "u" 'eww-up-url)
(define-key map "t" 'eww-top-url)
(define-key map "w" 'eww-browse-with-external-browser)
(define-key map "y" 'eww-yank-page-url)
map))
(define-derived-mode eww-mode nil "eww"
@ -847,6 +849,10 @@ The browser to used is specified by the `eww-external-browser' variable."
(interactive)
(funcall eww-external-browser eww-current-url))
(defun eww-yank-page-url ()
(interactive)
(message eww-current-url)
(kill-new eww-current-url))
(provide 'eww)
;;; eww.el ends here