From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tom Baker Newsgroups: gmane.emacs.bugs Subject: bug#21652: bell chars Date: Sat, 15 Aug 2020 21:10:35 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19189"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 21652@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 16 03:11:10 2020 Return-path: Envelope-to: geb-bug-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 1k77CX-0004re-TH for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Aug 2020 03:11:10 +0200 Original-Received: from localhost ([::1]:60554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k77CW-00019q-9B for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Aug 2020 21:11:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k77CQ-00019h-Hb for bug-gnu-emacs@gnu.org; Sat, 15 Aug 2020 21:11:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45062) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k77CQ-00038u-6U for bug-gnu-emacs@gnu.org; Sat, 15 Aug 2020 21:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k77CQ-0000NN-0b for bug-gnu-emacs@gnu.org; Sat, 15 Aug 2020 21:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tom Baker Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Aug 2020 01:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21652 X-GNU-PR-Package: emacs Original-Received: via spool by 21652-submit@debbugs.gnu.org id=B21652.15975402471423 (code B ref 21652); Sun, 16 Aug 2020 01:11:01 +0000 Original-Received: (at 21652) by debbugs.gnu.org; 16 Aug 2020 01:10:47 +0000 Original-Received: from localhost ([127.0.0.1]:56608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k77CA-0000Mt-JV for submit@debbugs.gnu.org; Sat, 15 Aug 2020 21:10:46 -0400 Original-Received: from mail-lj1-f173.google.com ([209.85.208.173]:38201) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k77C6-0000Mc-IH for 21652@debbugs.gnu.org; Sat, 15 Aug 2020 21:10:45 -0400 Original-Received: by mail-lj1-f173.google.com with SMTP id m22so13712321ljj.5 for <21652@debbugs.gnu.org>; Sat, 15 Aug 2020 18:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=5md7qRIhehSrm28osKWhvheMZwQ2uB++xCm/mIKtUpM=; b=dQKOF4bK+dDSFWeBPHgRaLwXdxox0pkJwvY8LVpJYxy2WdRYz3YRaelVGqKJQSBPo1 V6Znr8X+heHHLufe+8wIf08gtMpTvxF3ixFGYFJgvsbICj3B+4ogk86BxodIsisI3//Z KUy9EzZCdaf86c7hJHAINJ31OHz0PVZgPQcL4lCe82I/aSiM6U8p9Huh3LR2Fnhh3zhG WuJDFLuLyd6SslfZW1/wsVJ6/9ltLzjRjX3UEGMR0TwF/5jU/6sYRL2tMMWfO969sLat 21wi3zswsigT+erjXzoBDjyf6Pc/uvkJytzQsmL2niscdnOgLFlBI3yJ1hBNWajfRf+7 079w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=5md7qRIhehSrm28osKWhvheMZwQ2uB++xCm/mIKtUpM=; b=Wdy6I+S/dUKEPkICl8ca1BU3p1llCxp5EF+TGleCMXYsFNYAzJerv1NRXHesEpt1O1 aKAxX9BDl1t9X1DdWUT6KF0+h79xNR+02HkqQHU6/zdF+aqqyJciYyxCYvplf+6k87hV bimzDRw0gGFYOYyByrDnPD00PRTApYRcdrAnnB5eSHXDfW7UdXspkE2UWXe0AhTGbLKE VUJWLjsZcogxZiQPtseRCgUoZBH6nQWC0adk3xwylVgMBrYKdx7Km1LNnGM7oUQWPwV6 nHvdBQGYGOsdjsOUUvfzqkAirq2mCbp8XPndfq7zct3XaPowbPzeFFydYgg0NS6TAhOg SDgg== X-Gm-Message-State: AOAM531GaSVbH9JQJ/ZHJ248sv75xcyBSGZa3/FyormQwzntLlipnffs aN2bXBaPWgdu3v1EJS7vgLTz3QAqc04048oUxzz2+wSz/t8= X-Google-Smtp-Source: ABdhPJxOSZQWQaD7Xy9QMio5uH4rPc0nm+jktnrRopzBxi/pIZUO6UY1zIT2IkBsPd8wPoT1a9ohZgmM2/Ef+CcJ+Gk= X-Received: by 2002:a2e:7e0d:: with SMTP id z13mr4525077ljc.12.1597540236077; Sat, 15 Aug 2020 18:10:36 -0700 (PDT) Original-Received: by 2002:a19:ed0f:0:0:0:0:0 with HTTP; Sat, 15 Aug 2020 18:10:35 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:185261 Archived-At: First the use case -- One has a number of things to do, in a limited amount of time. Using the command shell in emacs, give the first in a series of commands, one that will take a long time; after it finishes successfully, another command should be given; if it fails, it should be corrected and run again. And while it runs for a long time, one wants to be doing something else. So one arranges for an "echo control-G" command to make the thing beep when it is done, so one doesn't have to sit and watch the thing run through the command, watching for the first command to finish. I wrote this because I have a history of setting one command going, then going off to do something else, and then remembering an hour later "is that command done yet?" and looking to see that it finished a half hour before. Second -- I have little trouble withdrawing the suggestion, because the "shelisp" package is a more suitable implementation of my use case. The idea of an advice got to be a little sloppy of an implementation because the sound would come put before the call, or after the call, and not synchronized with the other characters. Thanks for your volunteer work in maintaining the emacs software! On 8/15/20, Stefan Kangas wrote: > Tom Baker writes: > >> I have a real need to have my command shells beep at me when their work is >> done, so I set it up so beeps are passed to the >> host system. >> >> In the function comint-carriage-motion I alter >> >> (defun comint-carriage-motion (start end) >> "Interpret carriage control characters in the region from START to END. >> Translate carriage return/linefeed sequences to linefeeds. >> Make single carriage returns delete to the beginning of the line. >> Make backspaces delete the previous character." >> >> to say >> >> (defun comint-carriage-motion (start end) >> "Interpret carriage control characters and bells in the region from >> START to END. >> Translate carriage return/linefeed sequences to linefeeds. >> Make single carriage returns delete to the beginning of the line. >> Make backspaces delete the previous character. Pass bells through." >> >> and the code chunk >> >> (cond ((= ch ?\b) ; CH = BS >> (delete-char 1) >> (if (> (point) lbeg) >> (delete-char -1))) >> ((= ch ?\n) >> (when delete-end ; CH = LF >> (if (< delete-end (point)) >> (delete-region lbeg delete-end)) >> (set-marker delete-end nil) >> (setq delete-end nil)) >> (forward-char 1) >> (setq lbeg (point))) >> (t ; CH = CR >> >> changed to >> >> (cond ((= ch ?\b) ; CH = BS >> (delete-char 1) >> (if (> (point) lbeg) >> (delete-char -1))) >> ((= ch ?\n) >> (when delete-end ; CH = LF >> (if (< delete-end (point)) >> (delete-region lbeg delete-end)) >> (set-marker delete-end nil) >> (setq delete-end nil)) >> (forward-char 1) >> (setq lbeg (point))) >> ((= ch ?\a) >> (forward-char 1) >> (ding) >> (sit-for 0.45 t)) ; CH = BL >> (t ; CH = CR > > So the difference here is that you would like to add a call to (ding)? > I'm not sure the addition you propose is suitable for general use. > > Perhaps you could explain the use-case here in a bit more detail? For > example, why can't you just add an advice to the function in question? > > Best regards, > Stefan Kangas >