|
From: | Gregory Heytings |
Subject: | Re: [PATCH] icomplete-vertical |
Date: | Tue, 06 Apr 2021 20:09:56 +0000 |
Okay. Here is the final (?) version of the patch; I forgot to update the docs in the previous one.I tried it out, and everything works nicely.
Thanks for reviewing!
The only problem I see this code is too hackish:+(defun icomplete--vertical-reformat-completions () + "Reformat the completion candidates returned by `icomplete-completions'." + (save-match-data + (setq icomplete-current-completions + (if (string-match "^\\((.*)\\|\\[.*\\]\\)?{\\(\\(?:.\\|\n\\)+\\)}" + icomplete-current-completions) + (format "%s \n%s" + (or (match-string 1 icomplete-current-completions) "") + (match-string 2 icomplete-current-completions)) + icomplete-current-completions))))I guess like there are variables that affect formatting of the output e.g. 'icomplete-hide-common-prefix', there could be a new similar variable 'icomplete-add-initial-newline' to add a newline in the 'icomplete-completions' formatting function.
It is (a bit) hackish because the output of icomplete-completions is (a bit) hackish.
Adding an initial newline to the output of icomplete-completions wouldn't be enough, icomplete-completions uses () [] {} and | as delimiters. Of course one could change all these delimiters into user options, but IMO it would add more complexity than necessary, and with the new icomplete-completions-filter-hook anyone can reformat the output the way they want it.
[Prev in Thread] | Current Thread | [Next in Thread] |