From 1a96071d5f010e9c4e2e7d5a0726a5d0e348fc9b Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 22 Sep 2025 10:27:14 -1000 Subject: [PATCH] ;doc:Account names: edits --- hledger/hledger.m4.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/hledger/hledger.m4.md b/hledger/hledger.m4.md index 6d69aa45f..847654443 100644 --- a/hledger/hledger.m4.md +++ b/hledger/hledger.m4.md @@ -1447,13 +1447,23 @@ Note the **two or more spaces** delimiter that's sometimes required after accoun hledger's account names, inherited from Ledger, are very permissive; they may contain pretty much any kind of text, including single spaces and semicolons. Because of this, they must be terminated by **two or more spaces** if there is anything following them on the same line. -For example, if an amount (`$10`), a balance assignment (`=$1000`), or a same-line comment (`; comment`) +For example, if an amount, balance assignment, or same-line comment follows an account name, they must be preceded by two or more spaces, -else they would be considered part of the account name. +else they would be considered part of the account name: + +```journal + assets:checking $10 ; <- 2+ spaces between assets:checking and $ +``` +```journal + assets:checking =$1000 ; <- 2+ spaces between assets:checking and = +``` +```journal + assets:checking ; comment ; <- 2+ spaces between assets:checking and ; +``` This two-space delimiter appears in a few places in hledger: eg in postings, in account directives, and in period expressions. -At the start it's easy to forget - expect it to catch you out at least once - but it soon becomes familiar. +When starting out it's easy to forget - expect it to catch you out at least once. ### Account hierarchy