unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#73663: 29.4; indirect-buffer behaviour is not correct
@ 2024-10-06 15:42 PENG Kevin
  2024-10-06 16:22 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: PENG Kevin @ 2024-10-06 15:42 UTC (permalink / raw)
  To: 73663


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


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.

[[file:/home/pk/rdf/workspace/_tmp/indirect-buffer_not_correct.png]]

In GNU Emacs 29.4 (build 6, x86_64-pc-linux-gnu, GTK+ Version 3.24.41,
 cairo version 1.18.0) of 2024-09-17 built on rainbow
Windowing system distributor 'The X.Org Foundation', version 11.0.12101011
System Description: Ubuntu 24.04.1 LTS

Configured using:
 'configure --with-tree-sitter --with-native-compilation
 --with-imagemagick --prefix=/opt/program/emacs/../
 --exec-prefix=/opt/program/emacs/../ 'CFLAGS=-I/opt/program/include/ '
 'LDFLAGS=-L/opt/program/lib/ ''

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ IMAGEMAGICK
JPEG JSON LCMS2 LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY
PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LC_MONETARY: zh_CN.UTF-8
  value of $LC_NUMERIC: zh_CN.UTF-8
  value of $LC_TIME: zh_CN.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=fcitx
  locale-coding-system: utf-8-unix

Major mode: IELM

Minor modes in effect:
  mu4e-modeline-mode: t
  dap-tooltip-mode: t
  dap-ui-many-windows-mode: t
  dap-ui-controls-mode: t
  dap-ui-mode: t
  dap-auto-configure-mode: t
  dap-mode: t
  treemacs-filewatch-mode: t
  treemacs-follow-mode: t
  treemacs-git-mode: t
  treemacs-fringe-indicator-mode: t
  global-git-commit-mode: t
  projectile-rails-global-mode: t
  projectile-rails-mode: t
  electric-pair-mode: t
  telega-root-auto-fill-mode: t
  telega-contact-birthdays-mode: t
  telega-active-video-chats-mode: t
  telega-active-locations-mode: t
  telega-patrons-mode: t
  telega-active-stories-mode: t
  TeX-PDF-mode: t
  pdf-occur-global-minor-mode: t
  org-roam-db-autosync-mode: t
  disable-mouse-global-mode: t
  pyvenv-mode: t
  backward-forward-mode: t
  beacon-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  helm-mode: t
  helm-minibuffer-history-mode: t
  helm-autoresize-mode: t
  async-bytecomp-package-mode: t
  projectile-mode: t
  shell-dirtrack-mode: t
  server-mode: t
  org-super-agenda-mode: t
  global-company-mode: t
  company-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  which-key-mode: t
  recentf-mode: t
  override-global-mode: t
  comint-fontify-input-mode: t
  straight-use-package-mode: t
  straight-package-neutering-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  abbrev-mode: t

Load-path shadows:
/opt/program/emacs/config/home/.emacs.d/ext/straight/straight/build/async/async hides /opt/program/emacs/config/home/.emacs.d/elpa/async-20240821.253/async
/opt/program/emacs/config/home/.emacs.d/ext/straight/straight/build/async/async-bytecomp hides /opt/program/emacs/config/home/.emacs.d/elpa/async-20240821.253/async-bytecomp
/opt/program/emacs/config/home/.emacs.d/ext/straight/straight/build/async/async-autoloads hides /opt/program/emacs/config/home/.emacs.d/elpa/async-20240821.253/async-autoloads
/opt/program/emacs/config/home/.emacs.d/ext/straight/straight/build/highlight-indentation/highlight-indentation hides /opt/program/emacs/config/home/.emacs.d/elpa/highlight-indentation-20210221.1418/highlight-indentation
/opt/program/emacs/config/home/.emacs.d/ext/straight/straight/build/highlight-indentation/highlight-indentation-autoloads hides /opt/program/emacs/config/home/.emacs.d/elpa/highlight-indentation-20210221.1418/highlight-indentation-autoloads
/opt/program/emacs/config/home/.emacs.d/ext/straight/straight/build/pyvenv/pyvenv hides /opt/program/emacs/config/home/.emacs.d/elpa/pyvenv-20211014.707/pyvenv
/opt/program/emacs/config/home/.emacs.d/ext/straight/straight/build/pyvenv/pyvenv-autoloads hides /opt/program/emacs/config/home/.emacs.d/elpa/pyvenv-20211014.707/pyvenv-autoloads
/opt/program/emacs/config/home/.emacs.d/ext/straight/straight/build/s/s hides /opt/program/emacs/config/home/.emacs.d/elpa/s-20220902.1511/s
/opt/program/emacs/config/home/.emacs.d/ext/straight/straight/build/s/s-autoloads hides /opt/program/emacs/config/home/.emacs.d/elpa/s-20220902.1511/s-autoloads
/opt/program/emacs/config/home/.emacs.d/ext/straight/straight/build/yasnippet/yasnippet hides /opt/program/emacs/config/home/.emacs.d/elpa/yasnippet-20240406.1314/yasnippet
/opt/program/emacs/config/home/.emacs.d/ext/straight/straight/build/yasnippet/yasnippet-autoloads hides /opt/program/emacs/config/home/.emacs.d/elpa/yasnippet-20240406.1314/yasnippet-autoloads
/opt/program/emacs/config/home/.emacs.d/elpa/transient-20240821.158/transient hides /opt/program/emacs/../share/emacs/29.4/lisp/transient

