all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to prevent ESC from closing frames
@ 2014-08-27  7:52 abdo.haji.ali
  2014-08-27 15:25 ` Dale Snell
       [not found] ` <mailman.7613.1409153217.1147.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 8+ messages in thread
From: abdo.haji.ali @ 2014-08-27  7:52 UTC (permalink / raw)
  To: help-gnu-emacs

Greetings,

Sometimes I press ESC one too many times and Emacs closes all my open frames.

How can I prevent this behaviour?
Thanks


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

* Re: How to prevent ESC from closing frames
  2014-08-27  7:52 How to prevent ESC from closing frames abdo.haji.ali
@ 2014-08-27 15:25 ` Dale Snell
       [not found] ` <mailman.7613.1409153217.1147.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 8+ messages in thread
From: Dale Snell @ 2014-08-27 15:25 UTC (permalink / raw)
  To: help-gnu-emacs

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

On Wed, 27 Aug 2014 00:52:03 -0700 (PDT)
abdo.haji.ali@gmail.com wrote:

> Greetings,
> 
> Sometimes I press ESC one too many times and Emacs closes all my open
> frames.
> 
> How can I prevent this behaviour?
> Thanks

I just tried that here and I do not get this behavior (Emacs
24.3.1).  It sounds like a configuration problem.  Does Emacs do
this if you start it as "emacs -Q"?

--Dale

--
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail? 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* Re: How to prevent ESC from closing frames
       [not found] ` <mailman.7613.1409153217.1147.help-gnu-emacs@gnu.org>
@ 2014-08-28  7:13   ` abdo.haji.ali
  2014-08-28 15:14     ` sokobania
                       ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: abdo.haji.ali @ 2014-08-28  7:13 UTC (permalink / raw)
  To: help-gnu-emacs


Yes, emacs -Q has the same behaviour

I wasn't very clear though. The frames close when pressing ESC three times in a row.
It's a habit of mine that is proving to be very inconvenient

Thanks


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

* Re: How to prevent ESC from closing frames
  2014-08-28  7:13   ` abdo.haji.ali
@ 2014-08-28 15:14     ` sokobania
  2014-08-28 20:37       ` Chris F.A. Johnson
  2014-08-28 18:03     ` Dale Snell
                       ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: sokobania @ 2014-08-28 15:14 UTC (permalink / raw)
  To: help-gnu-emacs

Le jeudi 28 août 2014 09:13:29 UTC+2, abdo.h...@gmail.com a écrit :
> Yes, emacs -Q has the same behaviour
> 
> I wasn't very clear though. The frames close when pressing ESC three times in a row.
> It's a habit of mine that is proving to be very inconvenient

What happens when you type:
  C-h k ESC ESC ESC


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

* Re: How to prevent ESC from closing frames
  2014-08-28  7:13   ` abdo.haji.ali
  2014-08-28 15:14     ` sokobania
@ 2014-08-28 18:03     ` Dale Snell
  2014-08-29  3:47     ` Yuri Khan
       [not found]     ` <mailman.7805.1409284030.1147.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 8+ messages in thread
From: Dale Snell @ 2014-08-28 18:03 UTC (permalink / raw)
  To: help-gnu-emacs

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

On Thu, 28 Aug 2014 00:13:29 -0700 (PDT)
abdo.haji.ali@gmail.com wrote:

> Yes, emacs -Q has the same behaviour
> 
> I wasn't very clear though. The frames close when pressing ESC three
> times in a row. It's a habit of mine that is proving to be very
> inconvenient

I wasn't very clear, either.  I tried three ESCs in a row, and all I
got was "ESC ESC" in the minibuffer, and the third one cleared it.

Perhaps your window manager is watching for three ESCs in a row, and
killing whatever window that sequence occurs in?  Sounds unlikely, I
know, but since "emacs -Q" fails, the problem most likely lies
elsewhere.  You might want to check your WM/DE settings to see if
there's a triple-ESC keyboard shortcut somewhere.

--Dale

--
Yet creeds mean very little, Coth answered the dark god, still
speaking almost gently.  The optimist proclaims that we live in
the best of all possible worlds; and the pessimist fears this is
true. 		-- James Branch Cabell, "The Silver Stallion"

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* Re: How to prevent ESC from closing frames
  2014-08-28 15:14     ` sokobania
@ 2014-08-28 20:37       ` Chris F.A. Johnson
  0 siblings, 0 replies; 8+ messages in thread
From: Chris F.A. Johnson @ 2014-08-28 20:37 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: sokobania

