Function: eww-clone-previous-history

eww-clone-previous-history is a byte-compiled function defined in eww.el.gz.

Signature

(eww-clone-previous-history)

Documentation

Clone and prepend entries in eww-history up to the currently-shown one.

These cloned entries get added to the beginning of eww-history so that it's possible to navigate back to the very first page for this EWW without deleting any history entries.

For example, if eww-history looks like this (going from newest to oldest, with "*" marking the current page):

  E D C* B A

then calling this function updates eww-history to:

  C* B A E D C B A

This is useful for setting eww-before-browse-history-function (which see).

Source Code

;; Defined in /usr/src/emacs/lisp/net/eww.el.gz
(defun eww-clone-previous-history ()
  "Clone and prepend entries in `eww-history' up to the currently-shown one.
These cloned entries get added to the beginning of `eww-history' so that
it's possible to navigate back to the very first page for this EWW
without deleting any history entries.

For example, if `eww-history' looks like this (going from newest to
oldest, with \"*\" marking the current page):

  E D C* B A

then calling this function updates `eww-history' to:

  C* B A E D C B A

This is useful for setting `eww-before-browse-history-function' (which
see)."
  (when (> eww-history-position 1)
    (setq eww-history (take eww-history-limit
                            (append (nthcdr (1- eww-history-position)
                                            eww-history)
                                    eww-history))
          ;; As with `eww-delete-future-history', we don't really need
          ;; to set this since `eww--before-browse' sets it too, but
          ;; let's be thorough.
          eww-history-position 1)))