[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: set-buffer-major-mode: how to use on buffer without file?
From: |
Stefan Monnier |
Subject: |
Re: set-buffer-major-mode: how to use on buffer without file? |
Date: |
Thu, 25 Mar 2021 10:26:04 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> I would like to set major mode for the buffer which only displays a
> revision in a buffer without associated file.
Your use of "the buffer" above is hilarious: it makes it sound like we
all should know, as a matter of course, which buffer it is you're
talking about, like if it had been on the front page of the newspaper
or something.
> The buffer name may end with let us say .scm for scheme or .org for
> Org mode, I would like to invoke the major mode based on the
> file extension.
You may want to do: `C-h o C-x v ~` and then look at the implementation
of that command (since that command does something closely related to
what you describe).
Stefan