From: "Rüdiger Sonderfeld" <ruediger@c-plusplus.de>
To: emacs-devel@gnu.org
Cc: Lars Magne Ingebrigtsen <larsi@gnus.org>,
Ted Zlatanov <tzz@lifelogs.com>
Subject: [PATCH 4/5] eww: Add tool bar support.
Date: Fri, 20 Dec 2013 00:44:49 +0100 [thread overview]
Message-ID: <3856770.xyGxovK1mL@descartes> (raw)
In-Reply-To: <cover.1387496431.git.ruediger@c-plusplus.de>
* lisp/net/eww.el (eww-tool-bar-map): New variable.
(eww-mode): Set `tool-bar-map'.
---
lisp/ChangeLog | 2 ++
lisp/net/eww.el | 17 +++++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 54f6c77..14d539d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -7,6 +7,8 @@
Use `user-error'.
(eww-bookmark-mode-map): Add menu.
(eww-render, eww-mode): Use `setq-local'.
+ (eww-tool-bar-map): New variable.
+ (eww-mode): Set `tool-bar-map'.
2013-12-19 Teodor Zlatanov <tzz@lifelogs.com>
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index a58b7ed..cae5cfd 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -438,6 +438,21 @@ (defvar eww-mode-map
["List cookies" url-cookie-list t]))
map))
+(defvar eww-tool-bar-map
+ (let ((map (make-sparse-keymap)))
+ (dolist (tool-bar-item
+ '((eww-quit . "close")
+ (eww-reload . "refresh")
+ (eww-back-url . "left-arrow")
+ (eww-forward-url . "right-arrow")
+ (eww-view-source . "show")
+ (eww-copy-page-url . "copy")
+ (eww-add-bookmark . "bookmark_add"))) ;; ...
+ (tool-bar-local-item-from-menu
+ (car tool-bar-item) (cdr tool-bar-item) map eww-mode-map))
+ map)
+ "Tool bar for `eww-mode'.")
+
(define-derived-mode eww-mode nil "eww"
"Mode for browsing the web.
@@ -450,6 +465,8 @@ (define-derived-mode eww-mode nil "eww"
(setq-local after-change-functions 'eww-process-text-input)
(setq-local eww-history nil)
(setq-local eww-history-position 0)
+ (when (boundp 'tool-bar-map)
+ (setq-local tool-bar-map eww-tool-bar-map))
(buffer-disable-undo)
;;(setq buffer-read-only t)
)
--
1.8.5
next prev parent reply other threads:[~2013-12-19 23:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1387496431.git.ruediger@c-plusplus.de>
2013-12-19 23:44 ` [PATCH 1/5] eww: Use `user-error' Rüdiger Sonderfeld
2013-12-19 23:44 ` [PATCH 2/5] eww: Add menu for `eww-bookmark-mode' Rüdiger Sonderfeld
2013-12-19 23:44 ` [PATCH 3/5] eww: Use `setq-local' Rüdiger Sonderfeld
2013-12-19 23:44 ` Rüdiger Sonderfeld [this message]
2013-12-19 23:44 ` [PATCH 5/5] eww: Check for `html-mode' using `fboundp' Rüdiger Sonderfeld
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3856770.xyGxovK1mL@descartes \
--to=ruediger@c-plusplus.de \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.org \
--cc=tzz@lifelogs.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.