help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Finding last *Async Shell Command* buffer?


From: Emanuel Berg
Subject: Re: Finding last *Async Shell Command* buffer?
Date: Fri, 26 Mar 2021 08:28:49 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Jean Louis wrote:

> (defun rcd-async-shell-command (command &rest args)
>   "Remembers last async shell command on `C-c l'"
>   (interactive)
>   (let* ((shell-command-buffer-name-async (concat "RCD Async: " 
> (format-time-string "%T")))
>          (last-buffer shell-command-buffer-name-async))
>     (global-set-key (kbd "C-c l") `(lambda () 
>                                      (interactive)
>                                      (switch-to-buffer ,last-buffer)))
>     (apply #'async-shell-command command args)))

(defun rcd-async-shell-command (cmd &optional args)
  (interactive)
  (let* ((buf (concat "RCD Async: " (format-time-string "%T")) )
         (last-buf buf) )
    (switch-to-buffer last-buf)
    (async-shell-command cmd args) ))

(global-set-key
 "\M-&"
 (lambda () (interactive) (rcd-async-shell-command "gimp")) )

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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