Function: eww-delete-future-history

eww-delete-future-history is a byte-compiled function defined in eww.el.gz.

Signature

(eww-delete-future-history)

Documentation

Remove any entries in eww-history after the currently-shown one.

This is useful for eww-before-browse-history-function to make EWW's navigation to a new page from a historical one work like other web browsers: it will delete any "future" history elements before adding the new page to the end of the history.

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

Source Code

;; Defined in /usr/src/emacs/lisp/net/eww.el.gz
(defun eww-delete-future-history ()
  "Remove any entries in `eww-history' after the currently-shown one.
This is useful for `eww-before-browse-history-function' to make EWW's
navigation to a new page from a historical one work like other web
browsers: it will delete any \"future\" history elements before adding
the new page to the end of the history.

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"
  (when (> eww-history-position 1)
    (setq eww-history (nthcdr (1- eww-history-position) eww-history)
          ;; We don't really need to set this since `eww--before-browse'
          ;; sets it too, but this ensures that other callers can use
          ;; this function and get the expected results.
          eww-history-position 1)))