The progressons Reference Manual

This is the progressons Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:20:48 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 progressons

Display a progress bar on one line.

Author

vindarel

License

MIT

Version

0.1

Dependencies
  • str (system).
  • cl-ansi-text (system).
Source

progressons.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 progressons/progressons.asd

Source

progressons.asd.

Parent Component

progressons (system).

ASDF Systems

progressons.


3.1.2 progressons/packages.lisp

Source

progressons.asd.

Parent Component

progressons (system).

Packages

progressons.


3.1.3 progressons/utils.lisp

Source

progressons.asd.

Parent Component

progressons (system).

Internals

3.1.4 progressons/termp.lisp

Source

progressons.asd.

Parent Component

progressons (system).

Internals

3.1.5 progressons/progressons.lisp

Source

progressons.asd.

Parent Component

progressons (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 progressons

Source

packages.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Ordinary functions

Function: make-progress (data &key fill-character rainbow)

A more manual way to create a progressbar than ‘progressbar’.

DATA can be a sequence or an integer.

Package

progressons.

Source

progressons.lisp.

Function: progressbar (data &key bar rainbow)

Create a progress bar with this data. Return the data, so we can iterate over it. At the end of each iteration, you must call (step!) to print the progress.

If ‘rainbow’ is non-nil, print the steps in a random color.

Package

progressons.

Source

progressons.lisp.

Function: step! (&optional obj)

Increment and print the bar.

Package

progressons.

Source

progressons.lisp.


5.1.2 Standalone methods

Method: initialize-instance :after ((obj progress) &rest initargs &key &allow-other-keys)
Source

progressons.lisp.

Method: print-object ((obj progress) stream)
Source

progressons.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: *progress*

the current progress bar.

Package

progressons.

Source

progressons.lisp.

Special Variable: *rainbow-steps*

If non-nil, print each step character in a random color.

You should rather create a progressbar with this preference enabled:

(progressbar :rainbow t)

Package

progressons.

Source

progressons.lisp.

Special Variable: *termp*
Package

progressons.

Source

termp.lisp.

Special Variable: *tty-p*
Package

progressons.

Source

utils.lisp.


5.2.2 Ordinary functions

Function: make-string-with-random-color (width &key initial-element print!)

Return a string with a random color (amongst the 8 basic ones).

Package

progressons.

Source

progressons.lisp.

Function: progress ()

Only works on the terminal.

Package

progressons.

Source

progressons.lisp.

Function: quit (&optional status message)

If we are in a real terminal, really quit. Otherwise, error out.

Package

progressons.

Source

termp.lisp.

Function: step-length (obj)

Return the length (integer) of the new step string.

Package

progressons.

Source

progressons.lisp.

Function: termp (&key force)

Return T if we run on a terminal.
This must fail on Slime (on Emacs’ default shell prompt) and succeed on a Lisp in a terminal window.

Package

progressons.

Source

termp.lisp.

Function: tty-p (&key force)

Return T if we run on a terminal.
This must fail on Slime (on Emacs’ default shell prompt) and succeed on a Lisp in a terminal window.

Package

progressons.

Source

utils.lisp.


5.2.3 Generic functions

Generic Function: current-percent (obj)
Package

progressons.

Methods
Method: current-percent ((obj progress))

Rounded

Source

progressons.lisp.

Generic Function: current-width (obj)
Package

progressons.

Methods
Method: current-width ((obj progress))

Rounded to nearest integer.

Source

progressons.lisp.

Generic Reader: default-fill-character (object)
Package

progressons.

Methods
Reader Method: default-fill-character ((progress progress))

automatically generated reader method

Source

progressons.lisp.

Target Slot

default-fill-character.

Generic Writer: (setf default-fill-character) (object)
Package

progressons.

Methods
Writer Method: (setf default-fill-character) ((progress progress))

automatically generated writer method

Source

progressons.lisp.

Target Slot

default-fill-character.

Generic Reader: percent-width (object)
Generic Writer: (setf percent-width) (object)
Package

progressons.

Methods
Reader Method: percent-width ((progress progress))
Writer Method: (setf percent-width) ((progress progress))

The percent to increment each step.

Source

progressons.lisp.

Target Slot

percent-width.

Generic Function: print-opening (obj &key stream)
Package

progressons.

Methods
Method: print-opening ((obj progress) &key stream)
Source

progressons.lisp.

Generic Function: print-rainbow-step (obj &key stream)
Package

progressons.

Methods
Method: print-rainbow-step ((obj progress) &key stream)

Print each bar in a different color.

Source

progressons.lisp.

Generic Function: print-step (obj &key stream)
Package

progressons.

Methods
Method: print-step ((obj progress) &key stream)

Print the bar at the right length.

Source

progressons.lisp.

Generic Function: print-step-dumb (obj &key stream)
Package

progressons.

Methods
Method: print-step-dumb ((obj progress) &key stream)

Print the progress step in a dumb terminal (like Emacs Slime).
We can’t erase a line (it prints the ^M character instead), so we can’t update the percentage and the ratio of done items. We print progress indicators in a row, one after the other, and we print the percent in the end.

Source

progressons.lisp.

Generic Reader: progress-data (object)
Package

progressons.

Methods
Reader Method: progress-data ((progress progress))

automatically generated reader method

Source

progressons.lisp.

Target Slot

data.

Generic Writer: (setf progress-data) (object)
Package

progressons.

Methods
Writer Method: (setf progress-data) ((progress progress))

automatically generated writer method

Source

progressons.lisp.

Target Slot

data.

Generic Reader: progress-fill-character (object)
Package

progressons.

Methods
Reader Method: progress-fill-character ((progress progress))

automatically generated reader method

Source

progressons.lisp.

Target Slot

fill-character.

Generic Writer: (setf progress-fill-character) (object)
Package

progressons.

Methods
Writer Method: (setf progress-fill-character) ((progress progress))

automatically generated writer method

Source

progressons.lisp.

Target Slot

fill-character.

Generic Reader: progress-finished (object)
Package

progressons.

Methods
Reader Method: progress-finished ((obj progress))
Source

progressons.lisp.

Target Slot

finished.

Generic Writer: (setf progress-finished) (object)
Package

progressons.

Methods
Writer Method: (setf progress-finished) ((progress progress))

Boolean. T after 100% of completion.

Source

progressons.lisp.

Target Slot

finished.

Generic Function: progress-length (obj)
Package

progressons.

Methods
Method: progress-length ((obj progress))
Source

progressons.lisp.

Generic Function: progress-percent (obj)
Package

progressons.

Methods
Method: progress-percent ((obj progress))
Source

progressons.lisp.

Generic Reader: progress-rainbow (object)
Generic Writer: (setf progress-rainbow) (object)
Package

progressons.

Methods
Reader Method: progress-rainbow ((progress progress))
Writer Method: (setf progress-rainbow) ((progress progress))

If non-nil, print each step in a different color. It uses the dumb print method (it doesn’t update the progress percent at the beginning of the line).

Source

progressons.lisp.

Target Slot

rainbow.

Generic Reader: progress-width (object)
Generic Writer: (setf progress-width) (object)
Package

progressons.

Methods
Reader Method: progress-width ((progress progress))
Writer Method: (setf progress-width) ((progress progress))

Screen width.

Source

progressons.lisp.

Target Slot

width.

Generic Function: reinit (obj)
Package

progressons.

Methods
Method: reinit ((obj progress))
Source

progressons.lisp.

Generic Reader: step-width (object)
Generic Writer: (setf step-width) (object)
Package

progressons.

Methods
Reader Method: step-width ((progress progress))
Writer Method: (setf step-width) ((progress progress))

length (width, characters count) of each step to print.

Source

progressons.lisp.

Target Slot

step-width.

Generic Reader: steps-counter (object)
Generic Writer: (setf steps-counter) (object)
Package

progressons.

Methods
Reader Method: steps-counter ((progress progress))
Writer Method: (setf steps-counter) ((progress progress))

A counter to increment each time we increase the bar.

Source

progressons.lisp.

Target Slot

steps-counter.


5.2.4 Classes

Class: progress
Package

progressons.

Source

progressons.lisp.

Direct methods
Direct slots
Slot: data
Initargs

:data

Readers

progress-data.

Writers

(setf progress-data).

Slot: width

Screen width.

Initform

80

Readers

progress-width.

Writers

(setf progress-width).

Slot: step-width

length (width, characters count) of each step to print.

Readers

step-width.

Writers

(setf step-width).

Slot: percent-width

The percent to increment each step.

Readers

percent-width.

Writers

(setf percent-width).

Slot: steps-counter

A counter to increment each time we increase the bar.

Initform

0

Readers

steps-counter.

Writers

(setf steps-counter).

Slot: finished

Boolean. T after 100% of completion.

Readers

progress-finished.

Writers

(setf progress-finished).

Slot: fill-character
Initform

#\full_block

Initargs

:fill-character

Readers

progress-fill-character.

Writers

(setf progress-fill-character).

Slot: default-fill-character
Allocation

:class

Initform

#\full_block

Readers

default-fill-character.

Writers

(setf default-fill-character).

Slot: rainbow

If non-nil, print each step in a different color. It uses the dumb print method (it doesn’t update the progress percent at the beginning of the line).

Initargs

:rainbow

Readers

progress-rainbow.

Writers

(setf progress-rainbow).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
C   D   F   G   I   M   P   Q   R   S   T  
Index Entry  Section

(
(setf default-fill-character): Private generic functions
(setf default-fill-character): Private generic functions
(setf percent-width): Private generic functions
(setf percent-width): Private generic functions
(setf progress-data): Private generic functions
(setf progress-data): Private generic functions
(setf progress-fill-character): Private generic functions
(setf progress-fill-character): Private generic functions
(setf progress-finished): Private generic functions
(setf progress-finished): Private generic functions
(setf progress-rainbow): Private generic functions
(setf progress-rainbow): Private generic functions
(setf progress-width): Private generic functions
(setf progress-width): Private generic functions
(setf step-width): Private generic functions
(setf step-width): Private generic functions
(setf steps-counter): Private generic functions
(setf steps-counter): Private generic functions

C
current-percent: Private generic functions
current-percent: Private generic functions
current-width: Private generic functions
current-width: Private generic functions

D
default-fill-character: Private generic functions
default-fill-character: Private generic functions

F
Function, make-progress: Public ordinary functions
Function, make-string-with-random-color: Private ordinary functions
Function, progress: Private ordinary functions
Function, progressbar: Public ordinary functions
Function, quit: Private ordinary functions
Function, step!: Public ordinary functions
Function, step-length: Private ordinary functions
Function, termp: Private ordinary functions
Function, tty-p: Private ordinary functions

G
Generic Function, (setf default-fill-character): Private generic functions
Generic Function, (setf percent-width): Private generic functions
Generic Function, (setf progress-data): Private generic functions
Generic Function, (setf progress-fill-character): Private generic functions
Generic Function, (setf progress-finished): Private generic functions
Generic Function, (setf progress-rainbow): Private generic functions
Generic Function, (setf progress-width): Private generic functions
Generic Function, (setf step-width): Private generic functions
Generic Function, (setf steps-counter): Private generic functions
Generic Function, current-percent: Private generic functions
Generic Function, current-width: Private generic functions
Generic Function, default-fill-character: Private generic functions
Generic Function, percent-width: Private generic functions
Generic Function, print-opening: Private generic functions
Generic Function, print-rainbow-step: Private generic functions
Generic Function, print-step: Private generic functions
Generic Function, print-step-dumb: Private generic functions
Generic Function, progress-data: Private generic functions
Generic Function, progress-fill-character: Private generic functions
Generic Function, progress-finished: Private generic functions
Generic Function, progress-length: Private generic functions
Generic Function, progress-percent: Private generic functions
Generic Function, progress-rainbow: Private generic functions
Generic Function, progress-width: Private generic functions
Generic Function, reinit: Private generic functions
Generic Function, step-width: Private generic functions
Generic Function, steps-counter: Private generic functions

I
initialize-instance: Public standalone methods

M
make-progress: Public ordinary functions
make-string-with-random-color: Private ordinary functions
Method, (setf default-fill-character): Private generic functions
Method, (setf percent-width): Private generic functions
Method, (setf progress-data): Private generic functions
Method, (setf progress-fill-character): Private generic functions
Method, (setf progress-finished): Private generic functions
Method, (setf progress-rainbow): Private generic functions
Method, (setf progress-width): Private generic functions
Method, (setf step-width): Private generic functions
Method, (setf steps-counter): Private generic functions
Method, current-percent: Private generic functions
Method, current-width: Private generic functions
Method, default-fill-character: Private generic functions
Method, initialize-instance: Public standalone methods
Method, percent-width: Private generic functions
Method, print-object: Public standalone methods
Method, print-opening: Private generic functions
Method, print-rainbow-step: Private generic functions
Method, print-step: Private generic functions
Method, print-step-dumb: Private generic functions
Method, progress-data: Private generic functions
Method, progress-fill-character: Private generic functions
Method, progress-finished: Private generic functions
Method, progress-length: Private generic functions
Method, progress-percent: Private generic functions
Method, progress-rainbow: Private generic functions
Method, progress-width: Private generic functions
Method, reinit: Private generic functions
Method, step-width: Private generic functions
Method, steps-counter: Private generic functions

P
percent-width: Private generic functions
percent-width: Private generic functions
print-object: Public standalone methods
print-opening: Private generic functions
print-opening: Private generic functions
print-rainbow-step: Private generic functions
print-rainbow-step: Private generic functions
print-step: Private generic functions
print-step: Private generic functions
print-step-dumb: Private generic functions
print-step-dumb: Private generic functions
progress: Private ordinary functions
progress-data: Private generic functions
progress-data: Private generic functions
progress-fill-character: Private generic functions
progress-fill-character: Private generic functions
progress-finished: Private generic functions
progress-finished: Private generic functions
progress-length: Private generic functions
progress-length: Private generic functions
progress-percent: Private generic functions
progress-percent: Private generic functions
progress-rainbow: Private generic functions
progress-rainbow: Private generic functions
progress-width: Private generic functions
progress-width: Private generic functions
progressbar: Public ordinary functions

Q
quit: Private ordinary functions

R
reinit: Private generic functions
reinit: Private generic functions

S
step!: Public ordinary functions
step-length: Private ordinary functions
step-width: Private generic functions
step-width: Private generic functions
steps-counter: Private generic functions
steps-counter: Private generic functions

T
termp: Private ordinary functions
tty-p: Private ordinary functions