diff --git a/ebib-utils.el b/ebib-utils.el index 06ba95d2..4093a7b9 100644 --- a/ebib-utils.el +++ b/ebib-utils.el @@ -1291,7 +1291,7 @@ Currently, the following problems are marked: (defvar ebib--entry-history '(:head 0 :history nil) "History of entries visited. `:history' is a list of all entries visited, with more recent -entries nearer the beginning. `:head' is a 0-based index +entries nearer the beginning. `:head' is a 0-based index indicating where in the `:history' list we are currently. Commands which navigate between entries (including those which @@ -1300,8 +1300,8 @@ navigate the history) should (in order): `:history' list, reverse the result, and prepend it to the history list (unless the `:head' value is less than 2, in which case nothing would be prepended). -- prepend the key of the entry arrived at to the `:history' list. -- set `:head' to 0 +- Prepend the key of the entry arrived at to the `:history' list. +- Set `:head' to 0 Passing the relevant key to `ebib--history-mutate' will achieve all of this in a convenient way.") @@ -2689,15 +2689,14 @@ specified in `ebib-field-sort-functions-alist', with ;; Now return the list of keys. keys) -;; History commands - +;;; History commands (defun ebib--history-mutate (key) "Alter `ebib--entry-history' list. Copy everything from the second element to the element at `ebib--history-get-head' in the `:history' list in `ebib--entry-history', reverse the result, and prepend it to the -history list. Then prepend KEY to the history list as well. +history list. Then prepend KEY to the history list as well. Finally, set `:head' in `ebib--entry-history' to 0." (when-let ((head (ebib--history-get-head)) ;; Only bother if head is sufficiently large, otherwise diff --git a/ebib.el b/ebib.el index 23acf622..4c2a9f50 100644 --- a/ebib.el +++ b/ebib.el @@ -1653,7 +1653,7 @@ interactively." (defun ebib-history-back () "Jump to the last visited entry. Repeated invocations of this function and `ebib-history-forward' -move back and forward in history without changing it. After this, +move back and forward in history without changing it. After this, moving somewhere else copies the sequence of moves through history into the history record, so that they can still be accessed." @@ -1671,7 +1671,7 @@ accessed." (defun ebib-history-forward () "Jump to the entry visited before the current one in the history. Repeated invocations of this function and `ebib-history-back' -move forward and back in history without changing it. After this, +move forward and back in history without changing it. After this, moving somewhere else copies the sequence of moves through history into the history record, so that they can still be accessed."