unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: PENG Kevin <kevin.remegame@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 73663@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#73663: 29.4; indirect-buffer behaviour is not correct
Date: Mon, 07 Oct 2024 22:34:27 +0800	[thread overview]
Message-ID: <87zfng2cdt.fsf@gmail.com> (raw)
In-Reply-To: <861q0turor.fsf@gnu.org>


[-- Attachment #1.1: Type: text/plain, Size: 2051 bytes --]


Yes, i know "C-c C-c" can preview the image directly.
But the case needed is to use one major-mode to edit,
and another major-mode to preview the result, with two
seperate windows. The svg edit is only one case for such
usages. As this document mentioned:
[[https://www.gnu.org/software/emacs/manual/html_node/emacs/Indirect-Buffers.html]]
#+BEGIN_QUOTE
The text of the indirect buffer is always identical to the text of its base
buffer;
changes made by editing either one are visible immediately in the other.
“Text” here includes both the characters and their text properties.
But in all other respects, the indirect buffer and its base buffer are
completely separate.
They can have different names, different values of point, different narrowing,
different markers, different overlays, different major modes, and different local variables. 
#+END_QUOTE

Seems the indirect-buffer also not work for any of other major modes.
fundamental-mode, org-mode, elisp-mode, ...
Almost all of the major-mode i know are failure.

Eli Zaretskii <eliz@gnu.org> writes:

> [+]
>> From: PENG Kevin <kevin.remegame@gmail.com>
>> Date: Sun, 06 Oct 2024 23:42:41 +0800
>> 
>> I have a .svg file want to edit in nXML-mode, and at the same time
>> want to preview the image with image-mode.
>> So i create one indirect-buffer by using =clone-indirect-buffer=,
>> then a new buffer is created, and i change the major-mode of
>> the indirect-buffer to image-mode, the original buffer's preview
>> changed to image-mode, but its major-mode is still nXML-mode.
>
> I guess that's because major-mode-suspend, which image-mode calls to
> be able to switch back to the original major mode, doesn't support
> indirect buffers.  Stefan, am I right?  Can this be fixed?
>
> Regardless, I don't really understand why you need a separate indirect
> buffer in this case: just typing "C-c C-c" will toggle the buffer
> between nXML mode and image mode, so previewing is simple and needs no
> other buffer.  Am I missing something?



[-- Attachment #1.2: Type: text/html, Size: 2538 bytes --]

[-- Attachment #2: Type: text/plain, Size: 20 bytes --]



-- 
Best Regards.

  reply	other threads:[~2024-10-07 14:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-06 15:42 bug#73663: 29.4; indirect-buffer behaviour is not correct PENG Kevin
2024-10-06 16:22 ` Eli Zaretskii
2024-10-07 14:34   ` PENG Kevin [this message]
2024-10-07 22:49     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-09  5:23       ` PENG Kevin
2024-10-09 12:46         ` Eli Zaretskii
2024-10-12 12:56           ` PENG Kevin
2024-10-12 14:26             ` Eli Zaretskii
2024-10-09 12:46         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-12 13:05           ` PENG Kevin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zfng2cdt.fsf@gmail.com \
    --to=kevin.remegame@gmail.com \
    --cc=73663@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).