PR #4675 rewrites Leo's abbreviation code

16 views
Skip to first unread message

Edward K. Ream

unread,
May 19, 2026, 6:00:15 AM (2 days ago) May 19
to leo-editor
Leo's "devel" branch now contains PR #4675. The highlight:

- Leo's regular find command replaces the wonky `,,` convention. Félix points out that newbies (and others) could easily wonder why Leo doesn't allow them to type two consecutive commas!

- New unit tests cover the operation of abbreviations. These should have been added a decade ago.

Félix contributed greatly to the work via his comments, testing, and code. It's been another great collaboration between us.

Edward

P.S. This PR supersedes at least three other PRs—it is a complete rewrite of Leo's abbreviation code in leo/commands/abbrevCommands.py. The old code was impossible to maintain. The new code is clear and direct. Getting to this apparent simplicity took lots of work. The first commit happened on May 9. There are 124 commits in the PR.

EKR

Edward K. Ream

unread,
May 19, 2026, 10:38:13 AM (2 days ago) May 19
to leo-e...@googlegroups.com
On Tue, May 19, 2026 at 5:00 AM Edward K. Ream <edre...@gmail.com> wrote:
Leo's "devel" branch now contains PR #4675. The highlight:

- Leo's regular find command replaces the wonky `,,` convention. Félix points out that newbies (and others) could easily wonder why Leo doesn't allow them to type two consecutive commas!

I've just created #4688 for an issue I thought might not be necessary. But I had forgotten about one of my private non-tree abbreviations, defined as follows:

new-bug;;=@language rest
\:@wrap
\:@nosearch
\:
\:https://github.com/leo-editor/leo-editor/issues/<|number|>
\:PR: https://github.com/leo-editor/leo-editor/pull/xxx
\:
\:@language python
\:

I use this all the time. Alas, this definition contains a search template,  <|number|> , so Leo will search for it and change Leo's find settings. Oops. Now I have to restore the search settings to my preferred defaults! Happily, the fix will be straightforward.

Edward
Reply all
Reply to author
Forward
0 new messages