[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r115875: Make the eww history browsing work again
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] trunk r115875: Make the eww history browsing work again |
Date: |
Sun, 05 Jan 2014 09:27:29 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 115875
revision-id: address@hidden
parent: address@hidden
author: Kenjiro NAKAYAMA <address@hidden>
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Sun 2014-01-05 10:27:26 +0100
message:
Make the eww history browsing work again
* net/eww.el (eww-list-histories,eww-history-browse): Fixup.
(eww-history-quit): Delete and use quit-window.
(eww-history-kill): Delete, because it doesn't work well and
not necessary.
(eww-history-mode-map): Delete some keys and add easy-menu.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/net/eww.el eww.el-20130610114603-80ap3gwnw4x4m5ix-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2014-01-05 09:25:05 +0000
+++ b/lisp/ChangeLog 2014-01-05 09:27:26 +0000
@@ -1,6 +1,11 @@
2014-01-05 Kenjiro NAKAYAMA <address@hidden>
- * net/eww.el (eww): Support single/double quote for search.
+ * net/eww.el (eww): Support single/double quote for search.
+ * net/eww.el (eww-list-histories,eww-history-browse): Fixup.
+ (eww-history-quit): Delete and use quit-window.
+ (eww-history-kill): Delete, because it doesn't work well and
+ not necessary.
+ (eww-history-mode-map): Delete some keys and add easy-menu.
2014-01-05 Paul Eggert <address@hidden>
=== modified file 'lisp/net/eww.el'
--- a/lisp/net/eww.el 2014-01-05 09:25:05 +0000
+++ b/lisp/net/eww.el 2014-01-05 09:27:26 +0000
@@ -1283,32 +1283,30 @@
(interactive)
(when (null eww-history)
(error "No eww-histories are defined"))
- (set-buffer (get-buffer-create "*eww history*"))
- (eww-history-mode)
- (let ((inhibit-read-only t)
- (domain-length 0)
- (title-length 0)
- url title format start)
- (erase-buffer)
- (dolist (history eww-history)
- (setq start (point))
- (setq domain-length (max domain-length (length (plist-get history
:url))))
- (setq title-length (max title-length (length (plist-get history
:title))))
- )
- (setq format (format "%%-%ds %%-%ds" title-length domain-length)
- header-line-format
- (concat " " (format format "Title" "URL")))
-
- (dolist (history eww-history)
- (setq url (plist-get history :url))
- (setq title (plist-get history :title))
- (insert (format format title url))
- (insert "\n")
- (put-text-property start (point) 'eww-history history)
- )
- (goto-char (point-min)))
- (pop-to-buffer "*eww history*")
- )
+ (let ((eww-history-trans eww-history))
+ (set-buffer (get-buffer-create "*eww history*"))
+ (eww-history-mode)
+ (let ((inhibit-read-only t)
+ (domain-length 0)
+ (title-length 0)
+ url title format start)
+ (erase-buffer)
+ (dolist (history eww-history-trans)
+ (setq start (point))
+ (setq domain-length (max domain-length (length (plist-get history
:url))))
+ (setq title-length (max title-length (length (plist-get history
:title)))))
+ (setq format (format "%%-%ds %%-%ds" title-length domain-length)
+ header-line-format
+ (concat " " (format format "Title" "URL")))
+ (dolist (history eww-history-trans)
+ (setq start (point))
+ (setq url (plist-get history :url))
+ (setq title (plist-get history :title))
+ (insert (format format title url))
+ (insert "\n")
+ (put-text-property start (1+ start) 'eww-history history))
+ (goto-char (point-min)))
+ (pop-to-buffer "*eww history*")))
(defun eww-history-browse ()
"Browse the history under point in eww."
@@ -1316,39 +1314,23 @@
(let ((history (get-text-property (line-beginning-position) 'eww-history)))
(unless history
(error "No history on the current line"))
- (eww-history-quit)
- (pop-to-buffer "*eww*")
- (eww-browse-url (plist-get history :url))))
-
-(defun eww-history-quit ()
- "Kill the current buffer."
- (interactive)
- (kill-buffer (current-buffer)))
-
-(defvar eww-history-kill-ring nil)
-
-(defun eww-history-kill ()
- "Kill the current history."
- (interactive)
- (let* ((start (line-beginning-position))
- (history (get-text-property start 'eww-history))
- (inhibit-read-only t))
- (unless history
- (error "No history on the current line"))
- (forward-line 1)
- (push (buffer-substring start (point)) eww-history-kill-ring)
- (delete-region start (point))
- (setq eww-history (delq history eww-history))
- ))
+ (quit-window)
+ (eww-restore-history history)))
(defvar eww-history-mode-map
(let ((map (make-sparse-keymap)))
(suppress-keymap map)
- (define-key map "q" 'eww-history-quit)
- (define-key map [(control k)] 'eww-history-kill)
+ (define-key map "q" 'quit-window)
(define-key map "\r" 'eww-history-browse)
- (define-key map "n" 'next-error-no-select)
- (define-key map "p" 'previous-error-no-select)
+;; (define-key map "n" 'next-error-no-select)
+;; (define-key map "p" 'previous-error-no-select)
+
+ (easy-menu-define nil map
+ "Menu for `eww-history-mode-map'."
+ '("Eww History"
+ ["Exit" quit-window t]
+ ["Browse" eww-history-browse
+ :active (get-text-property (line-beginning-position) 'eww-history)]))
map))
(define-derived-mode eww-history-mode nil "eww history"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r115875: Make the eww history browsing work again,
Lars Ingebrigtsen <=