unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tom Baker <tombaker17@gmail.com>
To: Stefan Kangas <stefan@marxist.se>
Cc: 21652@debbugs.gnu.org
Subject: bug#21652: bell chars
Date: Sat, 15 Aug 2020 21:10:35 -0400	[thread overview]
Message-ID: <CAK9k5tc6yvYHK7mtuZasR5Km1gtqVMU0Pihsx7piQt=SwMOfAQ@mail.gmail.com> (raw)
In-Reply-To: <CADwFkmnHuzeGANQD0cfXFa4SG0M+mTVj034-+ACxM3ME_v=N7w@mail.gmail.com>

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 <stefan@marxist.se> wrote:
> Tom Baker <tombaker17@gmail.com> 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
>





  reply	other threads:[~2020-08-16  1:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08 22:55 bug#21652: bell chars Tom Baker
2020-08-15  6:26 ` Stefan Kangas
2020-08-16  1:10   ` Tom Baker [this message]
2020-08-16 14:23     ` Stefan Kangas
2020-08-16 14:56       ` Eli Zaretskii
2020-08-16 15:55         ` Tom Baker
2020-08-16 16:34           ` Andreas Schwab
2020-08-16 17:19             ` Tom Baker
2020-08-16 16:39           ` Eli Zaretskii
2020-08-16 17:10             ` Tom Baker
2020-08-16 17:29               ` Eli Zaretskii
2020-08-16 17:51                 ` Andreas Schwab
2020-08-16 18:11                   ` Eli Zaretskii
2022-03-22 18:15                     ` Lars Ingebrigtsen
2020-08-16 16:11       ` Tom Baker
2020-08-16 17:31         ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK9k5tc6yvYHK7mtuZasR5Km1gtqVMU0Pihsx7piQt=SwMOfAQ@mail.gmail.com' \
    --to=tombaker17@gmail.com \
    --cc=21652@debbugs.gnu.org \
    --cc=stefan@marxist.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).