[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to execute/mimick the "watch" command using Emacs features?
From: |
Rodrigo Morales |
Subject: |
How to execute/mimick the "watch" command using Emacs features? |
Date: |
Fri, 05 Feb 2021 16:09:58 -0500 |
User-agent: |
mu4e 1.4.14; emacs 27.1 |
Taking into consideration that =watch= doesn't work properly in =M-x
shell= and =M-x eshell=, I'd like to know what alternatives do you guys
use for having the same behavior of the "watch" command inside Emacs? Do
you open a terminal emulator and execute "watch" there or have a pure
Emacs-approach?
I mainly use the =watch= command to see how the output of a command
changes over time. I run it in a terminal emulator (st). For example,
with the following command I would see how files are created under a
directory.
#+begin_src sh :eval no
watch -n 1 -d "find ~/Experiments | tree --fromfile"
#+end_src
Another example: I sometimes use =watch= to see how tangled files are
being generated. I only do this when working with multiple =noweb=
references in order to confirm that the tangled file doesn't contain any
error. I can mimick the behavior of the =watch= command in this scenario
by toggling =auto-revert-mode= inside Emacs.
#+begin_src sh :eval no
watch -n 1 -d -x cat ~/Experiments/tangled-file.py
#+end_src
However, I haven't found a way to mimick the behavior of "watch" for the
first example shown above. I was thinking of executing the command in
"compilation-mode" and repeatedly execute it but before going with that
approach I wanted to know your opinions.
--
Greetings,
Rodrigo Morales.
IRC: rdrg109 (freenode)
- How to execute/mimick the "watch" command using Emacs features?,
Rodrigo Morales <=