emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Abbrev suggestions - feedback appreciated


From: Stefan Monnier
Subject: Re: Abbrev suggestions - feedback appreciated
Date: Sat, 16 May 2020 23:13:00 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> I gave the mapc approach a naïve try, but I am not sure if it is better:
>
> (defun abbrev-get-active-expansions ()
>   "Return a list of all the active abbrev expansions.
> Includes expansions from parent abbrev tables."

I'm not suggesting to implement
`abbrev-get-active-expansions` differently.
I'm suggesting to implement something else.  I.e.

    (defmacro abbrev-do-active-expansions (VAR &rest BODY)
      "Bind VAR to an active expansion and run BODY with it.
    Repeat it for all active expansions."
      ...)

or

    (defun abbrev-mapc-active-expansions (FUNC)
      "Call FUNC on each active expansion."

This way you don't need to build a list of active expansions: you run
FUNC or BODY on each expansion when you encounter it.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]