all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com>
To: 16280@debbugs.gnu.org
Subject: bug#16280: 24.3.50; [PATCH] eww: Add new function to clean browser histories.
Date: Sun, 29 Dec 2013 00:32:12 +0900	[thread overview]
Message-ID: <878uv5yosj.fsf@dhcp-193-97.nrt.redhat.com> (raw)

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





             reply	other threads:[~2013-12-28 15:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-28 15:32 Kenjiro NAKAYAMA [this message]
2014-01-02  2:43 ` bug#16280: 24.3.50; [PATCH] eww: Add new function to clean browser histories 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878uv5yosj.fsf@dhcp-193-97.nrt.redhat.com \
    --to=nakayamakenjiro@gmail.com \
    --cc=16280@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.