Setting the major mode of a new buffer interactivelyDifferences between setting major mode keys with a hook versus adding them to the mode mapUse two major-mode-maps in the same bufferChange the default mode used when opening a new bufferNew buffers of the same name don't inherit default major mode?How do I get the current major mode?Make major mode be used by default for new files in directoryWriting a Major ModeSetting the Default Major Mode?use a major mode from the internetRecentf buffer is not interactively

What is the velocity distribution of the exhaust for a typical rocket engine?

Would it be fair to use 1d30 (instead of rolling 2d20 and taking the higher die) for advantage rolls?

Why does the U.S military use mercenaries?

Why do galaxies collide?

Why does Taylor’s series “work”?

Failing students when it might cause them economic ruin

Why can't I share a one use code with anyone else?

Can a person still be an Orthodox Jew and believe that the Torah contains narratives that are not scientifically correct?

Cross products/avoiding using your hand for the right hand rule in E and M

Physically unpleasant work environment

Cycling to work - 30mile return

Why would company (decision makers) wait for someone to retire, rather than lay them off, when their role is no longer needed?

FIFO data structure in pure C

Holding rent money for my friend which amounts to over $10k?

Why is the A380’s with-reversers stopping distance the same as its no-reversers stopping distance?

Does a non-singular matrix have a large minor with disjoint rows and columns and full rank?

Usage of the relative pronoun "dont"

Why did nobody know who the Lord of this region was?

Could a space colony 1g from the sun work?

When did Britain learn about American independence?

multiline equation inside a matrix that is a part of multiline equation

How can I fix the label locations on my tikzcd diagram?

Working hours and productivity expectations for game artists and programmers

How to know the path of a particular software?



Setting the major mode of a new buffer interactively


Differences between setting major mode keys with a hook versus adding them to the mode mapUse two major-mode-maps in the same bufferChange the default mode used when opening a new bufferNew buffers of the same name don't inherit default major mode?How do I get the current major mode?Make major mode be used by default for new files in directoryWriting a Major ModeSetting the Default Major Mode?use a major mode from the internetRecentf buffer is not interactively













1















When creating a new buffer via:



  1. C-x b


  2. NonExistentBufferName RET RET

I would like Emacs to prompt me for the major mode this buffer is going to use upon opening.
Moreover, I want Emacs to infer the major mode in some cases based on the buffer's name:



  1. C-x b


  2. test.org(no such buffer/file so far) RET RET
    => org-mode is used without asking me anything.

Could anybody advice on how I can achieve this? Package or, probably, just pure elisp with its hooks and advice?



P.S.
I'm using ido if it matters.










share|improve this question







New contributor



