[PATCH v4 10/10] doc: document autocorrect API
- From
- Jiamu Sun <39@barroit.sh>
- Date
- Mar 16, 2026, 15:36 UTC
- Message-ID
- <SY0P300MB0801D52DC6F8E7F37E3A85A7CE40A@SY0P300MB0801.AUSP300.PROD.OUTLOOK.COM>
- In-Reply-To
- <SY0P300MB080186A23FB9582AD793F0D1CE40A@SY0P300MB0801.AUSP300.PROD.OUTLOOK.COM>
Explain behaviors for autocorrect_resolve(), autocorrect_confirm(), and struct autocorrect.
Signed-off-by: Jiamu Sun <39@barroit.sh> --- autocorrect.h | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/autocorrect.h b/autocorrect.h index 0d3e819262ed..bfa3ba20a4fb 100644 --- a/autocorrect.h +++ b/autocorrect.h @@ -9,13 +9,24 @@ enum autocorrect_mode { AUTOCORRECT_DELAY, }; +/** + * `mode` indicates which action will be performed by autocorrect_confirm(). + * `delay` is the timeout before autocorrect_confirm() returns, in tenths of a + * second. Use it only with AUTOCORRECT_DELAY. + */ struct autocorrect { enum autocorrect_mode mode; int delay; }; +/** + * Resolve the autocorrect configuration into `conf`. + */ void autocorrect_resolve(struct autocorrect *conf); +/** + * Interact with the user in different ways depending on `conf->mode`. + */ void autocorrect_confirm(struct autocorrect *conf, const char *assumed); #endif /* AUTOCORRECT_H */
-- 2.53.0