all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#16280: 24.3.50; [PATCH] eww: Add new function to clean browser histories.
@ 2013-12-28 15:32 Kenjiro NAKAYAMA
  2014-01-02  2:43 ` Stefan Monnier
  2014-01-05  9:32 ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 6+ messages in thread
From: Kenjiro NAKAYAMA @ 2013-12-28 15:32 UTC (permalink / raw)
  To: 16280

I think this function is simple but sufficient. 
Please review and install it to the official tree if appreciated, after Feature freeze.

Signed-off-by: Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com>

          * net/eww.el (eww-mode-map): Add new key map and easy-menu to
            clean up browser histories.
            (eww-history-cleanup): New function to cleanup browser histories.

---
 lisp/net/eww.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 25309d1..11fcbf1 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -428,6 +428,7 @@ word(s) will be searched for via `eww-search-prefix'."
     (define-key map "C" 'url-cookie-list)
     (define-key map "v" 'eww-view-source)
     (define-key map "H" 'eww-list-histories)
+    (define-key map [(meta c)] 'eww-history-cleanup)

     (define-key map "b" 'eww-add-bookmark)
     (define-key map "B" 'eww-list-bookmarks)
@@ -448,6 +449,8 @@ word(s) will be searched for via `eww-search-prefix'."
        ["View page source" eww-view-source]
        ["Copy page URL" eww-copy-page-url t]
        ["List histories" eww-list-histories t]
+       ["Clean histories" eww-history-cleanup
+        :active (not (zerop (length eww-history)))]
        ["Add bookmark" eww-add-bookmark t]
        ["List bookmarks" eww-list-bookmarks t]
        ["List cookies" url-cookie-list t]))
@@ -1091,6 +1094,13 @@ Differences in #targets are ignored."
        (setq count (1+ count)))
       (expand-file-name file directory)))

+(defun eww-history-cleanup ()
+  (interactive)
+  (if (y-or-n-p "clean up browser histories? ")
+      (progn
+       (setq-local eww-history nil)
+       (setq-local eww-history-position 0))))
+
 ;;; Bookmarks code

 (defvar eww-bookmarks nil)
-- 
1.8.3.1

Regards,

Kenji





^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-01-05 11:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-28 15:32 bug#16280: 24.3.50; [PATCH] eww: Add new function to clean browser histories Kenjiro NAKAYAMA
2014-01-02  2:43 ` Stefan Monnier
2014-01-05  2:23   ` Kenjiro NAKAYAMA
2014-01-05  9:35   ` Lars Magne Ingebrigtsen
2014-01-05  9:32 ` Lars Magne Ingebrigtsen
2014-01-05 11:07   ` Kenjiro NAKAYAMA

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.