[gnus git] branch master updated: m0-7-47-g97df796 =1= (eww-quit): New command.

Lars Magne Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  97df796a8a29ed3085ad1514b473ecb053ddd4d0 (commit)
      from  f39e57245fa29c620d0b9c499788a12504eebb2e (commit)


- Log -----------------------------------------------------------------
commit 97df796a8a29ed3085ad1514b473ecb053ddd4d0
Author: Lars Magne Ingebrigtsen <[email protected]>
Date:   Mon Jun 10 11:53:44 2013 +0200

    (eww-quit): New command.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0bd0fe8..8193f93 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,7 @@
 
 	* eww.el: Start writing a new, tiny web browser.
 	(eww-previous-url): New command.
+	(eww-quit): New command.
 
 2013-06-10  Albert Krewinkel  <[email protected]>
 
diff --git a/lisp/eww.el b/lisp/eww.el
index b43586b..c637154 100644
--- a/lisp/eww.el
+++ b/lisp/eww.el
@@ -31,7 +31,6 @@
 
 (defvar eww-current-url nil)
 (defvar eww-history nil)
-(defvar eww-current-page nil)
 
 (defun eww (url)
   "Fetch URL and render the page."
@@ -84,31 +83,39 @@
 	  (libxml-parse-html-region (point) (point-max)))))
     (eww-setup-buffer)
     (setq eww-current-url url)
-    (shr-insert-document document)
+    (let ((inhibit-read-only t))
+      (shr-insert-document document))
     (goto-char (point-min))))
 
 (defun eww-display-raw (charset)
   (let ((data (buffer-substring (point) (point-max))))
     (eww-setup-buffer)
-    (insert data)
+    (let ((inhibit-read-only t))
+      (insert data))
     (goto-char (point-min))))
 
 (defun eww-display-image ()
   (let ((data (buffer-substring (point) (point-max))))
     (eww-setup-buffer)
-    (shr-put-image data nil)
+    (let ((inhibit-read-only t))
+      (shr-put-image data nil))
     (goto-char (point-min))))
 
 (defun eww-setup-buffer ()
   (pop-to-buffer (get-buffer-create "*eww*"))
-  (erase-buffer)
+  (let ((inhibit-read-only t))
+    (erase-buffer))
   (eww-mode))
 
 (defvar eww-mode-map
   (let ((map (make-sparse-keymap)))
+    (suppress-keymap map)
     (define-key map "q" 'eww-quit)
     (define-key map [tab] 'widget-forward)
     (define-key map [backtab] 'widget-backward)
+    (define-key map [delete] 'scroll-down-command)
+    (define-key map "\177" 'scroll-down-command)
+    (define-key map " " 'scroll-up-command)
     (define-key map "p" 'eww-previous-url)
     ;;(define-key map "n" 'eww-next-url)
     map))
@@ -122,6 +129,7 @@
 	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))
 
 (defun eww-browse-url (url &optional new-window)
@@ -129,6 +137,12 @@
 	eww-history)
   (eww url))
 
+(defun eww-quit ()
+  "Exit the Emacs Web Wowser."
+  (interactive)
+  (setq eww-history nil)
+  (kill-buffer (current-buffer)))
+
 (defun eww-previous-url ()
   "Go to the previously displayed page."
   (interactive)

-----------------------------------------------------------------------
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 |    1 +
 lisp/eww.el    |   24 +++++++++++++++++++-----
 2 files changed, 20 insertions(+), 5 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.