Features:
(shadow emacs-news-mode cus-start rng-xsd xsd-regexp rng-cmpct rng-nxml
rng-valid nxml-mode nxml-outln nxml-rap company-css skewer-html
skewer-mode cache-table shr-color sort smiley gnus-cite mm-archive
mail-extr qp textsec uni-scripts idna-mapping uni-confusable
textsec-check rot13 disp-table netrc mu4e-contrib mu4e mu4e-org
mu4e-notification mu4e-main mu4e-view mu4e-headers mu4e-compose
mu4e-draft mu4e-actions smtpmail mu4e-search mu4e-lists mu4e-bookmarks
mu4e-mark mu4e-message flow-fill mu4e-contacts mu4e-update mu4e-folders
mu4e-context mu4e-query-items mu4e-server mu4e-modeline mu4e-vars
mu4e-helpers mu4e-config mu4e-window mu4e-obsolete shortdoc cl-print
vc-hg vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs log-view vc
bug-reference lsp-diagnostics lsp-modeline dap-mouse dap-ui gdb-mi bui
bui-list bui-info bui-entry bui-core bui-history bui-button bui-utils
lsp-lens dap-chrome dap-utils dap-lldb dap-mode dap-tasks dap-launch
dap-overlays lsp-zig lsp-yang lsp-yaml lsp-xml lsp-wgsl lsp-volar
lsp-vimscript lsp-vhdl lsp-vetur lsp-html lsp-verilog lsp-vala lsp-v
lsp-typeprof lsp-ttcn3 lsp-trunk lsp-toml lsp-tilt lsp-tex lsp-terraform
lsp-tailwindcss lsp-svelte lsp-steep lsp-sqls lsp-sql lsp-sorbet
lsp-solidity lsp-solargraph lsp-semgrep lsp-rust lsp-ruff-lsp
lsp-ruby-syntax-tree lsp-ruby-lsp lsp-rubocop lsp-roslyn lsp-rf
lsp-remark lsp-racket lsp-r lsp-qml lsp-pylsp lsp-pyls lsp-pwsh
lsp-purescript lsp-pls lsp-php lsp-perlnavigator lsp-perl lsp-openscad
lsp-ocaml lsp-nushell lsp-nix lsp-nim lsp-nginx lsp-move lsp-mojo
lsp-mint lsp-meson lsp-mdx lsp-marksman lsp-markdown lsp-magik lsp-lua
lsp-lisp lsp-kotlin lsp-json lsp-jq lsp-javascript lsp-idris lsp-haxe
lsp-hack lsp-groovy lsp-graphql lsp-golangci-lint lsp-glsl lsp-gleam
lsp-gdscript lsp-fsharp lsp-fortran lsp-eslint lsp-erlang lsp-emmet
lsp-elm lsp-elixir lsp-earthly lsp-dockerfile lsp-docker yaml lsp-dhall
lsp-d lsp-cypher lsp-cucumber lsp-css lsp-csharp lsp-crystal lsp-credo
lsp-cobol lsp-cmake lsp-clojure lsp-treemacs lsp-treemacs-generic
lsp-treemacs-themes treemacs-treelib treemacs treemacs-header-line
treemacs-compatibility treemacs-mode treemacs-bookmarks treemacs-tags
treemacs-interface treemacs-persistence treemacs-filewatch-mode
treemacs-follow-mode treemacs-rendering treemacs-annotations
treemacs-async treemacs-workspaces treemacs-dom treemacs-visuals
treemacs-fringe-indicator treemacs-faces treemacs-icons treemacs-scope
treemacs-themes treemacs-core-utils pfuture hl-line treemacs-logging
treemacs-customization treemacs-macros lsp-clangd lsp-bufls lsp-go
lsp-completion lsp-beancount lsp-bash lsp-awk lsp-autotools lsp-astro
lsp-asm lsp-ansible lsp-angular lsp-ada lsp-semantic-tokens
lsp-actionscript conf-mode tabify ucs-normalize elfeed-link elfeed-org
elfeed-show elfeed-search elfeed-csv elfeed elfeed-curl elfeed-log
xml-query elfeed-db elfeed-lib ox-org magit-extras magit-bookmark
magit-submodule magit-blame magit-stash magit-reflog magit-bisect
magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log magit-diff git-commit
log-edit pcvs-util add-log magit-core magit-margin magit-transient
magit-process magit-mode mule-util helm-command helm-elisp helm-eval
edebug debug backtrace helm-info projectile-rails hydra rake inflections
autoinsert sh-script executable smerge-mode rubocop swiper ivy delsel
ivy-faces ivy-overlay colir yaml-mode timezone url-http url-gw url-cache
url-auth google-translate google-translate-default-ui
google-translate-core-ui google-translate-core google-translate-tk
google-translate-backend elec-pair winner tramp-archive tramp-gvfs
zeroconf redef-config org-appear org-fragtog oc-basic ol-eww ol-rmail
ol-mhe ol-irc ol-gnus nnselect gnus-art mm-uu mml2015 mm-view mml-smime
smime gnutls dig ol-docview doc-view ol-bibtex bibtex ol-bbdb ol-w3m
ol-doi org-link-doi company-dabbrev company-abbrev company-yasnippet
company-keywords make-mode company-files flycheck-google-cpplint
telega-obsolete telega telega-tdlib-events telega-webpage telega-match
telega-root telega-info telega-chat visual-fill-column telega-modes
telega-company telega-emoji telega-user telega-notifications
notifications telega-voip telega-msg telega-story telega-tme
telega-sticker telega-vvnote telega-ffplay telega-i18n telega-sort
telega-filter telega-ins telega-inline telega-util telega-folders
telega-topic telega-media telega-tdlib telega-server telega-core
telega-customize emacsbug rainbow-identifiers w32-registry dired+
image-file image-converter bookmark+ bookmark+-key bookmark+-1 gnus-sum
gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud nnimap nnmail
mail-source utf7 nnoo gnus-spec gnus-int gnus-range gnus-win
bookmark+-bmu bookmark+-lit bookmark+-mac chatgpt-shell shell-maker
esh-mode company-auctex latex latex-flymake tex-ispell tex-style tex
dbus texmathp protobuf-mode cc-langs haml-mode slim-mode ob-shell ob-ein
ein-cell ein-shared-output ein-output-area ein-kernel ein-ipdb ein-query
ein-events ein-websocket websocket bindat ein-node ein-log ein-classes
ein-core request ein-utils anaphora deferred ob-haskell ob-plantuml
ob-dot ob-python ob-ruby ob-C ein pdf-occur tablist tablist-filter
semantic/wisent/comp semantic/wisent semantic/wisent/wisent
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw mode-local cedet pdf-isearch pdf-misc pdf-tools pdf-view
pdf-cache pdf-info tq pdf-util pdf-macs org-roam-dailies
org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id
org-roam-node org-roam-db emacsql-sqlite-builtin org-roam-utils
org-roam-compat org-roam org-capture org-attach emacsql-sqlite
emacsql-sqlite-common emacsql emacsql-compiler clang-format
google-c-style disable-mouse cling helm-rtags company-rtags
company-template rtags repeat asm-mode bookmark pyim-autoloads
xr-autoloads posframe highlight-indentation company-capf help-fns
radix-tree elpy elpy-rpc elpy-shell elpy-profile elpy-django
elpy-refactor ido hideshow elpy-autoloads pyvenv eshell esh-cmd esh-ext
esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util
haskell-interactive-mode haskell-presentation-mode haskell-process
haskell-session haskell-compile haskell-mode haskell-cabal haskell-utils
haskell-font-lock haskell-indentation haskell-string
haskell-sort-imports haskell-lexeme haskell-align-imports
haskell-complete-module haskell-ghc-support flymake-proc flymake dabbrev
haskell-customize plantuml-mode langtool backward-forward ccls
ccls-member-hierarchy ccls-inheritance-hierarchy ccls-call-hierarchy
ccls-tree ccls-code-lens ccls-semantic-highlight ccls-common helm-lsp
helm-imenu lsp-ui lsp-ui-flycheck lsp-ui-doc goto-addr lsp-ui-imenu
lsp-ui-peek lsp-ui-sideline flycheck jka-compr lsp-ui-util face-remap
lsp-mode lsp-protocol spinner network-stream nsm lv f ewoc beacon
epa-file cmake-mode message sendmail yank-media rfc822 mml mml-sec epa
epg rfc6068 epg-config mailabbrev gmm-utils mailheader mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums
company-tailwindcss typescript-mode indium indium-list-sources
indium-scratch indium-interaction indium-chrome indium-nodejs
indium-repl indium-debugger indium-debugger-litable js2-refactor
js2r-paredit js2r-conveniences js2r-conditionals js2r-wrapping
js2r-functions js2r-vars js2r-iife js2r-formatting js2r-helpers
indium-debugger-locals indium-breakpoint indium-inspector indium-render
indium-faces indium-seq-fix indium-client let-alist indium-structs
json-process-client markdown-mode impatient-mode htmlize simple-httpd
js2-mode etags fileloop xref xterm-color graphviz-dot-mode yasnippet
yasnippet-classic-snippets multiple-cursors mc-separate-operations
rectangular-region-mode mc-mark-pop mc-edit-lines
mc-hide-unmatched-lines-mode mc-mark-more mc-cycle-cursors
multiple-cursors-core advice rect ace-window avy helm-gtags pulse
helm-projectile helm-ag helm-mode helm-misc helm-files image-dired
image-dired-tags image-dired-external image-dired-util image-mode exif
dired-x dired-aux helm-buffers helm-occur helm-tags helm-locate
helm-grep helm-regexp helm-utils helm-help helm-types helm
helm-global-bindings helm-easymenu helm-core async-bytecomp helm-source
helm-multi-match helm-lib popup tramp-cache time-stamp tramp-sh tramp
tramp-loaddefs trampver tramp-integration tramp-compat parse-time
iso8601 projectile skeleton ibuf-macs find-dired dired dired-loaddefs
lisp-mnt grep ibuf-ext ibuffer ibuffer-loaddefs magit-autorevert
autorevert filenotify magit-git files-x magit-base which-func vc-git
diff-mode vc-dispatcher magit-section benchmark cursor-sensor crm
with-editor shell server async inf-ruby compile org-super-agenda
org-habit ts s ht inline dash ox-gfm org-indent ox-hugo
ox-hugo-deprecated ol-info ox-blackfriday ox-md ox-odt rng-loc rng-uri
rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns
nxml-enc xmltok nxml-util ox-latex ox-icalendar org-agenda ox-html table
ox-ascii ox-publish ox org-element org-persist org-id org-refile
avl-tree tomelr company cus-edit cus-load undo-tree derived diff queue
generator cl which-key cap-words superword subword ielm pp emoji
multisession sqlite transient comp comp-cstr warnings mhtml-mode
css-mode color js c-ts-common imenu sgml-mode facemenu cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
python project compat compat-30 compat-macs treesit sql view gud
flyspell ispell use-package-ensure desktop frameset ruby-mode smie eww
xdg url-queue shr pixel-fill kinsoku url-file svg xml dom puny mm-url
gnus nnheader gnus-util text-property-search mail-utils range mm-util
mail-prsvr recentf tree-widget wid-edit edmacro kmacro
use-package-bind-key bind-key easy-mmode font-display redef-lib
os-wrapper ffap thingatpt redef-boot org ob ob-tangle ob-ref ob-lob
ob-table ob-exp org-macro org-src ob-comint org-pcomplete pcomplete
comint ansi-osc ansi-color ring org-list org-footnote org-faces
org-entities time-date noutline outline icons ob-emacs-lisp ob-core
ob-eval org-cycle org-table ol rx org-fold org-fold-core org-keys oc
org-loaddefs find-func cal-menu calendar cal-loaddefs org-version
org-compat org-macs format-spec use-package-core finder-inf
straight-autoloads cl-extra help-mode straight
backward-forward-autoloads bbdb-vcard-autoloads bbdb-autoloads
beacon-autoloads cargo-autoloads ccls-autoloads chatgpt-shell-autoloads
clang-format-autoloads company-auctex-autoloads auctex-autoloads
tex-site company-irony-autoloads company-irony-c-headers-autoloads
company-rtags-autoloads company-tabnine-autoloads
counsel-projectile-autoloads counsel-autoloads dap-mode-autoloads
bui-autoloads desktop+-autoloads disable-mouse-autoloads ein-autoloads
deferred-autoloads anaphora-autoloads elfeed-org-autoloads
elfeed-autoloads elpa-mirror-autoloads emms-autoloads
eyebrowse-autoloads flycheck-google-cpplint-autoloads
google-c-style-autoloads graphviz-dot-mode-autoloads guide-key-autoloads
haml-mode-autoloads haskell-mode-autoloads helm-ag-autoloads
helm-gtags-autoloads helm-lsp-autoloads helm-projectile-autoloads
helm-rtags-autoloads helm-autoloads helm-core-autoloads async-autoloads
highlight-indentation-autoloads impatient-mode-autoloads
htmlize-autoloads indium-autoloads company-autoloads
irony-eldoc-autoloads irony-autoloads js2-refactor-autoloads
json-process-client-autoloads keycast-autoloads keyfreq-autoloads
langtool-autoloads lsp-docker-autoloads lsp-tailwindcss-autoloads
lsp-treemacs-autoloads lsp-ui-autoloads lsp-mode-autoloads
magit-autoloads pcase git-commit-autoloads multiple-cursors-autoloads
org-appear-autoloads org-fragtog-autoloads org-mime-autoloads
org-roam-autoloads magit-section-autoloads emacsql-autoloads
org-super-agenda-autoloads ox-gfm-autoloads ox-hugo-autoloads
pdf-tools-autoloads plantuml-mode-autoloads polymode-autoloads
popup-autoloads popwin-autoloads projectile-rails-autoloads
inf-ruby-autoloads inflections-autoloads projectile-autoloads
protobuf-mode-autoloads pyim-basedict-autoloads pyvenv-autoloads
rainbow-identifiers-autoloads rake-autoloads request-autoloads
rtags-autoloads rubocop-autoloads rustic-autoloads flycheck-autoloads
markdown-mode-autoloads f-autoloads rust-mode-autoloads
shell-maker-autoloads skewer-mode-autoloads js2-mode-autoloads
simple-httpd-autoloads slim-mode-autoloads spinner-autoloads
swiper-autoloads ivy-autoloads tablist-autoloads tomelr-autoloads
transient-autoloads treemacs-autoloads cfrs-autoloads posframe-autoloads
ht-autoloads hydra-autoloads lv-autoloads pfuture-autoloads
ace-window-autoloads avy-autoloads ts-autoloads s-autoloads
dash-autoloads typescript-mode-autoloads undo-tree-autoloads
queue-autoloads visual-fill-column-autoloads visual-regexp-autoloads
web-mode-autoloads websocket-autoloads wfnames-autoloads
which-key-autoloads with-editor-autoloads info compat-autoloads
wttrin-autoloads xterm-color-autoloads yaml-autoloads
yaml-mode-autoloads yasnippet-classic-snippets-autoloads
yasnippet-autoloads package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie generate-lisp-file
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv
bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip
cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 6214955 379112)
 (symbols 48 153238 81)
 (strings 32 854088 33628)
 (string-bytes 1 20958081)
 (vectors 16 157028)
 (vector-slots 8 4166508 238887)
 (floats 8 403912 1023)
 (intervals 56 66490 4674)
 (buffers 984 137))


