noctuid / general.el

More convenient key definitions in emacs
GNU General Public License v3.0
986 stars 43 forks source link

Allow 'general--print-map' to print keymaps as commands #545

Closed SqrtMinusOne closed 1 year ago

SqrtMinusOne commented 1 year ago

The current implementation of general--print-map sometimes prints broken Org Tables for me:

| key         | command                    | previous |
|-------------+----------------------------+----------|
| =SPC ?=     | ~which-key-show-top-level~ | ~nil~    |
| =SPC E=     | ~eval-expression~          | ~nil~    |
| =SPC SPC=   | ~nil~                      | ~nil~    |
| =SPC SPC x= | ~(keymap #^[nil nil keymap |          |
#^^[3 0 pop-global-mark ~|~2~|
|=SPC a=|~nil~|~nil~|
|=M-u=|~universal-argument~|~nil~|
|=SPC P=|~nil~|~nil~|
|=SPC P s=|~profiler-start~|~2~|
|=SPC P e=|~profiler-stop~|~2~|

Because the command in the 4th row has a linebreak.

This change removes unnecessary linebreaks from the result of the format expression, so that the case above works correctly.

| key           | command                                              | previous                                             |
|---------------+------------------------------------------------------+------------------------------------------------------|
| =SPC ?=       | ~which-key-show-top-level~                           | ~nil~                                                |
| =SPC E=       | ~eval-expression~                                    | ~nil~                                                |
| =SPC SPC=     | ~nil~                                                | ~nil~                                                |
| =SPC SPC x=   | ~(keymap #^[nil nil keymap #^^[3 0 pop-global-mark ~ | ~2~                                                  |
| =SPC a=       | ~nil~                                                | ~nil~                                                |
| =M-u=         | ~universal-argument~                                 | ~nil~                                                |
| =SPC P=       | ~nil~                                                | ~nil~                                                |
| =SPC P s=     | ~profiler-start~                                     | ~2~                                                  |
| =SPC P e=     | ~profiler-stop~                                      | ~2~                                                  |
codecov-commenter commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: -0.21 :warning:

Comparison is base (2862575) 69.40% compared to head (b1a24ff) 69.19%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #545 +/- ## ========================================== - Coverage 69.40% 69.19% -0.21% ========================================== Files 1 1 Lines 1000 1003 +3 ========================================== Hits 694 694 - Misses 306 309 +3 ``` | [Impacted Files](https://codecov.io/gh/noctuid/general.el/pull/545?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fox+Kiester) | Coverage Δ | | |---|---|---| | [general.el](https://codecov.io/gh/noctuid/general.el/pull/545?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fox+Kiester#diff-Z2VuZXJhbC5lbA==) | `69.19% <0.00%> (-0.21%)` | :arrow_down: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fox+Kiester). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fox+Kiester)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

SqrtMinusOne commented 1 year ago

Hmm, it seems like this part of the package doesn't have tests...

noctuid commented 1 year ago

Thanks. That's fine. I don't plan to add tests or new functionality for this code (only bugfixes) since there is annalist.