Dmitry Senin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    1















    When creating a new buffer via:



    1. C-x b


    2. NonExistentBufferName RET RET

    I would like Emacs to prompt me for the major mode this buffer is going to use upon opening.
    Moreover, I want Emacs to infer the major mode in some cases based on the buffer's name:



    1. C-x b


    2. test.org(no such buffer/file so far) RET RET
      => org-mode is used without asking me anything.

    Could anybody advice on how I can achieve this? Package or, probably, just pure elisp with its hooks and advice?



    P.S.
    I'm using ido if it matters.










    share|improve this question







    New contributor



    Dmitry Senin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      1












      1








      1








      When creating a new buffer via:



      1. C-x b


      2. NonExistentBufferName RET RET

      I would like Emacs to prompt me for the major mode this buffer is going to use upon opening.
      Moreover, I want Emacs to infer the major mode in some cases based on the buffer's name:



      1. C-x b


      2. test.org(no such buffer/file so far) RET RET
        => org-mode is used without asking me anything.

      Could anybody advice on how I can achieve this? Package or, probably, just pure elisp with its hooks and advice?



      P.S.
      I'm using ido if it matters.










      share|improve this question







      New contributor



      Dmitry Senin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      When creating a new buffer via:



      1. C-x b


      2. NonExistentBufferName RET RET

      I would like Emacs to prompt me for the major mode this buffer is going to use upon opening.
      Moreover, I want Emacs to infer the major mode in some cases based on the buffer's name:



      1. C-x b


      2. test.org(no such buffer/file so far) RET RET
        => org-mode is used without asking me anything.

      Could anybody advice on how I can achieve this? Package or, probably, just pure elisp with its hooks and advice?



      P.S.
      I'm using ido if it matters.







      major-mode ido






      share|improve this question







      New contributor



      Dmitry Senin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question







      New contributor



      Dmitry Senin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question






      New contributor



      Dmitry Senin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked May 11 at 19:59









      Dmitry SeninDmitry Senin

      132




      132




      New contributor



      Dmitry Senin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      Dmitry Senin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          3














          I know this is not exactly what you're asking, but the Emacs way to solve this problem is to use C-x C-f instead of C-x b (if you don't want to create a file, just don't use C-x C-s in that buffer).






          share|improve this answer























          • Thanks, @Stefan, for such a prompt response. Yeah, that seems to be a solution. I was a bit worried about the scenario when I finally decide to save that buffer. If it is already associated with a path and I want to change the final location, it is a problem. But seems like C-x C-w solves this problem.

            – Dmitry Senin
            May 11 at 20:30












          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "583"
          ;
          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: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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
          );



          );






          Dmitry Senin is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f50446%2fsetting-the-major-mode-of-a-new-buffer-interactively%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          I know this is not exactly what you're asking, but the Emacs way to solve this problem is to use C-x C-f instead of C-x b (if you don't want to create a file, just don't use C-x C-s in that buffer).






          share|improve this answer























          • Thanks, @Stefan, for such a prompt response. Yeah, that seems to be a solution. I was a bit worried about the scenario when I finally decide to save that buffer. If it is already associated with a path and I want to change the final location, it is a problem. But seems like C-x C-w solves this problem.

            – Dmitry Senin
            May 11 at 20:30
















          3














          I know this is not exactly what you're asking, but the Emacs way to solve this problem is to use C-x C-f instead of C-x b (if you don't want to create a file, just don't use C-x C-s in that buffer).






          share|improve this answer























          • Thanks, @Stefan, for such a prompt response. Yeah, that seems to be a solution. I was a bit worried about the scenario when I finally decide to save that buffer. If it is already associated with a path and I want to change the final location, it is a problem. But seems like C-x C-w solves this problem.

            – Dmitry Senin
            May 11 at 20:30














          3












          3








          3







          I know this is not exactly what you're asking, but the Emacs way to solve this problem is to use C-x C-f instead of C-x b (if you don't want to create a file, just don't use C-x C-s in that buffer).






          share|improve this answer













          I know this is not exactly what you're asking, but the Emacs way to solve this problem is to use C-x C-f instead of C-x b (if you don't want to create a file, just don't use C-x C-s in that buffer).







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 11 at 20:14









          StefanStefan

          20.4k2564




          20.4k2564












          • Thanks, @Stefan, for such a prompt response. Yeah, that seems to be a solution. I was a bit worried about the scenario when I finally decide to save that buffer. If it is already associated with a path and I want to change the final location, it is a problem. But seems like C-x C-w solves this problem.

            – Dmitry Senin
            May 11 at 20:30


















          • Thanks, @Stefan, for such a prompt response. Yeah, that seems to be a solution. I was a bit worried about the scenario when I finally decide to save that buffer. If it is already associated with a path and I want to change the final location, it is a problem. But seems like C-x C-w solves this problem.

            – Dmitry Senin
            May 11 at 20:30

















          Thanks, @Stefan, for such a prompt response. Yeah, that seems to be a solution. I was a bit worried about the scenario when I finally decide to save that buffer. If it is already associated with a path and I want to change the final location, it is a problem. But seems like C-x C-w solves this problem.

          – Dmitry Senin
          May 11 at 20:30






          Thanks, @Stefan, for such a prompt response. Yeah, that seems to be a solution. I was a bit worried about the scenario when I finally decide to save that buffer. If it is already associated with a path and I want to change the final location, it is a problem. But seems like C-x C-w solves this problem.

          – Dmitry Senin
          May 11 at 20:30











          Dmitry Senin is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          Dmitry Senin is a new contributor. Be nice, and check out our Code of Conduct.












          Dmitry Senin is a new contributor. Be nice, and check out our Code of Conduct.











          Dmitry Senin is a new contributor. Be nice, and check out our Code of Conduct.














          Thanks for contributing an answer to Emacs Stack Exchange!


          • 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%2femacs.stackexchange.com%2fquestions%2f50446%2fsetting-the-major-mode-of-a-new-buffer-interactively%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

          Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form