Eli Zaretskii writes: >> From: Thierry Volpiatto >> Cc: 68602@debbugs.gnu.org >> Date: Sat, 20 Jan 2024 16:37:04 +0000 >> >> >> From: Thierry Volpiatto >> >> Date: Sat, 20 Jan 2024 05:56:11 +0000 >> >> >> >> >> >> Its read-language-name specify default in prompt but not as DEFAULT arg. >> > >> > Thanks. But why is that a problem? >> >> Because Helm needs this info to handle DEFAULT, it can't be aware of the >> code running after the completing-read (read-language-name in this >> case). > > Can you elaborate on this? I don't think I follow (I don't use Helm). When you press RET on an empty completing-read prompt and the function provides a default, the completing-read returns this default. When you run this function with helm-mode enabled, helm provide its interface for completion on this completing-read and puts default on top of its list to allow user pressing RET with an empty prompt to have this default. If the default arg is handled AFTER the completing-read helm cannot guess what is it. Example (selection is "|"): (defun foo () (let ((val (completing-read "test: " '("a" "b" "c" "d") nil nil nil nil "d"))) val)) d| a b c (defun foo-1 () (let ((val (completing-read "test: " '("a" "b" "c" "d")))) (if (string= val "") "d" val))) a| b c d In `foo` and `foo-1` with helm-mode enabled and press RET with nothing in prompt, helm will return "d" with `foo` but "a" with `foo-1`. In `foo` helm is aware that "d" is the default, in `foo-1` it has no ideas of what the default is even if `foo-1` code is as correct as `foo`. -- Thierry