Subject: 26.1; sgml-mode: Match data clobbered by buffer modification hooks
From: Vladimir Alexiev <[email-masked]>
To: [email-masked]
Date: Fri, 27 Mar 2020 20:16:29 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

When  sgml-electric-tag-pair-mode is enabled  in nxml-mode
and I try query-replace of a tag name, the first match is replaced and
then I get this error:

Debugger entered--Lisp error: (error "Match data clobbered by buffer
modification hooks")
  replace-match("name" nil t)
  replace-match-maybe-edit("name" nil t nil (1803 1814 #<buffer
Fahrstromrückleitung-en.xml>) nil)
  perform-replace("designation" "name" t nil nil nil nil nil nil nil nil)
  query-replace("designation" "name" nil nil nil nil nil)
  funcall-interactively(query-replace "designation" "name" nil nil nil nil
nil)
  call-interactively(query-replace nil nil)
  command-execute(query-replace)

In GNU Emacs 26.1 (build 1, i686-w64-mingw32)
 of 2018-05-30 built on CIRROCUMULUS
Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea
Windowing system distributor 'Microsoft Corp.', version 10.0.18362
Recent messages:
Entering debugger...
Making completion list... [2 times]
Back to top level
Mark set
Replaced 0 occurrences
Mark set
sgml-electric-tag-pair-before-change-function: new clone
Entering debugger...
Mark set [2 times]
Back to top level

Configured using:
 'configure --without-dbus --host=i686-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS THREADS LCMS2

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: cp1251

Major mode: nXML

Minor modes in effect:
  sgml-electric-tag-pair-mode: t
  override-global-mode: t
  flycheck-color-mode-line-mode: t
  window-numbering-mode: t
  winner-mode: t
  shell-dirtrack-mode: t
  global-flycheck-mode: t
  flycheck-mode: t
  diff-auto-refine-mode: t
  desktop-save-mode: t
  show-paren-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  global-visual-line-mode: t
  visual-line-mode: t
  transient-mark-mode: t

Load-path shadows:
~/emacs/lisp/rnc-mode hides
c:/my/.emacs.d/elpa/rnc-mode-20121227.1502/rnc-mode
~/emacs/lisp/smart-compile hides
c:/my/.emacs.d/elpa/smart-compile-20180316.330/smart-compile
~/emacs/lisp/bibtex hides c:/Emacs/share/emacs/26.1/lisp/textmodes/bibtex
c:/my/.emacs.d/elpa/cperl-mode-20140309.122/cperl-mode hides
c:/Emacs/share/emacs/26.1/lisp/progmodes/cperl-mode
c:/my/.emacs.d/elpa/org-20190311/ox hides
c:/Emacs/share/emacs/26.1/lisp/org/ox
c:/my/.emacs.d/elpa/org-20190311/ox-texinfo hides
c:/Emacs/share/emacs/26.1/lisp/org/ox-texinfo
c:/my/.emacs.d/elpa/org-20190311/ox-publish hides
c:/Emacs/share/emacs/26.1/lisp/org/ox-publish
c:/my/.emacs.d/elpa/org-20190311/ox-org hides
c:/Emacs/share/emacs/26.1/lisp/org/ox-org
c:/my/.emacs.d/elpa/org-20190311/ox-odt hides
c:/Emacs/share/emacs/26.1/lisp/org/ox-odt
c:/my/.emacs.d/elpa/org-20190311/ox-md hides
c:/Emacs/share/emacs/26.1/lisp/org/ox-md
c:/my/.emacs.d/elpa/org-20190311/ox-man hides
c:/Emacs/share/emacs/26.1/lisp/org/ox-man
c:/my/.emacs.d/elpa/org-20190311/ox-latex hides
c:/Emacs/share/emacs/26.1/lisp/org/ox-latex
c:/my/.emacs.d/elpa/org-20190311/ox-icalendar hides
c:/Emacs/share/emacs/26.1/lisp/org/ox-icalendar
c:/my/.emacs.d/elpa/org-20190311/ox-html hides
c:/Emacs/share/emacs/26.1/lisp/org/ox-html
c:/my/.emacs.d/elpa/org-20190311/ox-beamer hides
c:/Emacs/share/emacs/26.1/lisp/org/ox-beamer
c:/my/.emacs.d/elpa/org-20190311/ox-ascii hides
c:/Emacs/share/emacs/26.1/lisp/org/ox-ascii
c:/my/.emacs.d/elpa/org-20190311/org hides
c:/Emacs/share/emacs/26.1/lisp/org/org
c:/my/.emacs.d/elpa/org-20190311/org-w3m hides
c:/Emacs/share/emacs/26.1/lisp/org/org-w3m
c:/my/.emacs.d/elpa/org-20190311/org-version hides
c:/Emacs/share/emacs/26.1/lisp/org/org-version
c:/my/.emacs.d/elpa/org-20190311/org-timer hides
c:/Emacs/share/emacs/26.1/lisp/org/org-timer
c:/my/.emacs.d/elpa/org-20190311/org-table hides
c:/Emacs/share/emacs/26.1/lisp/org/org-table
c:/my/.emacs.d/elpa/org-20190311/org-src hides
c:/Emacs/share/emacs/26.1/lisp/org/org-src
c:/my/.emacs.d/elpa/org-20190311/org-rmail hides
c:/Emacs/share/emacs/26.1/lisp/org/org-rmail
c:/my/.emacs.d/elpa/org-20190311/org-protocol hides
c:/Emacs/share/emacs/26.1/lisp/org/org-protocol
c:/my/.emacs.d/elpa/org-20190311/org-plot hides
c:/Emacs/share/emacs/26.1/lisp/org/org-plot
c:/my/.emacs.d/elpa/org-20190311/org-pcomplete hides
c:/Emacs/share/emacs/26.1/lisp/org/org-pcomplete
c:/my/.emacs.d/elpa/org-20190311/org-mouse hides
c:/Emacs/share/emacs/26.1/lisp/org/org-mouse
c:/my/.emacs.d/elpa/org-20190311/org-mobile hides
c:/Emacs/share/emacs/26.1/lisp/org/org-mobile
c:/my/.emacs.d/elpa/org-20190311/org-mhe hides
c:/Emacs/share/emacs/26.1/lisp/org/org-mhe
c:/my/.emacs.d/elpa/org-20190311/org-macs hides
c:/Emacs/share/emacs/26.1/lisp/org/org-macs
c:/my/.emacs.d/elpa/org-20190311/org-macro hides
c:/Emacs/share/emacs/26.1/lisp/org/org-macro
c:/my/.emacs.d/elpa/org-20190311/org-loaddefs hides
c:/Emacs/share/emacs/26.1/lisp/org/org-loaddefs
c:/my/.emacs.d/elpa/org-20190311/org-list hides
c:/Emacs/share/emacs/26.1/lisp/org/org-list
c:/my/.emacs.d/elpa/org-20190311/org-lint hides
c:/Emacs/share/emacs/26.1/lisp/org/org-lint
c:/my/.emacs.d/elpa/org-20190311/org-irc hides
c:/Emacs/share/emacs/26.1/lisp/org/org-irc
c:/my/.emacs.d/elpa/org-20190311/org-install hides
c:/Emacs/share/emacs/26.1/lisp/org/org-install
c:/my/.emacs.d/elpa/org-20190311/org-inlinetask hides
c:/Emacs/share/emacs/26.1/lisp/org/org-inlinetask
c:/my/.emacs.d/elpa/org-20190311/org-info hides
c:/Emacs/share/emacs/26.1/lisp/org/org-info
c:/my/.emacs.d/elpa/org-20190311/org-indent hides
c:/Emacs/share/emacs/26.1/lisp/org/org-indent
c:/my/.emacs.d/elpa/org-20190311/org-id hides
c:/Emacs/share/emacs/26.1/lisp/org/org-id
c:/my/.emacs.d/elpa/org-20190311/org-habit hides
c:/Emacs/share/emacs/26.1/lisp/org/org-habit
c:/my/.emacs.d/elpa/org-20190311/org-gnus hides
c:/Emacs/share/emacs/26.1/lisp/org/org-gnus
c:/my/.emacs.d/elpa/org-20190311/org-footnote hides
c:/Emacs/share/emacs/26.1/lisp/org/org-footnote
c:/my/.emacs.d/elpa/org-20190311/org-feed hides
c:/Emacs/share/emacs/26.1/lisp/org/org-feed
c:/my/.emacs.d/elpa/org-20190311/org-faces hides
c:/Emacs/share/emacs/26.1/lisp/org/org-faces
c:/my/.emacs.d/elpa/org-20190311/org-eww hides
c:/Emacs/share/emacs/26.1/lisp/org/org-eww
c:/my/.emacs.d/elpa/org-20190311/org-eshell hides
c:/Emacs/share/emacs/26.1/lisp/org/org-eshell
c:/my/.emacs.d/elpa/org-20190311/org-entities hides
c:/Emacs/share/emacs/26.1/lisp/org/org-entities
c:/my/.emacs.d/elpa/org-20190311/org-element hides
c:/Emacs/share/emacs/26.1/lisp/org/org-element
c:/my/.emacs.d/elpa/org-20190311/org-duration hides
c:/Emacs/share/emacs/26.1/lisp/org/org-duration
c:/my/.emacs.d/elpa/org-20190311/org-docview hides
c:/Emacs/share/emacs/26.1/lisp/org/org-docview
c:/my/.emacs.d/elpa/org-20190311/org-datetree hides
c:/Emacs/share/emacs/26.1/lisp/org/org-datetree
c:/my/.emacs.d/elpa/org-20190311/org-ctags hides
c:/Emacs/share/emacs/26.1/lisp/org/org-ctags
c:/my/.emacs.d/elpa/org-20190311/org-crypt hides
c:/Emacs/share/emacs/26.1/lisp/org/org-crypt
c:/my/.emacs.d/elpa/org-20190311/org-compat hides
c:/Emacs/share/emacs/26.1/lisp/org/org-compat
c:/my/.emacs.d/elpa/org-20190311/org-colview hides
c:/Emacs/share/emacs/26.1/lisp/org/org-colview
c:/my/.emacs.d/elpa/org-20190311/org-clock hides
c:/Emacs/share/emacs/26.1/lisp/org/org-clock
c:/my/.emacs.d/elpa/org-20190311/org-capture hides
c:/Emacs/share/emacs/26.1/lisp/org/org-capture
c:/my/.emacs.d/elpa/org-20190311/org-bibtex hides
c:/Emacs/share/emacs/26.1/lisp/org/org-bibtex
c:/my/.emacs.d/elpa/org-20190311/org-bbdb hides
c:/Emacs/share/emacs/26.1/lisp/org/org-bbdb
c:/my/.emacs.d/elpa/org-20190311/org-attach hides
c:/Emacs/share/emacs/26.1/lisp/org/org-attach
c:/my/.emacs.d/elpa/org-20190311/org-archive hides
c:/Emacs/share/emacs/26.1/lisp/org/org-archive
c:/my/.emacs.d/elpa/org-20190311/org-agenda hides
c:/Emacs/share/emacs/26.1/lisp/org/org-agenda
c:/my/.emacs.d/elpa/org-20190311/ob hides
c:/Emacs/share/emacs/26.1/lisp/org/ob
c:/my/.emacs.d/elpa/org-20190311/ob-vala hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-vala
c:/my/.emacs.d/elpa/org-20190311/ob-tangle hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-tangle
c:/my/.emacs.d/elpa/org-20190311/ob-table hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-table
c:/my/.emacs.d/elpa/org-20190311/ob-stan hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-stan
c:/my/.emacs.d/elpa/org-20190311/ob-sqlite hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-sqlite
c:/my/.emacs.d/elpa/org-20190311/ob-sql hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-sql
c:/my/.emacs.d/elpa/org-20190311/ob-shen hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-shen
c:/my/.emacs.d/elpa/org-20190311/ob-shell hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-shell
c:/my/.emacs.d/elpa/org-20190311/ob-sed hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-sed
c:/my/.emacs.d/elpa/org-20190311/ob-screen hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-screen
c:/my/.emacs.d/elpa/org-20190311/ob-scheme hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-scheme
c:/my/.emacs.d/elpa/org-20190311/ob-sass hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-sass
c:/my/.emacs.d/elpa/org-20190311/ob-ruby hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-ruby
c:/my/.emacs.d/elpa/org-20190311/ob-ref hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-ref
c:/my/.emacs.d/elpa/org-20190311/ob-R hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-R
c:/my/.emacs.d/elpa/org-20190311/ob-python hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-python
c:/my/.emacs.d/elpa/org-20190311/ob-processing hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-processing
c:/my/.emacs.d/elpa/org-20190311/ob-plantuml hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-plantuml
c:/my/.emacs.d/elpa/org-20190311/ob-picolisp hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-picolisp
c:/my/.emacs.d/elpa/org-20190311/ob-perl hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-perl
c:/my/.emacs.d/elpa/org-20190311/ob-org hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-org
c:/my/.emacs.d/elpa/org-20190311/ob-octave hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-octave
c:/my/.emacs.d/elpa/org-20190311/ob-ocaml hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-ocaml
c:/my/.emacs.d/elpa/org-20190311/ob-mscgen hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-mscgen
c:/my/.emacs.d/elpa/org-20190311/ob-maxima hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-maxima
c:/my/.emacs.d/elpa/org-20190311/ob-matlab hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-matlab
c:/my/.emacs.d/elpa/org-20190311/ob-makefile hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-makefile
c:/my/.emacs.d/elpa/org-20190311/ob-lua hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-lua
c:/my/.emacs.d/elpa/org-20190311/ob-lob hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-lob
c:/my/.emacs.d/elpa/org-20190311/ob-lisp hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-lisp
c:/my/.emacs.d/elpa/org-20190311/ob-lilypond hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-lilypond
c:/my/.emacs.d/elpa/org-20190311/ob-ledger hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-ledger
c:/my/.emacs.d/elpa/org-20190311/ob-latex hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-latex
c:/my/.emacs.d/elpa/org-20190311/ob-keys hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-keys
c:/my/.emacs.d/elpa/org-20190311/ob-js hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-js
c:/my/.emacs.d/elpa/org-20190311/ob-java hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-java
c:/my/.emacs.d/elpa/org-20190311/ob-J hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-J
c:/my/.emacs.d/elpa/org-20190311/ob-io hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-io
c:/my/.emacs.d/elpa/org-20190311/ob-hledger hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-hledger
c:/my/.emacs.d/elpa/org-20190311/ob-haskell hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-haskell
c:/my/.emacs.d/elpa/org-20190311/ob-groovy hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-groovy
c:/my/.emacs.d/elpa/org-20190311/ob-gnuplot hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-gnuplot
c:/my/.emacs.d/elpa/org-20190311/ob-fortran hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-fortran
c:/my/.emacs.d/elpa/org-20190311/ob-forth hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-forth
c:/my/.emacs.d/elpa/org-20190311/ob-exp hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-exp
c:/my/.emacs.d/elpa/org-20190311/ob-eval hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-eval
c:/my/.emacs.d/elpa/org-20190311/ob-emacs-lisp hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-emacs-lisp
c:/my/.emacs.d/elpa/org-20190311/ob-ebnf hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-ebnf
c:/my/.emacs.d/elpa/org-20190311/ob-dot hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-dot
c:/my/.emacs.d/elpa/org-20190311/ob-ditaa hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-ditaa
c:/my/.emacs.d/elpa/org-20190311/ob-css hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-css
c:/my/.emacs.d/elpa/org-20190311/ob-core hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-core
c:/my/.emacs.d/elpa/org-20190311/ob-coq hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-coq
c:/my/.emacs.d/elpa/org-20190311/ob-comint hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-comint
c:/my/.emacs.d/elpa/org-20190311/ob-clojure hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-clojure
c:/my/.emacs.d/elpa/org-20190311/ob-calc hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-calc
c:/my/.emacs.d/elpa/org-20190311/ob-C hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-C
c:/my/.emacs.d/elpa/org-20190311/ob-awk hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-awk
c:/my/.emacs.d/elpa/org-20190311/ob-asymptote hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-asymptote
c:/my/.emacs.d/elpa/org-20190311/ob-abc hides
c:/Emacs/share/emacs/26.1/lisp/org/ob-abc

Features:
(shadow mail-extr emacsbug message rmc puny rfc822 mml mml-sec epa epg
gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils cus-edit cus-start cus-load
wid-edit cl-print debug tmm eieio-opt speedbar sb-image ezimage dframe
help-fns radix-tree apropos ibuf-ext ibuffer ibuffer-loaddefs
flymake-proc flymake compile warnings auto-complete popup rect sort
markdown-toc s dabbrev cal-move parse-time browse-url time-stamp
ox-reveal ox-latex ox-rst ox-ascii ox-html table ox-publish ox misearch
multi-isearch flycheck-yamllint yaml-mode rng-xsd xsd-regexp rng-cmpct
rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt
rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap sgml-mode dom
nxml-util nxml-enc xmltok hide-copyleft elec-pair cperl-mode imenu
image-file n3-mode use-package-bind-key bind-key
smart-mode-line-light-theme smart-mode-line rich-minority
use-package-core flycheck-color-mode-line face-remap flyspell ispell
derived window-numbering winner server graphql-mode org-indent org-tempo
tempo org-protocol org-mouse org-info org-docview doc-view jka-compr
image-mode dired dired-loaddefs org-crypt org-bibtex org-attach org-id
org-element avl-tree generator ob-sparql sparql-mode url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util mailcap ob-shell shell ob-salt ob-plantuml ob-perl ob-dot
ob-ditaa org-inset-dblock org ob ob-tangle ob-ref ob-lob ob-table ob-exp
org-macro org-footnote org-src ob-comint ob-keys org-pcomplete pcomplete
comint ansi-color ring org-list org-faces org-entities org-version
ob-emacs-lisp ob-core ob-eval org-compat org-macs org-loaddefs
format-spec cal-menu calendar cal-loaddefs markdown-mode color noutline
outline flycheck cl-extra json map find-func help-mode rx subr-x dash
vc-git diff-mode easy-mmode bibtex desktop frameset paren ffap thingatpt
edmacro kmacro advice cl finder-inf info package easymenu epg-config
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib time-date mule-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32
ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core term/tty-colors frame cl-generic
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 charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote w32notify w32 lcms2
multi-tty make-network-process emacs)

Memory information:
((conses 8 761566 121032)
 (symbols 32 48416 7)
 (miscs 32 5264 2165)
 (strings 16 167445 6624)
 (string-bytes 1 4510650)
 (vectors 12 59431)
 (vector-slots 4 1869221 29654)
 (floats 8 405 1065)
 (intervals 28 50139 4859)
 (buffers 536 90))