Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSX layer - command+w should kill the frame if only one window remains. #4246

Closed
jordwalke opened this issue Dec 20, 2015 · 3 comments
Closed
Labels
Enhancement ☺ Found work-around Key Bindings stale marked as a stale issue/pr (usually by a bot)

Comments

@jordwalke
Copy link

It would be very natural to osx users if command+w would kill the frame if only a single window remains.
(Super new to emacs, I apologize if I'm not using the correct terminology here).

@ngortheone
Copy link

I would like to disable command+w in emacs completely, but I don't know how.
Often when switching windows with SPC w I can hit command instead of space and it will kill my frame!

@nixmaniack
Copy link
Contributor

Given the lack of traction on this issue, it might seem that this behaviour is not much desired by everyone. Hence, instead of proposing an enhancement to Spacemacs, here's a piece of code that'll achieve what you want.

(defun delete-frame-if-one-window (orig-fun &rest args)
  (if (one-window-p t)
      (delete-frame)
    (apply orig-fun args)))

(advice-add 'delete-window :around #'delete-frame-if-one-window)

@github-actions
Copy link

github-actions bot commented Mar 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ☺ Found work-around Key Bindings stale marked as a stale issue/pr (usually by a bot)
Projects
None yet
Development

No branches or pull requests

5 participants