summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml9
-rw-r--r--CMakeLists.txt3
-rw-r--r--CONTRIBUTING.md110
-rw-r--r--INSTALL.md174
-rw-r--r--LICENSE.md (renamed from doc/LICENSE)0
-rw-r--r--README-1ST173
-rw-r--r--README.md162
-rw-r--r--doc/DEVELOP.md81
-rw-r--r--doc/DEVELOP.md.new0
-rw-r--r--doc/LICENSE.rtfbin1719 -> 0 bytes
-rw-r--r--doc/ledger.126
-rw-r--r--doc/ledger3.texi36
-rw-r--r--lisp/ledger-fontify.el1
-rw-r--r--test/unit/t_balance.cc3
14 files changed, 415 insertions, 363 deletions
diff --git a/.travis.yml b/.travis.yml
index 59501f68..9c6a1910 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,17 +18,16 @@ before_install:
install:
# Install GNU GCC 4.8 required by use of C++11
- - sudo apt-get install -qq g++-4.8 gcc-4.8
- - export CXX="g++-4.8" CC="gcc-4.8"
+ - if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.8 gcc-4.8; fi
+ - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
# Install Ledger dependencies
- sudo apt-get install -qq libboost1.55 libgmp-dev libmpfr-dev libeditline-dev
before_script:
- - export JOBS=2
- - ./acprep opt make --jobs $JOBS --python
+ - ./acprep opt make --python
script:
- - ./acprep check --jobs $JOBS -- --output-on-failure
+ - ./acprep check --jobs $(nproc) -- --output-on-failure
- PYTHONPATH=. python python/demo.py
notifications:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ca82084e..b7e7e920 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -267,11 +267,12 @@ add_subdirectory(test)
# build a CPack driven installer package
include (InstallRequiredSystemLibraries)
-set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/doc/LICENSE.rtf")
+set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.md")
set (CPACK_PACKAGE_VERSION_MAJOR "${Ledger_VERSION_MAJOR}")
set (CPACK_PACKAGE_VERSION_MINOR "${Ledger_VERSION_MINOR}")
set (CPACK_PACKAGE_VERSION_PATCH "${Ledger_VERSION_PATCH}")
+set (CPACK_GENERATOR "TBZ2")
set (CPACK_SOURCE_GENERATOR "TBZ2")
set (CPACK_SOURCE_PACKAGE_FILE_NAME
"${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a4b8b14f..bab3f7c8 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,7 +2,115 @@ Tips for contributors
---------------------
* Please **make pull requests against `next`, not `master`**.
- Ledger follows a [git-flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model,
+ Ledger follows a [git-flow] branching model,
in which development happens on the `next` branch and is subsequently merged into `master` for releases.
* If you're making **changes to `ledger-mode`, or other files for which the Travis build is not
relevant**, please **add `[ci skip]` to the end of the commit message**.
+
+GLOSSARY
+----
+
+Developing the Ledger software uses a number different tools, not all of
+which will be familiar to all developers.
+
+**[Boost]**: a standard set of C++ libraries. Most
+Boost libraries consist of inline functions and templates in header files.
+
+**[Boost.Python]**: C++ library which enables seamless interoperability
+between C++ and the Python programming language.
+
+**[Cheetah]**: a Python templating engine, used by `./python/server.py`.
+
+**[CMake]**: A cross platform system for building from source code. It uses
+the `CMakeLists.txt` files.
+
+**[Doxygen]**: generates programming documentation from
+source code files. Primarily used on C++ sources, but works on all. Uses
+the `doc/Doxyfile.in` file.
+
+**[GCC]**: Gnu Compiler Collection, which includes the
+*gcc* compiler and *gcov* coverage/profiler tool.
+
+**[clang]**: C language family frontend for LLVM, which
+includes the *clang* compiler.
+
+**[GMP]**: Gnu Multiple Precision Arithmetic Library
+provides arbitrary precision math.
+
+**[MPFR]**: Gnu Multiple Precision Floating-point Library
+with correct rounding.
+
+**[Markdown]**: A typesetter
+format that produces *html* files from *.md* files. Note that GitHub
+automatically renders *.md* files.
+
+**[SHA1]**: a marginally secure cryptographic hash function, used only for
+signing the license file.
+
+**[Texinfo]**: Gnu documentation
+typesetter that produces *html* and *pdf* files from the `doc/\*.texi` files.
+
+**[Travis CI]**: a hosted continuous integration
+ service that builds and runs tests each commit posted to GitHub. Each
+ build creates a [log], updates a [small badge] at
+ the top left of the main project's
+ [README.md], and
+ emails the author of the commit if any tests fail.
+
+**[utfcpp]**: a library for handling utf-8 in a variety of C++ versions.
+
+
+Orientation
+---
+
+The source tree can be confusing to a new developer. Here is a selective
+orientation:
+
+**./acprep**: a custom thousand-line script to install dependencies, grab
+ updates, and build. It also creates `\*.cmake`,
+ `./CmakeFiles/` and other CMake temporary files. Use `./acprep --help`
+ for more information.
+
+**./README.md**: user readme file in markdown format, also used as the project
+ description on GitHub.
+
+**./contrib/**: contributed scripts of random quality and completion. They
+ usually require editing to run.
+
+**./doc/**: documentation, licenses, and
+ tools for generating documents such as the *pdf* manual.
+
+**./lib/**: a couple of libraries used in development.
+
+**./lisp/**: the [Emacs][] [ledger-mode] lisp code, under the [GPLv2] license.
+
+**./python/**: samples using the Python ledger module.
+
+**./src/**: the C++ header and source files in a flat directory.
+
+**./test/**: a testing harness with subdirectories full of tests
+
+**./tools/**: an accretion of tools, mostly small scripts, to aid development
+
+
+[Boost]: http://boost.org
+[Boost.Python]: http://www.boost.org/libs/python/
+[GMP]: http://gmplib.org/
+[MPFR]: http://www.mpfr.org/
+[Cheetah]: http://www.cheetahtemplate.org
+[CMake]: http://www.cmake.org
+[Doxygen]: http://doxygen.org
+[Markdown]: https://daringfireball.net/projects/markdown/
+[SHA1]: http://en.wikipedia.org/wiki/SHA-1
+[Texinfo]: http://www.gnu.org/software/texinfo/
+[Travis CI]: https://travis-ci.org
+[GCC]: http://gcc.gnu.org
+[utfcpp]: http://utfcpp.sourceforge.net
+[log]: https://travis-ci.org/ledger/ledger
+[small badge]: https://img.shields.io/travis/ledger/ledger/master.svg?&style=flat
+[git-flow]: http://nvie.com/posts/a-successful-git-branching-model/
+[README.md]: https://github.com/ledger/ledger/blob/master/README.md
+[Emacs]: http://www.gnu.org/software/emacs/
+[ledger-mode]: http://ledger-cli.org/3.0/doc/ledger-mode.html
+[GPLv2]: http://www.gnu.org/licenses/gpl-2.0.html
+[clang]: http://clang.llvm.org
diff --git a/INSTALL.md b/INSTALL.md
new file mode 100644
index 00000000..62de2a97
--- /dev/null
+++ b/INSTALL.md
@@ -0,0 +1,174 @@
+# INSTALL
+
+To build this code after doing a Git clone, run:
+
+ $ ./acprep update
+
+If anything goes wrong, see "COMMON CONFIGURE/BUILD PROBLEMS" below.
+
+If you try to configure and build without running acprep first, you are
+almost certainly going to run into problems. In future, you can run
+`acprep update` again and again, and it will keep you updated to the
+very latest version.
+
+Now install it:
+
+ $ sudo make install
+
+
+## COMMON CONFIGURE / BUILD PROBLEMS
+
+To build and install Ledger requires several dependencies on various
+platforms. You can install these dependencies very simply for most of them
+using:
+
+ $ ./acprep dependencies
+
+The first order of business if acprep update doesn't work is to find out where
+things went wrong. So follow these steps to produce a bug report I can track
+down easily:
+
+ $ ./acprep --debug update # shows what acprep was thinking
+ $ $EDITOR CMakeCache.txt # shows what cmake was thinking
+
+With the contents of config.log, and the output from acprep --debug update,
+it's usually fairly obvious where things have gone astray.
+
+
+## F.A.Q.
+
+
+Q: The build fails saying it can't find `utf8.h`
+
+A: You didn't run `./acprep update`.
+
+----------------------------------------------------------------------
+
+Q: `./acprep update` gives errors or `./acprep dependencies` fails
+
+A: You're probably missing some dependency libraries. If you tried
+ `./acprep dependencies` already and that didn't solve the problem,
+ then you may need to install dependencies by hand. On a Debian
+ GNU/Linux system (or Debian-based system such as Ubuntu), something
+ like this should work (as root):
+
+ $ sudo apt-get install build-essential cmake texinfo python-dev \
+ zlib1g-dev libbz2-dev libgmp3-dev gettext libmpfr-dev \
+ libboost-date-time-dev libboost-filesystem-dev \
+ libboost-graph-dev libboost-iostreams-dev \
+ libboost-python-dev libboost-regex-dev libboost-test-dev \
+ doxygen libedit-dev libmpc-dev
+
+----------------------------------------------------------------------
+
+Q: Configure fails saying it can't find boost_regex
+
+A: Look in config.log and search for "boost_regex", then scroll down a bit
+ until you see the exact compile error. Usually it's failing because
+ your include directory is different from anything acprep is expecting to
+ see. It could also be failing because your Boost libraries have a
+ custom "suffix" on them.
+
+ Let's say your Boost was installed in ~/boost, and every library has the
+ suffix `-xgcc42`. This is what you would run:
+
+ $ CPPFLAGS=-I$HOME/boost acprep --boost=xgcc42 update
+
+----------------------------------------------------------------------
+
+Q: Configure fails saying it can't find MPFR
+
+A: You need MPFR version 2.4.0 or higher. This version does not come with
+ most Debian distributions, so you will need to build it. The
+ relevant packages are `libmpfr-dev` and `libmpfr-dbg`. See also
+ the question above about what to do if `./acprep update` gives
+ errors or `./acprep dependencies` fails.
+
+----------------------------------------------------------------------
+
+Q: I'm seeing a segfault deep inside the boost_regex code!
+
+A: Actually, the real segfault is in libstdc++'s facet code. It's being
+ caused by using a debug Boost with a non-debug build of Ledger, or
+ vice-versa.
+
+----------------------------------------------------------------------
+
+Q: Something else fails, or Ledger crashes on startup
+
+A: This, I am most interested in hearing about. Please file a bug
+ at the Ledger Bugzilla, http://bugs.ledger-cli.org/. The more
+ details you can provide, the better. Also, if Ledger is crashing,
+ try running it under gdb like so:
+
+ $ gdb ledger
+ (gdb) run <ARGS TO LEDGER>
+ ... runs till crash ...
+ (gdb) bt
+
+ Put that backtrace output, and the output from `ledger --version`
+ in the bug report.
+
+----------------------------------------------------------------------
+
+Q: Whenever I try to use the Python support, I get a segfault
+
+A: Make sure that the boost_python library you linked against is using the
+ exact same Python as the Ledger executable. In particular I see this
+ bug on OS X systems where boost_python is linked against the default
+ Python, while Ledger is linked against the version provided by MacPorts.
+ Or vice versa.
+
+ Solution: Use one or the other. If you prefer the system Python, run
+ `port deactivate -f python26`, to get MacPorts' version out of the way.
+ You'll then need to delete the Ledger binary and run `make` to relink
+ it.
+
+----------------------------------------------------------------------
+
+Q: When I run `make check`, the Python unit tests always crash
+
+A: This can happen for the same reason as above. It can also happen if you
+ have ICU support enabled. This is a bug I'm still trying to track down.
+
+----------------------------------------------------------------------
+
+Q: My distribution has versions of Boost and/or CMake that are too old for
+ Ledger. How do I build my own Boost and/or CMake binaries that will
+ work properly with Ledger? Thereafter, how do I configure Ledger
+ properly to use those newly built verisons of Boost and/or CMake?
+
+A: Here's commands that one user used to make this work, for Boost 1.51.0
+ on Debian GNU/Linux 6.0.x (aka Debian squeeze). It's likely to work ok
+ for other versions of Boost as well. YMMV on other distributions and/or
+ other Debian distribution versions, though.
+
+ - Preparing and building Boos
+
+ $ export BOOST_VERSION=1.57.0
+ $ cd /somewhere/you/want/to/build/boost
+ $ wget -N http://iweb.dl.sourceforge.net/project/boost/boost/$BOOST_VERSION/boost_${BOOST_VERSION//./_}.tar.bz2
+ $ tar xvf boost_${BOOST_VERSION//./_}.tar.bz2
+ $ cd boost_${BOOST_VERSION//./_}
+ $ ./bootstrap.sh
+ $ ./b2 --build-type=complete --layout=tagged --prefix=/where/you/want/boost/installed
+ $ ./b2 --build-type=complete --layout=tagged --prefix=/where/you/want/boost/installed install
+
+ - Preparing and building CMake
+
+ $ export CMAKE_VERSION=3.1.0
+ $ cd /somewhere/you/want/to/build/cmake
+ $ wget -N http://www.cmake.org/files/v${CMAKE_VERSION:0:3}/cmake-${CMAKE_VERSION}.tar.gz
+ $ tar xvf cmake-${CMAKE_VERSION}.tar.gz
+ $ cd cmake-${CMAKE_VERSION}
+ $ ./configure --prefix=/where/you/want/cmake/installed/
+ $ make
+ $ make install
+
+ - Building Ledger using the CMake and/or Boost as installed above
+
+ $ cd /path/to/ledger/sources
+ $ env PATH=/where/you/want/cmake/installed/bin:$PATH BOOST_ROOT=/where/you/want/boost/installed PREFIX=/where/you/want/ledger/installed $SHELL
+ $ ./acprep --prefix=$PREFIX --debug --python config
+ $ ./acprep --prefix=$PREFIX --debug --python make
+ $ ./acprep --prefix=$PREFIX --debug --python install
diff --git a/doc/LICENSE b/LICENSE.md
index 92be3a1d..92be3a1d 100644
--- a/doc/LICENSE
+++ b/LICENSE.md
diff --git a/README-1ST b/README-1ST
deleted file mode 100644
index 64f69411..00000000
--- a/README-1ST
+++ /dev/null
@@ -1,173 +0,0 @@
- README FIRST!!!
-
-To build this code after doing a Git clone, run:
-
- $ ./acprep update
-
-If anything goes wrong, see "COMMON CONFIGURE/BUILD PROBLEMS" below.
-
-If you try to configure and build without running acprep first, you are
-almost certainly going to run into problems. In future, you can run
-'acprep update' again and again, and it will keep you updated to the
-very latest version.
-
-Now install it:
-
- $ sudo make install
-
-===============================================================================
- COMMON CONFIGURE/BUILD PROBLEMS
-===============================================================================
-
-To build and install Ledger requires several dependencies on various
-platforms. You can install these dependencies very simply for most of them
-using:
-
- $ ./acprep dependencies
-
-The first order of business if acprep update doesn't work is to find out where
-things went wrong. So follow these steps to produce a bug report I can track
-down easily:
-
- $ ./acprep --debug update # shows what acprep was thinking
- $ <edit config.log> # shows what configure was thinking
-
-With the contents of config.log, and the output from acprep --debug update,
-it's usually fairly obvious where things have gone astray.
-
-===============================================================================
- F.A.Q.
-===============================================================================
-
-
- - Q: The build fails saying it can't find utf8.h
-
- A: You didn't run ./acprep update.
-
- ----------------------------------------------------------------------
-
- - Q: './acprep update' gives errors or './acprep dependencies' fails
-
- A: You're probably missing some dependency libraries. If you tried
- './acprep dependencies' already and that didn't solve the problem,
- then you may need to install dependencies by hand. On a Debian
- GNU/Linux system (or Debian-based system such as Ubuntu), something
- like this should work (as root):
-
- sudo apt-get install build-essential cmake texinfo python-dev \
- zlib1g-dev libbz2-dev libgmp3-dev gettext libmpfr-dev \
- libboost-date-time-dev libboost-filesystem-dev \
- libboost-graph-dev libboost-iostreams-dev \
- libboost-python-dev libboost-regex-dev libboost-test-dev \
- doxygen libedit-dev libmpc-dev
-
- ----------------------------------------------------------------------
-
- - Q: Configure fails saying it can't find boost_regex
-
- A: Look in config.log and search for "boost_regex", then scroll down a bit
- until you see the exact compile error. Usually it's failing because
- your include directory is different from anything acprep is expecting to
- see. It could also be failing because your Boost libraries have a
- custom "suffix" on them.
-
- Let's say your Boost was installed in ~/boost, and every library has the
- suffix '-xgcc42'. This is what you would run:
-
- CPPFLAGS=-I$HOME/boost acprep --boost=xgcc42 update
-
- ----------------------------------------------------------------------
-
- - Q: Configure fails saying it can't find MPFR
-
- A: You need MPFR version 2.4.0 or higher. This version does not come with
- most Debian distributions, so you will need to build it. The
- relevant packages are 'libmpfr-dev' and 'libmpfr-dbg'. See also
- the question above about what to do if './acprep update' gives
- errors or './acprep dependencies' fails.
-
- ----------------------------------------------------------------------
-
- - Q: I'm seeing a segfault deep inside the boost_regex code!
-
- A: Actually, the real segfault is in libstdc++'s facet code. It's being
- caused by using a debug Boost with a non-debug build of Ledger, or
- vice-versa.
-
- ----------------------------------------------------------------------
-
- - Q: Something else fails, or Ledger crashes on startup
-
- A: This, I am most interested in hearing about. Please file a bug
- at the Ledger Bugzilla, http://bugs.ledger-cli.org/. The more
- details you can provide, the better. Also, if Ledger is crashing,
- try running it under gdb like so:
-
- $ gdb ledger
- (gdb) run <ARGS TO LEDGER>
- ... runs till crash ...
- (gdb) bt
-
- Put that backtrace output, and the output from "ledger
- --version" in the bug report.
-
- ----------------------------------------------------------------------
-
- - Q: Whenever I try to use the Python support, I get a segfault
-
- A: Make sure that the boost_python library you linked against is using the
- exact same Python as the Ledger executable. In particular I see this
- bug on OS X systems where boost_python is linked against the default
- Python, while Ledger is linked against the version provided by MacPorts.
- Or vice versa.
-
- Solution: Use one or the other. If you prefer the system Python, run
- "port deactivate -f python26", to get MacPorts' version out of the way.
- You'll then need to delete the Ledger binary and run "make" to relink
- it.
-
- ----------------------------------------------------------------------
-
- - Q: When I run "make check", the Python unit tests always crash
-
- A: This can happen for the same reason as above. It can also happen if you
- have ICU support enabled. This is a bug I'm still trying to track down.
-
- ----------------------------------------------------------------------
-
- - Q: My distribution has versions of Boost and/or CMake that are too old for
- Ledger. How do I build my own Boost and/or CMake binaries that will
- work properly with Ledger? Thereafter, how do I configure Ledger
- properly to use those newly built verisons of Boost and/or CMake?
-
- A: Here's commands that one user used to make this work, for Boost 1.51.0
- on Debian GNU/Linux 6.0.x (aka Debian squeeze). It's likely to work ok
- for other versions of Boost as well. YMMV on other distributions and/or
- other Debian distribution versions, though.
-
- # Preparing and building Boost 1.51.0
-
- $ cd /somewhere/you/want/to/build/boost
- $ wget -N http://iweb.dl.sourceforge.net/project/boost/boost/1.51.0/boost_1_51_0.tar.bz2
- $ tar xvf boost_1_51_0.tar.bz2
- $ cd boost_1_51_0
- $ ./bootstrap.sh
- $ ./b2 --build-type=complete --layout=tagged --prefix=/where/you/want/boost/installed
- $ ./b2 --build-type=complete --layout=tagged --prefix=/where/you/want/boost/installed install
-
- # Preparing and building CMake 2.8.8
-
- $ cd /somewhere/you/want/to/build/cmake
- $ wget -N http://www.cmake.org/files/v2.8/cmake-2.8.8.tar.gz
- $ tar xvf cmake-2.8.8.tar.gz
- $ cd cmake-2.8.8
- $ ./configure --prefix=/where/you/want/cmake/installed/
- $ make
- $ make install
-
- # Building Ledger using the CMake and/or Boost as installed above
-
- $ cd /path/to/ledger/sources
- $ env PATH=/where/you/want/cmake/installed/bin:$PATH BOOST_ROOT=/where/you/want/boost/installed ./acprep --prefix=/where/you/want/ledger/installed --debug --python config
- $ env PATH=/where/you/want/cmake/installed/bin:$PATH BOOST_ROOT=/where/you/want/boost/installed ./acprep --prefix=/where/you/want/ledger/installed --debug --python make
- $ env PATH=/where/you/want/cmake/installed/bin:$PATH BOOST_ROOT=/where/you/want/boost/installed ./acprep --prefix=/where/you/want/ledger/installed --debug --python install
diff --git a/README.md b/README.md
index e18792d6..5e2c6a07 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,8 @@
-[![Build Status](https://travis-ci.org/ledger/ledger.svg?branch=master)](https://travis-ci.org/ledger/ledger)
+[![Build Status](https://img.shields.io/travis/ledger/ledger/master.svg?&style=flat)](https://travis-ci.org/ledger/ledger)
+[![Status](https://img.shields.io/badge/status-active-brightgreen.svg?style=flat)](https://github.com/ledger/ledger/pulse/monthly)
+[![License](https://img.shields.io/badge/license-BSD-blue.svg?style=flat)](http://opensource.org/licenses/BSD-3-Clause)
+[![GitHub tag](https://img.shields.io/github/tag/ledger/ledger.svg?style=flat)](https://github.com/ledger/ledger/releases)
+
# Ledger: Command-Line Accounting
@@ -21,44 +25,36 @@ and easy to use.
I know, you just want to build and play. If you have all the dependencies
installed (see below), then simply do this:
- git clone git://github.com/ledger/ledger.git
- cd ledger && ./acprep update # Update to the latest, configure, make
+ $ git clone git://github.com/ledger/ledger.git
+ $ cd ledger && ./acprep update # Update to the latest, configure, make
Now try your first ledger command:
- ./ledger -f test/input/sample.dat reg
+ $ ./ledger -f test/input/sample.dat reg
For help on keeping your journal have a look at the
-[documentation](http://www.ledger-cli.org/docs.html) and the
-[wiki](http://wiki.ledger-cli.org/) (Also see the “Resources” section at the
+[documentation] and the [wiki][] (Also see the “Resources” section at the
end of this file). An emacs mode for ledger files can be found in the `lisp`
-directory and a vim plugin is located in the [ledger/vim-ledger
-repository](https://github.com/ledger/vim-ledger).
+directory and a vim plugin is located in the [ledger/vim-ledger repository].
## To the Rest
If you're reading this file, you have in your hands the Bleeding Edge. This
may very well *not* be what you want, since it's not guaranteed to be in a
functionally complete state. It's under active development, and may change in
-any way at any time.
-
-What you may prefer is the current stable release, or the current beta branch.
-The **BETA** is what I prefer people use, since I still have a chance to fix
-major bugs that you find. Just e-mail me, or post to the mailing list,
-they'll become a part of my work list.
+any way at any time. What you may prefer is the **CURRENT** stable release, or
+the **BETA** branch.
-<table>
-<tr><td><strong>RELEASE</strong></td><td><tt>git checkout v3.1</tt></td></tr>
-<tr><td><strong>CURRENT</strong></td><td><tt>git checkout maint</tt></td></tr>
-<tr><td><strong>BETA</strong></td><td><tt>git checkout -b master origin/master</tt></td></tr>
-<tr><td><strong>ALPHA</strong></td><td><tt>git checkout -b next origin/next</tt></td></tr>
-</table>
+Branch | Command
+-------|--------
+**RELEASE** | `git checkout -b stable v3.1` |
+**CURRENT** | `git checkout -b master origin/master` |
+**BETA** | `git checkout -b 3.1.1 release/3.1.1` |
+**ALPHA** | `git checkout -b next origin/next` |
There are also several topic branches which contain experimental features,
though none of these are guaranteed to compile. Best to chat with me on
-[IRC](irc://irc.freenode.net/ledger) or via the
-[mailing list](http://groups.google.com/group/ledger-cli) before going too
-much further with those.
+[IRC] or via the [mailing list] before going too much further with those.
## Dependencies
@@ -66,53 +62,53 @@ If you wish to proceed in this venture, you'll need a few dependencies. The
easiest way to get them for your platform is to run this handy Python
script:
- ./acprep dependencies
+ $ ./acprep dependencies
If that doesn't completely work, here are the dependencies for building the
current `master` branch:
-<table>
-<tr><td>Boost</td><td>1.35</td><td></td></tr>
-<tr><td>GMP</td><td>4.2.2</td><td></td></tr>
-<tr><td>MPFR</td><td>2.4.0</td><td></td></tr>
-<tr><td>utfcpp</td><td>2.3.4</td><td></td></tr>
-<tr><td>gettext</td><td>0.17</td><td><em>optional</em></td></tr>
-<tr><td>libedit</td><td>20090111-3.0</td><td><em>optional</em></td></tr>
-<tr><td>Python</td><td>2.4</td><td><em>optional</em></td></tr>
-<tr><td>doxygen</td><td>1.5.7.1</td><td><em>optional</em>, for <tt>make docs</tt></td></tr>
-<tr><td>graphviz</td><td>2.20.3</td><td><em>optional</em>, for <tt>make docs</tt></td></tr>
-<tr><td>texinfo</td><td>4.13</td><td><em>optional</em>, for <tt>make docs</tt></td></tr>
-<tr><td>lcov</td><td>1.6</td><td><em>optional</em>, for <tt>make report</tt>, used with <tt>/./acprep gcov</tt></td></tr>
-<tr><td>sloccount</td><td>2.26</td><td><em>optional</em>, for <tt>make sloc</tt></td></tr>
-</table>
-
-And for building the current `maint` branch:
-
-<table>
-<tr><td>GMP</td><td>4.2.2</td><td> </td></tr>
-<tr><td>pcre</td><td>7.7</td><td> </td></tr>
-<tr><td>libofx</td><td>0.8.3</td><td><em>optional</em></td></tr>
-<tr><td>expat</td><td>2.0.1</td><td><em>optional</em></td></tr>
-<tr><td>libxml2</td><td>2.7.2</td><td><em>optional</em></td></tr>
-</table>
-
-### OS X
-
-You can use [MacPorts](https://www.macports.org/) or [homebrew](http://brew.sh/) to install this very quickly on OS X.
+Dependency | Version (or greater)
+-----------|---------------------
+[Boost] | 1.49
+[GMP] | 4.2.2
+[MPFR] | 2.4.0
+[utfcpp] | 2.3.4
+[gettext] | 0.17 _optional_
+[libedit] | 20090111-3.0 _optional_
+[Python] | 2.4 _optional_
+[doxygen] | 1.5.7.1 _optional_, for `make docs`
+[graphviz] | 2.20.3 _optional_, for `make docs`
+[texinfo] | 4.13 _optional_, for `make docs`
+[lcov] | 1.6 _optional_, for `make report`, used with `/./acprep gcov`
+[sloccount] | 2.26 _optional_, for `make sloc`
+
+And for building the outdated `release/2.6.3` branch:
+
+Dependency | Version
+-----------|--------
+[GMP] | 4.2.2
+[pcre] | 7.7
+[libofx] | 0.8.3 _optional_
+[expat] | 2.0.1 _optional_
+[libxml2] | 2.7.2 _optional_
+
+### Mac OS X
+
+You can use [Homebrew] or [MacPorts] to install Ledger easily on OS X.
#### 1. Homebrew
You can see the parameters you can pass while installing with brew by the command `brew options ledger`. To install ledger, simply type the following command:
- brew install ledger
+ $ brew install ledger
If everything worked well, you should have ledger working now. If you want to install this with python bindings, you can use the following command:
- brew install ledger --with-python
+ $ brew install ledger --with-python
If you to want to startup python, use the following command:
- ledger python
+ $ ledger python
#### 2. MacPorts
@@ -120,7 +116,7 @@ If you to want to startup python, use the following command:
If you build stuff using MacPorts on OS X, as I do, here is what you would
run:
- sudo port install -f cmake python26 \
+ $ sudo port install -f cmake python26 \
libiconv +universal zlib +universal gmp +universal \
mpfr +universal ncurses +universal ncursesw +universal \
gettext +universal libedit +universal boost-jam \
@@ -132,7 +128,7 @@ run:
If you're going to build on Ubuntu, `sudo apt-get install ...` the
following packages (current as of Ubuntu 14.04):
- sudo apt-get install build-essential cmake doxygen \
+ $ sudo apt-get install build-essential cmake doxygen \
libboost-system-dev libboost-dev python-dev gettext git \
libboost-date-time-dev libboost-filesystem-dev \
libboost-iostreams-dev libboost-python-dev libboost-regex-dev \
@@ -140,7 +136,7 @@ following packages (current as of Ubuntu 14.04):
Or, for Ubuntu 12.04:
- sudo apt-get install build-essential cmake zlib1g-dev libbz2-dev \
+ $ sudo apt-get install build-essential cmake zlib1g-dev libbz2-dev \
python-dev gettext libgmp3-dev libmpfr-dev libboost-dev \
libboost-regex-dev libboost-date-time-dev \
libboost-filesystem-dev libboost-python-dev texinfo lcov \
@@ -155,7 +151,7 @@ Debian 7 (wheezy) and Debian 8 (jessie) contain all components needed to
build ledger. You can install all required build dependencies using the
following command:
- sudo apt-get install build-essential cmake autopoint texinfo python-dev \
+ $ sudo apt-get install build-essential cmake autopoint texinfo python-dev \
zlib1g-dev libbz2-dev libgmp3-dev gettext libmpfr-dev \
libboost-date-time-dev libboost-filesystem-dev \
libboost-graph-dev libboost-iostreams-dev \
@@ -167,12 +163,13 @@ The next step is preparing your environment for building. While you can use
`cmake .` and make, I've prepared a script that does a lot more of the
footwork for you:
- ./acprep update
+ $ ./acprep update
# or, if you want to use the Boost libraries with suffix -mt, install in
# $HOME/local and build with 2 processes in parallel
- ./acprep update --boost-suffix=-mt --prefix=$HOME/local -j2
+ $ ./acprep update --boost-suffix=-mt --prefix=$HOME/local -j2
-Please read the contents of `config.log` if the configure step fails. Also,
+Please read the contents of `CMakeFiles/CMakeOutput.log` and
+`CMakeFiles/CMakeError.log` if the configure step fails. Also,
see the `help` subcommand to `acprep`, which explains some of its many
options. It's pretty much the only command I run for configuring, building
and testing Ledger.
@@ -183,14 +180,41 @@ You can run `make check` to confirm the result, and `make install` to install.
Now that you're up and running, here are a few resources to keep in mind:
- - [Home page](http://ledger-cli.org)
- - [Documentation](http://www.ledger-cli.org/docs.html)
- - [IRC channel](irc://irc.freenode.net/ledger)
- - [Mailing List / Forum](http://groups.google.com/group/ledger-cli)
- - [GitHub project page](http://github.com/ledger/ledger)
- - [Ohloh code analysis](http://www.ohloh.net/projects/ledger)
+ - [Homepage]
+ - [Documentation]
+ - [IRC channel][IRC]
+ - [Mailing List / Forum][mailing list]
+ - [GitHub project page][github]
+ - [Code analysis][openhub]
If you have ideas you'd like to share, the best way is either to e-mail me a
patch (I prefer attachments over pasted text), or to get an account on GitHub.
-Once you do, fork the [Ledger project](http://github.com/ledger/ledger),
+Once you do, fork the [Ledger project][github],
hack as much as you like, then send me a pull request via GitHub.
+
+[Homepage]: http://ledger-cli.org/
+[documentation]: http://www.ledger-cli.org/docs.html
+[mailing list]: http://list.ledger-cli.org/
+[wiki]: http://wiki.ledger-cli.org/
+[IRC]: irc://irc.freenode.net/ledger
+[github]: http://github.com/ledger/ledger
+[ledger/vim-ledger repository]: https://github.com/ledger/vim-ledger
+[Homebrew]: http://brew.sh/
+[MacPorts]: https://www.macports.org/
+[Boost]: http://boost.org
+[GMP]: http://gmplib.org/
+[MPFR]: http://www.mpfr.org/
+[utfcpp]: http://utfcpp.sourceforge.net
+[gettext]: https://www.gnu.org/software/gettext/
+[libedit]: http://thrysoee.dk/editline/
+[Python]: http://python.org
+[doxygen]: http://www.doxygen.org/
+[graphviz]: http://graphviz.org/
+[texinfo]: http://www.gnu.org/software/texinfo/
+[lcov]: http://ltp.sourceforge.net/coverage/lcov.php
+[sloccount]: http://www.dwheeler.com/sloccount/
+[pcre]: http://www.pcre.org/
+[libofx]: http://libofx.sourceforge.net
+[expat]: http://www.libexpat.org
+[libxml2]: http://xmlsoft.org
+[openhub]: https://www.openhub.net/p/ledger
diff --git a/doc/DEVELOP.md b/doc/DEVELOP.md
deleted file mode 100644
index ce897741..00000000
--- a/doc/DEVELOP.md
+++ /dev/null
@@ -1,81 +0,0 @@
-GLOSSARY
-----
-
-Developing the Ledger software uses a number different tools, not all of
-which will be familiar to all developers.
-
-[**Boost**](http://www.boost.org): a standard set of C++ libraries. Most
-Boost libraries consist of inline functions and templates in header files.
-
-[**Cheetah**](http://www.cheetahtemplate.org): a Python templating engine,
-used by *./python/server.py*.
-
-[**CMake**](http://www.cmake.org): A cross platform system for building
-from source code. It uses the *CMakeLists.txt* files.
-
-[**DOxygen**](http://doxygen.org): generates programming documentation from
-source code files. Primarily used on C++ sources, but works on all. Uses
-the *doc/Doxyfile.in* file.
-
-[**GCC**](http://gcc.gnu.org): Gnu Compiler Collection, which includes the
-*gcc* compiler and *gcov* coverage/profiler tool.
-
-[**GMP**](https://gmplib.org): Gnu Multiple Precision Arithmetic Library
-provides arbitrary precision math.
-
-[**Markdown**](https://daringfireball.net/projects/markdown/): A typesetter
-format that produces *html* files from *.md* files. Note that GitHub
-automatically renders *.md* files.
-
-[**sha1**](http://en.wikipedia.org/wiki/SHA-1): a marginally secure
-cryptographic hash function, used only for signing the license file.
-
-[**Texinfo**](http://www.gnu.org/software/texinfo/): Gnu documentation
-typesetter that produces *html* and *pdf* files from the *doc/\*.texi*
-files.
-
-[**Travis CI**](https://travis-ci.org): a hosted continuous integration
- service that builds and runs tests each commit posted to GitHub. Each
- build creates a [log](https://travis-ci.org/ledger/ledger), updates a
- [small graphic](https://travis-ci.org/ledger/ledger.png?branch=master) at
- the top left of the main project's
- [README.md](https://github.com/ledger/ledger/blob/master/README.md), and
- emails the author of the commit if any tests fail.
-
-[**utfcpp**](http://utfcpp.sourceforge.net): a library for handling utf-8
-in a variety of C++ versions.
-
-
-Orientation
----
-
-The source tree can be confusing to a new developer. Here is a selective
-orientation:
-
-**./acprep**: a custom thousand-line script to install dependencies, grab
- updates, and build. It also creates *\*.cmake*,
- *./CmakeFiles/* and other CMake temporary files. Use *./acprep --help*
- for more information.
-
-**./README.md**: user readme file in markdown format, also used as the project
- description on GitHub.
-
-**./contrib/**: contributed scripts of random quality and completion. They
- usually require editing to run.
-
-**./doc/**: documentation, licenses, and
- tools for generating documents such as the *pdf* manual.
-
-**./lib/**: a couple libraries used in development.
-
-**./lisp/**: the [Emacs](http://www.gnu.org/software/emacs/)
- [ledger-mode](http://ledger-cli.org/3.0/doc/ledger-mode.html) lisp code,
- under the [GPLv2](http://www.gnu.org/licenses/gpl-2.0.html) license.
-
-**./python/**: samples using the Python ledger module.
-
-**./src/**: the C++ header and source files in a flat directory.
-
-**./test/**: a testing harness with subdirectories full of tests
-
-**./tools/**: an accretion of tools, mostly small scripts, to aid development
diff --git a/doc/DEVELOP.md.new b/doc/DEVELOP.md.new
deleted file mode 100644
index e69de29b..00000000
--- a/doc/DEVELOP.md.new
+++ /dev/null
diff --git a/doc/LICENSE.rtf b/doc/LICENSE.rtf
deleted file mode 100644
index 471065fe..00000000
--- a/doc/LICENSE.rtf
+++ /dev/null
Binary files differ
diff --git a/doc/ledger.1 b/doc/ledger.1
index b4746eb9..6995e2c8 100644
--- a/doc/ledger.1
+++ b/doc/ledger.1
@@ -333,7 +333,7 @@ Anonymize registry output, mostly for sending in bug reports.
.It Fl \-auto-match
.It Fl \-aux-date
Show auxiliary dates for all calculations.
-Alias for
+Alias for
.Fl \-effective
.It Fl \-average Pq Fl A
Print average values over the number of transactions instead of
@@ -408,7 +408,7 @@ Shorthand for
.Nm --limit 'date <= today' .
.It Fl \-daily Pq Fl D
Shorthand for
-.Nm --period 'daily' .
+.Nm --period Ar 'daily' .
.It Fl \-date Ar EXPR
Transform the date of the transaction using
.Ar EXPR .
@@ -501,7 +501,7 @@ Print the first
.Ar INT
entries. Opposite of
.Fl \-tail Ar INT .
-Alias for
+Alias for
.Fl \-head .
.It Fl \-flat
Force the full names of accounts to be used in the balance report. The
@@ -582,7 +582,7 @@ report.
Alias for
.Fl \-tail .
.It Fl \-leeway Ar INT Pq Fl Z
-Alias for
+Alias for
.Fl \-price-expr .
.It Fl \-limit Ar EXPR Pq Fl l
Limit postings in calculations.
@@ -612,7 +612,7 @@ Specify the width of the Meta column used for the
options.
.It Fl \-monthly Pq Fl M
Shorthand for
-.Fl \-period 'monthly' .
+.Fl \-period Ar 'monthly' .
.It Fl \-no-aliases
Aliases are completely ignored.
.It Fl \-no-color
@@ -714,7 +714,7 @@ Show primary dates for all calculations. Alias for
Report commodity totals (this is the default).
.It Fl \-quarterly
Synonym for
-\Fl \-period 'quarterly' .
+\Fl \-period Ar 'quarterly' .
.It Fl \-raw
In the
.Nm print
@@ -739,7 +739,7 @@ of the transaction.
.It Fl \-related-all
Show all postings in a transaction, similar to
.Fl \-related
-but show
+but show
.Nm both sides
of each transaction.
.It Fl \-revalued
@@ -834,12 +834,12 @@ ledger will produce memory trace information.
Print version information and exit.
.It Fl \-weekly Pq Fl W
Synonym for
-.Fl \-period 'weekly' .
+.Fl \-period Ar 'weekly' .
.It Fl \-wide Pq Fl w
Assume 132 columns instead of 80.
.It Fl \-yearly Pq Fl Y
Synonym for
-.Fl \-period 'yearly' .
+.Fl \-period Ar 'yearly' .
.El
.Pp
.Sh PRE-COMMANDS
@@ -868,8 +868,8 @@ Evaluate the given period and report how Ledger interprets it.
.It Nm script
.It Nm template
Shows the insertion template that the
-.Nm xact sub-command generates.
-This is a debugging command.
+.Nm xact
+sub-command generates. This is a debugging command.
.El
.Pp
.Sh QUERIES
@@ -984,7 +984,7 @@ for example:
.Pp
.Sh ENTRIES
.Pp
-.Sh FORMATS
+.Sh FORMATS
.Pp
.Sh DEBUG COMMANDS
In addition to the regular reporting commands, Ledger also accepts several
@@ -1033,7 +1033,7 @@ and displays information about how it was parsed. See the section on
.El
.Pp
.Sh SEE ALSO
-.Xr beancount 1,
+.Xr beancount 1 ,
.Xr hledger 1
.Sh AUTHORS
.An "John Wiegley"
diff --git a/doc/ledger3.texi b/doc/ledger3.texi
index 62869a29..c3b7571d 100644
--- a/doc/ledger3.texi
+++ b/doc/ledger3.texi
@@ -5770,31 +5770,27 @@ Specify the location of the init file. The default is @file{~/.ledgerrc}.
Display the options in effect for this Ledger invocation, along with
their values and the source of those values, for example:
-@smallexample
-$ ledger --options bal --cleared -f ~/ledger/test/input/drewr3.dat
-===========================================================================
+@smallexample @c command:A9349E4,with_input:03ACB97
+$ ledger --options bal --cleared
+@end smallexample
+
+@smallexample @c output:A9349E4
+===============================================================================
[Global scope options]
+ --args-only --args-only
[Session scope options]
- --file = ~/ledger/test/input/drewr3.dat -f
- --price-db = ~/FinanceData/PriceDB $price-db
+ --file = A9349E4.dat --file
[Report scope options]
- --cleared --cleared
- --color ?normalize
- --date-format = %Y/%m/%d $date-format
- --limit = cleared --cleared
- --prepend-width = 0 ?normalize
- --meta-width = 0 ?normalize
- --date-width = 10 ?normalize
- --payee-width = 21 ?normalize
- --account-width = 21 ?normalize
- --amount-width = 12 ?normalize
- --total-width = 12 ?normalize
-===========================================================================
- $ 775.00 Assets:Checking
- $ -1,000.00 Equity:Opening Balances
- $ 225.00 Expenses:Food:Groceries
+ --cleared --cleared
+ --columns = 80 --columns
+ --limit = cleared --cleared
+===============================================================================
+ $15.00 Expenses
+ $12.45 Food
+ $2.55 Tips
+ $-15.00 Liabilities:MasterCard
--------------------
0
@end smallexample
diff --git a/lisp/ledger-fontify.el b/lisp/ledger-fontify.el
index d307208f..8dbe1bd5 100644
--- a/lisp/ledger-fontify.el
+++ b/lisp/ledger-fontify.el
@@ -42,6 +42,7 @@
(save-excursion
(unless beg (setq beg (point-min)))
(unless end (setq end (point-max)))
+ (goto-char beg)
(beginning-of-line)
(while (< (point) end)
(cond ((or (looking-at ledger-xact-start-regex)
diff --git a/test/unit/t_balance.cc b/test/unit/t_balance.cc
index c4ec2f31..b503d02a 100644
--- a/test/unit/t_balance.cc
+++ b/test/unit/t_balance.cc
@@ -178,7 +178,10 @@ BOOST_AUTO_TEST_CASE(testEqaulity)
BOOST_CHECK(b4 == b5);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-value"
BOOST_CHECK_THROW(b0 == a0, balance_error);
+#pragma GCC diagnostic pop
BOOST_CHECK(b0.valid());
BOOST_CHECK(b1.valid());