[gnus git] branch master updated: m0-7-88-gd575d9b =3= Put the <title> into a page header ; Allow customizing the <li> "bullet" ; Add support for SVG images

Lars Magne Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  d575d9bfc43bc17a6b36340413153eacfc0016dc (commit)
       via  683033623187f1386008eb87e38417283bad1ca0 (commit)
       via  e0f550aa54ba0ea2e35a2fbafa8157e64f563746 (commit)
      from  f51a1216b43c84bd148fb6f08ff986581f0fca8c (commit)


- Log -----------------------------------------------------------------
commit d575d9bfc43bc17a6b36340413153eacfc0016dc
Author: Rüdiger Sonderfeld <[email protected]>
Date:   Sun Jun 16 16:23:23 2013 +0200

    Put the <title> into a page header
    
    * eww.el (eww): New group.
    (eww-header-line-format): New custom variable.
    (eww-current-title): New variable.
    (eww-display-html): Update header and handle title tag.
    (eww-update-header-line-format): New function.
    (eww-tag-title): New function.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b538076..551d360 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,12 @@
 2013-06-16  Rüdiger Sonderfeld  <[email protected]>
 
+	* eww.el (eww): New group.
+	(eww-header-line-format): New custom variable.
+	(eww-current-title): New variable.
+	(eww-display-html): Update header and handle title tag.
+	(eww-update-header-line-format): New function.
+	(eww-tag-title): New function.
+
 	* shr.el (shr-dom-to-xml): (shr-dom-to-xml): New function.
 	(shr-tag-svg): Add support for the SVG tag.
 	(shr-bullet): New custom variable.
diff --git a/lisp/eww.el b/lisp/eww.el
index ddc4edd..6579d1a 100644
--- a/lisp/eww.el
+++ b/lisp/eww.el
@@ -29,7 +29,22 @@
 (require 'url)
 (require 'mm-url)
 
+(defgroup eww nil
+  "Emacs Web Wowser"
+  :version "24.4"
+  :group 'hypermedia
+  :prefix "eww-")
+
+(defcustom eww-header-line-format "%t: %u"
+  "Header line format.
+- %t is replaced by the title.
+- %u is replaced by the URL."
+  :group 'eww
+  :type 'string)
+
 (defvar eww-current-url nil)
+(defvar eww-current-title ""
+  "Title of current page.")
 (defvar eww-history nil)
 
 ;;;###autoload
@@ -104,9 +119,11 @@
 	  (libxml-parse-html-region (point) (point-max)))))
     (eww-setup-buffer)
     (setq eww-current-url url)
+    (eww-update-header-line-format)
     (let ((inhibit-read-only t)
 	  (shr-external-rendering-functions
-	   '((form . eww-tag-form)
+	   '((title . eww-tag-title)
+	     (form . eww-tag-form)
 	     (input . eww-tag-input)
 	     (body . eww-tag-body)
 	     (select . eww-tag-select))))
@@ -114,6 +131,20 @@
       (eww-convert-widgets))
     (goto-char (point-min))))
 
