Emacs - kill buffer without prompt The Next CEO of Stack Overflowstrange characters in emacs...

Proper way to express "He disappeared them"

Find non-case sensitive string in a mixed list of elements?

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

0 rank tensor vs 1D vector

How to count occurrences of text in a file?

What is the value of α and β in a triangle?

RigExpert AA-35 - Interpreting The Information

Does increasing your ability score affect your main stat?

What flight has the highest ratio of time difference to flight time?

Why is my new battery behaving weirdly?

Why do airplanes bank sharply to the right after air-to-air refueling?

Easy to read palindrome checker

Are police here, aren't itthey?

If Nick Fury and Coulson already knew about aliens (Kree and Skrull) why did they wait until Thor's appearance to start making weapons?

Does Germany produce more waste than the US?

Axiom Schema vs Axiom

Why does standard notation not preserve intervals (visually)

Where do students learn to solve polynomial equations these days?

Unclear about dynamic binding

Can we say or write : "No, it'sn't"?

Flying from Cape Town to England and return to another province

How to get from Geneva Airport to Metabief?

Is it professional to write unrelated content in an almost-empty email?

Is a distribution that is normal, but highly skewed considered Gaussian?



Emacs - kill buffer without prompt



The Next CEO of Stack Overflowstrange characters in emacs shell bufferHow to set the exit status for emacsclientCan I display emacs buffer modification history?get emacs 23 buffer-list behavior in emacs 24?Kill compilation buffer after successHow can I kill the buffer when I exit emacs clientemacs buffer color control charactersCannot kill emacs with M-x kill-emacsEmacs initial anonymous bufferEmacs command to kill other buffer and window












15















I'm wondering how it can be done, so Emacs doesn't pop the prompt asking me whether I really want to kill current buffer with C-x k shortcut.



Interesting thing is that same action done via toolbar kills buffer instantly without prompting the user. Any solution? Thank you.










