[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Delete multiple repositories programmatically from elisp by supplyin

From: Robert Pluim
Subject: Re: Delete multiple repositories programmatically from elisp by supplying `y' as the answer to an interactively called function.
Date: Wed, 08 Dec 2021 10:07:28 +0100

>>>>> On Wed, 8 Dec 2021 10:56:12 +0800, Hongyi Zhao <> 
>>>>> said:

    Hongyi> On Wed, Dec 8, 2021 at 1:05 AM Robert Pluim <> 
    >> That function takes a 'force' argument, so if you manage to supply any
    >> prefix arg at all it will delete all the repos without prompting. One
    >> way to do that is by using `current-prefix-arg':
    >> (let ((current-prefix-arg '(4)))
    >> (call-interactively #'straight-remove-unused-repos))

    Hongyi> The author told me the following solution here [1]:

    Hongyi> ==========

    Hongyi> Please see:

    Hongyi> You can pass the universal argument to the command and force will 
be non-nil.

    Hongyi> And if you wish to use the command in an elisp program you can just
    Hongyi> pass the force argument you desire:

    Hongyi> (straight-remove-unused-repos 'force)

    Hongyi> ==========

    Hongyi> [1]

Yes, that works for `straight-remove-unused-repos', because it only
cares about the argument being non-nil. There are commands that care
about the actual value of `current-prefix-arg', and then you have to
bind it via `let'.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]