diff options
| author | Ted Zlatanov | 2013-12-11 14:01:44 -0500 |
|---|---|---|
| committer | Ted Zlatanov | 2013-12-11 14:01:44 -0500 |
| commit | f4fe8fdd37f5ddb7aff322e2ff716b16ecb10c32 (patch) | |
| tree | c311a75232b35ee526793833d8c558b126b316cb | |
| parent | 3c29190fbed76238c719718c9149762bfe8fd372 (diff) | |
| download | emacs-f4fe8fdd37f5ddb7aff322e2ff716b16ecb10c32.tar.gz emacs-f4fe8fdd37f5ddb7aff322e2ff716b16ecb10c32.zip | |
eww: exit and close actions
* net/eww.el (eww-exit, eww-close): Add UI convenience wrappers.
(eww-mode-map): Use them.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/net/eww.el | 18 |
2 files changed, 20 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bb812f13ade..0c6b5948fe0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-12-11 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 2 | |||
| 3 | * net/eww.el (eww-exit, eww-close): Add UI convenience wrappers. | ||
| 4 | (eww-mode-map): Use them. | ||
| 5 | |||
| 1 | 2013-12-11 Martin Rudalics <rudalics@gmx.at> | 6 | 2013-12-11 Martin Rudalics <rudalics@gmx.at> |
| 2 | 7 | ||
| 3 | * window.el (display-buffer-in-side-window): Fix doc-string | 8 | * window.el (display-buffer-in-side-window): Fix doc-string |
diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 8355ce1fb3c..34c6728ba9e 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el | |||
| @@ -392,7 +392,8 @@ word(s) will be searched for via `eww-search-prefix'." | |||
| 392 | (defvar eww-mode-map | 392 | (defvar eww-mode-map |
| 393 | (let ((map (make-sparse-keymap))) | 393 | (let ((map (make-sparse-keymap))) |
| 394 | (suppress-keymap map) | 394 | (suppress-keymap map) |
| 395 | (define-key map "q" 'quit-window) | 395 | (define-key map "q" 'eww-close) |
| 396 | (define-key map "Q" 'eww-exit) | ||
| 396 | (define-key map "g" 'eww-reload) | 397 | (define-key map "g" 'eww-reload) |
| 397 | (define-key map [tab] 'shr-next-link) | 398 | (define-key map [tab] 'shr-next-link) |
| 398 | (define-key map [backtab] 'shr-previous-link) | 399 | (define-key map [backtab] 'shr-previous-link) |
| @@ -418,8 +419,8 @@ word(s) will be searched for via `eww-search-prefix'." | |||
| 418 | 419 | ||
| 419 | (easy-menu-define nil map "" | 420 | (easy-menu-define nil map "" |
| 420 | '("Eww" | 421 | '("Eww" |
| 421 | ["Exit" eww-quit t] | 422 | ["Exit" eww-exit t] |
| 422 | ["Close browser" quit-window t] | 423 | ["Close browser" eww-close t] |
| 423 | ["Reload" eww-reload t] | 424 | ["Reload" eww-reload t] |
| 424 | ["Back to previous page" eww-back-url | 425 | ["Back to previous page" eww-back-url |
| 425 | :active (not (zerop (length eww-history)))] | 426 | :active (not (zerop (length eww-history)))] |
| @@ -450,6 +451,17 @@ word(s) will be searched for via `eww-search-prefix'." | |||
| 450 | ;;(setq buffer-read-only t) | 451 | ;;(setq buffer-read-only t) |
| 451 | ) | 452 | ) |
| 452 | 453 | ||
| 454 | (defun eww-exit () | ||
| 455 | "Exit the Emacs Web Wowser." | ||
| 456 | (interactive) | ||
| 457 | (setq eww-history nil) | ||
| 458 | (kill-buffer (current-buffer))) | ||
| 459 | |||
| 460 | (defun eww-close () | ||
| 461 | "Close the Emacs Web Wowser browser, leaving history intact." | ||
| 462 | (interactive) | ||
| 463 | (quit-window)) | ||
| 464 | |||
| 453 | (defun eww-save-history () | 465 | (defun eww-save-history () |
| 454 | (push (list :url eww-current-url | 466 | (push (list :url eww-current-url |
| 455 | :title eww-current-title | 467 | :title eww-current-title |