[-- Attachment #1.2.1: Type: text/html, Size: 20508 bytes --]

[-- Attachment #1.2.2: indirect-buffer_not_correct.png --]
[-- Type: image/png, Size: 24372 bytes --]

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



-- 
Best Regards.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#73663: 29.4; indirect-buffer behaviour is not correct
  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
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2024-10-06 16:22 UTC (permalink / raw)
  To: PENG Kevin, Stefan Monnier; +Cc: 73663

> 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?





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#73663: 29.4; indirect-buffer behaviour is not correct
  2024-10-06 16:22 ` Eli Zaretskii
@ 2024-10-07 14:34   ` PENG Kevin
  2024-10-07 22:49     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 10+ messages in thread
From: PENG Kevin @ 2024-10-07 14:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 73663, Stefan Monnier


[-- 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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#73663: 29.4; indirect-buffer behaviour is not correct
  2024-10-07 14:34   ` PENG Kevin
@ 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
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-10-07 22:49 UTC (permalink / raw)
  To: PENG Kevin; +Cc: Eli Zaretskii, 73663, Stefan Monnier

PENG Kevin <kevin.remegame@gmail.com> writes:

> 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.

`image-mode' uses text properties to display the image!  Most major
modes use text properties to font-lock the buffer and change the way how
its contents are displayed.

Use cases of indirect buffers are limited, maybe we need to warn more
explicitly that their usefulness is very restricted.  IIRC, having
indirect and base buffer using different major modes is something that
was never supported.

From the past discussions about the matter I also recall that the
limitations are lying in the concept and we can't do much here without a
reimplementation of the idea.

So I would suggest to rather think about how to get what you want
without using indirect buffers.


Michael.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#73663: 29.4; indirect-buffer behaviour is not correct
  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-09 12:46         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 10+ messages in thread
From: PENG Kevin @ 2024-10-09  5:23 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Eli Zaretskii, 73663, Stefan Monnier


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


Ok, i got a mistake to use indirect buffer in this way.
The text properties of base buffer are shared with indirect buffers.

Due to svg in emacs is not fully support, i have implemented this
by using =impatient-mode= with web-browser, when the svg file modified the
preview will be changed at the same time.

Michael Heerdegen <michael_heerdegen@web.de> writes:

> PENG Kevin <kevin.remegame@gmail.com> writes:
>
> [+]
>> 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.
>
> `image-mode' uses text properties to display the image!  Most major
> modes use text properties to font-lock the buffer and change the way how
> its contents are displayed.
>
> Use cases of indirect buffers are limited, maybe we need to warn more
> explicitly that their usefulness is very restricted.  IIRC, having
> indirect and base buffer using different major modes is something that
> was never supported.
>
> From the past discussions about the matter I also recall that the
> limitations are lying in the concept and we can't do much here without a
> reimplementation of the idea.
>
> So I would suggest to rather think about how to get what you want
> without using indirect buffers.
>
>
> Michael.



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

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



-- 
Best Regards.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#73663: 29.4; indirect-buffer behaviour is not correct
  2024-10-09  5:23       ` PENG Kevin
@ 2024-10-09 12:46         ` Eli Zaretskii
  2024-10-12 12:56           ` PENG Kevin
  2024-10-09 12:46         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2024-10-09 12:46 UTC (permalink / raw)
  To: PENG Kevin; +Cc: michael_heerdegen, 73663, monnier

> From: PENG Kevin <kevin.remegame@gmail.com>
> Cc: Eli Zaretskii <eliz@gnu.org>, 73663@debbugs.gnu.org, Stefan Monnier
>  <monnier@iro.umontreal.ca>
> Date: Wed, 09 Oct 2024 13:23:23 +0800
> 
> Ok, i got a mistake to use indirect buffer in this way. The text properties of base buffer are shared with
> indirect buffers. 
> 
> Due to svg in emacs is not fully support, i have implemented this by using impatient-mode with
> web-browser, when the svg file modified the preview will be changed at the same time. 

Thanks, so can we now close this non-bug?





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#73663: 29.4; indirect-buffer behaviour is not correct
  2024-10-09  5:23       ` PENG Kevin
  2024-10-09 12:46         ` 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
  1 sibling, 1 reply; 10+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-10-09 12:46 UTC (permalink / raw)
  To: PENG Kevin; +Cc: Michael Heerdegen, Eli Zaretskii, 73663

> Due to svg in emacs is not fully support, i have implemented this
> by using =impatient-mode= with web-browser, when the svg file modified the
> preview will be changed at the same time.

It would probably be a good idea to add support for some kind of
"simultaneous preview" to the nxml-mode when editing an SVG, such that
it creates an auxiliary buffer in image-mode and updates it e.g. when
you save the file.

The same probably holds for other similar text+image formats, like XPM
and PostScript.

Maybe it should be some kind of `image-minor-mode` which lets you either
switch between `image-mode` and some other mode (like now) or display
the image in an auxiliary buffer.


        Stefan






^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#73663: 29.4; indirect-buffer behaviour is not correct
  2024-10-09 12:46         ` Eli Zaretskii
@ 2024-10-12 12:56           ` PENG Kevin
  2024-10-12 14:26             ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: PENG Kevin @ 2024-10-12 12:56 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: michael_heerdegen, 73663, monnier


Sure. Thank for your reply.

Eli Zaretskii <eliz@gnu.org> writes:

> [+]
>> From: PENG Kevin <kevin.remegame@gmail.com>
>> Cc: Eli Zaretskii <eliz@gnu.org>, 73663@debbugs.gnu.org, Stefan Monnier
>>  <monnier@iro.umontreal.ca>
>> Date: Wed, 09 Oct 2024 13:23:23 +0800
>> 
>> Ok, i got a mistake to use indirect buffer in this way. The text properties of base buffer are shared with
>> indirect buffers. 
>> 
>> Due to svg in emacs is not fully support, i have implemented this by using impatient-mode with
>> web-browser, when the svg file modified the preview will be changed at the same time. 
>
> Thanks, so can we now close this non-bug?


-- 
Best Regards.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#73663: 29.4; indirect-buffer behaviour is not correct
  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
  0 siblings, 0 replies; 10+ messages in thread
From: PENG Kevin @ 2024-10-12 13:05 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Michael Heerdegen, Eli Zaretskii, 73663


Yeah, this is a good idea to implement the preview feature
you mentioned.

An auxiliary buffer is needed to store the preview content.
But should synchronous its content with the base buffer.
This also need some effort on buffer management.
More complex then a shared one.

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> [+]
>> Due to svg in emacs is not fully support, i have implemented this
>> by using =impatient-mode= with web-browser, when the svg file modified the
>> preview will be changed at the same time.
>
> It would probably be a good idea to add support for some kind of
> "simultaneous preview" to the nxml-mode when editing an SVG, such that
> it creates an auxiliary buffer in image-mode and updates it e.g. when
> you save the file.
>
> The same probably holds for other similar text+image formats, like XPM
> and PostScript.
>
> Maybe it should be some kind of `image-minor-mode` which lets you either
> switch between `image-mode` and some other mode (like now) or display
> the image in an auxiliary buffer.
>
>
>         Stefan


-- 
Best Regards.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#73663: 29.4; indirect-buffer behaviour is not correct
  2024-10-12 12:56           ` PENG Kevin
@ 2024-10-12 14:26             ` Eli Zaretskii
  0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2024-10-12 14:26 UTC (permalink / raw)
  To: PENG Kevin; +Cc: michael_heerdegen, 73663-done, monnier

> From: PENG Kevin <kevin.remegame@gmail.com>
> Cc: michael_heerdegen@web.de, 73663@debbugs.gnu.org, monnier@iro.umontreal.ca
> Date: Sat, 12 Oct 2024 20:56:33 +0800
> 
> 
> Sure. Thank for your reply.
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > [+]
> >> From: PENG Kevin <kevin.remegame@gmail.com>
> >> Cc: Eli Zaretskii <eliz@gnu.org>, 73663@debbugs.gnu.org, Stefan Monnier
> >>  <monnier@iro.umontreal.ca>
> >> Date: Wed, 09 Oct 2024 13:23:23 +0800
> >> 
> >> Ok, i got a mistake to use indirect buffer in this way. The text properties of base buffer are shared with
> >> indirect buffers. 
> >> 
> >> Due to svg in emacs is not fully support, i have implemented this by using impatient-mode with
> >> web-browser, when the svg file modified the preview will be changed at the same time. 
> >
> > Thanks, so can we now close this non-bug?

Closing.





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-10-12 14:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).