hledger-ui 1.16.2 → 1.17
raw patch · 14 files changed
+409/−263 lines, 14 filesdep +extradep ~basedep ~hledgerdep ~hledger-lib
Dependencies added: extra
Dependency ranges changed: base, hledger, hledger-lib
Files
- CHANGES.md +14/−0
- Hledger/UI/AccountsScreen.hs +13/−10
- Hledger/UI/Editor.hs +81/−62
- Hledger/UI/ErrorScreen.hs +1/−1
- Hledger/UI/Main.hs +13/−16
- Hledger/UI/RegisterScreen.hs +14/−9
- Hledger/UI/TransactionScreen.hs +1/−1
- Hledger/UI/UIOptions.hs +1/−20
- Hledger/UI/UIState.hs +17/−6
- Hledger/UI/UIUtils.hs +11/−2
- hledger-ui.1 +41/−27
- hledger-ui.cabal +8/−7
- hledger-ui.info +120/−38
- hledger-ui.txt +74/−64
CHANGES.md view
@@ -1,6 +1,20 @@ User-visible changes in hledger-ui. See also the hledger changelog. +# 1.17 2020-03-01++- don't enable --auto by default++- don't enable --forecast by default; drop the --future flag (#1193)++ Previously, periodic transactions occurring today were always shown,+ in both "present" and "future" modes.++ Now, generation of periodic transactions and display of future+ transactions (all kinds) are combined as "forecast mode", which can+ be enabled with --forecast and/or the F key. The --future flag is+ now a hidden alias for --forecast, and deprecated.+ # 1.16.2 2020-01-14 - add support for megaparsec 8 (#1175)
Hledger/UI/AccountsScreen.hs view
@@ -83,12 +83,15 @@ uopts' = uopts{cliopts_=copts{reportopts_=ropts'}} ropts' = ropts{accountlistmode_=if tree_ ropts then ALTree else ALFlat} - -- Add a date:-tomorrow to the query to exclude future txns, by default.- -- XXX this necessitates special handling in multiBalanceReport, at least- pfq | presentorfuture_ uopts == PFFuture = Any- | otherwise = Date $ DateSpan Nothing (Just $ addDays 1 d)- q = And [queryFromOpts d ropts, pfq]-+ q = And [queryFromOpts d ropts, excludeforecastq (forecast_ ropts)]+ where+ -- Except in forecast mode, exclude future/forecast transactions.+ excludeforecastq True = Any+ excludeforecastq False = -- not:date:tomorrow- not:tag:generated-transaction+ And [+ Not (Date $ DateSpan (Just $ addDays 1 d) Nothing)+ ,Not (Tag "generated-transaction" Nothing)+ ] -- run the report (items,_total) = report ropts' q j@@ -123,7 +126,7 @@ asInit _ _ _ = error "init function called with wrong screen type, should not happen" asDraw :: UIState -> [Widget Name]-asDraw UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}}+asDraw UIState{aopts=_uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} ,ajournal=j ,aScreen=s@AccountsScreen{} ,aMode=mode@@ -215,7 +218,7 @@ ,("-+", str "depth") ,("T", renderToggle (tree_ ropts) "flat" "tree") ,("H", renderToggle (not ishistorical) "end-bals" "changes")- ,("F", renderToggle (presentorfuture_ uopts == PFFuture) "present" "future")+ ,("F", renderToggle1 (forecast_ ropts) "forecast") --,("/", "filter") --,("DEL", "unfilter") --,("ESC", "cancel/top")@@ -310,7 +313,7 @@ VtyEvent (EvKey (KChar 'I') []) -> continue $ uiCheckBalanceAssertions d (toggleIgnoreBalanceAssertions ui) VtyEvent (EvKey (KChar 'a') []) -> suspendAndResume $ clearScreen >> setCursorPosition 0 0 >> add copts j >> uiReloadJournalIfChanged copts d j ui VtyEvent (EvKey (KChar 'A') []) -> suspendAndResume $ void (runIadd (journalFilePath j)) >> uiReloadJournalIfChanged copts d j ui- VtyEvent (EvKey (KChar 'E') []) -> suspendAndResume $ void (runEditor endPos (journalFilePath j)) >> uiReloadJournalIfChanged copts d j ui+ VtyEvent (EvKey (KChar 'E') []) -> suspendAndResume $ void (runEditor endPosition (journalFilePath j)) >> uiReloadJournalIfChanged copts d j ui VtyEvent (EvKey (KChar 'B') []) -> continue $ regenerateScreens j d $ toggleCost ui VtyEvent (EvKey (KChar 'V') []) -> continue $ regenerateScreens j d $ toggleValue ui VtyEvent (EvKey (KChar '0') []) -> continue $ regenerateScreens j d $ setDepth (Just 0) ui@@ -336,7 +339,7 @@ VtyEvent (EvKey (KChar 'U') []) -> asCenterAndContinue $ regenerateScreens j d $ toggleUnmarked ui VtyEvent (EvKey (KChar 'P') []) -> asCenterAndContinue $ regenerateScreens j d $ togglePending ui VtyEvent (EvKey (KChar 'C') []) -> asCenterAndContinue $ regenerateScreens j d $ toggleCleared ui- VtyEvent (EvKey (KChar 'F') []) -> asCenterAndContinue $ regenerateScreens j d $ toggleFuture ui+ VtyEvent (EvKey (KChar 'F') []) -> continue $ regenerateScreens j d $ toggleForecast ui VtyEvent (EvKey (KDown) [MShift]) -> continue $ regenerateScreens j d $ shrinkReportPeriod d ui VtyEvent (EvKey (KUp) [MShift]) -> continue $ regenerateScreens j d $ growReportPeriod d ui
Hledger/UI/Editor.hs view
@@ -2,11 +2,15 @@ -- {-# LANGUAGE OverloadedStrings #-} -module Hledger.UI.Editor+module Hledger.UI.Editor (+ -- TextPosition+ endPosition+ ,runEditor+ ,runIadd+ ) where import Control.Applicative ((<|>))-import Data.List import Safe import System.Environment import System.Exit@@ -15,76 +19,91 @@ import Hledger --- | Editors we know how to create more specific command lines for.-data EditorType = Emacs | EmacsClient | Vi | Other- -- | A position we can move to in a text editor: a line and optional column number.--- 1 (or 0) means the first and -1 means the last (and -2 means the second last, etc.--- though this may not be well supported.)+-- Line number 1 or 0 means the first line. A negative line number means the last line. type TextPosition = (Int, Maybe Int) -endPos :: Maybe TextPosition-endPos = Just (-1,Nothing)+-- | The text position meaning "last line, first column".+endPosition :: Maybe TextPosition+endPosition = Just (-1,Nothing) --- | Run the hledger-iadd executable (an alternative to the built-in add command),--- or raise an error.+-- | Run the hledger-iadd executable on the given file, blocking until it exits,+-- and return the exit code; or raise an error.+-- hledger-iadd is an alternative to the built-in add command. runIadd :: FilePath -> IO ExitCode runIadd f = runCommand ("hledger-iadd -f " ++ f) >>= waitForProcess --- | Try running the user's preferred text editor, or a default edit command,--- on the main journal file, blocking until it exits, and returning the exit code;--- or raise an error.+-- | Run the user's preferred text editor (or try a default editor),+-- on the given file, blocking until it exits, and return the exit+-- code; or raise an error. If a text position is provided, the editor+-- will be focussed at that position in the file, if we know how. runEditor :: Maybe TextPosition -> FilePath -> IO ExitCode-runEditor mpos f = editorOpenPositionCommand mpos f >>= runCommand >>= waitForProcess+runEditor mpos f = editFileAtPositionCommand mpos f >>= runCommand >>= waitForProcess --- Get the basic shell command to start the user's preferred text editor.--- This is the value of environment variable $HLEDGER_UI_EDITOR, or $EDITOR, or--- a default (emacsclient -a '' -nw, start/connect to an emacs daemon in terminal mode).-editorCommand :: IO String-editorCommand = do+-- | Get a shell command line to open the user's preferred text editor+-- (or a default editor) on the given file, and to focus it at the+-- given text position if one is provided and if we know how.+-- We know how to focus on position for: emacs, vi, nano.+-- We know how to focus on last line for: vi.+--+-- Some tests: With line and column numbers specified,+-- @+-- if EDITOR is: the command should be:+-- ------------- -----------------------------------+-- notepad notepad FILE+-- vi vi +LINE FILE+-- vi + FILE # negative LINE+-- emacs emacs +LINE:COL FILE+-- emacs FILE # negative LINE+-- (unset) emacsclient -a '' -nw +LINE:COL FILE+-- emacsclient -a '' -nw FILE # negative LINE+-- @+--+-- How to open editors at the last line of a file:+-- @+-- emacs: emacs FILE -f end-of-buffer+-- emacsclient: can't+-- vi: vi + FILE+-- @+--+editFileAtPositionCommand :: Maybe TextPosition -> FilePath -> IO String+editFileAtPositionCommand mpos f = do+ let f' = singleQuoteIfNeeded f+ editcmd <- getEditCommand+ let editor = lowercase $ takeFileName $ headDef "" $ words' editcmd+ let positionarg =+ case mpos of+ Just (l, mc)+ | editor `elem` [+ "ex",+ "vi","vim","view","nvim","evim","eview",+ "gvim","gview","rvim","rview","rgvim","rgview"+ ] -> plusAndMaybeLine l mc+ Just (l, mc)+ | editor `elem` ["emacs", "emacsclient"] -> plusLineAndMaybeColonColumnOrEnd l mc+ Just (l, mc)+ | editor `elem` ["nano"] -> plusLineAndMaybeCommaColumn l mc+ _ -> ""+ where+ plusAndMaybeLine l _ = "+" ++ if l >= 0 then show l else ""+ plusLineAndMaybeCommaColumn l mc = "+" ++ show l ++ maybe "" ((","++).show) mc+ plusLineAndMaybeColonColumnOrEnd l mc+ | l >= 0 = "+" ++ show l ++ maybe "" ((":"++).show) mc+ | otherwise = ""+ -- otherwise = "-f end-of-buffer"+ -- XXX Problems with this:+ -- it must appear after the filename, whereas +LINE:COL must appear before+ -- it works only with emacs, not emacsclient+ return $ unwords [editcmd, positionarg, f']++-- | Get the user's preferred edit command. This is the value of the+-- $HLEDGER_UI_EDITOR environment variable, or of $EDITOR, or a+-- default ("emacsclient -a '' -nw", which starts/connects to an emacs+-- daemon in terminal mode).+getEditCommand :: IO String+getEditCommand = do hledger_ui_editor_env <- lookupEnv "HLEDGER_UI_EDITOR" editor_env <- lookupEnv "EDITOR"- let Just cmd =- hledger_ui_editor_env- <|> editor_env- <|> Just "emacsclient -a '' -nw"+ let Just cmd = hledger_ui_editor_env <|> editor_env <|> Just "emacsclient -a '' -nw" return cmd --- | Get a shell command to start the user's preferred text editor, or a default,--- and optionally jump to a given position in the file. This will be the basic--- editor command, with the appropriate options added, if we know how.--- Currently we know how to do this for emacs and vi.--- Some examples:--- $EDITOR=notepad -> "notepad FILE"--- $EDITOR=vi -> "vi +LINE FILE"--- $EDITOR=vi, line -1 -> "vi + FILE"--- $EDITOR=emacs -> "emacs +LINE:COL FILE"--- $EDITOR=emacs, line -1 -> "emacs FILE -f end-of-buffer"--- $EDITOR not set -> "emacs -nw FILE -f end-of-buffer"----editorOpenPositionCommand :: Maybe TextPosition -> FilePath -> IO String-editorOpenPositionCommand mpos f = do- cmd <- editorCommand- let f' = singleQuoteIfNeeded f- return $- case (identifyEditor cmd, mpos) of- (EmacsClient, Just (l,mc)) | l >= 0 -> cmd ++ " " ++ emacsposopt l mc ++ " " ++ f'- (EmacsClient, Just (l,mc)) | l < 0 -> cmd ++ " " ++ emacsposopt 999999999 mc ++ " " ++ f'- (Emacs, Just (l,mc)) | l >= 0 -> cmd ++ " " ++ emacsposopt l mc ++ " " ++ f'- (Emacs, Just (l,_)) | l < 0 -> cmd ++ " " ++ f' ++ " -f end-of-buffer"- (Vi, Just (l,_)) -> cmd ++ " " ++ viposopt l ++ " " ++ f'- _ -> cmd ++ " " ++ f'- where- emacsposopt l mc = "+" ++ show l ++ maybe "" ((":"++).show) mc- viposopt l = "+" ++ if l >= 0 then show l else ""---- Identify which text editor is used in the basic editor command, if possible.-identifyEditor :: String -> EditorType-identifyEditor cmd- | "emacsclient" `isPrefixOf` exe = EmacsClient- | "emacs" `isPrefixOf` exe = Emacs- | exe `elem` ["vi","nvim","vim","ex","view","gvim","gview","evim","eview","rvim","rview","rgvim","rgview"]- = Vi- | otherwise = Other- where- exe = lowercase $ takeFileName $ headDef "" $ words' cmd
Hledger/UI/ErrorScreen.hs view
@@ -99,7 +99,7 @@ where (pos,f) = case parsewithString hledgerparseerrorpositionp esError of Right (f,l,c) -> (Just (l, Just c),f)- Left _ -> (endPos, journalFilePath j)+ Left _ -> (endPosition, journalFilePath j) e | e `elem` [VtyEvent (EvKey (KChar 'g') []), AppEvent FileChange] -> liftIO (uiReloadJournal copts d (popScreen ui)) >>= continue . uiCheckBalanceAssertions d -- (ej, _) <- liftIO $ journalReloadIfChanged copts d j
Hledger/UI/Main.hs view
@@ -21,13 +21,13 @@ #endif -- import Data.Monoid -- import Data.List+import Data.List.Extra (nubSort) import Data.Maybe -- import Data.Text (Text) import qualified Data.Text as T -- import Data.Time.Calendar import Graphics.Vty (mkVty) import Safe-import System.Exit import System.Directory import System.FilePath import System.FSNotify@@ -61,22 +61,19 @@ main :: IO () main = do- opts <- getHledgerUIOpts- let copts = cliopts_ opts- copts' = copts- { inputopts_ = (inputopts_ copts) { auto_ = True }- , reportopts_ = (reportopts_ copts) { forecast_ = True }- }-+ opts@UIOpts{cliopts_=copts@CliOpts{inputopts_=_iopts,reportopts_=ropts,rawopts_=rawopts}} <- getHledgerUIOpts -- when (debug_ $ cliopts_ opts) $ printf "%s\n" prognameandversion >> printf "opts: %s\n" (show opts)- run $ opts { cliopts_ = copts' }- where- run opts- | "help" `inRawOpts` (rawopts_ $ cliopts_ opts) = putStr (showModeUsage uimode) >> exitSuccess- | "version" `inRawOpts` (rawopts_ $ cliopts_ opts) = putStrLn prognameandversion >> exitSuccess- | "binary-filename" `inRawOpts` (rawopts_ $ cliopts_ opts) = putStrLn (binaryfilename progname)- | otherwise = withJournalDo (cliopts_ opts) (runBrickUi opts) + -- always include forecasted periodic transactions when loading data;+ -- they will be toggled on and off in the UI.+ let copts' = copts{reportopts_=ropts{forecast_=True}}++ case True of+ _ | "help" `inRawOpts` rawopts -> putStr (showModeUsage uimode)+ _ | "version" `inRawOpts` rawopts -> putStrLn prognameandversion+ _ | "binary-filename" `inRawOpts` rawopts -> putStrLn (binaryfilename progname)+ _ -> withJournalDo copts' (runBrickUi opts)+ runBrickUi :: UIOpts -> Journal -> IO () runBrickUi uopts@UIOpts{cliopts_=copts@CliOpts{inputopts_=_iopts,reportopts_=ropts}} j = do d <- getCurrentDay@@ -205,7 +202,7 @@ withManager $ \mgr -> do dbg1IO "fsnotify using polling ?" $ isPollingManager mgr files <- mapM (canonicalizePath . fst) $ jfiles j- let directories = nub $ sort $ map takeDirectory files+ let directories = nubSort $ map takeDirectory files dbg1IO "files" files dbg1IO "directories to watch" directories
Hledger/UI/RegisterScreen.hs view
@@ -59,7 +59,7 @@ rsSetAccount _ _ scr = scr rsInit :: Day -> Bool -> UIState -> UIState-rsInit d reset ui@UIState{aopts=uopts@UIOpts{cliopts_=CliOpts{reportopts_=ropts}}, ajournal=j, aScreen=s@RegisterScreen{..}} =+rsInit d reset ui@UIState{aopts=_uopts@UIOpts{cliopts_=CliOpts{reportopts_=ropts}}, ajournal=j, aScreen=s@RegisterScreen{..}} = ui{aScreen=s{rsList=newitems'}} where -- gather arguments and queries@@ -69,10 +69,15 @@ ropts' = ropts{ depth_=Nothing }- pfq | presentorfuture_ uopts == PFFuture = Any- | otherwise = Date $ DateSpan Nothing (Just $ addDays 1 d)- q = And [queryFromOpts d ropts', pfq]--- reportq = filterQuery (not . queryIsDepth) q+ q = And [queryFromOpts d ropts, excludeforecastq (forecast_ ropts)]+ where+ -- Except in forecast mode, exclude future/forecast transactions.+ excludeforecastq True = Any+ excludeforecastq False = -- not:date:tomorrow- not:tag:generated-transaction+ And [+ Not (Date $ DateSpan (Just $ addDays 1 d) Nothing)+ ,Not (Tag "generated-transaction" Nothing)+ ] (_label,items) = accountTransactionsReport ropts' j q thisacctq items' = (if empty_ ropts' then id else filter (not . isZeroMixedAmount . fifth6)) $ -- without --empty, exclude no-change txns@@ -133,7 +138,7 @@ rsInit _ _ _ = error "init function called with wrong screen type, should not happen" rsDraw :: UIState -> [Widget Name]-rsDraw UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}}+rsDraw UIState{aopts=_uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} ,aScreen=RegisterScreen{..} ,aMode=mode } =@@ -232,7 +237,7 @@ -- ,("RIGHT", str "transaction") ,("T", renderToggle (tree_ ropts) "flat(-subs)" "tree(+subs)") -- rsForceInclusive may override, but use tree_ to ensure a visible toggle effect ,("H", renderToggle (not ishistorical) "historical" "period")- ,("F", renderToggle (presentorfuture_ uopts == PFFuture) "present" "future")+ ,("F", renderToggle1 (forecast_ ropts) "forecast") -- ,("a", "add") -- ,("g", "reload") -- ,("q", "quit")@@ -315,7 +320,7 @@ VtyEvent (EvKey (KChar 'E') []) -> suspendAndResume $ void (runEditor pos f) >> uiReloadJournalIfChanged copts d j ui where (pos,f) = case listSelectedElement rsList of- Nothing -> (endPos, journalFilePath j)+ Nothing -> (endPosition, journalFilePath j) Just (_, RegisterScreenItem{ rsItemTransaction=Transaction{tsourcepos=GenericSourcePos f l c}}) -> (Just (l, Just c),f) Just (_, RegisterScreenItem{@@ -331,7 +336,7 @@ VtyEvent (EvKey (KChar 'U') []) -> rsCenterAndContinue $ regenerateScreens j d $ toggleUnmarked ui VtyEvent (EvKey (KChar 'P') []) -> rsCenterAndContinue $ regenerateScreens j d $ togglePending ui VtyEvent (EvKey (KChar 'C') []) -> rsCenterAndContinue $ regenerateScreens j d $ toggleCleared ui- VtyEvent (EvKey (KChar 'F') []) -> rsCenterAndContinue $ regenerateScreens j d $ toggleFuture ui+ VtyEvent (EvKey (KChar 'F') []) -> rsCenterAndContinue $ regenerateScreens j d $ toggleForecast ui VtyEvent (EvKey (KChar '/') []) -> continue $ regenerateScreens j d $ showMinibuffer ui VtyEvent (EvKey (KDown) [MShift]) -> continue $ regenerateScreens j d $ shrinkReportPeriod d ui
Hledger/UI/TransactionScreen.hs view
@@ -45,7 +45,7 @@ tsInit :: Day -> Bool -> UIState -> UIState tsInit _d _reset ui@UIState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=_ropts}} ,ajournal=_j- ,aScreen=TransactionScreen{..}+ ,aScreen=TransactionScreen{} } = -- plog ("initialising TransactionScreen, value_ is " -- -- ++ (pshow (Just (AtDefault Nothing)::Maybe ValuationType))
Hledger/UI/UIOptions.hs view
@@ -7,11 +7,8 @@ module Hledger.UI.UIOptions where-import Data.Data (Data) import Data.Default-import Data.Typeable (Typeable) import Data.List (intercalate)-import Data.Maybe (fromMaybe) import System.Environment import Hledger.Cli hiding (progname,version,prognameandversion)@@ -41,7 +38,6 @@ ,flagNone ["flat","F"] (setboolopt "flat") "show accounts as a list (default)" ,flagNone ["tree","T"] (setboolopt "tree") "show accounts as a tree" -- ,flagNone ["present"] (setboolopt "present") "exclude transactions dated later than today (default)"- ,flagNone ["future"] (setboolopt "future") "show transactions dated later than today (normally hidden)" -- ,flagReq ["drop"] (\s opts -> Right $ setopt "drop" s opts) "N" "with --flat, omit this many leading account name components" -- ,flagReq ["format"] (\s opts -> Right $ setopt "format" s opts) "FORMATSTR" "use this custom line format" -- ,flagNone ["no-elide"] (setboolopt "no-elide") "don't compress empty parent accounts on one line"@@ -54,6 +50,7 @@ modeGroupFlags = Group { groupUnnamed = uiflags ,groupHidden = hiddenflags+ ++ [flagNone ["future"] (setboolopt "forecast") "compatibility alias, use --forecast instead"] ,groupNamed = [(generalflagsgroup1)] } ,modeHelpSuffix=[@@ -65,7 +62,6 @@ data UIOpts = UIOpts { watch_ :: Bool ,change_ :: Bool- ,presentorfuture_ :: PresentOrFutureOpt ,cliopts_ :: CliOpts } deriving (Show) @@ -73,7 +69,6 @@ def def def- def -- instance Default CliOpts where def = defcliopts @@ -83,22 +78,8 @@ return defuiopts { watch_ = boolopt "watch" rawopts ,change_ = boolopt "change" rawopts- ,presentorfuture_ = presentorfutureopt rawopts ,cliopts_ = cliopts }---- | Should transactions dated later than today be included ?--- Like flat/tree mode, there are three states, and the meaning of default can vary by command.-data PresentOrFutureOpt = PFDefault | PFPresent | PFFuture deriving (Eq, Show, Data, Typeable)-instance Default PresentOrFutureOpt where def = PFDefault--presentorfutureopt :: RawOpts -> PresentOrFutureOpt-presentorfutureopt =- fromMaybe PFDefault . choiceopt parse where- parse = \case- "present" -> Just PFPresent- "future" -> Just PFFuture- _ -> Nothing checkUIOpts :: UIOpts -> UIOpts checkUIOpts opts =
Hledger/UI/UIState.hs view
@@ -151,13 +151,24 @@ b | balancetype_ ropts == HistoricalBalance = PeriodChange | otherwise = HistoricalBalance --- | Toggle between including and excluding transactions dated later than today.-toggleFuture :: UIState -> UIState-toggleFuture ui@UIState{aopts=uopts@UIOpts{presentorfuture_=pf}} =- ui{aopts=uopts{presentorfuture_=pf'}}+-- | Toggle hledger-ui's "forecast mode". In forecast mode, periodic+-- transactions (generated by periodic rules) are enabled (as with+-- hledger --forecast), and also future transactions in general+-- (including non-periodic ones) are displayed. In normal mode, all+-- future transactions (periodic or not) are suppressed (unlike+-- command-line hledger).+--+-- After toggling this, we do a full reload of the journal from disk+-- to make it take effect; currently that's done in the callers (cf+-- AccountsScreen, RegisterScreen) where it's easier. This is+-- overkill, probably we should just hide/show the periodic+-- transactions with a query for their special tag.+--+toggleForecast :: UIState -> UIState+toggleForecast ui@UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}}} =+ ui{aopts=uopts{cliopts_=copts'}} where- pf' | pf == PFFuture = PFPresent- | otherwise = PFFuture+ copts' = copts{reportopts_=ropts{forecast_=not $ forecast_ ropts}} -- | Toggle between showing all and showing only real (non-virtual) items. toggleReal :: UIState -> UIState
Hledger/UI/UIUtils.hs view
@@ -19,6 +19,7 @@ ,moveUpEvents ,normaliseMovementKeys ,renderToggle+ ,renderToggle1 ,replaceHiddenAccountsNameWith ,scrollSelectionToMiddle ,suspend@@ -122,7 +123,7 @@ withAttr ("help" <> "heading") $ str "Filtering" ,renderKey ("/ ", "set a filter query") ,renderKey ("UPC ", "show unmarked/pending/cleared")- ,renderKey ("F ", "show future/present txns")+ ,renderKey ("F ", "show future & periodic txns") ,renderKey ("R ", "show real/all postings") ,renderKey ("Z ", "show nonzero/all amounts") ,renderKey ("DEL ", "remove filters")@@ -210,13 +211,21 @@ -- sep = str " | " sep = str " " --- | Render the two states of a toggle, highlighting the active one.+-- | Show both states of a toggle ("aaa/bbb"), highlighting the active one. renderToggle :: Bool -> String -> String -> Widget Name renderToggle isright l r = let bold = withAttr ("border" <> "selected") in if isright then str (l++"/") <+> bold (str r) else bold (str l) <+> str ("/"++r)++-- | Show a toggle's label, highlighted (bold) when the toggle is active.+renderToggle1 :: Bool -> String -> Widget Name+renderToggle1 isactive l =+ let bold = withAttr ("border" <> "selected") in+ if isactive+ then bold (str l)+ else str l -- temporary shenanigans:
hledger-ui.1 view
@@ -1,5 +1,5 @@ -.TH "hledger-ui" "1" "January 2020" "hledger-ui 1.16.2" "hledger User Manuals"+.TH "hledger-ui" "1" "March 2020" "hledger-ui 1.17" "hledger User Manuals" @@ -15,9 +15,9 @@ \f[C]hledger ui -- [OPTIONS] [QUERYARGS]\f[R] .SH DESCRIPTION .PP-hledger is a cross-platform program for tracking money, time, or any-other commodity, using double-entry accounting and a simple, editable-file format.+hledger is a reliable, cross-platform set of programs for tracking+money, time, or any other commodity, using double-entry accounting and a+simple, editable file format. hledger is inspired by and largely compatible with ledger(1). .PP hledger-ui is hledger\[aq]s terminal interface, providing an efficient@@ -26,19 +26,17 @@ It is easier than hledger\[aq]s command-line interface, and sometimes quicker and more convenient than the web interface. .PP-Note hledger-ui has some different defaults (experimental):-.IP \[bu] 2-it generates rule-based transactions and postings by default (--forecast-and --auto are always on).-.IP \[bu] 2-it hides transactions dated in the future by default (change this with---future or the F key).-.PP Like hledger, it reads data from one or more files in hledger journal, timeclock, timedot, or CSV format specified with \f[C]-f\f[R], or \f[C]$LEDGER_FILE\f[R], or \f[C]$HOME/.hledger.journal\f[R] (on windows, perhaps \f[C]C:/Users/USER/.hledger.journal\f[R]). For more about this see hledger(1), hledger_journal(5) etc.+.PP+Unlike hledger, hledger-ui hides all future-dated transactions by+default.+They can be revealed, along with any rule-generated periodic+transactions, by pressing the F key (or starting with --forecast) to+enable \[dq]forecast mode\[dq]. .SH OPTIONS .PP Note: if invoking hledger-ui as a hledger subcommand, write \f[C]--\f[R]@@ -64,9 +62,6 @@ .TP \f[B]\f[CB]-T --tree\f[B]\f[R] show accounts as a tree-.TP-\f[B]\f[CB]--future\f[B]\f[R]-show transactions dated later than today (normally hidden) .PP hledger input options: .TP@@ -91,7 +86,8 @@ use some other field or tag for the account name .TP \f[B]\f[CB]-I --ignore-assertions\f[B]\f[R]-ignore any failing balance assertions+disable balance assertion checks (note: does not disable balance+assignments) .PP hledger reporting options: .TP@@ -154,8 +150,9 @@ apply automated posting rules to modify transactions. .TP \f[B]\f[CB]--forecast\f[B]\f[R]-apply periodic transaction rules to generate future transactions, to 6-months from now or report end date.+generate future transactions from periodic transaction rules, for the+next 6 months or till report end date.+In hledger-ui, also make ordinary future transactions visible. .PP When a reporting option appears more than once in the command line, the last one takes precedence.@@ -217,12 +214,11 @@ \f[C]BACKSPACE\f[R] or \f[C]DELETE\f[R] removes all filters, showing all transactions. .PP-As mentioned above, hledger-ui shows auto-generated periodic-transactions, and hides future transactions (auto-generated or not) by-default.-\f[C]F\f[R] toggles showing and hiding these future transactions.-This is similar to using a query like \f[C]date:-tomorrow\f[R], but more-convenient.+As mentioned above, by default hledger-ui hides future transactions -+both ordinary transactions recorded in the journal, and periodic+transactions generated by rule.+\f[C]F\f[R] toggles forecast mode, in which future/forecasted+transactions are shown. (experimental) .PP \f[C]ESCAPE\f[R] removes all filters and jumps back to the top screen.@@ -370,9 +366,6 @@ a depth limit. In other words, the register always shows the transactions contributing to the balance shown on the accounts screen.-.PD 0-.P-.PD Tree mode/flat mode can be toggled with \f[C]T\f[R] here also. .PP \f[C]U\f[R] toggles filtering by unmarked status, showing or hiding@@ -427,6 +420,27 @@ \f[C]-f\f[R]. Default: \f[C]\[ti]/.hledger.journal\f[R] (on windows, perhaps \f[C]C:/Users/USER/.hledger.journal\f[R]).+.PP+A typical value is \f[C]\[ti]/DIR/YYYY.journal\f[R], where DIR is a+version-controlled finance directory and YYYY is the current year.+Or \f[C]\[ti]/DIR/current.journal\f[R], where current.journal is a+symbolic link to YYYY.journal.+.PP+On Mac computers, you can set this and other environment variables in a+more thorough way that also affects applications started from the GUI+(say, an Emacs dock icon).+Eg on MacOS Catalina I have a \f[C]\[ti]/.MacOSX/environment.plist\f[R]+file containing+.IP+.nf+\f[C]+{+ \[dq]LEDGER_FILE\[dq] : \[dq]\[ti]/finance/current.journal\[dq]+}+\f[R]+.fi+.PP+To see the effect you may need to \f[C]killall Dock\f[R], or reboot. .SH FILES .PP Reads data from one or more files in hledger journal, timeclock,
hledger-ui.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 2b0a9cb6df439ba7f11df93f34158c1317a7327c5e4cffe2e92a242a706f1ab2+-- hash: 66249cd38304b42dc730bbee0dc85ef0132c4bd1977482948b16c1781d2d04d8 name: hledger-ui-version: 1.16.2+version: 1.17 synopsis: Terminal user interface for the hledger accounting tool description: This is hledger's terminal interface. It is simpler and more convenient for browsing data than the command-line interface,@@ -27,7 +27,7 @@ maintainer: Simon Michael <simon@joyful.com> license: GPL-3 license-file: LICENSE-tested-with: GHC==8.0.2, GHC==8.2.2, GHC==8.4.3, GHC==8.6.5, GHC==8.8.1+tested-with: GHC==8.0.2, GHC==8.2.2, GHC==8.4.3, GHC==8.6.5, GHC==8.8.2, GHC==8.10 build-type: Simple extra-source-files: CHANGES.md@@ -64,20 +64,21 @@ hs-source-dirs: ./. ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans- cpp-options: -DVERSION="1.16.2"+ cpp-options: -DVERSION="1.17" build-depends: ansi-terminal >=0.6.2.3 , async- , base >=4.9 && <4.14+ , base >=4.9 && <4.15 , base-compat-batteries >=0.10.1 && <0.12 , cmdargs >=0.8 , containers , data-default , directory+ , extra >=1.6.3 , filepath , fsnotify >=0.2.1.2 && <0.4- , hledger >=1.16.2 && <1.17- , hledger-lib >=1.16.2 && <1.17+ , hledger >=1.17 && <1.18+ , hledger-lib >=1.17 && <1.18 , megaparsec >=7.0.0 && <8.1 , microlens >=0.4 , microlens-platform >=0.2.3.1
hledger-ui.info view
@@ -3,33 +3,44 @@ File: hledger-ui.info, Node: Top, Next: OPTIONS, Up: (dir) -hledger-ui(1) hledger-ui 1.16.2-*******************************+hledger-ui(1) hledger-ui 1.17+***************************** -hledger-ui is hledger's terminal interface, providing an efficient+hledger-ui - terminal interface for the hledger accounting tool++ 'hledger-ui [OPTIONS] [QUERYARGS]'+'hledger ui -- [OPTIONS] [QUERYARGS]'++ hledger is a reliable, cross-platform set of programs for tracking+money, time, or any other commodity, using double-entry accounting and a+simple, editable file format. hledger is inspired by and largely+compatible with ledger(1).++ hledger-ui is hledger's terminal interface, providing an efficient full-window text UI for viewing accounts and transactions, and some limited data entry capability. It is easier than hledger's command-line interface, and sometimes quicker and more convenient than the web interface. - Note hledger-ui has some different defaults (experimental):-- * it generates rule-based transactions and postings by default- (-forecast and -auto are always on).- * it hides transactions dated in the future by default (change this- with -future or the F key).- Like hledger, it reads data from one or more files in hledger journal, timeclock, timedot, or CSV format specified with '-f', or '$LEDGER_FILE', or '$HOME/.hledger.journal' (on windows, perhaps 'C:/Users/USER/.hledger.journal'). For more about this see hledger(1), hledger_journal(5) etc. + Unlike hledger, hledger-ui hides all future-dated transactions by+default. They can be revealed, along with any rule-generated periodic+transactions, by pressing the F key (or starting with -forecast) to+enable "forecast mode".+ * Menu: * OPTIONS:: * KEYS:: * SCREENS::+* ENVIRONMENT::+* FILES::+* BUGS:: File: hledger-ui.info, Node: OPTIONS, Next: KEYS, Prev: Top, Up: Top@@ -62,10 +73,7 @@ '-T --tree' show accounts as a tree-'--future' - show transactions dated later than today (normally hidden)- hledger input options: '-f FILE --file=FILE'@@ -89,7 +97,8 @@ use some other field or tag for the account name '-I --ignore-assertions' - ignore any failing balance assertions+ disable balance assertion checks (note: does not disable balance+ assignments) hledger reporting options: @@ -154,8 +163,9 @@ apply automated posting rules to modify transactions. '--forecast' - apply periodic transaction rules to generate future transactions,- to 6 months from now or report end date.+ generate future transactions from periodic transaction rules, for+ the next 6 months or till report end date. In hledger-ui, also+ make ordinary future transactions visible. When a reporting option appears more than once in the command line, the last one takes precedence.@@ -215,11 +225,10 @@ below). 'BACKSPACE' or 'DELETE' removes all filters, showing all transactions. - As mentioned above, hledger-ui shows auto-generated periodic-transactions, and hides future transactions (auto-generated or not) by-default. 'F' toggles showing and hiding these future transactions.-This is similar to using a query like 'date:-tomorrow', but more-convenient. (experimental)+ As mentioned above, by default hledger-ui hides future transactions -+both ordinary transactions recorded in the journal, and periodic+transactions generated by rule. 'F' toggles forecast mode, in which+future/forecasted transactions are shown. (experimental) 'ESCAPE' removes all filters and jumps back to the top screen. Or, it cancels a minibuffer edit or help dialog in progress.@@ -277,7 +286,7 @@ Additional screen-specific keys are described below. -File: hledger-ui.info, Node: SCREENS, Prev: KEYS, Up: Top+File: hledger-ui.info, Node: SCREENS, Next: ENVIRONMENT, Prev: KEYS, Up: Top 3 SCREENS *********@@ -366,8 +375,8 @@ the register if the accounts screen is in tree mode, or if it's in flat mode but this account has subaccounts which are not shown due to a depth limit. In other words, the register always shows the transactions-contributing to the balance shown on the accounts screen.-Tree mode/flat mode can be toggled with 'T' here also.+contributing to the balance shown on the accounts screen. Tree+mode/flat mode can be toggled with 'T' here also. 'U' toggles filtering by unmarked status, showing or hiding unmarked transactions. Similarly, 'P' toggles pending transactions, and 'C'@@ -421,22 +430,95 @@ to cancel the reload attempt.) +File: hledger-ui.info, Node: ENVIRONMENT, Next: FILES, Prev: SCREENS, Up: Top++4 ENVIRONMENT+*************++*COLUMNS* The screen width to use. Default: the full terminal width.++ *LEDGER_FILE* The journal file path when not specified with '-f'.+Default: '~/.hledger.journal' (on windows, perhaps+'C:/Users/USER/.hledger.journal').++ A typical value is '~/DIR/YYYY.journal', where DIR is a+version-controlled finance directory and YYYY is the current year. Or+'~/DIR/current.journal', where current.journal is a symbolic link to+YYYY.journal.++ On Mac computers, you can set this and other environment variables in+a more thorough way that also affects applications started from the GUI+(say, an Emacs dock icon). Eg on MacOS Catalina I have a+'~/.MacOSX/environment.plist' file containing++{+ "LEDGER_FILE" : "~/finance/current.journal"+}++ To see the effect you may need to 'killall Dock', or reboot.+++File: hledger-ui.info, Node: FILES, Next: BUGS, Prev: ENVIRONMENT, Up: Top++5 FILES+*******++Reads data from one or more files in hledger journal, timeclock,+timedot, or CSV format specified with '-f', or '$LEDGER_FILE', or+'$HOME/.hledger.journal' (on windows, perhaps+'C:/Users/USER/.hledger.journal').+++File: hledger-ui.info, Node: BUGS, Prev: FILES, Up: Top++6 BUGS+******++The need to precede options with '--' when invoked from hledger is+awkward.++ '-f-' doesn't work (hledger-ui can't read from stdin).++ '-V' affects only the accounts screen.++ When you press 'g', the current and all previous screens are+regenerated, which may cause a noticeable pause with large files. Also+there is no visual indication that this is in progress.++ '--watch' is not yet fully robust. It works well for normal usage,+but many file changes in a short time (eg saving the file thousands of+times with an editor macro) can cause problems at least on OSX. Symptoms+include: unresponsive UI, periodic resetting of the cursor position,+momentary display of parse errors, high CPU usage eventually subsiding,+and possibly a small but persistent build-up of CPU usage until the+program is restarted.++ Also, if you are viewing files mounted from another machine,+'--watch' requires that both machine clocks are roughly in step.++ Tag Table: Node: Top71-Node: OPTIONS1101-Ref: #options1198-Node: KEYS4589-Ref: #keys4684-Node: SCREENS8991-Ref: #screens9076-Node: Accounts screen9166-Ref: #accounts-screen9294-Node: Register screen11510-Ref: #register-screen11665-Node: Transaction screen13661-Ref: #transaction-screen13819-Node: Error screen14689-Ref: #error-screen14811+Node: OPTIONS1470+Ref: #options1567+Node: KEYS4998+Ref: #keys5093+Node: SCREENS9369+Ref: #screens9474+Node: Accounts screen9564+Ref: #accounts-screen9692+Node: Register screen11908+Ref: #register-screen12063+Node: Transaction screen14060+Ref: #transaction-screen14218+Node: Error screen15088+Ref: #error-screen15210+Node: ENVIRONMENT15454+Ref: #environment15568+Node: FILES16375+Ref: #files16474+Node: BUGS16687+Ref: #bugs16764 End Tag Table
hledger-ui.txt view
@@ -11,10 +11,10 @@ hledger ui -- [OPTIONS] [QUERYARGS] DESCRIPTION- hledger is a cross-platform program for tracking money, time, or any- other commodity, using double-entry accounting and a simple, editable- file format. hledger is inspired by and largely compatible with- ledger(1).+ hledger is a reliable, cross-platform set of programs for tracking+ money, time, or any other commodity, using double-entry accounting and+ a simple, editable file format. hledger is inspired by and largely+ compatible with ledger(1). hledger-ui is hledger's terminal interface, providing an efficient full-window text UI for viewing accounts and transactions, and some@@ -22,25 +22,22 @@ line interface, and sometimes quicker and more convenient than the web interface. - Note hledger-ui has some different defaults (experimental):-- o it generates rule-based transactions and postings by default (--fore-- cast and --auto are always on).-- o it hides transactions dated in the future by default (change this- with --future or the F key).- Like hledger, it reads data from one or more files in hledger journal, timeclock, timedot, or CSV format specified with -f, or $LEDGER_FILE, or $HOME/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.journal). For more about this see hledger(1), hledger_journal(5) etc. + Unlike hledger, hledger-ui hides all future-dated transactions by de-+ fault. They can be revealed, along with any rule-generated periodic+ transactions, by pressing the F key (or starting with --forecast) to+ enable "forecast mode".+ OPTIONS- Note: if invoking hledger-ui as a hledger subcommand, write -- before+ Note: if invoking hledger-ui as a hledger subcommand, write -- before options as shown above. - Any QUERYARGS are interpreted as a hledger search query which filters+ Any QUERYARGS are interpreted as a hledger search query which filters the data. --watch@@ -53,7 +50,7 @@ start in the (first) matched account's register screen --change- show period balances (changes) at startup instead of historical+ show period balances (changes) at startup instead of historical balances -F --flat@@ -62,9 +59,6 @@ -T --tree show accounts as a tree - --future- show transactions dated later than today (normally hidden)- hledger input options: -f FILE --file=FILE@@ -72,7 +66,7 @@ $LEDGER_FILE or $HOME/.hledger.journal) --rules-file=RULESFILE- Conversion rules file to use when reading CSV (default:+ Conversion rules file to use when reading CSV (default: FILE.rules) --separator=CHAR@@ -87,7 +81,8 @@ use some other field or tag for the account name -I --ignore-assertions- ignore any failing balance assertions+ disable balance assertion checks (note: does not disable balance+ assignments) hledger reporting options: @@ -150,8 +145,9 @@ --auto apply automated posting rules to modify transactions. --forecast- apply periodic transaction rules to generate future transac-- tions, to 6 months from now or report end date.+ generate future transactions from periodic transaction rules,+ for the next 6 months or till report end date. In hledger-ui,+ also make ordinary future transactions visible. When a reporting option appears more than once in the command line, the last one takes precedence.@@ -170,44 +166,43 @@ show debug output (levels 1-9, default: 1) A @FILE argument will be expanded to the contents of FILE, which should- contain one command line option/argument per line. (To prevent this,+ contain one command line option/argument per line. (To prevent this, insert a -- argument before.) KEYS- ? shows a help dialog listing all keys. (Some of these also appear in+ ? shows a help dialog listing all keys. (Some of these also appear in the quick help at the bottom of each screen.) Press ? again (or ESCAPE, or LEFT) to close it. The following keys work on most screens: The cursor keys navigate: right (or enter) goes deeper, left returns to- the previous screen, up/down/page up/page down/home/end move up and- down through lists. Vi-style (h/j/k/l) and Emacs-style (CTRL-p/CTRL-- n/CTRL-f/CTRL-b) movement keys are also supported. A tip: movement- speed is limited by your keyboard repeat rate, to move faster you may- want to adjust it. (If you're on a mac, the Karabiner app is one way+ the previous screen, up/down/page up/page down/home/end move up and+ down through lists. Vi-style (h/j/k/l) and Emacs-style (CTRL-p/CTRL-+ n/CTRL-f/CTRL-b) movement keys are also supported. A tip: movement+ speed is limited by your keyboard repeat rate, to move faster you may+ want to adjust it. (If you're on a mac, the Karabiner app is one way to do that.) - With shift pressed, the cursor keys adjust the report period, limiting- the transactions to be shown (by default, all are shown). shift-- down/up steps downward and upward through these standard report period- durations: year, quarter, month, week, day. Then, shift-left/right- moves to the previous/next period. t sets the report period to today.- With the --watch option, when viewing a "current" period (the current+ With shift pressed, the cursor keys adjust the report period, limiting+ the transactions to be shown (by default, all are shown). shift-+ down/up steps downward and upward through these standard report period+ durations: year, quarter, month, week, day. Then, shift-left/right+ moves to the previous/next period. t sets the report period to today.+ With the --watch option, when viewing a "current" period (the current day, week, month, quarter, or year), the period will move automatically to track the current date. To set a non-standard period, you can use / and a date: query. - / lets you set a general filter query limiting the data shown, using- the same query terms as in hledger and hledger-web. While editing the- query, you can use CTRL-a/e/d/k, BS, cursor keys; press ENTER to set+ / lets you set a general filter query limiting the data shown, using+ the same query terms as in hledger and hledger-web. While editing the+ query, you can use CTRL-a/e/d/k, BS, cursor keys; press ENTER to set it, or ESCAPEto cancel. There are also keys for quickly adjusting some- common filters like account depth and transaction status (see below).+ common filters like account depth and transaction status (see below). BACKSPACE or DELETE removes all filters, showing all transactions. - As mentioned above, hledger-ui shows auto-generated periodic transac-- tions, and hides future transactions (auto-generated or not) by de-- fault. F toggles showing and hiding these future transactions. This- is similar to using a query like date:-tomorrow, but more convenient.- (experimental)+ As mentioned above, by default hledger-ui hides future transactions -+ both ordinary transactions recorded in the journal, and periodic trans-+ actions generated by rule. F toggles forecast mode, in which fu-+ ture/forecasted transactions are shown. (experimental) ESCAPE removes all filters and jumps back to the top screen. Or, it cancels a minibuffer edit or help dialog in progress.@@ -329,44 +324,44 @@ the register if the accounts screen is in tree mode, or if it's in flat mode but this account has subaccounts which are not shown due to a depth limit. In other words, the register always shows the transac-- tions contributing to the balance shown on the accounts screen.- Tree mode/flat mode can be toggled with T here also.+ tions contributing to the balance shown on the accounts screen. Tree+ mode/flat mode can be toggled with T here also. - U toggles filtering by unmarked status, showing or hiding unmarked+ U toggles filtering by unmarked status, showing or hiding unmarked transactions. Similarly, P toggles pending transactions, and C toggles- cleared transactions. (By default, transactions with all statuses are- shown; if you activate one or two status filters, only those transac-+ cleared transactions. (By default, transactions with all statuses are+ shown; if you activate one or two status filters, only those transac- tions are shown; and if you activate all three, the filter is removed.) R toggles real mode, in which virtual postings are ignored. - Z toggles nonzero mode, in which only transactions posting a nonzero- change are shown (hledger-ui shows zero items by default, unlike com-+ Z toggles nonzero mode, in which only transactions posting a nonzero+ change are shown (hledger-ui shows zero items by default, unlike com- mand-line hledger). Press right (or enter) to view the selected transaction in detail. Transaction screen- This screen shows a single transaction, as a general journal entry,- similar to hledger's print command and journal format (hledger_jour-+ This screen shows a single transaction, as a general journal entry,+ similar to hledger's print command and journal format (hledger_jour- nal(5)). - The transaction's date(s) and any cleared flag, transaction code, de-- scription, comments, along with all of its account postings are shown.- Simple transactions have two postings, but there can be more (or in+ The transaction's date(s) and any cleared flag, transaction code, de-+ scription, comments, along with all of its account postings are shown.+ Simple transactions have two postings, but there can be more (or in certain cases, fewer). - up and down will step through all transactions listed in the previous- account register screen. In the title bar, the numbers in parentheses- show your position within that account register. They will vary de-+ up and down will step through all transactions listed in the previous+ account register screen. In the title bar, the numbers in parentheses+ show your position within that account register. They will vary de- pending on which account register you came from (remember most transac-- tions appear in multiple account registers). The #N number preceding+ tions appear in multiple account registers). The #N number preceding them is the transaction's position within the complete unfiltered jour- nal, which is a more stable id (at least until the next reload). Error screen- This screen will appear if there is a problem, such as a parse error,- when you press g to reload. Once you have fixed the problem, press g+ This screen will appear if there is a problem, such as a parse error,+ when you press g to reload. Once you have fixed the problem, press g again to reload and resume normal operation. (Or, you can press escape to cancel the reload attempt.) @@ -374,9 +369,24 @@ COLUMNS The screen width to use. Default: the full terminal width. LEDGER_FILE The journal file path when not specified with -f. Default:- ~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour-+ ~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour- nal). + A typical value is ~/DIR/YYYY.journal, where DIR is a version-con-+ trolled finance directory and YYYY is the current year. Or ~/DIR/cur-+ rent.journal, where current.journal is a symbolic link to YYYY.journal.++ On Mac computers, you can set this and other environment variables in a+ more thorough way that also affects applications started from the GUI+ (say, an Emacs dock icon). Eg on MacOS Catalina I have a ~/.MacOSX/en-+ vironment.plist file containing++ {+ "LEDGER_FILE" : "~/finance/current.journal"+ }++ To see the effect you may need to killall Dock, or reboot.+ FILES Reads data from one or more files in hledger journal, timeclock, time- dot, or CSV format specified with -f, or $LEDGER_FILE, or@@ -431,4 +441,4 @@ -hledger-ui 1.16.2 January 2020 hledger-ui(1)+hledger-ui 1.17 March 2020 hledger-ui(1)