GNU bug report logs - #19663
24.4: eww.el delete entry from history list

Previous Next

Package: emacs;

Reported by: Boruch Baum <boruch_baum <at> gmx.com>

Date: Fri, 23 Jan 2015 15:58:02 UTC

Severity: wishlist

Tags: notabug

Found in version 24.4

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Boruch Baum <boruch_baum <at> gmx.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4: eww.el delete entry from history list
Date: Fri, 23 Jan 2015 10:57:24 -0500
[Message part 1 (text/plain, inline)]
I found it desirable to be able to delete entries from the history list.

Following is the code that seems to work for me:

(defun eww-history-delete-entry ()
"Delete an entry from the eww history list"
  (interactive)
  (cond
    ((equal (buffer-name) "*eww history*")
      (setq
        current-point (point)
        current-line  (- (line-number-at-pos (point-max))
                         (line-number-at-pos)))
      (with-current-buffer "*eww*"
        (setq eww-history (append
                (butlast eww-history current-line)
                (last    eww-history (1- current-line))))
              eww-history-position
                (min eww-history-position (1- current-line))
        (eww-list-histories)
        (goto-char current-point)))
    ((equal (buffer-name) "*eww*")
      (setq
        current-entry (- (length eww-history)
                         eww-history-position)
        eww-history   (append
          (butlast eww-history current-entry)
          (last    eww-history (1- current-entry))))
      (when (eq current-entry 1)
        (setq eww-history-position (1- eww-history-position))\
)
      (eww-restore-history
        (elt eww-history eww-history-position))
      (when (get-buffer "*eww history*")
        (eww-list-histories)))
    (t
      (user-error "Current buffer is neither the eww buffer, \
nor the eww history buffer"))))


-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0


[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 10 years and 120 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.