From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rodrigo Morales Newsgroups: gmane.emacs.help Subject: How to execute/mimick the "watch" command using Emacs features? Date: Fri, 05 Feb 2021 16:09:58 -0500 Message-ID: <87o8gy43x5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28511"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.14; emacs 27.1 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 05 22:14:03 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l88QV-0007JL-PC for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 05 Feb 2021 22:14:03 +0100 Original-Received: from localhost ([::1]:46288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l88QU-00072A-Pj for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 05 Feb 2021 16:14:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l88Pt-000724-LZ for help-gnu-emacs@gnu.org; Fri, 05 Feb 2021 16:13:25 -0500 Original-Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]:37599) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l88Ps-00053t-6U for help-gnu-emacs@gnu.org; Fri, 05 Feb 2021 16:13:25 -0500 Original-Received: by mail-qt1-x82b.google.com with SMTP id v3so6077490qtw.4 for ; Fri, 05 Feb 2021 13:13:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:message-id:date:mime-version; bh=hjRLcn5A+SQH+RA0T/Hm+W8n4EbR1AHrWOqqlD9BjYg=; b=GPmxjxqltA02/AuX83yd2m/lOchGY5moG9K0XlsAeG07p5peaXLg+bVnyT9Td5Lh1W Bbd0GxFYSt/firMAwO7r/RTxJTbu71jBorS14JV10FN7VvXmt/x3d4t94gPTyvZT6EAH PygL7ByufE+W5/9SXyzYD0BDwPWjI48Ma5Jovs8oQlzkvzqM0jkTRO+Xj7VUtoTECQnX coLv4fV0cKNtayNeyGLk6H0SRs8vy86KswnYK6C2zUcjnAOHuzQd8nPWC/i/CzbYCXcO vQAAC7DAvLRWjywXVsVw6mevX8asuKAraA6rYsSaqzgqR0AySWjrbrkwvcXRo8jLHSMF NoGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:message-id:date :mime-version; bh=hjRLcn5A+SQH+RA0T/Hm+W8n4EbR1AHrWOqqlD9BjYg=; b=NDkZFUUD7qJnuulynCQf/AMe5hPVnU2HZNuHvmlYvo22wEyUi0lF0l3Tx0rZ/vRqTi wJ29xQmKEOrqP8nW5em0tcCURjpQuq4KTuRg6zmY2+B7AmSg+ATXZMPHA4GNY/zDMf/V COBIh3p4b1tRfCC5QEY8CsWYaFuQXbo5AUbLm27/BgGrFBmbXYpSd0zeEVyzIerH+kkR mKz4Nbzgw5hpAsuiRgjpBeD/tZqz+Ey7/qnke+G6aNwYNCg4+meXW7AxklfCV5OIOXbX KfhWncjteIidsfb2JH2l5c/RQGwMIs+JyhE4G4T74k6TLdblz47qZYfDdeidDC6zrNtQ Rh4A== X-Gm-Message-State: AOAM532ZBYhgulN2mrGYPoP/10TUxeyIUXAL8x4ptrbEJrw3jQIwQovI vOv0xuzjx1Z4NZgck09yEVc9gk0DrJE= X-Google-Smtp-Source: ABdhPJyadOwnQaWYRNhKSvv/39nMhkJPpJKfGmOwK8HIXoXM6TuQyeB5Mwl8XdcSz/+Tw0/cUojlDQ== X-Received: by 2002:a05:622a:303:: with SMTP id q3mr5966065qtw.235.1612559602806; Fri, 05 Feb 2021 13:13:22 -0800 (PST) Original-Received: from localhost ([190.239.232.181]) by smtp.gmail.com with ESMTPSA id q25sm10462238qkq.32.2021.02.05.13.13.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 13:13:22 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::82b; envelope-from=moralesrodrigo1100@gmail.com; helo=mail-qt1-x82b.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:127625 Archived-At: 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)