[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: non word abbrevs
From: |
Jean-Christophe Helary |
Subject: |
Re: non word abbrevs |
Date: |
Sun, 7 Nov 2021 12:24:27 +0900 |
> On Nov 7, 2021, at 12:15, Stefan Monnier via Users list for the GNU Emacs
> text editor <help-gnu-emacs@gnu.org> wrote:
> Not completely: the original motivation for adding that `:regexp`
> keyword was to handle abbrevs of the form "`foo" as well as others of
> the form "foo/bar" ;-)
And the overall feature seems severely under-documented... Honestly, I barely
understood your explanations...
Maybe expecting to have abbrevs work way was a mistake, but it does not seem
possible to have (easy...) arbitrary string expansion in out-of-the-box-emacs
without abbrevs.
Would there be another more idiomatic way ?
I know about assigning key shortcuts to arbitrary string insertion, but that
needlessly fills the keymaps with shortcuts that could be put to better use
*and* the combination would be longer to enter than a normal abbrev...
>
>>> You might want to `M-x report-emacs-bug` and request that this
>>> constraint be made more flexible.
>> I will. Thank you again.
>
> In the mean time, you might be able to implement
> a `post-self-insert-hook` which runs expands your abbrevs.
Christmas in November ? :-)
> You could start with something like:
>
> (add-hook 'post-self-insert-hook #'my-expand-arrow-abbrevs)
> (defun my-expand-arrow-abbrevs ()
> (if (memq (char-before) '(?= ?< ?-))
> (expand-abbrev)))
I'll try that and will report. Thank you !
--
Jean-Christophe Helary @brandelune
https://mac4translators.blogspot.com
https://sr.ht/~brandelune/omegat-as-a-book/
- Re: non word abbrevs, (continued)
- Re: non word abbrevs, Jean-Christophe Helary, 2021/11/01
- Re: non word abbrevs, Stefan Monnier, 2021/11/01
- Re: non word abbrevs, Jean-Christophe Helary, 2021/11/01
- Re: non word abbrevs, Leo Butler, 2021/11/01
- Re: non word abbrevs, tomas, 2021/11/01
- Re: non word abbrevs, Stefan Monnier, 2021/11/01
- Re: non word abbrevs, Jean-Christophe Helary, 2021/11/06
- Re: non word abbrevs, Stefan Monnier, 2021/11/06
- Re: non word abbrevs, Jean-Christophe Helary, 2021/11/06
- Re: non word abbrevs, Stefan Monnier, 2021/11/06
- Re: non word abbrevs,
Jean-Christophe Helary <=
- Re: non word abbrevs, Emanuel Berg, 2021/11/07
- Re: non word abbrevs, Kevin Vigouroux, 2021/11/08
- Re: non word abbrevs, Jean-Christophe Helary, 2021/11/08
- Re: non word abbrevs, Stefan Monnier, 2021/11/08
- Re: non word abbrevs, Emanuel Berg, 2021/11/07