share|improve this question



























    15















    I'm wondering how it can be done, so Emacs doesn't pop the prompt asking me whether I really want to kill current buffer with C-x k shortcut.



    Interesting thing is that same action done via toolbar kills buffer instantly without prompting the user. Any solution? Thank you.










    share|improve this question

























      15












      15








      15


      1






      I'm wondering how it can be done, so Emacs doesn't pop the prompt asking me whether I really want to kill current buffer with C-x k shortcut.



      Interesting thing is that same action done via toolbar kills buffer instantly without prompting the user. Any solution? Thank you.










      share|improve this question














      I'm wondering how it can be done, so Emacs doesn't pop the prompt asking me whether I really want to kill current buffer with C-x k shortcut.



      Interesting thing is that same action done via toolbar kills buffer instantly without prompting the user. Any solution? Thank you.







      emacs






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 7 '11 at 18:47









      JarekJarek

      71621228




      71621228






















          4 Answers
          4






          active

          oldest

          votes


















          14














          By default, Emacs doesn't ask you if you want to kill the buffer. It does ask you which buffer you want to kill.



          If you don't want to be asked which buffer you want to kill, you can use this:



          (global-set-key (kbd "C-x k") 'kill-this-buffer)


          If you're being prompted for confirmation, then there's something in your .emacs (or the site specific initialziation). Try running emacs -q to check Emacs w/out your .emacs.



          Note: Verified with Emacs 23.2.






          share|improve this answer





















          • 1





            'kill-this-buffer is part of emacs and that should be used instead.

            – Jaseem
            Feb 26 '15 at 19:02



















          10














          You can find out what that menu entry does with C-h k and then clicking on the entry. It turns out to be a command named kill-this-buffer.



          Then you can bind that command to a key combination:



          (global-set-key "C-xk" 'kill-this-buffer)





          share|improve this answer































            2














            I use this



            (global-set-key (kbd "C-x k") (lambda ()
            (interactive)
            (kill-buffer (buffer-name))))





            share|improve this answer
























            • Minor improvement: (kill-buffer (current-buffer))

              – Jaseem
              Feb 26 '15 at 19:01



















            0














            answered here: https://stackoverflow.com/questions/6467002/how-to-kill-buffer-in-emacs-without-answering-confirmation



            (defun volatile-kill-buffer ()
            "Kill current buffer unconditionally."
            (interactive)
            (let ((buffer-modified-p nil))
            (kill-buffer (current-buffer))))

            (global-set-key (kbd "C-x k") 'volatile-kill-buffer) ;; Unconditionally kill unmodified buffers.




            share
























              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',
              autoActivateHeartbeat: false,
              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%2f354849%2femacs-kill-buffer-without-prompt%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              4 Answers
              4






              active

              oldest

              votes








              4 Answers
              4






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              14














              By default, Emacs doesn't ask you if you want to kill the buffer. It does ask you which buffer you want to kill.



              If you don't want to be asked which buffer you want to kill, you can use this:



              (global-set-key (kbd "C-x k") 'kill-this-buffer)


              If you're being prompted for confirmation, then there's something in your .emacs (or the site specific initialziation). Try running emacs -q to check Emacs w/out your .emacs.



              Note: Verified with Emacs 23.2.






              share|improve this answer





















              • 1





                'kill-this-buffer is part of emacs and that should be used instead.

                – Jaseem
                Feb 26 '15 at 19:02
















              14














              By default, Emacs doesn't ask you if you want to kill the buffer. It does ask you which buffer you want to kill.



              If you don't want to be asked which buffer you want to kill, you can use this:



              (global-set-key (kbd "C-x k") 'kill-this-buffer)


              If you're being prompted for confirmation, then there's something in your .emacs (or the site specific initialziation). Try running emacs -q to check Emacs w/out your .emacs.



              Note: Verified with Emacs 23.2.






              share|improve this answer





















              • 1





                'kill-this-buffer is part of emacs and that should be used instead.

                – Jaseem
                Feb 26 '15 at 19:02














              14












              14








              14







              By default, Emacs doesn't ask you if you want to kill the buffer. It does ask you which buffer you want to kill.



              If you don't want to be asked which buffer you want to kill, you can use this:



              (global-set-key (kbd "C-x k") 'kill-this-buffer)


              If you're being prompted for confirmation, then there's something in your .emacs (or the site specific initialziation). Try running emacs -q to check Emacs w/out your .emacs.



              Note: Verified with Emacs 23.2.






              share|improve this answer















              By default, Emacs doesn't ask you if you want to kill the buffer. It does ask you which buffer you want to kill.



              If you don't want to be asked which buffer you want to kill, you can use this:



              (global-set-key (kbd "C-x k") 'kill-this-buffer)


              If you're being prompted for confirmation, then there's something in your .emacs (or the site specific initialziation). Try running emacs -q to check Emacs w/out your .emacs.



              Note: Verified with Emacs 23.2.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Feb 27 '15 at 20:11

























              answered Nov 7 '11 at 20:10









              Trey JacksonTrey Jackson

              3,5411722




              3,5411722








              • 1





                'kill-this-buffer is part of emacs and that should be used instead.

                – Jaseem
                Feb 26 '15 at 19:02














              • 1





                'kill-this-buffer is part of emacs and that should be used instead.

                – Jaseem
                Feb 26 '15 at 19:02








              1




              1





              'kill-this-buffer is part of emacs and that should be used instead.

              – Jaseem
              Feb 26 '15 at 19:02





              'kill-this-buffer is part of emacs and that should be used instead.

              – Jaseem
              Feb 26 '15 at 19:02













              10














              You can find out what that menu entry does with C-h k and then clicking on the entry. It turns out to be a command named kill-this-buffer.



              Then you can bind that command to a key combination:



              (global-set-key "C-xk" 'kill-this-buffer)





              share|improve this answer




























                10














                You can find out what that menu entry does with C-h k and then clicking on the entry. It turns out to be a command named kill-this-buffer.



                Then you can bind that command to a key combination:



                (global-set-key "C-xk" 'kill-this-buffer)





                share|improve this answer


























                  10












                  10








                  10







                  You can find out what that menu entry does with C-h k and then clicking on the entry. It turns out to be a command named kill-this-buffer.



                  Then you can bind that command to a key combination:



                  (global-set-key "C-xk" 'kill-this-buffer)





                  share|improve this answer













                  You can find out what that menu entry does with C-h k and then clicking on the entry. It turns out to be a command named kill-this-buffer.



                  Then you can bind that command to a key combination:



                  (global-set-key "C-xk" 'kill-this-buffer)






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 8 '11 at 12:37









                  nschumnschum

                  280112




                  280112























                      2














                      I use this



                      (global-set-key (kbd "C-x k") (lambda ()
                      (interactive)
                      (kill-buffer (buffer-name))))





                      share|improve this answer
























                      • Minor improvement: (kill-buffer (current-buffer))

                        – Jaseem
                        Feb 26 '15 at 19:01
















                      2














                      I use this



                      (global-set-key (kbd "C-x k") (lambda ()
                      (interactive)
                      (kill-buffer (buffer-name))))





                      share|improve this answer
























                      • Minor improvement: (kill-buffer (current-buffer))

                        – Jaseem
                        Feb 26 '15 at 19:01














                      2












                      2








                      2







                      I use this



                      (global-set-key (kbd "C-x k") (lambda ()
                      (interactive)
                      (kill-buffer (buffer-name))))





                      share|improve this answer













                      I use this



                      (global-set-key (kbd "C-x k") (lambda ()
                      (interactive)
                      (kill-buffer (buffer-name))))






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Nov 7 '11 at 21:23









                      kindaherokindahero

                      1,053710




                      1,053710













                      • Minor improvement: (kill-buffer (current-buffer))

                        – Jaseem
                        Feb 26 '15 at 19:01



















                      • Minor improvement: (kill-buffer (current-buffer))

                        – Jaseem
                        Feb 26 '15 at 19:01

















                      Minor improvement: (kill-buffer (current-buffer))

                      – Jaseem
                      Feb 26 '15 at 19:01





                      Minor improvement: (kill-buffer (current-buffer))

                      – Jaseem
                      Feb 26 '15 at 19:01











                      0














                      answered here: https://stackoverflow.com/questions/6467002/how-to-kill-buffer-in-emacs-without-answering-confirmation



                      (defun volatile-kill-buffer ()
                      "Kill current buffer unconditionally."
                      (interactive)
                      (let ((buffer-modified-p nil))
                      (kill-buffer (current-buffer))))

                      (global-set-key (kbd "C-x k") 'volatile-kill-buffer) ;; Unconditionally kill unmodified buffers.




                      share




























                        0














                        answered here: https://stackoverflow.com/questions/6467002/how-to-kill-buffer-in-emacs-without-answering-confirmation



                        (defun volatile-kill-buffer ()
                        "Kill current buffer unconditionally."
                        (interactive)
                        (let ((buffer-modified-p nil))
                        (kill-buffer (current-buffer))))

                        (global-set-key (kbd "C-x k") 'volatile-kill-buffer) ;; Unconditionally kill unmodified buffers.




                        share


























                          0












                          0








                          0







                          answered here: https://stackoverflow.com/questions/6467002/how-to-kill-buffer-in-emacs-without-answering-confirmation



                          (defun volatile-kill-buffer ()
                          "Kill current buffer unconditionally."
                          (interactive)
                          (let ((buffer-modified-p nil))
                          (kill-buffer (current-buffer))))

                          (global-set-key (kbd "C-x k") 'volatile-kill-buffer) ;; Unconditionally kill unmodified buffers.




                          share













                          answered here: https://stackoverflow.com/questions/6467002/how-to-kill-buffer-in-emacs-without-answering-confirmation



                          (defun volatile-kill-buffer ()
                          "Kill current buffer unconditionally."
                          (interactive)
                          (let ((buffer-modified-p nil))
                          (kill-buffer (current-buffer))))

                          (global-set-key (kbd "C-x k") 'volatile-kill-buffer) ;; Unconditionally kill unmodified buffers.





                          share











                          share


                          share










                          answered 9 mins ago









                          Kirill YunussovKirill Yunussov

                          991




                          991






























                              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.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f354849%2femacs-kill-buffer-without-prompt%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

                              Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

                              VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

                              Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...