[gnus git] branch master updated: m0-7-69-gba73664 =4= Make file:// links work ; (eww-mode): Use `define-derived-mode'. ; * eww.el (eww): Prepend urls with http:// if scheme is missing. ; * eww.el (eww-detect-charset): Detect charset from the <meta> tag.

Lars Magne Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  ba7366475d45e7dad36fd53c42175ada2529710c (commit)
       via  b17360d04303d6cd9d54f2dd19d36d52ef077660 (commit)
       via  6552bfbda9a9ffe53f06b1429172597f556d0036 (commit)
       via  cdf8dd7af80884ce292f5ab7ea3c1a4f88e463d6 (commit)
      from  80b02fdb8733cfe4afdbd7478017a7b5adfa49c3 (commit)


- Log -----------------------------------------------------------------
commit ba7366475d45e7dad36fd53c42175ada2529710c
Author: Rüdiger Sonderfeld <[email protected]>
Date:   Thu Jun 13 07:42:37 2013 +0200

    Make file:// links work
    
    (eww-parse-headers): Parse headers from beginning of buffer so that
    file:// links work.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a674928..be24fa7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,8 @@
 
 	* eww.el (eww): Prepend urls with http:// if scheme is missing.
 	(eww-mode): Use `define-derived-mode'.
+	(eww-parse-headers): Parse headers from beginning of buffer so that
+	file:// links work.
 
 2013-06-13  Katsumi Yamaoka  <[email protected]>
 
diff --git a/lisp/eww.el b/lisp/eww.el
index 1e2abfd..3f0399e 100644
--- a/lisp/eww.el
+++ b/lisp/eww.el
@@ -80,6 +80,7 @@
 
 (defun eww-parse-headers ()
   (let ((headers nil))
+    (goto-char (point-min))
     (while (and (not (eobp))
 		(not (eolp)))
       (when (looking-at "\\([^:]+\\): *\\(.*\\)")

commit b17360d04303d6cd9d54f2dd19d36d52ef077660
Author: Rüdiger Sonderfeld <[email protected]>
Date:   Thu Jun 13 07:41:06 2013 +0200

    (eww-mode): Use `define-derived-mode'.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2b703cf..a674928 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,6 +1,7 @@
 2013-06-13  Rüdiger Sonderfeld  <[email protected]>
 
 	* eww.el (eww): Prepend urls with http:// if scheme is missing.
+	(eww-mode): Use `define-derived-mode'.
 
 2013-06-13  Katsumi Yamaoka  <[email protected]>
 
diff --git a/lisp/eww.el b/lisp/eww.el
index e0997c2..1e2abfd 100644
--- a/lisp/eww.el
+++ b/lisp/eww.el
@@ -145,17 +145,12 @@
     ;;(define-key map "n" 'eww-next-url)
     map))
 
-(defun eww-mode ()
+(define-derived-mode eww-mode nil "eww"
   "Mode for browsing the web.
 
 \\{eww-mode-map}"
-  (interactive)
-  (setq major-mode 'eww-mode
-	mode-name "eww")
   (set (make-local-variable 'eww-current-url) 'author)
-  (set (make-local-variable 'browse-url-browser-function) 'eww-browse-url)
-  ;;(setq buffer-read-only t)
-  (use-local-map eww-mode-map))
+  (set (make-local-variable 'browse-url-browser-function) 'eww-browse-url))
 
 (defun eww-browse-url (url &optional new-window)
   (push (list eww-current-url (point))

commit 6552bfbda9a9ffe53f06b1429172597f556d0036
Author: Rüdiger Sonderfeld <[email protected]>
Date:   Thu Jun 13 07:39:34 2013 +0200

    * eww.el (eww): Prepend urls with http:// if scheme is missing.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f41d86d..2b703cf 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2013-06-13  Rüdiger Sonderfeld  <[email protected]>
+
+	* eww.el (eww): Prepend urls with http:// if scheme is missing.
+
 2013-06-13  Katsumi Yamaoka  <[email protected]>
 
 	* eww.el (eww-detect-charset): Detect charset from the <meta> tag.
diff --git a/lisp/eww.el b/lisp/eww.el
index 8f8dbec..e0997c2 100644
--- a/lisp/eww.el
+++ b/lisp/eww.el
@@ -36,6 +36,8 @@
 (defun eww (url)
   "Fetch URL and render the page."
   (interactive "sUrl: ")
+  (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url)
+    (setq url (concat "http://" url)))
   (url-retrieve url 'eww-render (list url)))
 
 (defun eww-detect-charset (html-p)

commit cdf8dd7af80884ce292f5ab7ea3c1a4f88e463d6
Author: Katsumi Yamaoka <[email protected]>
Date:   Thu Jun 13 07:38:23 2013 +0200

    * eww.el (eww-detect-charset): Detect charset from the <meta> tag.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1072910..f41d86d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2013-06-13  Katsumi Yamaoka  <[email protected]>
+
+	* eww.el (eww-detect-charset): Detect charset from the <meta> tag.
+
 2013-06-12  Lars Magne Ingebrigtsen  <[email protected]>
 
 	* shr.el (shr-tag-svg): Ignore SVG elements, because we don't know how
diff --git a/lisp/eww.el b/lisp/eww.el
index 3e79973..8f8dbec 100644
--- a/lisp/eww.el
+++ b/lisp/eww.el
@@ -38,6 +38,18 @@
   (interactive "sUrl: ")
   (url-retrieve url 'eww-render (list url)))
 
+(defun eww-detect-charset (html-p)
+  (let ((case-fold-search t)
+	(pt (point)))
+    (or (and html-p
+	     (re-search-forward
+	      "<meta[\t\n\r ]+[^>]*charset=\\([^\t\n\r \"/>]+\\)" nil t)
+	     (goto-char pt)
+	     (match-string 1))
+	(and (looking-at
+	      "[\t\n\r ]*<\\?xml[\t\n\r ]+[^>]*encoding=\"\\([^\"]+\\)")
+	     (match-string 1)))))
+
 (defun eww-render (status url &optional point)
   (let* ((headers (eww-parse-headers))
 	 (content-type
@@ -47,6 +59,8 @@
 	 (charset (intern
 		   (downcase
 		    (or (cdr (assq 'charset (cdr content-type)))
+			(eww-detect-charset (equal (car content-type)
+						   "text/html"))
 			"utf8"))))
 	 (data-buffer (current-buffer)))
     (unwind-protect

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog |   11 +++++++++++
 lisp/eww.el    |   26 +++++++++++++++++++-------
 2 files changed, 30 insertions(+), 7 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.