~protesilaos/tmr

2

Improve description prompt

Details
Message ID
<87o7zwhcqn.fsf@cassou.me>
DKIM signature
missing
Download raw message
These 2 patches improve how tmr--description-prompt asks for a
description by leaving the candidates in the user's order.

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
Details
Message ID
<87pmkcwosm.fsf@protesilaos.com>
In-Reply-To
<87o7zwhcqn.fsf@cassou.me> (view parent)
DKIM signature
pass
Download raw message
> From: Damien Cassou <damien@cassou.me>
> Date: Tue, 17 May 2022 08:52:48 +0200
>
> These 2 patches improve how tmr--description-prompt asks for a
> description by leaving the candidates in the user's order.

Thank you!

> -  (let ((def (or default (nth 0 tmr--description-hist))))
> -    (completing-read
> -     (if def
> -         (format "Description for this tmr [%s]: " def)
> -       "Description for this tmr: ")
> -     tmr-descriptions-list nil nil nil
> -     'tmr--description-hist def)))
> +  (completing-read
> +   (if default
> +       (format "Description for this tmr [%s]: " default)
> +     "Description for this tmr: ")
> +   tmr-descriptions-list nil nil nil
> +   'tmr--description-hist default))

Did you mean to remove the "def" which falls back to the completion
history?

-- 
Protesilaos Stavrou
https://protesilaos.com
Details
Message ID
<87k0akwoa8.fsf@protesilaos.com>
In-Reply-To
<87pmkcwosm.fsf@protesilaos.com> (view parent)
DKIM signature
pass
Download raw message
> From: Protesilaos Stavrou <info@protesilaos.com>
> Date: Tue, 17 May 2022 11:23:21 +0300
>
>> From: Damien Cassou <damien@cassou.me>
>> Date: Tue, 17 May 2022 08:52:48 +0200
>>
>> These 2 patches improve how tmr--description-prompt asks for a
>> description by leaving the candidates in the user's order.
>
> Thank you!
>
>> -  (let ((def (or default (nth 0 tmr--description-hist))))
>> -    (completing-read
>> -     (if def
>> -         (format "Description for this tmr [%s]: " def)
>> -       "Description for this tmr: ")
>> -     tmr-descriptions-list nil nil nil
>> -     'tmr--description-hist def)))
>> +  (completing-read
>> +   (if default
>> +       (format "Description for this tmr [%s]: " default)
>> +     "Description for this tmr: ")
>> +   tmr-descriptions-list nil nil nil
>> +   'tmr--description-hist default))
>
> Did you mean to remove the "def" which falls back to the completion
> history?

Oh sorry, just read the Vertico thread.  We are good to go!

-- 
Protesilaos Stavrou
https://protesilaos.com
Reply to thread Export thread (mbox)