Disallow closing last Emacs window via Window-Manager close button











up vote
3
down vote

favorite
1












I like to start Emacs as part of a login script and leave it running for the duration of my login session (which is typically weeks).



I have scripts to call emacs-client which will allow me to use a file-manager or Windows Explorer to locate files and right-click to edit them in Emacs.



I often end up with a lot of emacs windows (frames) open and I like to just be able to close them by clicking on the MS-Windows or KDE X button at the top-right.



The trouble is, if the window is the last one, this will shut down emacs which will lose all kinds of interesting history information.



As a work-around I use C-x 5 0 which won't let me close the last frame but this is often not as convenient as using the mouse



Does anyone know how to configure Emacs so that it can intercept the Window-Close button of the last frame to either request confirmation or simply disallow it?



On MS-Windows, disallowing closing of the last window may cause logoff to hang if emacs is still running but I'm not too worried about that.










share|improve this question




























    up vote
    3
    down vote

    favorite
    1












    I like to start Emacs as part of a login script and leave it running for the duration of my login session (which is typically weeks).



    I have scripts to call emacs-client which will allow me to use a file-manager or Windows Explorer to locate files and right-click to edit them in Emacs.



    I often end up with a lot of emacs windows (frames) open and I like to just be able to close them by clicking on the MS-Windows or KDE X button at the top-right.



    The trouble is, if the window is the last one, this will shut down emacs which will lose all kinds of interesting history information.



    As a work-around I use C-x 5 0 which won't let me close the last frame but this is often not as convenient as using the mouse



    Does anyone know how to configure Emacs so that it can intercept the Window-Close button of the last frame to either request confirmation or simply disallow it?



    On MS-Windows, disallowing closing of the last window may cause logoff to hang if emacs is still running but I'm not too worried about that.










    share|improve this question


























      up vote
      3
      down vote

      favorite
      1









      up vote
      3
      down vote

      favorite
      1






      1





      I like to start Emacs as part of a login script and leave it running for the duration of my login session (which is typically weeks).



      I have scripts to call emacs-client which will allow me to use a file-manager or Windows Explorer to locate files and right-click to edit them in Emacs.



      I often end up with a lot of emacs windows (frames) open and I like to just be able to close them by clicking on the MS-Windows or KDE X button at the top-right.



      The trouble is, if the window is the last one, this will shut down emacs which will lose all kinds of interesting history information.



      As a work-around I use C-x 5 0 which won't let me close the last frame but this is often not as convenient as using the mouse



      Does anyone know how to configure Emacs so that it can intercept the Window-Close button of the last frame to either request confirmation or simply disallow it?



      On MS-Windows, disallowing closing of the last window may cause logoff to hang if emacs is still running but I'm not too worried about that.










      share|improve this question















      I like to start Emacs as part of a login script and leave it running for the duration of my login session (which is typically weeks).



      I have scripts to call emacs-client which will allow me to use a file-manager or Windows Explorer to locate files and right-click to edit them in Emacs.



      I often end up with a lot of emacs windows (frames) open and I like to just be able to close them by clicking on the MS-Windows or KDE X button at the top-right.



      The trouble is, if the window is the last one, this will shut down emacs which will lose all kinds of interesting history information.



      As a work-around I use C-x 5 0 which won't let me close the last frame but this is often not as convenient as using the mouse



      Does anyone know how to configure Emacs so that it can intercept the Window-Close button of the last frame to either request confirmation or simply disallow it?



      On MS-Windows, disallowing closing of the last window may cause logoff to hang if emacs is still running but I'm not too worried about that.







      windows linux emacs elisp






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jul 11 '11 at 10:05

























      asked Jul 8 '11 at 10:11









      Adrian Pronk

      250214




      250214






















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          Two ways I can think of, but I'm sure there are more. The function that is called when you click the delete-frame button (upper-right corner [X] on Windows) is handle-delete-frame. You can advise that command or you can replace it as the function that handles that click by some other command.



          To advise it:




          (defadvice handle-delete-frame (around my-handle-delete-frame-advice activate)
          "Ask for confirmation before deleting the last frame"
          (let ((frame (posn-window (event-start event)))
          (numfrs (length (visible-frame-list))))
          (when (or (> numfrs 1) (y-or-n-p "Really exit Emacs? "))
          ad-do-it)))


          To replace it:




          (defun my-handle-delete-frame (event)
          "Ask for confirmation before deleting the last frame"
          (interactive "e")
          (let ((frame (posn-window (event-start event)))
          (numfrs (length (visible-frame-list))))
          (cond ((> numfrs 1) (delete-frame frame t))
          ((y-or-n-p "Really exit Emacs? ") (save-buffers-kill-emacs)))))

          (define-key special-event-map [delete-frame] 'my-handle-delete-frame)


          Don't do both of these; just do one of them.






          share|improve this answer





















          • This seems to work well on Windows. I'll try it out for a few days and also in KDE before I accept your answer.
            – Adrian Pronk
            Aug 28 '11 at 22:40










          • Option 1 prompts when I close the last visible frame. I think I should use frame-list rather than visible-frame-list to prompt at the last frame. Or is there some tricky problem with using frame-list?
            – Adrian Pronk
            Aug 29 '11 at 9:58










          • Yes, you can use frame-list -- that makes more sense, actually.
            – Drew
            Sep 5 '11 at 23:15


















          up vote
          3
          down vote













          You should use the emacs daemon: launch Emacs as



                 emacs -d


          Then Emacs will be launch in background, waiting for emacsclient to open a new windows. The Emacs daemon won't close when its last windows will be closed.






          share|improve this answer

















          • 1




            It looks like I'll be able to use emacs --daemon on Linux but NTEmacs doesn't seem to support that option. I'll keep at it...
            – Adrian Pronk
            Jul 11 '11 at 10:04


















          up vote
          0
          down vote













          And, here's an update which uses Drew's 'my-handle-delete-frame' function, in order to remove the 'Really kill emacs' pop-up necessary in the original version, and enable one to simply exit when the 'X button' is now clicked.



          ;; The function that is called when you click the delete-frame button
          ;; (upper-right corner [X] on Windows) is handle-delete-frame. You can advise
          ;; that command or you can replace it with a function that handles that click
          ;; via some other command. Therefore, whenever the 'X button' is now clicked
          ;; the event now is handled here, and invokes kill-emacs, which replaced
          ;; previous code. The user no longer has to deal w/'Really exit emacs' pop-up.
          (defun exit-emacs-via-del-frm (event)
          "No longer ask for confirmation before deleting the last frame; simply exit"
          (interactive "e")
          (let ((frame (posn-window (event-start event)))
          (numfrs (length (visible-frame-list))))
          (kill-emacs) ) )

          (define-key special-event-map [delete-frame] 'exit-emacs-via-del-frm)





          share|improve this answer



















          • 1




            It's not clear to me what you are doing here, or even what you are trying to accomplish.  It seems like you are just restoring the default behavior; i.e., cancelling out Drew's answer. Please do not respond in comments; edit your answer to make it clearer and more complete.
            – Scott
            Dec 3 at 3:50











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f308045%2fdisallow-closing-last-emacs-window-via-window-manager-close-button%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          3 Answers
          3






          active

          oldest

          votes








          3 Answers
          3






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          4
          down vote



          accepted










          Two ways I can think of, but I'm sure there are more. The function that is called when you click the delete-frame button (upper-right corner [X] on Windows) is handle-delete-frame. You can advise that command or you can replace it as the function that handles that click by some other command.



          To advise it:




          (defadvice handle-delete-frame (around my-handle-delete-frame-advice activate)
          "Ask for confirmation before deleting the last frame"
          (let ((frame (posn-window (event-start event)))
          (numfrs (length (visible-frame-list))))
          (when (or (> numfrs 1) (y-or-n-p "Really exit Emacs? "))
          ad-do-it)))


          To replace it:




          (defun my-handle-delete-frame (event)
          "Ask for confirmation before deleting the last frame"
          (interactive "e")
          (let ((frame (posn-window (event-start event)))
          (numfrs (length (visible-frame-list))))
          (cond ((> numfrs 1) (delete-frame frame t))
          ((y-or-n-p "Really exit Emacs? ") (save-buffers-kill-emacs)))))

          (define-key special-event-map [delete-frame] 'my-handle-delete-frame)


          Don't do both of these; just do one of them.






          share|improve this answer





















          • This seems to work well on Windows. I'll try it out for a few days and also in KDE before I accept your answer.
            – Adrian Pronk
            Aug 28 '11 at 22:40










          • Option 1 prompts when I close the last visible frame. I think I should use frame-list rather than visible-frame-list to prompt at the last frame. Or is there some tricky problem with using frame-list?
            – Adrian Pronk
            Aug 29 '11 at 9:58










          • Yes, you can use frame-list -- that makes more sense, actually.
            – Drew
            Sep 5 '11 at 23:15















          up vote
          4
          down vote



          accepted










          Two ways I can think of, but I'm sure there are more. The function that is called when you click the delete-frame button (upper-right corner [X] on Windows) is handle-delete-frame. You can advise that command or you can replace it as the function that handles that click by some other command.



          To advise it:




          (defadvice handle-delete-frame (around my-handle-delete-frame-advice activate)
          "Ask for confirmation before deleting the last frame"
          (let ((frame (posn-window (event-start event)))
          (numfrs (length (visible-frame-list))))
          (when (or (> numfrs 1) (y-or-n-p "Really exit Emacs? "))
          ad-do-it)))


          To replace it:




          (defun my-handle-delete-frame (event)
          "Ask for confirmation before deleting the last frame"
          (interactive "e")
          (let ((frame (posn-window (event-start event)))
          (numfrs (length (visible-frame-list))))
          (cond ((> numfrs 1) (delete-frame frame t))
          ((y-or-n-p "Really exit Emacs? ") (save-buffers-kill-emacs)))))

          (define-key special-event-map [delete-frame] 'my-handle-delete-frame)


          Don't do both of these; just do one of them.






          share|improve this answer





















          • This seems to work well on Windows. I'll try it out for a few days and also in KDE before I accept your answer.
            – Adrian Pronk
            Aug 28 '11 at 22:40










          • Option 1 prompts when I close the last visible frame. I think I should use frame-list rather than visible-frame-list to prompt at the last frame. Or is there some tricky problem with using frame-list?
            – Adrian Pronk
            Aug 29 '11 at 9:58










          • Yes, you can use frame-list -- that makes more sense, actually.
            – Drew
            Sep 5 '11 at 23:15













          up vote
          4
          down vote



          accepted







          up vote
          4
          down vote



          accepted






          Two ways I can think of, but I'm sure there are more. The function that is called when you click the delete-frame button (upper-right corner [X] on Windows) is handle-delete-frame. You can advise that command or you can replace it as the function that handles that click by some other command.



          To advise it:




          (defadvice handle-delete-frame (around my-handle-delete-frame-advice activate)
          "Ask for confirmation before deleting the last frame"
          (let ((frame (posn-window (event-start event)))
          (numfrs (length (visible-frame-list))))
          (when (or (> numfrs 1) (y-or-n-p "Really exit Emacs? "))
          ad-do-it)))


          To replace it:




          (defun my-handle-delete-frame (event)
          "Ask for confirmation before deleting the last frame"
          (interactive "e")
          (let ((frame (posn-window (event-start event)))
          (numfrs (length (visible-frame-list))))
          (cond ((> numfrs 1) (delete-frame frame t))
          ((y-or-n-p "Really exit Emacs? ") (save-buffers-kill-emacs)))))

          (define-key special-event-map [delete-frame] 'my-handle-delete-frame)


          Don't do both of these; just do one of them.






          share|improve this answer












          Two ways I can think of, but I'm sure there are more. The function that is called when you click the delete-frame button (upper-right corner [X] on Windows) is handle-delete-frame. You can advise that command or you can replace it as the function that handles that click by some other command.



          To advise it:




          (defadvice handle-delete-frame (around my-handle-delete-frame-advice activate)
          "Ask for confirmation before deleting the last frame"
          (let ((frame (posn-window (event-start event)))
          (numfrs (length (visible-frame-list))))
          (when (or (> numfrs 1) (y-or-n-p "Really exit Emacs? "))
          ad-do-it)))


          To replace it:




          (defun my-handle-delete-frame (event)
          "Ask for confirmation before deleting the last frame"
          (interactive "e")
          (let ((frame (posn-window (event-start event)))
          (numfrs (length (visible-frame-list))))
          (cond ((> numfrs 1) (delete-frame frame t))
          ((y-or-n-p "Really exit Emacs? ") (save-buffers-kill-emacs)))))

          (define-key special-event-map [delete-frame] 'my-handle-delete-frame)


          Don't do both of these; just do one of them.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 26 '11 at 14:48









          Drew

          582




          582












          • This seems to work well on Windows. I'll try it out for a few days and also in KDE before I accept your answer.
            – Adrian Pronk
            Aug 28 '11 at 22:40










          • Option 1 prompts when I close the last visible frame. I think I should use frame-list rather than visible-frame-list to prompt at the last frame. Or is there some tricky problem with using frame-list?
            – Adrian Pronk
            Aug 29 '11 at 9:58










          • Yes, you can use frame-list -- that makes more sense, actually.
            – Drew
            Sep 5 '11 at 23:15


















          • This seems to work well on Windows. I'll try it out for a few days and also in KDE before I accept your answer.
            – Adrian Pronk
            Aug 28 '11 at 22:40










          • Option 1 prompts when I close the last visible frame. I think I should use frame-list rather than visible-frame-list to prompt at the last frame. Or is there some tricky problem with using frame-list?
            – Adrian Pronk
            Aug 29 '11 at 9:58










          • Yes, you can use frame-list -- that makes more sense, actually.
            – Drew
            Sep 5 '11 at 23:15
















          This seems to work well on Windows. I'll try it out for a few days and also in KDE before I accept your answer.
          – Adrian Pronk
          Aug 28 '11 at 22:40




          This seems to work well on Windows. I'll try it out for a few days and also in KDE before I accept your answer.
          – Adrian Pronk
          Aug 28 '11 at 22:40












          Option 1 prompts when I close the last visible frame. I think I should use frame-list rather than visible-frame-list to prompt at the last frame. Or is there some tricky problem with using frame-list?
          – Adrian Pronk
          Aug 29 '11 at 9:58




          Option 1 prompts when I close the last visible frame. I think I should use frame-list rather than visible-frame-list to prompt at the last frame. Or is there some tricky problem with using frame-list?
          – Adrian Pronk
          Aug 29 '11 at 9:58












          Yes, you can use frame-list -- that makes more sense, actually.
          – Drew
          Sep 5 '11 at 23:15




          Yes, you can use frame-list -- that makes more sense, actually.
          – Drew
          Sep 5 '11 at 23:15












          up vote
          3
          down vote













          You should use the emacs daemon: launch Emacs as



                 emacs -d


          Then Emacs will be launch in background, waiting for emacsclient to open a new windows. The Emacs daemon won't close when its last windows will be closed.






          share|improve this answer

















          • 1




            It looks like I'll be able to use emacs --daemon on Linux but NTEmacs doesn't seem to support that option. I'll keep at it...
            – Adrian Pronk
            Jul 11 '11 at 10:04















          up vote
          3
          down vote













          You should use the emacs daemon: launch Emacs as



                 emacs -d


          Then Emacs will be launch in background, waiting for emacsclient to open a new windows. The Emacs daemon won't close when its last windows will be closed.






          share|improve this answer

















          • 1




            It looks like I'll be able to use emacs --daemon on Linux but NTEmacs doesn't seem to support that option. I'll keep at it...
            – Adrian Pronk
            Jul 11 '11 at 10:04













          up vote
          3
          down vote










          up vote
          3
          down vote









          You should use the emacs daemon: launch Emacs as



                 emacs -d


          Then Emacs will be launch in background, waiting for emacsclient to open a new windows. The Emacs daemon won't close when its last windows will be closed.






          share|improve this answer












          You should use the emacs daemon: launch Emacs as



                 emacs -d


          Then Emacs will be launch in background, waiting for emacsclient to open a new windows. The Emacs daemon won't close when its last windows will be closed.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jul 8 '11 at 11:09









          Rémi

          1,212710




          1,212710








          • 1




            It looks like I'll be able to use emacs --daemon on Linux but NTEmacs doesn't seem to support that option. I'll keep at it...
            – Adrian Pronk
            Jul 11 '11 at 10:04














          • 1




            It looks like I'll be able to use emacs --daemon on Linux but NTEmacs doesn't seem to support that option. I'll keep at it...
            – Adrian Pronk
            Jul 11 '11 at 10:04








          1




          1




          It looks like I'll be able to use emacs --daemon on Linux but NTEmacs doesn't seem to support that option. I'll keep at it...
          – Adrian Pronk
          Jul 11 '11 at 10:04




          It looks like I'll be able to use emacs --daemon on Linux but NTEmacs doesn't seem to support that option. I'll keep at it...
          – Adrian Pronk
          Jul 11 '11 at 10:04










          up vote
          0
          down vote













          And, here's an update which uses Drew's 'my-handle-delete-frame' function, in order to remove the 'Really kill emacs' pop-up necessary in the original version, and enable one to simply exit when the 'X button' is now clicked.



          ;; The function that is called when you click the delete-frame button
          ;; (upper-right corner [X] on Windows) is handle-delete-frame. You can advise
          ;; that command or you can replace it with a function that handles that click
          ;; via some other command. Therefore, whenever the 'X button' is now clicked
          ;; the event now is handled here, and invokes kill-emacs, which replaced
          ;; previous code. The user no longer has to deal w/'Really exit emacs' pop-up.
          (defun exit-emacs-via-del-frm (event)
          "No longer ask for confirmation before deleting the last frame; simply exit"
          (interactive "e")
          (let ((frame (posn-window (event-start event)))
          (numfrs (length (visible-frame-list))))
          (kill-emacs) ) )

          (define-key special-event-map [delete-frame] 'exit-emacs-via-del-frm)





          share|improve this answer



















          • 1




            It's not clear to me what you are doing here, or even what you are trying to accomplish.  It seems like you are just restoring the default behavior; i.e., cancelling out Drew's answer. Please do not respond in comments; edit your answer to make it clearer and more complete.
            – Scott
            Dec 3 at 3:50















          up vote
          0
          down vote













          And, here's an update which uses Drew's 'my-handle-delete-frame' function, in order to remove the 'Really kill emacs' pop-up necessary in the original version, and enable one to simply exit when the 'X button' is now clicked.



          ;; The function that is called when you click the delete-frame button
          ;; (upper-right corner [X] on Windows) is handle-delete-frame. You can advise
          ;; that command or you can replace it with a function that handles that click
          ;; via some other command. Therefore, whenever the 'X button' is now clicked
          ;; the event now is handled here, and invokes kill-emacs, which replaced
          ;; previous code. The user no longer has to deal w/'Really exit emacs' pop-up.
          (defun exit-emacs-via-del-frm (event)
          "No longer ask for confirmation before deleting the last frame; simply exit"
          (interactive "e")
          (let ((frame (posn-window (event-start event)))
          (numfrs (length (visible-frame-list))))
          (kill-emacs) ) )

          (define-key special-event-map [delete-frame] 'exit-emacs-via-del-frm)





          share|improve this answer



















          • 1




            It's not clear to me what you are doing here, or even what you are trying to accomplish.  It seems like you are just restoring the default behavior; i.e., cancelling out Drew's answer. Please do not respond in comments; edit your answer to make it clearer and more complete.
            – Scott
            Dec 3 at 3:50













          up vote
          0
          down vote










          up vote
          0
          down vote









          And, here's an update which uses Drew's 'my-handle-delete-frame' function, in order to remove the 'Really kill emacs' pop-up necessary in the original version, and enable one to simply exit when the 'X button' is now clicked.



          ;; The function that is called when you click the delete-frame button
          ;; (upper-right corner [X] on Windows) is handle-delete-frame. You can advise
          ;; that command or you can replace it with a function that handles that click
          ;; via some other command. Therefore, whenever the 'X button' is now clicked
          ;; the event now is handled here, and invokes kill-emacs, which replaced
          ;; previous code. The user no longer has to deal w/'Really exit emacs' pop-up.
          (defun exit-emacs-via-del-frm (event)
          "No longer ask for confirmation before deleting the last frame; simply exit"
          (interactive "e")
          (let ((frame (posn-window (event-start event)))
          (numfrs (length (visible-frame-list))))
          (kill-emacs) ) )

          (define-key special-event-map [delete-frame] 'exit-emacs-via-del-frm)





          share|improve this answer














          And, here's an update which uses Drew's 'my-handle-delete-frame' function, in order to remove the 'Really kill emacs' pop-up necessary in the original version, and enable one to simply exit when the 'X button' is now clicked.



          ;; The function that is called when you click the delete-frame button
          ;; (upper-right corner [X] on Windows) is handle-delete-frame. You can advise
          ;; that command or you can replace it with a function that handles that click
          ;; via some other command. Therefore, whenever the 'X button' is now clicked
          ;; the event now is handled here, and invokes kill-emacs, which replaced
          ;; previous code. The user no longer has to deal w/'Really exit emacs' pop-up.
          (defun exit-emacs-via-del-frm (event)
          "No longer ask for confirmation before deleting the last frame; simply exit"
          (interactive "e")
          (let ((frame (posn-window (event-start event)))
          (numfrs (length (visible-frame-list))))
          (kill-emacs) ) )

          (define-key special-event-map [delete-frame] 'exit-emacs-via-del-frm)






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 3 at 1:22









          Scott

          15.5k113889




          15.5k113889










          answered Dec 3 at 1:13









          odoncaoa

          1




          1








          • 1




            It's not clear to me what you are doing here, or even what you are trying to accomplish.  It seems like you are just restoring the default behavior; i.e., cancelling out Drew's answer. Please do not respond in comments; edit your answer to make it clearer and more complete.
            – Scott
            Dec 3 at 3:50














          • 1




            It's not clear to me what you are doing here, or even what you are trying to accomplish.  It seems like you are just restoring the default behavior; i.e., cancelling out Drew's answer. Please do not respond in comments; edit your answer to make it clearer and more complete.
            – Scott
            Dec 3 at 3:50








          1




          1




          It's not clear to me what you are doing here, or even what you are trying to accomplish.  It seems like you are just restoring the default behavior; i.e., cancelling out Drew's answer. Please do not respond in comments; edit your answer to make it clearer and more complete.
          – Scott
          Dec 3 at 3:50




          It's not clear to me what you are doing here, or even what you are trying to accomplish.  It seems like you are just restoring the default behavior; i.e., cancelling out Drew's answer. Please do not respond in comments; edit your answer to make it clearer and more complete.
          – Scott
          Dec 3 at 3:50


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f308045%2fdisallow-closing-last-emacs-window-via-window-manager-close-button%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Mouse cursor on multiple screens with different PPI

          Agildo Ribeiro

          Sometime when accessing a menu: “Ubuntu 16.04 has experienced an internal error”