[gnus git] branch master updated: m0-7-116-g6c74b53 =3= (eww-convert-widgets): Fix last patch. ; * eww.el (eww-tag-select): Don't render totally empty <select> forms. ; Make input fields on their own lines work

Lars Magne Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  6c74b53e357ecec4f6e48c1dbba4d60129d874dc (commit)
       via  d35146fa43e9e2d8d346073c3c0692162abf4759 (commit)
       via  53ba8f343521c48f295df2a0238aa6b9e55a975e (commit)
      from  85de68c435317f0e5ec851498a4ff163c3d1c596 (commit)


- Log -----------------------------------------------------------------
commit 6c74b53e357ecec4f6e48c1dbba4d60129d874dc
Author: Lars Magne Ingebrigtsen <[email protected]>
Date:   Mon Jun 17 23:59:46 2013 +0200

    (eww-convert-widgets): Fix last patch.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 34703c8..d1ec5f2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,6 +1,9 @@
 2013-06-17  Lars Magne Ingebrigtsen  <[email protected]>
 
 	* eww.el (eww-tag-select): Don't render totally empty <select> forms.
+	(eww-convert-widgets): Don't bug out if the first widget starts at the
+	beginning of the buffer.
+	(eww-convert-widgets): Fix last patch.
 
 	* shr.el (shr-insert-table): Respect border-collapse: collapse.
 	(shr-tag-base): Protect against base specs that are degenerate.
diff --git a/lisp/eww.el b/lisp/eww.el
index 811aa57..fc6f591 100644
--- a/lisp/eww.el
+++ b/lisp/eww.el
@@ -308,7 +308,7 @@
 		  :size (string-to-number
 			 (or (cdr (assq :size cont))
 			     "40"))
-		  :value value
+		  :value (or value "")
 		  :secret (and (equal type "password") ?*)
 		  :action 'eww-submit
 		  :name (cdr (assq :name cont))
@@ -449,7 +449,9 @@
     ;; so we need to nix out the list of widgets and recreate them.
     (setq widget-field-list nil
 	  widget-field-new nil)
-    (while (setq start (next-single-property-change start 'eww-widget))
+    (while (setq start (if (get-text-property start 'eww-widget)
+			   start
+			 (next-single-property-change start 'eww-widget)))
       (setq widget (get-text-property start 'eww-widget))
       (goto-char start)
       (let ((end (next-single-property-change start 'eww-widget)))

commit d35146fa43e9e2d8d346073c3c0692162abf4759
Author: Lars Magne Ingebrigtsen <[email protected]>
Date:   Mon Jun 17 23:49:24 2013 +0200

    * eww.el (eww-tag-select): Don't render totally empty <select> forms.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 06a930c..34703c8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
 2013-06-17  Lars Magne Ingebrigtsen  <[email protected]>
 
+	* eww.el (eww-tag-select): Don't render totally empty <select> forms.
+
 	* shr.el (shr-insert-table): Respect border-collapse: collapse.
 	(shr-tag-base): Protect against base specs that are degenerate.
 	(shr-ensure-paragraph): Don't delete empty lines that have text
diff --git a/lisp/eww.el b/lisp/eww.el
index ccbd5ee..811aa57 100644
--- a/lisp/eww.el
+++ b/lisp/eww.el
@@ -350,13 +350,14 @@
 		    :value (cdr (assq :value (cdr elem)))
 		    :tag (cdr (assq 'text (cdr elem))))
 	      options)))
+    (when options
     ;; If we have no selected values, default to the first value.
     (unless (plist-get (cdr menu) :value)
       (nconc menu (list :value (nth 2 (car options)))))
     (nconc menu options)
     (apply 'widget-create menu)
     (put-text-property start (point) 'eww-widget menu)
-    (shr-ensure-paragraph)))
+      (shr-ensure-paragraph))))
 
 (defun eww-click-radio (widget &rest ignore)
   (let ((form (plist-get (cdr widget) :eww-form))

commit 53ba8f343521c48f295df2a0238aa6b9e55a975e
Author: Lars Magne Ingebrigtsen <[email protected]>
Date:   Mon Jun 17 23:48:00 2013 +0200

    Make input fields on their own lines work
    
    (shr-ensure-paragraph): Don't delete empty lines that have text
    properties, because these may be input fields.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 50d2180..06a930c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,8 @@
 
 	* shr.el (shr-insert-table): Respect border-collapse: collapse.
 	(shr-tag-base): Protect against base specs that are degenerate.
+	(shr-ensure-paragraph): Don't delete empty lines that have text
+	properties, because these may be input fields.
 
 	* eww.el (eww-convert-widgets): Put `help-echo' on input fields so that
 	we can navigate to them.
diff --git a/lisp/eww.el b/lisp/eww.el
index eedbde1..ccbd5ee 100644
--- a/lisp/eww.el
+++ b/lisp/eww.el
@@ -276,34 +276,39 @@
   (let* ((start (point))
 	 (type (downcase (or (cdr (assq :type cont))
 			     "text")))
+	 (value (cdr (assq :value cont)))
 	 (widget
 	  (cond
 	   ((equal type "submit")
 	    (list 'push-button
 		  :notify 'eww-submit
 		  :name (cdr (assq :name cont))
-		  :value (cdr (assq :value cont))
+		  :value (if (zerop (length value))
+			     "Submit"
+			   value)
 		  :eww-form eww-form
-		  (or (cdr (assq :value cont)) "Submit")))
+		  (or (if (zerop (length value))
+			  "Submit"
+			value))))
 	   ((or (equal type "radio")
 		(equal type "checkbox"))
 	    (list 'checkbox
 		  :notify 'eww-click-radio
 		  :name (cdr (assq :name cont))
-		  :checkbox-value (cdr (assq :value cont))
+		  :checkbox-value value
 		  :checkbox-type type
 		  :eww-form eww-form
 		  (cdr (assq :checked cont))))
 	   ((equal type "hidden")
 	    (list 'hidden
 		  :name (cdr (assq :name cont))
-		  :value (cdr (assq :value cont))))
+		  :value value))
 	   (t
 	    (list 'editable-field
 		  :size (string-to-number
 			 (or (cdr (assq :size cont))
 			     "40"))
-		  :value (or (cdr (assq :value cont)) "")
+		  :value value
 		  :secret (and (equal type "password") ?*)
 		  :action 'eww-submit
 		  :name (cdr (assq :name cont))
diff --git a/lisp/shr.el b/lisp/shr.el
index 16c2936..2d0c910 100644
--- a/lisp/shr.el
+++ b/lisp/shr.el
@@ -596,7 +596,14 @@ size, and full-buffer size."
 	  (insert "\n"))
       (if (save-excursion
 	    (beginning-of-line)
-	    (looking-at " *$"))
+	    ;; If the current line is totally blank, and doesn't even
+	    ;; have any face properties set, then delete the blank
+	    ;; space.
+	    (and (looking-at " *$")
+		 (not (get-text-property (point) 'face))
+		 (not (= (next-single-property-change (point) 'face nil
+						      (line-end-position))
+			 (line-end-position)))))
 	  (delete-region (match-beginning 0) (match-end 0))
 	(insert "\n\n")))))
 

-----------------------------------------------------------------------
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 |    7 +++++++
 lisp/eww.el    |   34 +++++++++++++++++++++-------------
 lisp/shr.el    |    9 ++++++++-
 3 files changed, 36 insertions(+), 14 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.