How to programmatically pop the last command from comint-input-history
?
I tried something like (pop (cdr (cdr comint-input-ring)))
but that does not work.
It seems to be an array, but I'm also stuck with (aref (cdr (cdr comint-input-ring)) 0)
How to programmatically pop the last command from comint-input-history
?
I tried something like (pop (cdr (cdr comint-input-ring)))
but that does not work.
It seems to be an array, but I'm also stuck with (aref (cdr (cdr comint-input-ring)) 0)
Copyright © 2021 Jogjafile Inc.
The
comint-input-ring
is a ring, and as such should be manipulated with ring functions. And, I'm not sure if you mean "last" as in the most recent (the "last" thing I typed) or "last" as in oldest.If you want to remove the oldest (FIFO), you can do:
If you want to remove the most recent (LIFO), you can do: