[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: help in writing function to pop indirect buffer
From: |
Jean Louis |
Subject: |
Re: help in writing function to pop indirect buffer |
Date: |
Tue, 31 Jan 2023 10:36:45 +0300 |
User-agent: |
Mutt/2.2.9+54 (af2080d) (2022-11-21) |
* Luca Ferrari <fluca1978@gmail.com> [2023-01-30 16:31]:
> On Sat, Jan 28, 2023 at 12:51 PM Bruno Barbier <brubar.cs@gmail.com> wrote:
> > In your use case, it might not be possible to use indirect buffers: the
> > base buffer and the indirect buffer share the same text and its
> > properties, and, syntax highlighting is mostly done using text
> > properties.
> >
>
> Gosh!
> I've tested that if I enable cperl-mode in the original buffer, then
> the indirect buffer inherits the syntax highligthing also for new
> code.
I gave you reference:
EmacsWiki: Indirect Buffers:
https://www.emacswiki.org/emacs/IndirectBuffers
Where it says:
--------------
It seems one can also set the mode from a fake buffer-file-name (using
auto-mode-alist in the usual way). At least with Emacs v20. So a
fake-file-name of say “x.el” will result in emacs-lisp-mode.
(with-current-buffer the-indirect-buffer
(set 'buffer-file-name fake-file-name)
(set-auto-mode) ; in files.el
; (set 'buffer-file-name nil) doesn't appear necessary.
)
Does using fake file name works?
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
Re: help in writing function to pop indirect buffer, Jean Louis, 2023/01/28