+2013-12-24 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * net/eww.el (eww-bookmark-quit): Remove.
+ (eww-bookmark-browse): Restore the window configuration when you
+ choose a bookmark (bug#16144).
+
2013-12-24 Daniel Colascione <dancol@dancol.org>
* icomplete.el: Remove redundant :group arguments to `defcustom'
;;; Bookmarks code
(defvar eww-bookmarks nil)
+(defvar eww-previous-window-configuration nil)
+(make-variable-buffer-local 'eww-previous-window-configuration)
(defun eww-add-bookmark ()
"Add the current page to the bookmarks."
(unless eww-bookmarks
(user-error "No bookmarks are defined"))
(set-buffer (get-buffer-create "*eww bookmarks*"))
+ (setq eww-previous-window-configuration (current-window-configuration))
(eww-bookmark-mode)
(let ((format "%-40s %s")
(inhibit-read-only t)
(cons bookmark (nthcdr line eww-bookmarks)))))
(eww-write-bookmarks)))
-(defun eww-bookmark-quit ()
- "Kill the current buffer."
- (interactive)
- (kill-buffer (current-buffer)))
-
(defun eww-bookmark-browse ()
"Browse the bookmark under point in eww."
(interactive)
(let ((bookmark (get-text-property (line-beginning-position) 'eww-bookmark)))
(unless bookmark
(user-error "No bookmark on the current line"))
- ;; We wish to leave this window, but if it's the only window here,
- ;; just let it remain.
- (ignore-errors
- (delete-window))
+ (quit-window)
+ (when eww-previous-window-configuration
+ (set-window-configuration eww-previous-window-configuration))
(eww-browse-url (plist-get bookmark :url))))
(defun eww-next-bookmark ()
(defvar eww-bookmark-mode-map
(let ((map (make-sparse-keymap)))
(suppress-keymap map)
- (define-key map "q" 'eww-bookmark-quit)
+ (define-key map "q" 'quit-window)
(define-key map [(control k)] 'eww-bookmark-kill)
(define-key map [(control y)] 'eww-bookmark-yank)
(define-key map "\r" 'eww-bookmark-browse)
(easy-menu-define nil map
"Menu for `eww-bookmark-mode-map'."
'("Eww Bookmark"
- ["Exit" eww-bookmark-quit t]
+ ["Exit" quit-window t]
["Browse" eww-bookmark-browse
:active (get-text-property (line-beginning-position) 'eww-bookmark)]
["Kill" eww-bookmark-kill