DarwinAwardWinner / with-simulated-input

Test your interactive elisp functions non-interactively!
GNU General Public License v3.0
38 stars 4 forks source link

Discussion about possible syntax changes #15

Open DarwinAwardWinner opened 3 years ago

DarwinAwardWinner commented 3 years ago

As of v3.0, with-simulated-input will support the following values for KEYS:

Note that when KEYS is a list, any constant/pure/side-effect-free expressions in KEYS have no effect at all, since their return values are discarded. Hence, while it is syntactically legal to put a pure expression in KEYS like this, it is a likely indicator that the programmer has misunderstood the macro and is expecting the return value to be used as a key sequence. A warning is therefore generated whenever the code is able to detect such expressions.

In addition, the following are deprecated, but still supported for backward compatibility:

This last case, the list that is interpreted as a function call, is required for backward compatibility, but is dangerous and potentially inconsistent since it only triggers if the first element satisfies functionp or macrop at the time the macro is expanded. Technically, there is also the potential that when KEYS is a list, it could be interpreted either as a function call or a list of key sequences. However, this can only happen when the first element is a constant expression, so it doesn't conflict with any legitimate use of a key list. Still, this is a precarious balance.

In a future version, support for these deprecated forms will be dropped entirely, opening the potential for new syntax to be added that would otherwise conflict with them. The purpose of this issue is to suggest and discuss possible useful extensions to the syntax of KEYS. Any such extensions must not conflict with the first list above, but may conflict with the list of deprecated forms, since they will be removed. Some suggestions are already in #12.

DarwinAwardWinner commented 3 years ago

@nbfalcon Now that 3.0 is released, please let me know if there's any functionality that you think should be added.