[-- Attachment #1: Type: TEXT/PLAIN, Size: 646 bytes --]

On Thu, 28 Aug 2014, sokobania@gmail.com wrote:

> Le jeudi 28 août 2014 09:13:29 UTC+2, abdo.h...@gmail.com a écrit :
>> Yes, emacs -Q has the same behaviour
>>
>> I wasn't very clear though. The frames close when pressing ESC three times in a row.
>> It's a habit of mine that is proving to be very inconvenient
>
> What happens when you type:
>  C-h k ESC ESC ESC

ESC ESC ESC (translated from <escape> <escape> <escape>) runs the
command keyboard-escape-quit, which is an interactive compiled Lisp
function in `simple.el'.

It is bound to M-ESC ESC.

(keyboard-escape-quit)

-- 
Chris F.A. Johnson, <http://cfajohnson.com>

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

* Re: How to prevent ESC from closing frames
  2014-08-28  7:13   ` abdo.haji.ali
  2014-08-28 15:14     ` sokobania
  2014-08-28 18:03     ` Dale Snell
@ 2014-08-29  3:47     ` Yuri Khan
       [not found]     ` <mailman.7805.1409284030.1147.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 8+ messages in thread
From: Yuri Khan @ 2014-08-29  3:47 UTC (permalink / raw)
  To: abdo.haji.ali; +Cc: help-gnu-emacs@gnu.org

On Thu, Aug 28, 2014 at 2:13 PM,  <abdo.haji.ali@gmail.com> wrote:
>
> Yes, emacs -Q has the same behaviour
>
> I wasn't very clear though. The frames close when pressing ESC three times in a row.
> It's a habit of mine that is proving to be very inconvenient

You use the term “frame” but actually mean Emacs windows, that’s why
some other replies misunderstand you.


C-h k ESC ESC ESC

```
ESC ESC ESC (translated from <escape> <escape> <escape>) runs the
command keyboard-escape-quit, which is an interactive compiled Lisp
function in `simple.el'.

It is bound to M-ESC ESC.

(keyboard-escape-quit)

Exit the current "mode" (in a generalized sense of the word).
This command can exit an interactive command such as `query-replace',
can clear out a prefix argument or a region,
can get out of the minibuffer or other recursive edit,
cancel the use of the current buffer (for special-purpose buffers),
**or go back to just one window (by deleting all but the selected window).**
```


I have looked at the source of this function and it does not check any
variables that could be used to control its features. So, no, you
can’t, at least not directly.

What you can do is to instead pick up the habit of pressing C-g to
cancel whatever you are doing, C-M-c to get out of recursive edit, and
the key you usually use to kill buffers for special-purpose buffers
too.

Or you can copy the source of keyboard-escape-quit, rename it to your
own name, delete the alternative that deals with deleting windows, and
bind your version to ESC ESC ESC.



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

* Re: How to prevent ESC from closing frames
       [not found]     ` <mailman.7805.1409284030.1147.help-gnu-emacs@gnu.org>
@ 2014-08-29  9:09       ` sokobania.01
  0 siblings, 0 replies; 8+ messages in thread
From: sokobania.01 @ 2014-08-29  9:09 UTC (permalink / raw)
  To: help-gnu-emacs

Le vendredi 29 août 2014 05:47:04 UTC+2, Yuri Khan a écrit :
> On Thu, Aug 28, 2014 at 2:13 PM,  abdo.haji.ali wrote:
> ESC ESC ESC (translated from <escape> <escape> <escape>) runs the
> command keyboard-escape-quit, which is an interactive compiled Lisp
> function in `simple.el'.
> 
> It is bound to M-ESC ESC.
> 
> (keyboard-escape-quit)
> 
> Exit the current "mode" (in a generalized sense of the word).
> This command can exit an interactive command such as `query-replace',
> can clear out a prefix argument or a region,
> can get out of the minibuffer or other recursive edit,
> cancel the use of the current buffer (for special-purpose buffers),
> **or go back to just one window (by deleting all but the selected window).**
> 
> I have looked at the source of this function and it does not check any
> variables that could be used to control its features. So, no, you
> can't, at least not directly.

Well, the code of keyboard-escape-quit tests the variable buffer-quit-function.

So something like the following could work... 
(while at least keeping some of keyboard-escape-quit functionalities):

(setq-default buffer-quit-function
 #'(lambda () (message "Are you trying to quit?")))

Or you might rebind ESC-ESC-ESC like this:

(define-key global-map "\e\e\e"
 #'(lambda () (interactive) (message "Are you trying to quit?")))


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

end of thread, other threads:[~2014-08-29  9:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-27  7:52 How to prevent ESC from closing frames abdo.haji.ali
2014-08-27 15:25 ` Dale Snell
     [not found] ` <mailman.7613.1409153217.1147.help-gnu-emacs@gnu.org>
2014-08-28  7:13   ` abdo.haji.ali
2014-08-28 15:14     ` sokobania
2014-08-28 20:37       ` Chris F.A. Johnson
2014-08-28 18:03     ` Dale Snell
2014-08-29  3:47     ` Yuri Khan
     [not found]     ` <mailman.7805.1409284030.1147.help-gnu-emacs@gnu.org>
2014-08-29  9:09       ` sokobania.01

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.