[gnus git] branch master updated: m0-7-144-g9745b0e =1= * eww.el (eww-process-text-input): Display passwords as asterisks.

Lars Magne Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  9745b0e751fffedf6929067c5559718654ae9e36 (commit)
      from  46c22a7cc913e94deb9ef826887fff586b32df5b (commit)


- Log -----------------------------------------------------------------
commit 9745b0e751fffedf6929067c5559718654ae9e36
Author: Lars Magne Ingebrigtsen <[email protected]>
Date:   Wed Jun 19 23:37:35 2013 +0200

    * eww.el (eww-process-text-input): Display passwords as asterisks.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2b0ab1b..f7ae63f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
 2013-06-19  Lars Magne Ingebrigtsen  <[email protected]>
 
+	* eww.el (eww-process-text-input): Display passwords as asterisks.
+
 	* shr.el (shr-make-table-1): Protect against invalid column-spans.
 
 2013-06-19  Tom Tromey  <[email protected]>
diff --git a/lisp/eww.el b/lisp/eww.el
index 2bc0750..b09d873 100644
--- a/lisp/eww.el
+++ b/lisp/eww.el
@@ -523,7 +523,7 @@ appears in a <link> or <a> tag."
 	       (member type '("text" "password" "textarea")))
       (cond
        ((zerop length)
-	;; Delete some text
+	;; Delete some space at the end.
 	(save-excursion
 	  (goto-char
 	   (if (equal type "textarea")
@@ -545,9 +545,17 @@ appears in a <link> or <a> tag."
 	  (let ((start (point)))
 	    (insert (make-string length ? ))
 	    (set-text-properties start (point) properties)))))
-      (plist-put form :value (buffer-substring-no-properties
+      (let ((value (buffer-substring-no-properties
 			      (eww-beginning-of-field)
-			      (eww-end-of-field))))))
+		    (eww-end-of-field))))
+	(when (string-match " +\\'" value)
+	  (setq value (substring value 0 (match-beginning 0))))
+	(plist-put form :value value)
+	(when (equal type "password")
+	  ;; Display passwords as asterisks.
+	  (let ((start (eww-beginning-of-field)))
+	    (put-text-property start (+ start (length value))
+			       'display (make-string (length value) ?*))))))))
 
 (defun eww-tag-textarea (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 |    2 ++
 lisp/eww.el    |   20 ++++++++++++++------
 2 files changed, 16 insertions(+), 6 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.