[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: repeat the last single shell command
From: |
Tassilo Horn |
Subject: |
Re: repeat the last single shell command |
Date: |
Thu, 18 Jul 2013 16:22:39 +0200 |
User-agent: |
Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) |
Nicolas Richard <theonewiththeevillook@yahoo.fr> writes:
> Tassilo Horn <tsdh@gnu.org> writes:
>> You can capture the last shell command using an advice, and have a
>> command for repeating it, though.
>
> Since a history is maintained accross invocations, there must be a
> variable holding that, already. Its name is shell-command-history ;
> its (car) holds the last command.
Indeed, so
--8<---------------cut here---------------start------------->8---
(defun th-repeat-last-shell-command ()
(interactive)
(if (car shell-command-history)
(apply #'shell-command (car shell-command-history))
(message "There's no last shell command!")))
--8<---------------cut here---------------end--------------->8---
is enough.
Bye,
Tassilo
- Re: repeat the last single shell command, (continued)
- Re: repeat the last single shell command, Tassilo Horn, 2013/07/18
- Re: repeat the last single shell command, Nicolas Richard, 2013/07/18
- Re: repeat the last single shell command, Tassilo Horn, 2013/07/18
- Re: repeat the last single shell command, Yuri Khan, 2013/07/18
- Message not available
- Re: repeat the last single shell command, Barry Margolin, 2013/07/18
- Message not available
- Re: repeat the last single shell command, Barry Margolin, 2013/07/18
Re: repeat the last single shell command, Peter Dyballa, 2013/07/18
Re: repeat the last single shell command, Tassilo Horn, 2013/07/18