[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: |
Jean Louis |
Subject: |
Re: set-buffer-major-mode: how to use on buffer without file? |
Date: |
Thu, 25 Mar 2021 18:07:38 +0300 |
User-agent: |
Mutt/2.0.6 (2021-03-06) |
* Stefan Monnier <monnier@iro.umontreal.ca> [2021-03-25 17:31]:
> > 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.
I have not expressed myself clearly, I have buffers that come from
database, and are not associated to the file within Emacs
context. Within program they are associated with the file with
specific extension.
vcfiles_filename entry may be "/home/admin/new.scm"
and buffer name becomes something like:
RCD VC Revision ID: 12, /home/admin/new.scm
so buffer is not really associated within Emacs context to file name,
within program's context it is directly associated. Now when I entered
the sphere of auto mode settings I can see that for buffers that
function is missing, or is not there. Am I right?
set-auto-mode function does not verify anything for buffers how I see
it. Maybe it would be better to have something for buffers not
associated to files.
Right now I am doing that trick to associate the file to buffer and
then set auto mode, and then I can disassociate file from buffer. I am
then associating the above example with
/home/admin/RCD-VC-Revision-ID-12-new.scm as that way it becomes
unique file.
So it is solved on my side.
But I still think that auto mode should also work in buffers without
file, at least when user enables it.
Jean