├── .dir-locals.el ├── .github ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── ci.yml ├── .gitignore ├── CHANGELOG.md ├── Dockerfile ├── LICENSE.md ├── Makefile ├── README.md ├── images ├── buffers.png ├── commands.png ├── files.png ├── libraries.png └── tramp.png ├── scripts ├── check-line-length.bash ├── docker-install.bash ├── docker.bash └── selectrum-indent.el ├── selectrum.el └── test ├── embark-completion-orderless.el ├── icomplete-orderless.el ├── install.el ├── run.sh ├── selectrum-orderless.el ├── selectrum-prescient-orderless.el ├── selectrum-prescient.el └── vertico-orderless.el /.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((nil . ((compile-command . "make lint") 2 | (bug-reference-bug-regexp . "#\\(?2:[0-9]+\\)") 3 | (bug-reference-url-format . "https://github.com/radian-software/selectrum/issues/%s") 4 | (fill-column . 70)))) 5 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: [push, pull_request] 3 | jobs: 4 | ci: 5 | runs-on: ubuntu-latest 6 | strategy: 7 | matrix: 8 | emacs_version: [26, 27, 28] 9 | steps: 10 | - name: Checkout 11 | uses: actions/checkout@v2 12 | - name: CI 13 | env: 14 | VERSION: ${{ matrix.emacs_version }} 15 | run: >- 16 | make docker CMD="make lint" 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.elc 2 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | The format is based on [Keep a Changelog]. 5 | 6 | ## Unreleased 7 | ### Deprecated 8 | * The function `selectrum-get-current-input` is deprecated ([#537]). 9 | 10 | ### Breaking changes 11 | * Support for Emacs versions older than 26.1 has been removed ([#454], 12 | [#465]). 13 | * The experimental `selectrum-helm.el` package has been removed 14 | ([#313], [#466]). 15 | * The faces `selectrum-primary-highlight` and 16 | `selectrum-secondary-highlight` have been removed. The match 17 | highlighting should be configured via the used 18 | filtering/highlighting packages. Users of `selectrum-prescient` can 19 | update to configure `selectrum-prescient-primary-highlight` and 20 | `selectrum-prescient-secondary-highlight` ([#455]). 21 | * The following deprecated functions have been removed ([#521): 22 | * selectrum-read 23 | * selectrum-default-candidate-refine-function 24 | * selectrum-default-candidate-highlight-function 25 | * The following deprecated variables have been removed ([#521): 26 | * selectrum-active-p 27 | * selectrum-should-sort-p 28 | * selectrum-fix-minibuffer-height 29 | * Running commands in buffers displayed via `selectrum-display-action` 30 | now automatically reselects the minibuffer ([#585], [#586]). 31 | 32 | ### Features 33 | * Add `selectrum-display-action-hook` which can be used to initialize 34 | the candidates buffer when using `selectrum-display-action` ([#518], 35 | [#519]). 36 | * Using the `selectrum-files-select-input-dirs` option you can adjust 37 | the selection behavior for file completions. When the option is 38 | non-nil the input gets selected whenever it contains a full 39 | directory name ([#259], [#300], [#509], [#516]). 40 | * You can quickly select and insert a candidate using the commands 41 | `selectrum-quick-select` and `selectrum-quick-insert` which are 42 | bound to `M-i` and `M-m` (analogue to `C-i` and `C-m` used for 43 | normal insertion and selection). These commands are similar in 44 | functionality to `ivy-avy`. You can configure the used keys via 45 | `selectrum-quick-keys` option and their appearance via 46 | `selectrum-quick-keys-highlight` and `selectrum-quick-keys-match` 47 | face ([#16], [#304], [#479]). 48 | * Add support for `x-group-function` completion metadata. The group 49 | title formatting is controlled by the customization variable 50 | `selectrum-group-format` and the faces `selectrum-group-separator` 51 | and `selectrum-group-title` ([#458], [#463]). 52 | * `selectrum-default-candidates-preprocess-function` sorts according 53 | to the history now, such that recently used candidates appear first 54 | ([#500]). 55 | * The face that is used when the mouse hovers over candidates can now 56 | be customized through `selectrum-mouse-highlight` ([#507]). 57 | * Add commands `selectrum-next-group` and `selectrum-previous-group` 58 | ([#554] , [#588]). 59 | * Add cycling to navigation commands ([#570], [#588]) with user option 60 | `selectrum-cycle-movement`. 61 | 62 | ### Enhancements 63 | * When using `selectrum-insert-current-candidate` in a 64 | `completing-read-multiple` session, the input will get selected 65 | after candidate insertion ([#494]). 66 | * File name completions using `selectrum-completion-in-region` have 67 | been improved. When starting with an empty input the completion 68 | starts at `default-directory` and file names are quoted in modes 69 | deriving from `comint-mode` ([#459], [#462]). 70 | * `selectrum-completion-in-region` does support cycling (as configured 71 | per `completion-cycle-threshold`) now ([#419], [#456]). 72 | * `selectrum-completion-in-region` includes the prefix in the input 73 | line in the minibuffer for non-file completions. This is already 74 | done for file completions. See [#576], [#583]. 75 | 76 | ### Changed defaults 77 | * `selectrum-completion-in-region-styles` now defaults to `nil`. In 78 | this case the initial filtering is done by `all-completions`, if 79 | that doesn't reveal any matches the completion is retried using your 80 | regularly configured `completion-styles`, honoring adjustments 81 | according to `completion-category-overrides` and 82 | `completion-category-defaults` ([#524]). 83 | 84 | ### Bugs fixed 85 | * When passing a cons as INITIAL-INPUT argument to `completing-read` 86 | the point was off by one, which has been fixed ([#528], [#530]). 87 | * When a match is required one couldn't exit prompts which used a 88 | dynamic completion table even if the input was a valid candidate, 89 | which has been fixed ([#176], #523). 90 | * Selectrum does now handle the different values of the 91 | `require-match` argument which gets passed to the various completion 92 | functions. The values `confirm` and `confirm-after-completion` now 93 | have an additional confirmation step as in the default UI ([#429], 94 | [#510]). 95 | * When completion functions would pass a list as default value, 96 | `minibuffer-default` would be set to the first candidate of the 97 | list. This has been fixed by also setting it to a list for these 98 | cases to match the expected default behavior. Commands like 99 | `next-history-element` which use 100 | `minibuffer-default-add-completions` by default now act like with 101 | default completion ([#314], [#506]). 102 | * When using `backward-kill-sexp` for the last part of inputs in file 103 | prompts, you would get an error message and the trailing space of 104 | the prompt would get included for the killed text. This got fixed by 105 | introducing the `selectrum-backward-kill-sexp` command ([#498], 106 | [#499]). 107 | * When using `marginalia-mode` there would be an arrow in the fringe 108 | for the currently selected candidate which has been fixed ([#450], 109 | [#488]). 110 | * When doing `completing-read-multiple`, selecting an additional 111 | candidate and exiting by pressing `RET` no longer fails when there 112 | are existing candidates already selected using `TAB` ([#460]). 113 | * When all candidates were selected in a completing-read-multiple 114 | session the return value wasn't correct, which has been fixed 115 | ([#495]). 116 | * Fix `selectrum--move-to-front-destructive`. This function 117 | previously deleted multiple instances of the moved candidate. It 118 | now correctly moves all instances to the front, maintaining their 119 | relative order. This was first mentioned in [#580]. See [#581]. 120 | * Using `selectrum-submit-exact-input` when completing library names 121 | with `selectrum-read-library-name` will cause the first matching 122 | library name in the list of unfiltered candidates to be 123 | selected. ([#577], [#580]) 124 | * Selectrum no longer remaps `C-g` when the function 125 | `abort-minibuffers` is available. Previously, this was done to 126 | better support recursive minibuffers, but default Emacs now handles 127 | this better. See [#569]. 128 | * Candidates selected via the mouse are now selected correctly in 129 | buffers created by `selectrum-display-action`. The active 130 | minibuffer window is now automatically re-selected when clicking on 131 | the buffer. ([#585], [#586]) 132 | * Ensure that the buffer displayed with `selectrum-display-action` 133 | always exists, even if we don't try to show it immediately. See 134 | [#571], [#587]. 135 | 136 | [#16]: https://github.com/radian-software/selectrum/issues/16 137 | [#176]: https://github.com/radian-software/selectrum/issues/176 138 | [#259]: https://github.com/radian-software/selectrum/issues/259 139 | [#300]: https://github.com/radian-software/selectrum/pull/300 140 | [#304]: https://github.com/radian-software/selectrum/issues/304 141 | [#313]: https://github.com/radian-software/selectrum/issues/313 142 | [#314]: https://github.com/radian-software/selectrum/issues/314 143 | [#419]: https://github.com/radian-software/selectrum/issues/419 144 | [#429]: https://github.com/radian-software/selectrum/issues/429 145 | [#450]: https://github.com/radian-software/selectrum/issues/450 146 | [#454]: https://github.com/radian-software/selectrum/issues/454 147 | [#455]: https://github.com/radian-software/selectrum/pull/455 148 | [#456]: https://github.com/radian-software/selectrum/pull/456 149 | [#458]: https://github.com/radian-software/selectrum/pull/458 150 | [#459]: https://github.com/radian-software/selectrum/issues/459 151 | [#460]: https://github.com/radian-software/selectrum/pull/460 152 | [#462]: https://github.com/radian-software/selectrum/pull/462 153 | [#463]: https://github.com/radian-software/selectrum/pull/463 154 | [#465]: https://github.com/radian-software/selectrum/pull/465 155 | [#466]: https://github.com/radian-software/selectrum/pull/466 156 | [#479]: https://github.com/radian-software/selectrum/pull/479 157 | [#488]: https://github.com/radian-software/selectrum/pull/488 158 | [#494]: https://github.com/radian-software/selectrum/pull/494 159 | [#495]: https://github.com/radian-software/selectrum/pull/495 160 | [#498]: https://github.com/radian-software/selectrum/issues/498 161 | [#499]: https://github.com/radian-software/selectrum/pull/499 162 | [#500]: https://github.com/radian-software/selectrum/pull/500 163 | [#506]: https://github.com/radian-software/selectrum/pull/506 164 | [#507]: https://github.com/radian-software/selectrum/pull/507 165 | [#509]: https://github.com/radian-software/selectrum/issues/509 166 | [#510]: https://github.com/radian-software/selectrum/pull/510 167 | [#516]: https://github.com/radian-software/selectrum/pull/516 168 | [#518]: https://github.com/radian-software/selectrum/pull/518 169 | [#519]: https://github.com/radian-software/selectrum/pull/519 170 | [#521]: https://github.com/radian-software/selectrum/pull/521 171 | [#523]: https://github.com/radian-software/selectrum/pull/523 172 | [#524]: https://github.com/radian-software/selectrum/pull/524 173 | [#528]: https://github.com/radian-software/selectrum/issues/528 174 | [#530]: https://github.com/radian-software/selectrum/pull/530 175 | [#537]: https://github.com/radian-software/selectrum/pull/537 176 | [#554]: https://github.com/radian-software/selectrum/issues/554 177 | [#569]: https://github.com/radian-software/selectrum/pull/569 178 | [#570]: https://github.com/radian-software/selectrum/issues/570 179 | [#571]: https://github.com/radian-software/selectrum/issues/571 180 | [#576]: https://github.com/radian-software/selectrum/issues/576 181 | [#577]: https://github.com/radian-software/selectrum/issues/577 182 | [#580]: https://github.com/radian-software/selectrum/pull/580 183 | [#581]: https://github.com/radian-software/selectrum/pull/581 184 | [#583]: https://github.com/radian-software/selectrum/pull/583 185 | [#585]: https://github.com/radian-software/selectrum/issues/585 186 | [#586]: https://github.com/radian-software/selectrum/pull/586 187 | [#587]: https://github.com/radian-software/selectrum/pull/587 188 | [#588]: https://github.com/radian-software/selectrum/pull/588 189 | 190 | ## 3.1 (released 2021-02-21) 191 | ### Deprecated 192 | * The `selectrum-read` API has been deprecated and made private. The 193 | intention of this change is to encourage users instead to rely on 194 | the plain `completing-read` function, which is completion system 195 | agnostic ([#446]). 196 | * The user option `selectrum-fix-minibuffer-height` has been 197 | deprecated. The new variable `selectrum-fix-vertical-window-height` 198 | takes its place ([#305]). 199 | * The special text property `selectrum-candidate-full` to change the 200 | canonical representation of a candidate has been deprecated 201 | ([#403]). 202 | * The hooks `selectrum-candidate-inserted-hook` and 203 | `selectrum-candidate-selected-hook` originally also received the 204 | arguments passed to `selectrum-read` which has been deprecated. 205 | These hooks are expected to be updated to only receive a single 206 | argument now, the inserted/selected candidate ([#446]). 207 | * `selectrum-default-candidate-refine-function` and 208 | `selectrum-default-candidate-highlight-function` have been 209 | deprecated, see the new default values for 210 | `selectrum-refine-candidates-function` and 211 | `selectrum-highlight-candidates-function` which should be used 212 | instead ([#330]). 213 | 214 | ### Changed defaults 215 | * The default value of `selectrum-num-candidates-displayed` has 216 | changed to `auto`. If you have customized 217 | `selectrum-num-candidates-displayed` you should remove that from 218 | your configuration or also adjust it to `auto`. For configuring the 219 | window height you should use the new `selectrum-max-window-height` 220 | option now ([#305]). 221 | * The new default functions used for 222 | `selectrum-refine-candidates-function` and 223 | `selectrum-highlight-candidates-function` have been updated to 224 | filter and highlight candidates according to `completion-styles` now 225 | ([#330]). 226 | 227 | ### Features 228 | * Line spacing is taken into account when using a fixed window height 229 | ([#424], [#432]). 230 | * The new option `selectrum-max-window-height` can now be used to 231 | configure the maximal display window height analogue to the built-in 232 | `max-mini-window-height`. The new option replaces the usage of the 233 | formerly used `selectrum-num-candidates-displayed` setting which is 234 | now set to `auto` by default. By using `auto` the number of 235 | candidates is automatically determined using the available space and 236 | current display settings. When setting the value to a number this 237 | will determine the actual amount of displayed candidates without 238 | having an effect on the window height ([#305]). 239 | * The option `selectrum-display-style` can be used to configure the 240 | display style for candidates. Vertical and horizontal display styles 241 | are included and you can cycle through styles using the new 242 | `selectrum-cycle-display-style` command which uses the 243 | `selectrum-display-style-cycle-list` option for cycling ([#305]). 244 | * `selectrum-exhibit` got an optional argument which allows to keep 245 | the current candidate selected after the update which is helpful for 246 | async completions ([#306], [#307], [#349]). 247 | * The user option `selectrum-display-action` can be used to show 248 | candidates in another window or frame ([#230], [#309]). 249 | * The user option `selectrum-show-indices` can now be a function that 250 | can be used to control the display of the a candidate's index ([#200]). 251 | * The user option `selectrum-extend-current-candidate-highlight` 252 | determines whether to extend the highlighting of the current 253 | candidate until the margin (the default is nil). See [#208]. 254 | * The user option `selectrum-complete-in-buffer` can be used to 255 | control whether Selectrum should handle in buffer completion (the 256 | default is t) ([#261]). 257 | * The user option `selectrum-default-value-format` can be used 258 | to specify the formatting of the default value indicator ([#445]). 259 | 260 | ### Enhancements 261 | * When hovering over candidates with the mouse there are no messages 262 | shown anymore which avoids interference with candidates display 263 | ([#452]). 264 | * The variable `selectrum-should-sort-p` and `selectrum-active-p` have 265 | been marked deprecated. You should use the new 266 | `selectrum-should-sort` and `selectrum-is-active`. 267 | `selectrum-should-sort` is also exposed as a user option now 268 | ([#441]). 269 | * The variable `selectrum-move-default-candidate` can be used to 270 | configure how the UI handles the default value ([#441]). 271 | * The command `selectrum-repeat` can also repeat the last recursive 272 | session now ([#322], [#440]). 273 | * The default value of `selectrum-extend-current-candidate-highlight` 274 | has been changed to `auto` which will automatically extend the 275 | highlighting if the session uses annotations ([#427], [#430]). 276 | * The accessibility of the default value in file completions has been 277 | improved. When the default exists in the prompting directory it gets 278 | sorted first otherwise the default is included as a virtual 279 | candidate ([#400], [#420], [#421]). 280 | * Depending on the used font and display settings like `line-spacing` 281 | the minibuffer height could be slightly off so that the displayed 282 | candidates wouldn't be completely visible, which has been fixed 283 | ([#303], [#414]). 284 | * The sorting of passed defaults for file completions has been 285 | improved such that paths like `/home/user/default`, `~/default` or a 286 | relative passed default get sorted first when they exist within the 287 | prompting directory ([#402], [#404]). 288 | * Tramp completions have been improved. You now get completion for 289 | tramp methods and hosts. If a connection hasn't been established yet 290 | and you are manually typing the path, a message is shown that you 291 | can refresh using `selectrum-insert-current-candidate` which helps 292 | correcting typos before trying to establish a new connection. Lastly 293 | if tramp would error or you would quit from a password prompt 294 | Selectrum stopped working until you restarted the session, which has 295 | been fixed ([#392], [#394], [#405], [#408]). 296 | * Selectrum will allow recursive sessions for 297 | `selectrum-completion-in-region` and `selectrum-select-from-history` 298 | so these commands work even if `enable-recursive-minibuffers` is not 299 | set by the user ([#100], [#397]). 300 | * In file completions where the directory path of the input does not 301 | exist, the candidates are automatically gathered by interpreting the 302 | input as an partial-completion style input pattern (see 303 | `completion-styles-alist`). For example the input "/us/l/bi/" would 304 | give results for "/usr/local/bin/". With tramp paths this has to be 305 | triggered manually using `selectrum-insert-current-candidate` to 306 | avoid possible speed problems ([#390], [#393]). 307 | * You can now complete environment variables in file completions by 308 | typing a "$" after a "/" ([#386], [#389]). 309 | * The `selectrum-select-from-history` command has been improved. You 310 | can now insert a history item into the previous session using your 311 | default binding for `selectrum-insert-current-candidate`. To submit 312 | the history item and exit use `selectrum-select-current-candidate` 313 | ([#362]). 314 | * When using commands where the prompt would exceed the window width 315 | the horizontal scroll wouldn't reset afterwards when a smaller 316 | element was pulled into the prompt under certain conditions (for 317 | example when using history commands), which has been fixed ([#360]). 318 | * When the prompt is empty and the default value is shown you can now 319 | insert it using `selectrum-insert-current-candidate`. Also 320 | `selectrum-insert-current-candidate` now moves point to end of the 321 | prompt even when there were no candidate insertion to have 322 | consistent UI behaviour ([#359], [#369]). 323 | * `selectrum-insert-current-candidate` will reset 324 | `minibuffer-history-position`, so that after "choosing" an item and 325 | using other history commands in succession the history will start 326 | from the beginning ([#361], [#368]). 327 | * History commands don't automatically trigger a refresh for tramp 328 | paths. This is useful to prevent unintended opening of tramp 329 | connections. To trigger a refresh for the selected tramp path you 330 | can use `selectrum-insert-current-candidate` ([#358], [#361], 331 | [#365], [#367], [#368], [#372]). 332 | * In file completions the prompt will also be selected when a match is 333 | required and the path exists ([#357]). 334 | * Improved selection behaviour for history commands. When using 335 | `next-history-element`, `previous-history-element` or isearch for 336 | history browsing the inserted history element will get selected when 337 | a match isn't required ([#323], [#324], [#341], [#346], [#380]). 338 | * Improved exit behaviour of `selectrum-select-current-candidate`. The 339 | commands gives feedback now when match is required and submission 340 | not possible. Also it allows submission of the prompt when a match 341 | is required and the prompt is a member of candidates ([#338]). 342 | * You can now configure the initial filtering for candidates in 343 | `selectrum-completion-in-region` using 344 | `selectrum-completion-in-region-styles` ([#331], [#356]). 345 | * Computation of candidates is faster for `describe-variable` ([#312], 346 | [#316], [#320], [#321], [#343]). 347 | * Candidates of `completing-read-multiple` which are submitted by 348 | `selectrum-select-current-candidate` are now passed to 349 | `selectrum-candidate-selected-hook` one by one in the order they 350 | were added. Before the hook would not run for the multi candidates 351 | case ([#296]). 352 | * File completions are faster because the internal handling was 353 | updated ([#334], [#335], [#339]). Most notably recomputation only 354 | happens on directory change now. Before, the candidates where 355 | recomputed on each input change which could slow down file 356 | completions significantly for cases where `read-file-name-internal` 357 | would be slow already ([#210], [#276], [#277]). 358 | * You can now give a prefix argument to selection moving commands 359 | ([#275]). 360 | * If completion table metadata or `completion-extra-properties` define 361 | an `affixation-function` (introduced in Emacs 28) Selectrum will use 362 | this information to annotate the candidates accordingly ([#240], 363 | [#271], [#286], [#288], [#289]). 364 | * The argument passed to `selectrum-select-current-candidate` and 365 | `selectrum-insert-current-candidate` is now used to choose the nth 366 | displayed candidate instead of calculating an index based on the 367 | currently selected candidate ([#194], [#215]). 368 | * `selectrum-insert-current-candidate` no longer adds inserted 369 | candidates to the history ([#212], [#213]). 370 | * Selectrum now by default shows indices relative to displayed 371 | candidates ([#200]). 372 | * Selectrum now uses the `initial-input` argument passed to 373 | `completing-read` which was ignored before ([#254]). 374 | * The prompt gets initially selected now when it equals the default 375 | value. This aligns with Selectrum's behavior of sorting the default 376 | first and will also make such prompts behave like in default Emacs 377 | completion where you can immediately submit the initial input 378 | ([#253]). 379 | * In buffer file completions act like normal completion now and insert 380 | the candidate without prompting if there is only one. You can drop 381 | into the minibuffer by triggering the completion again ([#261]). 382 | * The mark is pushed at the beginning of the candidate inserted by in 383 | buffer completion so you can easily jump there ([#261]). 384 | * When the prompt is selected``selectrum-insert-current-candidate` 385 | will now switch the selection to the first candidate. Before the 386 | prompt was reinserted in place so it did not have any useful effect 387 | ([#263]). 388 | * Default settings of `selectrum-multiline-display-settings` have been 389 | improved. There is now also a displayed line count by default which 390 | can be configured as well ([#266], [#302], [#318], [#398]). 391 | 392 | ### Bugs fixed 393 | * Candidate parts which used the `display` property wouldn't be 394 | correctly highlighted on selection, which has been fixed ([#411], 395 | [#413]). 396 | * The minibuffer prompt face would bleed into the candidates when the 397 | candidate strings used the `display` property, which has been fixed 398 | ([#235], [#413]). 399 | * Selectrum would error when providing a list as default value in file 400 | completions, which has been fixed ([#401], [#402]). 401 | * Selectrum did not set `minibuffer-default` for the current 402 | completion session, which has been fixed ([#350], [#352], [#354]). 403 | * When there were no candidates `selectrum-get-current-candidate` 404 | would throw an error, which has been fixed ([#347], [#348]). 405 | * There were UI and display problems when the prompt width exceeded 406 | the available window width. When `auto-hscroll-mode` was set to 407 | `current-line` it would introduce constant back and forth scrolling 408 | issues and other values also wouldn't allow to use such a prompt 409 | correctly ([#344], [#345], [#374], [#375], [#377], [#378], [#379], 410 | [#381]). 411 | * `selectrum-select-from-history` set variables 412 | `selectrum-should-sort-p`, `selectrum-candidate-inserted-hook`, 413 | `selectrum-candidate-selected-hook` and 414 | `enable-recursive-minibuffers` for subsequent recursive sessions, 415 | which has been fixed. It is also enhanced to trigger an error when 416 | called outside the minibuffer now [#337]. 417 | * `selectrum-completion-in-region` could trigger an error when 418 | `completion-all-completions` would be called within a session, which 419 | has been fixed ([#315], [#329]). 420 | * `selectrum-select-from-history` wasn't autoloaded which would 421 | trigger an error when used before Selectrum was loaded, this has 422 | been fixed ([#310], [#328]). 423 | * When let binding `minibuffer-message-timeout` around 424 | `minibuffer-message` within Selectrum sessions the value wouldn't be 425 | applied, which has been fixed ([#327]). 426 | * `minibuffer-default` is now treated as the default when set, before 427 | it would have no effect. When a list the car is used as default as 428 | of now ([#324]). 429 | * `selectrum-extend-current-candidate-highlight`, 430 | `selectrum-show-indices`, `selectrum-right-margin-padding` and 431 | `selectrum-multiline-display-settings` wouldn't use the local 432 | session bindings if there were any, which has been fixed ([#317]). 433 | * `selectrum-insert-current-candidate` would duplicate the prompt for 434 | `completing-read-multiple` when the prompt was selected, which has 435 | been fixed. The behavior is now like in `completing-read` ([#296]). 436 | * `selectrum-select-current-candidate` did not work correctly for 437 | `completing-read-multiple` when the prompt was submitted, which has 438 | been fixed ([#285], [#296]). 439 | * `selectrum-candidate-inserted-hook` would run after using 440 | `selectrum-insert-current-candidate` with a selected prompt, which 441 | has been fixed ([#296]). 442 | * Passing a symbol or a list of symbols to `completing-read` as 443 | default value DEF would trigger an error, which has been fixed. 444 | Selectrum now behaves like `completind-read-default` and returns the 445 | symbol (or the first in case of a list) ([#291], [#295]). 446 | * `selectrum-active-p` would wrongly report an active status for 447 | recursive minibuffer session with Selectrum turned off, which has 448 | been fixed ([#293]). 449 | * For in buffer file completions s-expression commands for path level 450 | navigation did not work which has been fixed ([#261]). 451 | * Do not insert spaces after path completion in comint buffers 452 | ([#261])]. 453 | * The return value of `selectrum-completion-in-region` has been fixed 454 | according to the documented API of `completion-in-region` ([#251]). 455 | * When strings of Selectrum display properties or completion table 456 | annotations have a face defined it gets used. Before those faces 457 | would be ignored ([#236], [#250]). 458 | * Selectrum's internal minibuffer setup hook now runs after any other 459 | functions added to `minibuffer-setup-hook`. Before, you couldn't set 460 | `selectrum-should-sort-p` locally via `minibuffer-with-setup-hook` 461 | to adjust sorting for a single `selectrum-read` session ([#242]). 462 | * `selectrum-completion-in-region` no longer unsets 463 | `selectrum-should-sort-p` for all recursive minibuffer sessions in 464 | the case the initial completion table specified its own 465 | `display-sort-function` ([#221]). 466 | * The candiate list returned from a dynamic candidate function passed 467 | to `selectrum-read` is now also prevented to be modified in case 468 | it's a list of strings. Before the list only wasn't modfied when the 469 | function returned the alist format as specified by `selectrum-read` 470 | ([#220]). 471 | * Annotations or usage or `selectrum-candidate-display-suffix` 472 | property in file completions were overwritten for directories and 473 | not displayed, which has been fixed ([#256], [#255]). 474 | * `selectrum-repeat` did not set `this-command` when calling the 475 | last command, which has been fixed ([#438], [#439]). 476 | 477 | [#100]: https://github.com/radian-software/selectrum/issues/100 478 | [#194]: https://github.com/radian-software/selectrum/issues/194 479 | [#200]: https://github.com/radian-software/selectrum/pull/200 480 | [#208]: https://github.com/radian-software/selectrum/pull/208 481 | [#210]: https://github.com/radian-software/selectrum/issues/210 482 | [#212]: https://github.com/radian-software/selectrum/issues/212 483 | [#213]: https://github.com/radian-software/selectrum/pull/213 484 | [#215]: https://github.com/radian-software/selectrum/pull/215 485 | [#220]: https://github.com/radian-software/selectrum/pull/220 486 | [#221]: https://github.com/radian-software/selectrum/pull/221 487 | [#242]: https://github.com/radian-software/selectrum/pull/242 488 | [#230]: https://github.com/radian-software/selectrum/pull/230 489 | [#235]: https://github.com/radian-software/selectrum/issues/235 490 | [#236]: https://github.com/radian-software/selectrum/issues/236 491 | [#240]: https://github.com/radian-software/selectrum/issues/240 492 | [#250]: https://github.com/radian-software/selectrum/pull/250 493 | [#251]: https://github.com/radian-software/selectrum/pull/251 494 | [#253]: https://github.com/radian-software/selectrum/pull/253 495 | [#254]: https://github.com/radian-software/selectrum/pull/254 496 | [#255]: https://github.com/radian-software/selectrum/issues/255 497 | [#256]: https://github.com/radian-software/selectrum/pull/256 498 | [#263]: https://github.com/radian-software/selectrum/pull/263 499 | [#266]: https://github.com/radian-software/selectrum/pull/266 500 | [#271]: https://github.com/radian-software/selectrum/pull/271 501 | [#275]: https://github.com/radian-software/selectrum/pull/275 502 | [#276]: https://github.com/radian-software/selectrum/issues/276 503 | [#277]: https://github.com/radian-software/selectrum/pull/277 504 | [#285]: https://github.com/radian-software/selectrum/issues/285 505 | [#286]: https://github.com/radian-software/selectrum/issues/286 506 | [#288]: https://github.com/radian-software/selectrum/pull/288 507 | [#289]: https://github.com/radian-software/selectrum/pull/289 508 | [#293]: https://github.com/radian-software/selectrum/pull/293 509 | [#291]: https://github.com/radian-software/selectrum/issues/291 510 | [#295]: https://github.com/radian-software/selectrum/pull/295 511 | [#296]: https://github.com/radian-software/selectrum/pull/296 512 | [#302]: https://github.com/radian-software/selectrum/pull/302 513 | [#303]: https://github.com/radian-software/selectrum/issues/303 514 | [#305]: https://github.com/radian-software/selectrum/pull/305 515 | [#306]: https://github.com/radian-software/selectrum/issues/306 516 | [#307]: https://github.com/radian-software/selectrum/pull/307 517 | [#309]: https://github.com/radian-software/selectrum/pull/309 518 | [#310]: https://github.com/radian-software/selectrum/issues/310 519 | [#312]: https://github.com/radian-software/selectrum/issues/312 520 | [#315]: https://github.com/radian-software/selectrum/issues/315 521 | [#316]: https://github.com/radian-software/selectrum/pull/316 522 | [#317]: https://github.com/radian-software/selectrum/pull/317 523 | [#318]: https://github.com/radian-software/selectrum/pull/318 524 | [#320]: https://github.com/radian-software/selectrum/issues/320 525 | [#321]: https://github.com/radian-software/selectrum/pull/321 526 | [#322]: https://github.com/radian-software/selectrum/issues/322 527 | [#323]: https://github.com/radian-software/selectrum/issues/323 528 | [#324]: https://github.com/radian-software/selectrum/pull/324 529 | [#327]: https://github.com/radian-software/selectrum/pull/327 530 | [#328]: https://github.com/radian-software/selectrum/pull/328 531 | [#329]: https://github.com/radian-software/selectrum/pull/329 532 | [#330]: https://github.com/radian-software/selectrum/pull/330 533 | [#331]: https://github.com/radian-software/selectrum/pull/331 534 | [#334]: https://github.com/radian-software/selectrum/issues/334 535 | [#335]: https://github.com/radian-software/selectrum/pull/335 536 | [#337]: https://github.com/radian-software/selectrum/pull/337 537 | [#338]: https://github.com/radian-software/selectrum/pull/338 538 | [#339]: https://github.com/radian-software/selectrum/pull/339 539 | [#341]: https://github.com/radian-software/selectrum/pull/341 540 | [#343]: https://github.com/radian-software/selectrum/pull/343 541 | [#344]: https://github.com/radian-software/selectrum/issues/344 542 | [#345]: https://github.com/radian-software/selectrum/pull/345 543 | [#346]: https://github.com/radian-software/selectrum/pull/346 544 | [#347]: https://github.com/radian-software/selectrum/pull/347 545 | [#348]: https://github.com/radian-software/selectrum/pull/348 546 | [#349]: https://github.com/radian-software/selectrum/pull/349 547 | [#350]: https://github.com/radian-software/selectrum/issues/350 548 | [#352]: https://github.com/radian-software/selectrum/pull/352 549 | [#354]: https://github.com/radian-software/selectrum/pull/354 550 | [#356]: https://github.com/radian-software/selectrum/pull/356 551 | [#357]: https://github.com/radian-software/selectrum/pull/357 552 | [#358]: https://github.com/radian-software/selectrum/pull/358 553 | [#359]: https://github.com/radian-software/selectrum/pull/359 554 | [#360]: https://github.com/radian-software/selectrum/pull/360 555 | [#361]: https://github.com/radian-software/selectrum/pull/361 556 | [#362]: https://github.com/radian-software/selectrum/pull/362 557 | [#365]: https://github.com/radian-software/selectrum/pull/365 558 | [#367]: https://github.com/radian-software/selectrum/pull/367 559 | [#368]: https://github.com/radian-software/selectrum/pull/368 560 | [#369]: https://github.com/radian-software/selectrum/pull/369 561 | [#372]: https://github.com/radian-software/selectrum/pull/372 562 | [#374]: https://github.com/radian-software/selectrum/pull/374 563 | [#375]: https://github.com/radian-software/selectrum/pull/375 564 | [#377]: https://github.com/radian-software/selectrum/pull/377 565 | [#378]: https://github.com/radian-software/selectrum/pull/378 566 | [#379]: https://github.com/radian-software/selectrum/pull/379 567 | [#380]: https://github.com/radian-software/selectrum/pull/380 568 | [#381]: https://github.com/radian-software/selectrum/pull/381 569 | [#386]: https://github.com/radian-software/selectrum/pull/386 570 | [#389]: https://github.com/radian-software/selectrum/pull/389 571 | [#390]: https://github.com/radian-software/selectrum/pull/390 572 | [#392]: https://github.com/radian-software/selectrum/issues/392 573 | [#393]: https://github.com/radian-software/selectrum/pull/393 574 | [#394]: https://github.com/radian-software/selectrum/pull/394 575 | [#397]: https://github.com/radian-software/selectrum/pull/397 576 | [#398]: https://github.com/radian-software/selectrum/pull/398 577 | [#400]: https://github.com/radian-software/selectrum/issues/400 578 | [#401]: https://github.com/radian-software/selectrum/pull/401 579 | [#402]: https://github.com/radian-software/selectrum/pull/402 580 | [#403]: https://github.com/radian-software/selectrum/pull/403 581 | [#404]: https://github.com/radian-software/selectrum/pull/404 582 | [#405]: https://github.com/radian-software/selectrum/pull/405 583 | [#408]: https://github.com/radian-software/selectrum/pull/408 584 | [#411]: https://github.com/radian-software/selectrum/issues/411 585 | [#413]: https://github.com/radian-software/selectrum/pull/413 586 | [#414]: https://github.com/radian-software/selectrum/pull/414 587 | [#420]: https://github.com/radian-software/selectrum/issues/420 588 | [#424]: https://github.com/radian-software/selectrum/issues/424 589 | [#421]: https://github.com/radian-software/selectrum/pull/421 590 | [#427]: https://github.com/radian-software/selectrum/issues/427 591 | [#430]: https://github.com/radian-software/selectrum/pull/430 592 | [#432]: https://github.com/radian-software/selectrum/pull/432 593 | [#438]: https://github.com/radian-software/selectrum/issues/438 594 | [#439]: https://github.com/radian-software/selectrum/pull/439 595 | [#440]: https://github.com/radian-software/selectrum/pull/440 596 | [#444]: https://github.com/radian-software/selectrum/pull/444 597 | [#445]: https://github.com/radian-software/selectrum/pull/445 598 | [#446]: https://github.com/radian-software/selectrum/pull/446 599 | [#452]: https://github.com/radian-software/selectrum/pull/452 600 | 601 | ## 3.0 (released 2020-10-20) 602 | ### Breaking changes 603 | * The function `selectrum-read-directory-name` is no longer available. 604 | * When reading directories and the default is already in the prompt, 605 | it gets selected so you can immediately submit it ([#126], [#127]). 606 | In correspondence with this change, the initial working directory 607 | for `read-directory-name` is now unchanged from the Emacs default, 608 | rather than being the parent directory. 609 | * Selectrum now uses a keymap (`selectrum-minibuffer-map`) instead of 610 | an alist (`selectrum-minibuffer-bindings`, now removed) for 611 | configuring bindings ([#186]). This better meets users' 612 | expectations, and allows other packages (e.g., General) to better 613 | work with Selectrum's keybindings ([#71]). 614 | 615 | ### Features 616 | * The user option `selectrum-completing-read-multiple-show-help` can 617 | be used to control display of additional usage information in the 618 | prompt in a `completing-read-multiple` session ([#130], [#132]). 619 | * `selectrum-read` accepts two additional keyword arguments 620 | `minibuffer-completion-table` and 621 | `minibuffer-completion-predicate`. These can be used to pass the 622 | `completing-read` collection and predicate so they are available for 623 | internal handling of completion API features and for other external 624 | commands or packages which make use of them ([#94], [#95]). 625 | * If the completion table passed to `completing-read` provides 626 | `annotation-function` or `display-sort-function` in its metadata, 627 | Selectrum will use this information to annotate or sort the 628 | candidates accordingly. Annotations defined by 629 | `completion-extra-properties` are handled, too ([#82], [#95]). 630 | * One can trigger an update of Selectrum's completions UI manually by 631 | calling `selectrum-exhibit` ([#95]). 632 | * You can now interact with candidates via the mouse. Left click 633 | (`mouse-1`) selects the candidate, and right click (`mouse-3`) 634 | inserts the candidate, just like `RET` and `TAB`, respectively. See 635 | [#113] and [#118]. 636 | 637 | ### Enhancements 638 | * If `selectrum-candidate-display-right-margin` is used the margin is 639 | included in the highlighting of the selected candidate so it's 640 | easier to see to which candidate the margin belongs to ([#166]). 641 | * If the `default-filename` passed to `selectrum-read-file-name` is an 642 | absolute path it will still be sorted to the top when it is 643 | contained in the prompting directory ([#160]). 644 | * `icomplete-mode` is now automatically disabled when entering 645 | Selectrum, to avoid conflicts ([#99]). 646 | * Working with the default candidate has been improved in cases where 647 | it is not in the candidate list. Such candidates are currently shown 648 | in the prompt message. For example, the command `lgrep` might 649 | suggest searching through files matching `*.el` instead of just a 650 | specific file. See [#120], [#122]. 651 | * While there is no user input, the default candidate remains 652 | visible in the prompt message. Previously, it would be hidden when 653 | the prompt line was not selected. Unchanged is the behavior is to 654 | hide the default candidate when text is typed, so that it is only 655 | visible when it can be submitted (similar to the effect of 656 | `minibuffer-electric-default-mode`). 657 | * The default candidate shown in the prompt message is now displayed 658 | with the face `selectrum-current-candidate` when it is selected. 659 | * Now that Selectrum always shows the default candidate when it can 660 | be submitted, it now attempts to remove the default candidate from 661 | prompt messages that already contain it. This decreases 662 | redundancy. 663 | * When there is no default value the prompt shows `[default-value : 664 | ""]` to indicate that you would submit the empty string. Previously 665 | it showed `[default-value: none]` ([#133]). 666 | * When reading file names spaces are now considered symbol 667 | constituents which means you can use s-expression commands to 668 | navigate and edit the input more efficently. A binding for 669 | `backward-kill-sexp` was added to go up a directory with `C-M-DEL` 670 | ([#138]). 671 | * Compliance to default minibuffer API has been further improved by 672 | using an overlay for candidates display. Previously code which 673 | assumed that the minibuffer only contains user input would be likely 674 | to fail ([#124]). This also means inside the minibuffer 675 | `minibuffer-contents` now returns only the current input as expected 676 | ([#116], [#133]). 677 | * Multiline candidates are now merged into a single truncated line so 678 | there is no gradual scrolling effect anymore when going through the 679 | candidate list. The first matched line is shown in front of the 680 | merged lines ([#133]). This formatting is customizable via 681 | `selectrum-multiline-display-settings` ([#147]). 682 | * `selectrum-insert-current-candidate` now automatically inserts the 683 | separator for common values of `crm-separator` when using 684 | `completing-read-multiple` ([#197]). 685 | 686 | ### Bugs fixed 687 | * The minibuffer height is now determined by the actual height of 688 | displayed candidates. Previously the height could be off for 689 | candidates containing unicode characters or other means which 690 | changed the display height such as `line-spacing` ([#146], [#151], 691 | [#154]). 692 | * When passing a named function or compiled lambda as CANDIDATES 693 | argument to `selectrum-read` an error would be thrown, which has 694 | been fixed ([#163]). 695 | * When selecting file name prompts and submitting them the result will 696 | be the selected prompt. Previously it could be the default file name 697 | passed to `selectrum-read-file-name` which is the behavior of 698 | default completion where there is no concept of an active selection 699 | ([#157], [#160]). 700 | * When there are no candidates and a match isn't required the prompt 701 | will now be shown as selected to indicate one can submit the input 702 | ([#160]). 703 | * If the MUSTMATCH argument to `read-directory-name` was non-nil the 704 | selection of the prompt wasn't visible which has been fixed ([#157], 705 | [#160]). 706 | * If a predicate was passed to `read-buffer` an error would be thrown 707 | which has been fixed ([#159], [#161]). 708 | * Dynamic collection functions can now reuse their returned 709 | candidates. Previously Selectrum could modify them even when the 710 | `:may-modify-candidates` argument wasn't passed to `selectrum-read`. 711 | * Incremental history search via `isearch` wasn't working which has 712 | been fixed ([#124], [#133]). 713 | * Empty string completion candidates are now ignored like in the 714 | default completion UI ([#101]). 715 | * Text properties are now stripped for standard completion functions 716 | ([#107], [#108]). 717 | * You can now select and submit empty input and for file prompts 718 | existing paths when require-match is non-nil ([#67], [#125]). 719 | * The default candidate is now first selected, even when it is not in 720 | the candidate list, conforming with expectations. Previously, the 721 | first candidate in the list was selected instead. See [#120]. 722 | * `selectrum-insert-current-candidate` now works correctly for 723 | `completing-read-multiple` when `crm-separator` has a non default 724 | value. Previously it would replace the separator with commas when 725 | adding new candidates ([#140]). 726 | * `selectrum-insert-current-candidate` now works from 727 | `selectrum-select-from-history` and other commands which ignore 728 | history by setting `minibuffer-history-variable` to `t`. Previously 729 | an error would be thrown ([#152]). 730 | * When completing filenames and a match is required, non-normalized 731 | paths (e.g., `~/Documents//etc/hosts`) are accepted ([#190]). 732 | * Pressing TAB when nothing matches shows a “No match” message in the 733 | minibuffer instead of signaling an error and erasing the minibuffer 734 | contents ([#193]). If `completion-fail-discreetly` is non-nil, 735 | nothing is done. 736 | * Fix type mismatch when configuring `selectrum-count-style` in 737 | customizations. 738 | * Submitting the default value with the empty prompt does no longer 739 | strip the text properties of the default candidate ([#180], [#198]). 740 | 741 | [#67]: https://github.com/radian-software/selectrum/issues/67 742 | [#71]: https://github.com/radian-software/selectrum/issues/71 743 | [#82]: https://github.com/radian-software/selectrum/issues/82 744 | [#94]: https://github.com/radian-software/selectrum/issues/94 745 | [#95]: https://github.com/radian-software/selectrum/pull/95 746 | [#99]: https://github.com/radian-software/selectrum/issues/99 747 | [#101]: https://github.com/radian-software/selectrum/pull/101 748 | [#107]: https://github.com/radian-software/selectrum/issues/107 749 | [#108]: https://github.com/radian-software/selectrum/pull/108 750 | [#113]: https://github.com/radian-software/selectrum/issues/113 751 | [#116]: https://github.com/radian-software/selectrum/issues/116 752 | [#118]: https://github.com/radian-software/selectrum/pull/118 753 | [#120]: https://github.com/radian-software/selectrum/issues/120 754 | [#122]: https://github.com/radian-software/selectrum/pull/122 755 | [#124]: https://github.com/radian-software/selectrum/issues/124 756 | [#125]: https://github.com/radian-software/selectrum/pull/125 757 | [#126]: https://github.com/radian-software/selectrum/issues/126 758 | [#127]: https://github.com/radian-software/selectrum/pull/127 759 | [#130]: https://github.com/radian-software/selectrum/issues/130 760 | [#132]: https://github.com/radian-software/selectrum/pull/132 761 | [#133]: https://github.com/radian-software/selectrum/pull/133 762 | [#138]: https://github.com/radian-software/selectrum/pull/138 763 | [#140]: https://github.com/radian-software/selectrum/pull/140 764 | [#146]: https://github.com/radian-software/selectrum/issues/146 765 | [#147]: https://github.com/radian-software/selectrum/pull/147 766 | [#151]: https://github.com/radian-software/selectrum/issues/151 767 | [#152]: https://github.com/radian-software/selectrum/pull/152 768 | [#154]: https://github.com/radian-software/selectrum/pull/154 769 | [#157]: https://github.com/radian-software/selectrum/issues/157 770 | [#159]: https://github.com/radian-software/selectrum/issues/159 771 | [#160]: https://github.com/radian-software/selectrum/pull/160 772 | [#161]: https://github.com/radian-software/selectrum/pull/161 773 | [#163]: https://github.com/radian-software/selectrum/pull/163 774 | [#166]: https://github.com/radian-software/selectrum/pull/166 775 | [#180]: https://github.com/radian-software/selectrum/issues/180 776 | [#186]: https://github.com/radian-software/selectrum/pull/186 777 | [#190]: https://github.com/radian-software/selectrum/pull/190 778 | [#193]: https://github.com/radian-software/selectrum/pull/193 779 | [#197]: https://github.com/radian-software/selectrum/pull/197 780 | [#198]: https://github.com/radian-software/selectrum/pull/198 781 | 782 | ## 2.0 (released 2020-07-18) 783 | ### Breaking changes 784 | * The way to dynamically generate the candidate list has changed. 785 | Instead of rebinding `selectrum-preprocess-candidates-function` and 786 | `selectrum-refine-candidates-function`, you simply pass a function 787 | as the COLLECTION argument to `selectrum-read`. This function takes 788 | one argument, the current user input, and returns the list of 789 | candidates as strings. Alternatively, it can return an alist whose 790 | `candidates` key is the candidate list and whose `input` key is a 791 | transformed user input to use for highlighting. 792 | 793 | As part of this change, `selectrum-refine-candidates-function` no 794 | longer can return an alist; that functionality should instead be 795 | moved to the CANDIDATES function. (This feature was never properly 796 | supported in the first place if you tried to use it in a way that 797 | can't be done equivalently in the CANDIDATES function.) 798 | 799 | See [#27]. 800 | 801 | ### Features 802 | * You can now give a prefix argument to 803 | `selectrum-insert-current-candidate` to insert the candidate at a 804 | given index directly ([#96]). 805 | * Candidates inserted by `selectrum-insert-current-candidate` are now 806 | added to history ([#54]). 807 | * You can resume the last completion session using the 808 | `selectrum-repeat` command. (Note that you must bind this command to 809 | a key sequence in order to use it.) This command implements similar 810 | functionality to `ivy-resume`. See [#39]. 811 | * Experimental support for using Selectrum as a backend for Helm 812 | commands. Use it by enabling `selectrum-helm-mode` from the 813 | `selectrum-helm` library. See [#18]. 814 | * You can now give a prefix argument to 815 | `selectrum-select-current-candidate` to select the candidate at a 816 | given index directly. New user option `selectrum-show-indices` to 817 | display these indices for your convenience. This feature implements 818 | similar functionality to `ivy-avy`. See [#16]. 819 | * Recursive minibuffers are now supported. 820 | * In the standard `completing-read` interface, you can use 821 | `previous-matching-history-element` to retrieve history 822 | elements. The binding now works properly in Selectrum too, except 823 | that you can use Selectrum to select a history element. See [#49], 824 | [#77]. If you prefer to use the original interface you can use 825 | `selectrum-previous-history-element` which is just not bound by 826 | default [#57]. 827 | * You can now cause the minibuffer to always have the same height, 828 | even if there are fewer candidates, by enabling 829 | `selectrum-fix-minibuffer-height` ([#35]). 830 | * Multiple candidate selection is now supported, and we provide a 831 | `selectrum-completing-read-multiple` function which is installed 832 | automatically by `selectrum-mode`. This means that commands like 833 | `describe-face` (which delegate to `completing-read-multiple` 834 | internally) now use Selectrum by default. To select additional 835 | candidates within a supported command, use `TAB` and input 836 | `crm-separator` (`,` by default). See [#53], [#80], [#74]. 837 | * We provide a `selectrum-completion-in-region` function now and 838 | install it on `completion-in-region-function` in `selectrum-mode`, 839 | so `completion-at-point` will use Selectrum when there is more than 840 | one completion ([#42]). This function can display annotation 841 | informations if the `completion-at-point-function` backend offers 842 | them ([#62]), and will respect completion boundaries ([#89]). 843 | Appearance can be configured using the faces 844 | `selectrum-completion-annotation`, `selectrum-completion-docsig`, 845 | and `completions-common-part` ([#86]). 846 | 847 | ### Enhancements 848 | * `selectrum-read-file-name` which is used as 849 | `read-file-name-function` now uses `read-file-name-default` 850 | internally. This means all default features of file completion 851 | should be available now. Most notably you can now use `M-n` to 852 | insert file names into the minibuffer (using 853 | `file-name-at-point-functions`) and you are able to use shortcuts 854 | like `//` or `~/` ([#50], [#52]). 855 | * In `read-file-name`, when a default is provided (for example in the 856 | `dired-do-rename` command), we actually use it as the initial 857 | contents of the minibuffer, which allows you to have convenient 858 | access to the default filename when that default file does not exist 859 | ([#25]). 860 | * We now bind `minibuffer-completing-file-name` during 861 | `read-file-name`, in conformance with the standard Emacs interface 862 | ([#30]). 863 | * A new text property `selectrum-candidate-display-right-margin` is 864 | added, to display a string at the right margin after a candidate 865 | ([#44]). 866 | * You can now access standard minibuffer history using `M-p` and `M-n` 867 | ([#4], [#38]). 868 | * Previously, setting `resize-mini-windows` to nil would cause 869 | Selectrum to be unable to display any candidates. This has been 870 | fixed by having Selectrum bind the variable to `grow-only` when 871 | entering the minibuffer ([#35]). 872 | * Previously, a large value of `selectrum-num-candidates-displayed` 873 | would produce a confusing result because `max-mini-window-height` 874 | imposed a lower limit on the height of the minibuffer. Now that 875 | variable is bound automatically by Selectrum based on the value of 876 | `selectrum-num-candidates-displayed` ([#22]). 877 | * Multiline candidates are now displayed properly and do not mess up 878 | scrolling in the candidate list ([#12]). 879 | * When you select the user input area and it doesn't have anything 880 | typed, we now show an overlay indicating that you are in this state, 881 | so it is less confusing. The overlay shows what default value will 882 | be submitted if you press return. See [#55]. 883 | * Switching buffers is now less confusing, because we don't modify the 884 | order of the buffer list at all. Previously the default buffer to 885 | switch to was moved to the top of the list. Now we leave it where it 886 | is, and just select it initially. `selectrum-read` grows a new 887 | argument `:no-move-default-candidate` to support this improvement. 888 | * Previously, `selectrum-read` sometimes modified the list of 889 | candidates it was given. This has been fixed, and there is a new 890 | keyword argument `:may-modify-candidates` to re-enable the old 891 | behavior for cases where it is safe and the performance gains are 892 | useful. See [#74]. 893 | 894 | ### Bugs fixed 895 | * You can now use the undo system in the minibuffer. Previously, 896 | trying to do so would break Selectrum ([#31]). 897 | * Passing a list of symbols to `selectrum-completing-read` works now. 898 | * Previously, `selectrum-read-buffer` ignored its PREDICATE argument. 899 | This has now been fixed ([#32], [#33]). 900 | * Previously, `selectrum-read` would return nil when 901 | `selectrum-submit-exact-input` was used on an empty input and no 902 | `:default-candidate` was provided. Now the empty string is returned, 903 | in accordance with the `completing-read` API ([#34]). 904 | * The keymap used in the minibuffer now inherits from 905 | `minibuffer-local-map`, so standard minibuffer bindings should still 906 | work ([radian-software/ctrlf#41]). 907 | * The application of face `selectrum-current-candidate` does not 908 | trample on the results of `selectrum-highlight-candidates-function`. 909 | In other words, the matched part of the current candidate is now 910 | highlighted just like the matched part of the other candidates. See 911 | ([#21], [#76]). 912 | * Previously, an error was thrown if you used certain non-Selectrum 913 | minibuffer commands before loading Selectrum. This has been fixed 914 | ([#28]). 915 | * If `selectrum-num-candidates-displayed` is set to one, the 916 | highlighting now works correctly. Before, the prompt would get 917 | highlighted instead of the current candidate. See [#85]. 918 | * `selectrum-read-library-name` previously, in certain versions of 919 | Emacs, showed some entries with `.el` appended. This has now been 920 | fixed. Also, `TAB` now inserts the current candidate and not the 921 | whole path to the library, so that the result can be submitted 922 | directly ([#73]). 923 | 924 | [#4]: https://github.com/radian-software/selectrum/issues/4 925 | [#12]: https://github.com/radian-software/selectrum/issues/12 926 | [#16]: https://github.com/radian-software/selectrum/issues/16 927 | [#18]: https://github.com/radian-software/selectrum/issues/18 928 | [#21]: https://github.com/radian-software/selectrum/issues/21 929 | [#22]: https://github.com/radian-software/selectrum/issues/22 930 | [#25]: https://github.com/radian-software/selectrum/pull/25 931 | [#27]: https://github.com/radian-software/selectrum/pull/27 932 | [#28]: https://github.com/radian-software/selectrum/issues/28 933 | [#30]: https://github.com/radian-software/selectrum/issues/30 934 | [#31]: https://github.com/radian-software/selectrum/issues/31 935 | [#32]: https://github.com/radian-software/selectrum/issues/32 936 | [#33]: https://github.com/radian-software/selectrum/pull/33 937 | [#34]: https://github.com/radian-software/selectrum/pull/34 938 | [#35]: https://github.com/radian-software/selectrum/issues/35 939 | [#38]: https://github.com/radian-software/selectrum/pull/38 940 | [#39]: https://github.com/radian-software/selectrum/issues/39 941 | [#42]: https://github.com/radian-software/selectrum/issues/42 942 | [#44]: https://github.com/radian-software/selectrum/pull/44 943 | [#49]: https://github.com/radian-software/selectrum/issues/49 944 | [#50]: https://github.com/radian-software/selectrum/pull/50 945 | [#52]: https://github.com/radian-software/selectrum/issues/52 946 | [#53]: https://github.com/radian-software/selectrum/issues/53 947 | [#54]: https://github.com/radian-software/selectrum/pull/54 948 | [#55]: https://github.com/radian-software/selectrum/issues/55 949 | [#57]: https://github.com/radian-software/selectrum/pull/57 950 | [#62]: https://github.com/radian-software/selectrum/pull/62 951 | [#73]: https://github.com/radian-software/selectrum/pull/73 952 | [#74]: https://github.com/radian-software/selectrum/pull/74 953 | [#76]: https://github.com/radian-software/selectrum/pull/76 954 | [#77]: https://github.com/radian-software/selectrum/pull/77 955 | [#80]: https://github.com/radian-software/selectrum/issues/80 956 | [#85]: https://github.com/radian-software/selectrum/pull/85 957 | [#86]: https://github.com/radian-software/selectrum/pull/86 958 | [#89]: https://github.com/radian-software/selectrum/pull/89 959 | [#96]: https://github.com/radian-software/selectrum/pull/96 960 | [radian-software/ctrlf#41]: https://github.com/radian-software/ctrlf/issues/41 961 | 962 | ## 1.0 (released 2020-03-23) 963 | ### Added 964 | * Package `selectrum` 965 | * Minor mode `selectrum-mode` 966 | * Faces: 967 | * `selectrum-current-candidate` 968 | * `selectrum-primary-highlight` 969 | * `selectrum-secondary-highlight` 970 | * Interface user options: 971 | * `selectrum-num-candidates-displayed` 972 | * `selectrum-minibuffer-bindings` 973 | * `selectrum-count-style` 974 | * Commands bound in minibuffer: 975 | * `selectrum-previous-candidate` 976 | * `selectrum-next-candidate` 977 | * `selectrum-previous-page` 978 | * `selectrum-next-page` 979 | * `selectrum-goto-beginning` 980 | * `selectrum-goto-end` 981 | * `selectrum-kill-ring-save` 982 | * `selectrum-select-current-candidate` 983 | * `selectrum-submit-exact-input` 984 | * `selectrum-insert-current-candidate` 985 | * Entry points: 986 | * `selectrum-read` 987 | * `selectrum-completing-read` 988 | * `selectrum-read-buffer` 989 | * `selectrum-read-file-name` 990 | * `selectrum-read-directory-name` 991 | * `selectrum-read-library-name` 992 | * Hooks: 993 | * `selectrum-candidate-selected-hook` 994 | * `selectrum-candidate-inserted-hook` 995 | * API user options, variables, and functions: 996 | * `selectrum-refine-candidates-function` 997 | * `selectrum-default-candidate-refine-function` 998 | * `selectrum-preprocess-candidates-function` 999 | * `selectrum-default-candidate-preprocess-function` 1000 | * `selectrum-highlight-candidates-function` 1001 | * `selectrum-default-candidate-highlight-function` 1002 | * `selectrum-should-sort-p` 1003 | 1004 | [keep a changelog]: https://keepachangelog.com/en/1.0.0/ 1005 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG VERSION 2 | FROM silex/emacs:$VERSION 3 | 4 | ARG UID 5 | 6 | COPY scripts/docker-install.bash /tmp/ 7 | RUN /tmp/docker-install.bash "$UID" 8 | 9 | USER $UID 10 | WORKDIR /home/docker/src 11 | 12 | CMD bash 13 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2019–2022 [Radian LLC](https://radian.codes) and 4 | contributors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | VERSION ?= 2 | CMD ?= 3 | 4 | SHELL := bash 5 | 6 | # The order is important for compilation. 7 | for_compile := selectrum.el 8 | for_checkdoc := selectrum.el 9 | for_checkindent := $(wildcard *.el) 10 | 11 | .PHONY: help 12 | help: ## Show this message 13 | @echo "usage:" >&2 14 | @grep -h "[#]# " $(MAKEFILE_LIST) | \ 15 | sed 's/^/ make /' | \ 16 | sed 's/:[^#]*[#]# /|/' | \ 17 | sed 's/%/LANG/' | \ 18 | column -t -s'|' >&2 19 | 20 | .PHONY: lint 21 | lint: compile checkdoc longlines checkindent toc ## Run all the linters 22 | 23 | .PHONY: compile 24 | compile: ## Byte-compile 25 | @for file in $(for_compile); do \ 26 | echo "[compile] $$file" >&2 ;\ 27 | emacs -Q --batch -L . -f batch-byte-compile $$file 2>&1 \ 28 | | grep -v "^Wrote" \ 29 | | grep . && exit 1 || true ;\ 30 | done 31 | 32 | .PHONY: checkdoc 33 | checkdoc: ## Check docstring style 34 | @for file in $(for_checkdoc); do \ 35 | echo "[checkdoc] $$file" >&2 ;\ 36 | emacs -Q --batch \ 37 | --eval "(or (fboundp 'checkdoc-file) (kill-emacs))" \ 38 | --eval "(checkdoc-file \"$$file\")" 2>&1 \ 39 | | grep . && exit 1 || true ;\ 40 | done 41 | 42 | .PHONY: longlines 43 | longlines: ## Check for long lines 44 | @scripts/check-line-length.bash 45 | 46 | .PHONY: checkindent 47 | checkindent: ## Ensure that indentation is correct 48 | @tmpdir="$$(mktemp -d)"; for file in $(for_checkindent); do \ 49 | echo "[checkindent] $$file" >&2; \ 50 | emacs -Q --batch \ 51 | -l scripts/selectrum-indent.el \ 52 | --eval "(setq inhibit-message t)" \ 53 | --eval "(load (expand-file-name \"selectrum.el\") nil t)" \ 54 | --eval "(find-file \"$$file\")" \ 55 | --eval "(indent-region (point-min) (point-max))" \ 56 | --eval "(write-file \"$$tmpdir/$$file\")"; \ 57 | (diff <(cat "$$file" | nl -v1 -ba | \ 58 | sed "s/\t/: /" | sed "s/^ */$$file:/") \ 59 | <(cat "$$tmpdir/$$file" | nl -v1 -ba | \ 60 | sed "s/\t/: /" | sed "s/^ */$$file:/") ) \ 61 | | grep -F ">" | grep -o "[a-z].*" | grep . && exit 1 || true; \ 62 | done 63 | 64 | .PHONY: toc 65 | toc: README.md ## Update table of contents in README 66 | @echo "[toc] $^" 67 | @if command -v markdown-toc >/dev/null; then \ 68 | markdown-toc -i $^ ; \ 69 | else \ 70 | echo " --> markdown-toc missing, skipping" ; \ 71 | fi 72 | 73 | .PHONY: clean 74 | clean: ## Remove build artifacts 75 | @echo "[clean]" *.elc >&2 76 | @rm -f *.elc 77 | 78 | .PHONY: docker 79 | docker: ## Start a Docker shell; e.g. make docker VERSION=25.3 80 | @scripts/docker.bash "$(VERSION)" "$(CMD)" 81 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [](https://melpa.org/#/selectrum) 2 | [](https://stable.melpa.org/#/selectrum) 3 | 4 | # Selectrum... is replaced 5 | 6 | Selectrum has been replaced by 7 | [Vertico](https://github.com/minad/vertico), a package which provides 8 | essentially the same features in a simpler way, and integrates more 9 | effectively with other packages. 10 | 11 | The original author of Selectrum, 12 | [**@raxod502**](https://github.com/raxod502), now uses Vertico instead 13 | in his Emacs configuration, 14 | [Radian](https://github.com/radian-software/radian). 15 | 16 | There is a [guide to migrate from Selectrum to 17 | Vertico](https://github.com/minad/vertico/wiki/Migrating-from-Selectrum-to-Vertico). 18 | 19 | Over time, we will improve this guide and ensure that it is possible 20 | to achieve feature parity for all existing configurations of Selectrum 21 | in the Vertico ecosystem (possibly with the use of one or more Vertico 22 | extension packages, of which there are many already). 23 | 24 | It's always annoying to change from one thing to another, but we (the 25 | Selectrum development team) think the replacement will be a benefit to 26 | everyone pretty soon, because Vertico is a lot simpler and easier to 27 | maintain and integrate, meaning the end result is likely to be more 28 | robust and likely to stick around for longer. 29 | 30 | ## Documentation 31 | 32 | [News feed](https://github.com/radian-software/selectrum/commits/master/CHANGELOG.md.atom) 33 | 34 | *Selectrum is a better solution for incremental narrowing in Emacs, 35 | replacing [Helm](https://github.com/emacs-helm/helm), 36 | [Ivy](https://github.com/abo-abo/swiper#ivy), and 37 | [Ido](https://www.gnu.org/software/emacs/manual/html_node/ido/index.html)*. 38 | 39 | 40 | 41 | 42 | 43 | - [What is it?](#what-is-it) 44 | - [Installation](#installation) 45 | - [Usage](#usage) 46 | * [Alternative 1: Prescient](#alternative-1-prescient) 47 | * [Alternative 2: Orderless](#alternative-2-orderless) 48 | - [User guide](#user-guide) 49 | * [Keybindings](#keybindings) 50 | * [Sorting and filtering](#sorting-and-filtering) 51 | * [Additional features](#additional-features) 52 | * [Customization](#customization) 53 | * [Complementary extensions](#complementary-extensions) 54 | * [But what is it doing to my Emacs??](#but-what-is-it-doing-to-my-emacs) 55 | * [News](#news) 56 | - [Developer guide](#developer-guide) 57 | * [Usage of Selectrum](#usage-of-selectrum) 58 | * [Sorting, filtering, and highlighting](#sorting-filtering-and-highlighting) 59 | * [Text properties](#text-properties) 60 | * [Hooks](#hooks) 61 | * [Variables](#variables) 62 | - [Contributor guide](#contributor-guide) 63 | - [Caveats](#caveats) 64 | - [Selectrum in comparison to other completion-systems](#selectrum-in-comparison-to-other-completion-systems) 65 | * [Ido](#ido) 66 | * [Helm](#helm) 67 | * [Ivy](#ivy) 68 | * [Icomplete](#icomplete) 69 | * [Vertico](#vertico) 70 | * [Icicles](#icicles) 71 | * [Snails](#snails) 72 | * [Sallet](#sallet) 73 | * [Raven](#raven) 74 | * [Swiper](#swiper) 75 | 76 | 77 | 78 | 79 | 80 | ## What is it? 81 | 82 | Selectrum aims to provide a better completion UI using standard Emacs 83 | APIs. In essence it is an interface for selecting items from a list. 84 | 85 | You can use it to run a command with `M-x`: 86 | 87 |