((META (EMPTY-STRING title "Query: Thread Directive") (WORD role "manual") (TAG-SET tags ("#manual" "#search" "#zettelstore")) (WORD syntax "zmk") (ZID-SET back ("00001007700000" "00001007720000")) (ZID-SET backward ("00001007700000" "00001007720000")) (NUMBER box-number "1") (STRING copyright "(c) 2020-present by Detlef Stern ") (TIMESTAMP created "20250624162823") (ZID-SET forward ("00001006020000" "00001007701000" "00001007720300")) (WORD lang "en") (EMPTY-STRING license "EUPL-1.2-or-later") (TIMESTAMP modified "20250626174233") (TIMESTAMP published "20250626174233") (WORD visibility "public")) (BLOCK (PARA (TEXT "A thread directive is similar to the ") (LINK () (ZETTEL "00001007720300") (TEXT "context directive")) (TEXT " by calculating zettel associated with a list of zettel identifier.") (SOFT) (TEXT "There are three thread directives, beginning with the keywords ") (LITERAL-INPUT () "FOLGE") (TEXT ", ") (LITERAL-INPUT () "SEQUEL") (TEXT ", and ") (LITERAL-INPUT () "THREAD") (TEXT ".")) (PARA (TEXT "With the help of the ") (LITERAL-INPUT () "FOLGE") (TEXT " directive, you can list all zettel that belong to the same ") (FORMAT-QUOTE () (TEXT "train of thought")) (TEXT ".") (SOFT) (TEXT "It is possible to list all folge zettel only or only precursor zettel.") (SOFT) (TEXT "Additionally, you can specify the maximum number to be listed.") (SOFT) (TEXT "A ") (LITERAL-INPUT () "FOLGE") (TEXT " directive considers only the metadata keys only metadata keys ") (LINK () (ZETTEL "00001006020000#folge") (LITERAL-INPUT () "folge")) (TEXT " and ") (LINK () (ZETTEL "00001006020000#precursor") (LITERAL-INPUT () "precursor")) (TEXT ".")) (PARA (TEXT "Similarly, the ") (LITERAL-INPUT () "SEQUEL") (TEXT " directive allows you to list all ") (FORMAT-QUOTE () (TEXT "branching ideas")) (SOFT) (TEXT "You can limit the search to only sequel or only prequel zettel, and you can also restrict the result size.") (SOFT) (TEXT "The ") (LITERAL-INPUT () "SEQUEL") (TEXT " directive works exclusively with the metadata keys ") (LINK () (ZETTEL "00001006020000#sequel") (LITERAL-INPUT () "sequel")) (TEXT " and ") (LINK () (ZETTEL "00001006020000#prequel") (LITERAL-INPUT () "prequel")) (TEXT ".")) (PARA (TEXT "The ") (LITERAL-INPUT () "THREAD") (TEXT " directive combines the functionality of the other two directives.") (SOFT) (TEXT "It lists all zettel (or a subset) that can be reached via the four metadata keys mentioned.")) (PARA (TEXT "Optionally yyou may specify additional parameters after the directive keyword, separated by space characters.") (SOFT) (TEXT "These include:")) (UNORDERED () (BLOCK (PARA (LITERAL-INPUT () "BACKWARD") (TEXT ": Search for zettel only via backward links, i.e. ") (LITERAL-INPUT () "precursor") (TEXT " and/or ") (LITERAL-INPUT () "prequel"))) (BLOCK (PARA (LITERAL-INPUT () "FORWARD") (TEXT ": Search for zettel only via forward links, i.e. ") (LITERAL-INPUT () "folge") (TEXT " and/or ") (LITERAL-INPUT () "sequel"))) (BLOCK (PARA (LITERAL-INPUT () "DIRECTED") (TEXT ": Search for zettel only in the same direction as the one that led to the current zettel.") (SOFT) (TEXT "If the zettel is one of the initial zettel, search in both directions.")) (PARA (LITERAL-INPUT () "DIRECTED") (TEXT " is equivalent to ") (LITERAL-INPUT () "FORWARD") (TEXT " if the current zettel is a starting point of a ") (LITERAL-INPUT () "folge") (TEXT " and/or ") (LITERAL-INPUT () "sequel") (TEXT " sequence.") (SOFT) (TEXT "It is equivalent to ") (LITERAL-INPUT () "BACKWARD") (TEXT " at the end of such a sequence (or at the beginning of a ") (LITERAL-INPUT () "precursor") (TEXT " and/or ") (LITERAL-INPUT () "prequel") (TEXT " sequence)."))) (BLOCK (PARA (LITERAL-INPUT () "MAX") (TEXT ": Followed by one or more space characters and a positive integer, sets the maximum number of resulting Zettel (default: 0 = unlimited)")))) (PARA (TEXT "If neither BACKWARD nor FORWARD is specified, the search includes both backward and forward links.")) (PARA (TEXT "If both ") (LITERAL-INPUT () "BACKWARD") (TEXT " and ") (LITERAL-INPUT () "FORWARD") (TEXT " are specified, the search for context zettel will be performed as ") (LITERAL-INPUT () "DIRECTED") (TEXT ".") (SOFT) (TEXT "Internally, ") (LITERAL-INPUT () "DIRECTED") (TEXT " is just a shorthand for specifying both ") (LITERAL-INPUT () "BACKWARD") (TEXT " and ") (LITERAL-INPUT () "FORWARD") (TEXT ".")) (PARA (TEXT "If any of the three direction specifiers ") (LITERAL-INPUT () "BACKWARD") (TEXT ", ") (LITERAL-INPUT () "FORWARD") (TEXT ", and ") (LITERAL-INPUT () "DIRECTED") (TEXT " is specified more than once, parsing of the thread directive is stopped.") (SOFT) (TEXT "All following text is then interpreted either as other directives or as a search term.")) (PARA (TEXT "The resulting list is sorted by the relative distance to the originating zettel.")) (PARA (TEXT "These directives may be specified only once as a query directive.") (SOFT) (TEXT "A second occurence of ") (LITERAL-INPUT () "FOLGE") (TEXT ", ") (LITERAL-INPUT () "SEQUEL") (TEXT " or ") (LITERAL-INPUT () "THREAD") (TEXT " is interpreted as a ") (LINK () (ZETTEL "00001007701000") (TEXT "search expression")) (TEXT "."))))