emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115727: Fix eww bookmark window configuration


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] trunk r115727: Fix eww bookmark window configuration
Date: Tue, 24 Dec 2013 07:31:46 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115727
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/16144
committer: Lars Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Tue 2013-12-24 08:25:27 +0100
message:
  Fix eww bookmark window configuration
  
  * net/eww.el (eww-bookmark-quit): Remove.
  (eww-bookmark-browse): Restore the window configuration when you
  choose a bookmark.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/eww.el                eww.el-20130610114603-80ap3gwnw4x4m5ix-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-12-24 03:48:55 +0000
+++ b/lisp/ChangeLog    2013-12-24 07:25:27 +0000
@@ -1,3 +1,9 @@
+2013-12-24  Lars Ingebrigtsen  <address@hidden>
+
+       * 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  <address@hidden>
 
        * icomplete.el: Remove redundant :group arguments to `defcustom'

=== modified file 'lisp/net/eww.el'
--- a/lisp/net/eww.el   2013-12-22 22:40:35 +0000
+++ b/lisp/net/eww.el   2013-12-24 07:25:27 +0000
@@ -1083,6 +1083,8 @@
 ;;; 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."
@@ -1127,6 +1129,7 @@
   (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)
@@ -1178,21 +1181,15 @@
                (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 ()
@@ -1238,7 +1235,7 @@
 (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)
@@ -1246,7 +1243,7 @@
     (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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]