all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Feature request: quiet keyboard-quit
@ 2002-05-22  8:09 Oliver Scholz
  2002-05-22 11:27 ` Kai Großjohann
  2002-05-22 15:53 ` Paul Jarc
  0 siblings, 2 replies; 4+ messages in thread
From: Oliver Scholz @ 2002-05-22  8:09 UTC (permalink / raw)


Hello!

Whenever I hit `C-g' Emacs beeps or -- in my case -- flashes. I'd like
to turn this of -- not in all cases, but solely for `keyboard-quit'.

I do know that I could set `ring-bell-function' to a function that
does nothing and get rid of all beeping or flashing. But this has the
unwelcome side-effect that I don't get a warning flash even in the
case of errors. So I don't get warned if something unexpected happens.

But I know what I am doing when I hit `C-g', so there is no need to
warn me -- while a fairly unobtrusive "Quit" in the echo area is fine.

Apparently `keyboard-quit' can't be defadviced "after" or "around":

(defadvice keyboard-quit (around do-not-beep! activate)
  (let ((ring-bell-function (lambda () nil)))
    ad-do-it))

... is futile.

`condition-case' does not trap the quit-signal and ...

(let ((inhibit-quit t))
  ... )

... is pointless when `keyboard-quit' gets a call from the lisp code.

So it seems that it is impossible to do this on the lisp customization
level. So here is my request:

Would you make this possible, please?

It would be very kind of you to give the user control over this by
setting a variable (`keyboard-quit-inhibit-warning' or so).

    -- Oliver


--
Oliver Scholz
Taunusstr. 25
60329 Frankfurt am Main
Tel. 069  97 40 99 42

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

* Re: Feature request: quiet keyboard-quit
  2002-05-22  8:09 Feature request: quiet keyboard-quit Oliver Scholz
@ 2002-05-22 11:27 ` Kai Großjohann
  2002-05-22 16:04   ` Oliver Scholz
  2002-05-22 15:53 ` Paul Jarc
  1 sibling, 1 reply; 4+ messages in thread
From: Kai Großjohann @ 2002-05-22 11:27 UTC (permalink / raw)


epameinondas@gmx.de (Oliver Scholz) writes:

> Whenever I hit `C-g' Emacs beeps or -- in my case -- flashes. I'd like
> to turn this of -- not in all cases, but solely for `keyboard-quit'.

Sometimes, you can also hit ESC ESC ESC to get a similar effect like
C-g.  But ESC ESC ESC only works when Emacs is waiting for input,
whereas C-g also interrupts Emacs while executing some Lisp code.

Could this be a (partial) workaround?

kai
-- 
Silence is foo!

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

* Re: Feature request: quiet keyboard-quit
  2002-05-22  8:09 Feature request: quiet keyboard-quit Oliver Scholz
  2002-05-22 11:27 ` Kai Großjohann
@ 2002-05-22 15:53 ` Paul Jarc
  1 sibling, 0 replies; 4+ messages in thread
From: Paul Jarc @ 2002-05-22 15:53 UTC (permalink / raw)


epameinondas@gmx.de (Oliver Scholz) wrote:
> Apparently `keyboard-quit' can't be defadviced "after" or "around":
>
> (defadvice keyboard-quit (around do-not-beep! activate)
>   (let ((ring-bell-function (lambda () nil)))
>     ad-do-it))
>
> .. is futile.

You could define a function like:
(defun my-keyboard-quit ()
  (interactive)
  (let ((ring-bell-function 'ignore))
    (keyboard-quit)))
Then bind that to C-g.

> .. is pointless when `keyboard-quit' gets a call from the lisp code.

You could redefine keyboard-quit itself to cover that case.  I'm not
sure whether byte-compiled code calling keyboard-quit would need to be
recompiled.


paul

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

* Re: Feature request: quiet keyboard-quit
  2002-05-22 11:27 ` Kai Großjohann
@ 2002-05-22 16:04   ` Oliver Scholz
  0 siblings, 0 replies; 4+ messages in thread
From: Oliver Scholz @ 2002-05-22 16:04 UTC (permalink / raw)


Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai writes:

>   [[ Mailed copy of news article posted to gnu.emacs.bug ]]

Yes, thanks for that. I do not read this group usually.

> epameinondas@gmx.de (Oliver Scholz) writes:
>
>> Whenever I hit `C-g' Emacs beeps or -- in my case -- flashes. I'd like
>> to turn this of -- not in all cases, but solely for `keyboard-quit'.
>
> Sometimes, you can also hit ESC ESC ESC to get a similar effect like
> C-g.  But ESC ESC ESC only works when Emacs is waiting for input,
> whereas C-g also interrupts Emacs while executing some Lisp code.
>
> Could this be a (partial) workaround?
[...]

Whee! But you don't suggest to bind `C-g' to `keyboard-escape-quit',
do you? The thought "Oh, oh, wrong command!" is bound to `C-g' on my
system. :-)

Actually there is no need for a _workaround_. The little flashes are
not _that_ annoying. At least they are less annoying than changing my
habits.

Thanks for the suggestion, anyway! I did not know that `ESC ESC ESC'
calls a different function than `C-g'. So at least I understand the
reason for the warning beep/flash that comes with `C-g':
`keyboard-quit' is the general "Stop this!"-command. There is no way
to distinguish between exiting command-input and stopping a running
function. The latter is considered to be some sort of an error. So I
admit that the flash/beep is a reasonable default.

But again: I know what I am doing when I hit `C-g'. So there is no
need to warn me, even if I, say, stop the loading of my .emacs with
it. The "Quit" in the echo area is enough for me.

It simply would be nice to customize this behaviour.

    'oliver

-- 
Oliver Scholz               3 Prairial an 210 de la Révolution
Taunusstr. 25               Liberté, Egalité, Fraternité!
60329 Frankfurt a. M.
Tel. (069) 97 40 99 42

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

end of thread, other threads:[~2002-05-22 16:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-22  8:09 Feature request: quiet keyboard-quit Oliver Scholz
2002-05-22 11:27 ` Kai Großjohann
2002-05-22 16:04   ` Oliver Scholz
2002-05-22 15:53 ` Paul Jarc

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.