+(defun eww-update-header-line-format ()
+  (if eww-header-line-format
+      (setq header-line-format (format-spec eww-header-line-format
+                                            `((?u . ,eww-current-url)
+                                              (?t . ,eww-current-title))))
+    (setq header-line-format nil)))
+
+(defun eww-tag-title (cont)
+  (setq eww-current-title "")
+  (dolist (sub cont)
+    (when (eq (car sub) 'text)
+      (setq eww-current-title (concat eww-current-title (cdr sub)))))
+  (eww-update-header-line-format))
+
 (defun eww-tag-body (cont)
   (let* ((start (point))
 	 (fgcolor (cdr (or (assq :fgcolor cont)

commit 683033623187f1386008eb87e38417283bad1ca0
Author: Rüdiger Sonderfeld <[email protected]>
Date:   Sun Jun 16 16:19:38 2013 +0200

    Allow customizing the <li> "bullet"
    
    (shr-bullet): New custom variable.
    (shr-tag-li): Support custom bullet in unordered lists.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2b2b63c..b538076 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,8 @@
 
 	* shr.el (shr-dom-to-xml): (shr-dom-to-xml): New function.
 	(shr-tag-svg): Add support for the SVG tag.
+	(shr-bullet): New custom variable.
+	(shr-tag-li): Support custom bullet in unordered lists.
 
 2013-06-16  Lars Magne Ingebrigtsen  <[email protected]>
 
diff --git a/lisp/shr.el b/lisp/shr.el
index 5173908..7f79e1a 100644
--- a/lisp/shr.el
+++ b/lisp/shr.el
@@ -83,6 +83,14 @@ used."
 		 (const   :tag "Use the width of the window" nil))
   :group 'shr)
 
+(defcustom shr-bullet "* "
+  "Bullet used for unordered lists.
+Alternative suggestions are:
+- \"  \"
+- \"  \""
+  :type 'string
+  :group 'shr)
+
 (defvar shr-content-function nil
   "If bound, this should be a function that will return the content.
 This is used for cid: URLs, and the function is called with the
@@ -1128,7 +1136,7 @@ ones, in case fg and bg are nil."
 	      (prog1
 		  (format "%d " shr-list-mode)
 		(setq shr-list-mode (1+ shr-list-mode)))
-	    "* "))
+	    shr-bullet))
 	 (shr-indentation (+ shr-indentation (length bullet))))
     (insert bullet)
     (shr-generic cont)))

commit e0f550aa54ba0ea2e35a2fbafa8157e64f563746
Author: Rüdiger Sonderfeld <[email protected]>
Date:   Sun Jun 16 16:18:02 2013 +0200

    Add support for SVG images
    
    * shr.el (shr-dom-to-xml): (shr-dom-to-xml): New function.
    (shr-tag-svg): Add support for the SVG tag.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7a1d4b1..2b2b63c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2013-06-16  Rüdiger Sonderfeld  <[email protected]>
+
+	* shr.el (shr-dom-to-xml): (shr-dom-to-xml): New function.
+	(shr-tag-svg): Add support for the SVG tag.
+
 2013-06-16  Lars Magne Ingebrigtsen  <[email protected]>
 
 	* shr.el (shr-expand-url): Respect // URLs.
diff --git a/lisp/shr.el b/lisp/shr.el
index 7ed5778..5173908 100644
--- a/lisp/shr.el
+++ b/lisp/shr.el
@@ -905,8 +905,31 @@ ones, in case fg and bg are nil."
 (defun shr-tag-comment (cont)
   )
 
+(defun shr-dom-to-xml (dom)
+  "Convert DOM into a string containing the xml representation."
+  (let ((arg " ")
+        (text ""))
+    (dolist (sub (cdr dom))
+      (cond
+       ((listp (cdr sub))
+        (setq text (concat text (dom-to-text sub))))
+       ((eq (car sub) 'text)
+        (setq text (concat text (cdr sub))))
+       (t
+        (setq arg (concat arg (format "%s=\"%s\" "
+                                      (substring (symbol-name (car sub)) 1)
+                                      (cdr sub)))))))
+    (format "<%s%s>%s</%s>"
+            (car dom)
+            (substring arg 0 (1- (length arg)))
+            text
+            (car dom))))
+
 (defun shr-tag-svg (cont)
-  )
+  (when (image-type-available-p 'svg)
+    (funcall shr-put-image-function
+             (shr-dom-to-xml (cons 'svg cont))
+             "SVG Image")))
 
 (defun shr-tag-sup (cont)
   (let ((start (point)))

-----------------------------------------------------------------------
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 |   14 ++++++++++++++
 lisp/eww.el    |   33 ++++++++++++++++++++++++++++++++-
 lisp/shr.el    |   35 +++++++++++++++++++++++++++++++++--
 3 files changed, 79 insertions(+), 3 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.