diff options
Diffstat (limited to 'lib/bufhist.el')
-rw-r--r-- | lib/bufhist.el | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/lib/bufhist.el b/lib/bufhist.el index 3d6a123d..65d33cc5 100644 --- a/lib/bufhist.el +++ b/lib/bufhist.el @@ -1,16 +1,24 @@ ;; bufhist.el --- keep read-only history of buffer contents for browsing -;; Copyright (C) 2006, 2009 David Aspinall / University of Edinburgh +;; This file is part of Proof General. + +;; Portions © Copyright 1994-2012 David Aspinall and University of Edinburgh +;; Portions © Copyright 2003, 2012, 2014 Free Software Foundation, Inc. +;; Portions © Copyright 2001-2017 Pierre Courtieu +;; Portions © Copyright 2010, 2016 Erik Martin-Dorel +;; Portions © Copyright 2011-2013, 2016-2017 Hendrik Tews +;; Portions © Copyright 2015-2017 Clément Pit-Claudel ;; Author: David Aspinall <David.Aspinall@ed.ac.uk> -;; License: GPL (GNU GENERAL PUBLIC LICENSE) ;; Keywords: tools -;; -;; $Id$ -;; + +;; License: GPL (GNU GENERAL PUBLIC LICENSE) + ;; This file is distributed under the terms of the GNU General Public ;; License, Version 2. Find a copy of the GPL with your version of ;; GNU Emacs or Texinfo. + +;;; Commentary: ;; ;; This library implements a minor mode for which keeps a ring history of ;; buffer contents. Intended to be used for small buffers which are @@ -29,6 +37,8 @@ ;; - buttons are put at top of buffer but inserts happen before them ;; +;;; Code: + (require 'ring) (declare-function bufhist-ordinary-erase-buffer "bufhist") @@ -176,7 +186,8 @@ This is as a pair (POINT . CONTENTS)." (bufhist-insert-buttons)) (defun bufhist-checkpoint-and-erase () - "Add buffer contents to history then erase. Only erase if not in bufhist mode" + "Add buffer contents to history then erase. +Only erase if not in bufhist mode." (interactive) (bufhist-checkpoint) (bufhist-erase-buffer)) @@ -231,7 +242,8 @@ If optional NOSAVE is non-nil, do not try to save current contents." (bufhist-switch-to-index 0 nil 'browsing)) (defun bufhist-prev (&optional n) - "Browse backward in the history of buffer contents." + "Browse backward in the history of buffer contents. +If N is omitted or nil, move backward by one item." (interactive "p") (bufhist-switch-to-index (mod (+ bufhist-ring-pos (or n 1)) @@ -239,7 +251,8 @@ If optional NOSAVE is non-nil, do not try to save current contents." nil 'browsing)) (defun bufhist-next (&optional n) - "Browse forward in the history of buffer contents." + "Browse forward in the history of buffer contents. +If N is omitted or nil, move forward by one item." (interactive "p") (bufhist-prev (- (or n 1)))) @@ -274,7 +287,7 @@ If optional NOSAVE is non-nil, do not try to save current contents." "Initialise a ring history for the current buffer. The history will be read-only unless READWRITE is non-nil. For read-only histories, edits to the buffer switch to the latest version. -The size defaults to `bufhist-ring-size'." +If RINGSIZE is omitted or nil, the size defaults to ‘bufhist-ring-size’." (interactive) (setq bufhist-ring (make-ring (or ringsize bufhist-ring-size))) (setq bufhist-normal-read-only buffer-read-only) @@ -360,3 +373,4 @@ The size defaults to `bufhist-ring-size'." (setq bufhist-top-point (point)))))) (provide 'bufhist) +;;; bufhist.el ends here |