all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#21652: bell chars
@ 2015-10-08 22:55 Tom Baker
  2020-08-15  6:26 ` Stefan Kangas
  0 siblings, 1 reply; 16+ messages in thread
From: Tom Baker @ 2015-10-08 22:55 UTC (permalink / raw)
  To: 21652

[-- Attachment #1: Type: text/plain, Size: 2577 bytes --]

Please excuse me if this has been suggested before for adding to Emacs.



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



Again, please excuse me if this has been suggested as a feature before.


God's Blessings,

Tom Baker

[-- Attachment #2: Type: text/html, Size: 10383 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-03-22 18:15 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.