From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#21652: bell chars Date: Fri, 14 Aug 2020 23:26:13 -0700 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="19528"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 21652@debbugs.gnu.org To: Tom Baker Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 15 08:27:13 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 1k6pep-0004w0-Ua for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Aug 2020 08:27:11 +0200 Original-Received: from localhost ([::1]:52114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6peo-0002cT-JO for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Aug 2020 02:27:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6peh-0002cL-Aa for bug-gnu-emacs@gnu.org; Sat, 15 Aug 2020 02:27:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42674) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6peh-0000O1-1N for bug-gnu-emacs@gnu.org; Sat, 15 Aug 2020 02:27:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k6peg-0004v0-Uu for bug-gnu-emacs@gnu.org; Sat, 15 Aug 2020 02:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Aug 2020 06:27:02 +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.159747278318836 (code B ref 21652); Sat, 15 Aug 2020 06:27:02 +0000 Original-Received: (at 21652) by debbugs.gnu.org; 15 Aug 2020 06:26:23 +0000 Original-Received: from localhost ([127.0.0.1]:54219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k6pe2-0004tk-No for submit@debbugs.gnu.org; Sat, 15 Aug 2020 02:26:22 -0400 Original-Received: from mail-yb1-f196.google.com ([209.85.219.196]:35512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k6pdz-0004tK-EN for 21652@debbugs.gnu.org; Sat, 15 Aug 2020 02:26:21 -0400 Original-Received: by mail-yb1-f196.google.com with SMTP id y134so6419801yby.2 for <21652@debbugs.gnu.org>; Fri, 14 Aug 2020 23:26:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=0GGh2sxsP+OIefnIpzoXipZNNvDh/nUW92saakT9rWg=; b=Pke2qzhkkfksUl1+njoIhUEdcIv0UaQ2eStYYnF//Eabb7ZZuYGLWKa3IeEnC/ccUr umF0FMcsORSo7Seu9LsfJYIdimmNtfBXgIvt0cNYjdWqhWkqZCFoNSi1jvkqJOqUZwwC oAEE0o3AhnZI1C56j1MFJtVUmuOa15wL/2NRozQ5NULXn6c/4h9aaReWifGzsSYGnnul hIJXj2ssOSJOTgMvyL2xsVVEaIKK3VQwRcA+ivf1i0udd87CMrv/DJI4SRIv9v6wEuNm AGr9xN9xtdKVq0eMrqvcQu3NmiU4XV5r24XLfoNDoE2LZXQk1Tf60P19M7heFWCq887F xWDQ== X-Gm-Message-State: AOAM530/UyyTwerBJsZfdCAg3boTBWAw6/xcYE+JarbP+yttfHolFB6J K+guqPJtazfHrxWbjrx3G9RDnz9GkNL+SSlT+L8= X-Google-Smtp-Source: ABdhPJw08CJin6kDQeyjL2JXqnSOak5wbOG9E0w/C3Z9ZU1X3KSgJNi4WEFCz8ucgfF/ow6KqDMzLBvkCHC/CoSk5oU= X-Received: by 2002:a25:7007:: with SMTP id l7mr8145657ybc.85.1597472774014; Fri, 14 Aug 2020 23:26:14 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 14 Aug 2020 23:26:13 -0700 In-Reply-To: (Tom Baker's message of "Thu, 8 Oct 2015 18:55:25 -0400") 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:185195 Archived-At: 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