Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate built-in aliases from preferred names. #105

Merged
merged 1 commit into from
Oct 27, 2021
Merged

Separate built-in aliases from preferred names. #105

merged 1 commit into from
Oct 27, 2021

Conversation

okamsn
Copy link
Owner

@okamsn okamsn commented Oct 21, 2021

Fixes #100.

  • Rename loopy-command-aliases to loopy-aliases.
    • TBD: Separate commands aliases from those for special macro arguments?
  • Move built-in command aliases to loopy-aliases.
  • Try to simplify how aliases for special macro arguments are handled.
    • TODO: Do we need special handling for let* for with in loopy-iter.
  • Go through code, removing special handling of aliases.
    • Variables:
      • loopy--valid-macro-arguments?
      • loopy--accumulation-constructors
    • Functions:
      • loopy-iter--sub-loop-command-p
      • anywhere using loopy--find-all-names
      • in the loopy and loopy-iter macro definitions

@okamsn okamsn force-pushed the sep-vars branch 3 times, most recently from 5cd39be to 2f2e54f Compare October 26, 2021 23:59
- Rename `loopy-command-aliases` to `loopy-aliases`.
- Make names `loopy-command-aliases`, `loopy-custom-command-aliases`, and
 `loopy-custom-command-parsers` obsolete.
- Move built-in aliases to user option `loopy-aliases`.
- Change structure of `loopy-aliases` from pairs of a alias and a true name to
  pairs of a true name and a list of aliases.
  - Update customization type of `loopy-aliases`.
- Better abstract working with aliases by creating functions
  `loopy--get-true-name`, `loopy--get-aliases`, and `loopy--get-all-names`.
  - Use these functions to replace things like `loopy--find-all-names` and
    manually working with aliases.
  - `loopy--find-all-names` can optionally use only the true name (much faster,
    and what we normally do) and ignore certain names.
- Remove aliases from `loopy---accumulation-constructors`.
  - Add support for aliases to `loopy--get-optimized-accum`.
- Create `loopy--def-special-processor` to create functions for handling aliases
  of special macro arguments.  This approach replaces
  `loopy--process-special-marco-args`, which did not work well with all aliases.
  Create the functions:
  - `loopy--process-special-arg-with`
  - `loopy--process-special-arg-before-do`
  - `loopy--process-special-arg-flag`
  - `loopy--process-special-arg-loop-name`
  - `loopy--process-special-arg-after-do`
  - `loopy--process-special-arg-wrap`
  - `loopy--process-special-arg-accum-opt`
  - `loopy--process-special-arg-without`
  - `loopy--process-special-arg-finally-do`
  - `loopy--process-special-arg-finally-return`
  - `loopy--process-special-arg-finally-protect`
- Create function `loopy--clean-up-stack-vars`.  This is just a convenience
  function.
- Update `loopy--get-command-parser` to check all aliases.
- Simplify definition of `loopy-defalias`.
  - Aliases should now *only* be defined with `loopy-defalias`.  This makes
    forward compatibility a lot easier, and simplifies search for all names
    if we just flatten the recursion ahead of time (during definition).
  - Update tests to use `loopy-defalias` instead of manipulating `loopy-aliases`.
- Move `loopy-defalias` from commands to vars.
- Update some comments.
- Convert `loopy-iter` to new structures.
- Add `loopy-iter-ignored-commands`, whose value is used when ignoring names in
  `loopy--get-all-names`.  This variable is always used with special macro
  arguments and optionally used with commands when the `lax-naming` flag
  is active.
- Try downloading map.el in tests.  This did not work as expected.
- Defensive return `nil` to work around older versions of `map-do`.
  `map-do` fails to return nil in older versions, like in `map.el` 2.0 (shipped
  with Emacs 27).  Ideally, we would instead download an updated version
  when installing Loopy during tests.
- Update CHANGELOG.md.
- Update the README with info on breaking changes.
- Note the changes in aliases in the Org doc.
- Add Org documentation on `loopy-iter-ignored-names`.
- Update Texinfo doc.
- Remove `loopy--valid-macro-arguments`.  No longer needed.
- Add unused variable  `loopy--special-maro-argument-processors`.
@okamsn okamsn merged commit 53b1a89 into master Oct 27, 2021
@okamsn okamsn deleted the sep-vars branch March 30, 2022 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More cleanly separate aliases and commands
1 participant