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
iMac 27" 2017 memory upgrade question
How are Core iX names like Core i5, i7 related to Haswell, Ivy Bridge?
Why was the Ancient One so hesitant to teach Dr. Strange the art of sorcery?
Does kinetic energy warp spacetime?
Smallest Guaranteed hash collision cycle length
On studying Computer Science vs. Software Engineering to become a proficient coder
How can a Lich look like a human without magic?
Can I use my laptop, which says 100-240V, in the USA?
Why do Thanos's punches not kill Captain America or at least cause some mortal injuries?
Understanding integration over Orthogonal Group
How to Access data returned from Apex class in JS controller using Lightning web component
Why was Endgame Thanos so different than Infinity War Thanos?
Bishop Berkeley's ideas put to the test
What is the best way for a skeleton to impersonate human without using magic?
How can I answer high-school writing prompts without sounding weird and fake?
Drawing lines to nearest point
Run script for 10 times until meets the condition, but break the loop if it meets the condition during iteration
For the erase-remove idiom, why is the second parameter necessary which points to the end of the container?
Is the schwa sound consistent?
How are one-time password generators like Google Authenticator different from having two passwords?
Can 'sudo apt-get remove [write]' destroy my Ubuntu?
Is it a bad idea to replace pull-up resistors with hard pull-ups?
Why is “Ich wusste, dass aus dir mal was wird” grammitally correct?
Who was this character from the Tomb of Annihilation adventure before they became a monster?
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
When creating a new buffer via:
C-x bNonExistentBufferNameRETRET
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:
C-x btest.org(no such buffer/file so far)RETRET
=> 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
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.
add a comment |
When creating a new buffer via:
C-x bNonExistentBufferNameRETRET
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:
C-x btest.org(no such buffer/file so far)RETRET
=> 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
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.
add a comment |
When creating a new buffer via:
C-x bNonExistentBufferNameRETRET
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:
C-x btest.org(no such buffer/file so far)RETRET
=> 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
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:
C-x bNonExistentBufferNameRETRET
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:
C-x btest.org(no such buffer/file so far)RETRET
=> 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
major-mode ido
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.
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 2 hours ago
Dmitry SeninDmitry Senin
82
82
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.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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).
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 likeC-x C-wsolves this problem.
– Dmitry Senin
1 hour ago
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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).
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 likeC-x C-wsolves this problem.
– Dmitry Senin
1 hour ago
add a comment |
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).
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 likeC-x C-wsolves this problem.
– Dmitry Senin
1 hour ago
add a comment |
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).
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).
answered 1 hour ago
StefanStefan
20.3k2564
20.3k2564
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 likeC-x C-wsolves this problem.
– Dmitry Senin
1 hour ago
add a comment |
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 likeC-x C-wsolves this problem.
– Dmitry Senin
1 hour ago
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
1 hour ago
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
1 hour ago
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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