Subject: bug#30823: 25.3; modification-hooks of overlays are not run in some cases

From: Ren Victor <[email-masked]>
Date: Thu, 15 Mar 2018 12:15:57 +0800

Two factors：

   1.  A commit of Emacs， modification-hooks might not be run in some cases:
    http://git.savannah.gnu.org/cgit/emacs.git/commit/src?id=564d811725596f15ecf543777e11504b47d2af86

   2.  In ggtags, an overlay is deleted in the overlay's modification-hooks:
    https://github.com/leoliu/ggtags/blob/eec392d2d639030c5a51bce8431f2815ad8e7bc5/ggtags.el#L2306

Deleted overlay ceases to be attached to the buffer. If the buffer of
the first overlay in the saved array doesn't match the current buffer,
then all the modification hooks will not be run in this buffer.

Thus modes that depends on modification-hooks won't work together with
ggtags-highlight-tag mode.

I think Emacs should support `delete-overlay' in modificaiton-hooks of
overlays, like ggtags.  So I report this bug.

In GNU Emacs 25.3.2 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
 of 2017-09-13 built on lcy01-32
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description:    Ubuntu 16.04.4 LTS

Configured using:
 'configure --build=x86_64-linux-gnu --prefix=/usr
 '--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
 '--infodir=${prefix}/share/info' --sysconfdir=/etc --localstatedir=/var
 --disable-silent-rules '--libdir=${prefix}/lib/x86_64-linux-gnu'
 '--libexecdir=${prefix}/lib/x86_64-linux-gnu' --disable-maintainer-mode
 --disable-dependency-tracking --prefix=/usr --sharedstatedir=/var/lib
 --program-suffix=25 --with-modules --with-x=yes --with-x-toolkit=gtk3
 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat
 -Werror=format-security' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'
 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES

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

Major mode: Emacs-Lisp

Minor modes in effect:
  savehist-mode: t
  desktop-save-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  pyvenv-mode: t
  diff-auto-refine-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  shell-dirtrack-mode: t
  global-ede-mode: t
  ede-minor-mode: t
  global-semanticdb-minor-mode: t
  global-semantic-idle-scheduler-mode: t
  global-semantic-stickyfunc-mode: t
  semantic-mode: t
  outline-minor-mode: t
  winner-mode: t
  midnight-mode: t
  ido-ubiquitous-mode: t
  ido-everywhere: t
  show-paren-mode: t
  override-global-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
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Quit
Mark set
Starting "look" process...
Spell-checking suspended; use C-u M-$ to resume
Quit
semantic-analyze-possible-completions: Nothing to complete
<C-return> is undefined
Mark set [3 times]
Mark saved where search started
Mark set
Quit [2 times]

Load-path shadows:
/home/victor/.emacs.d/site-lisp/other/emacs-goodies-el/htmlize hides
/home/victor/.emacs.d/elpa/htmlize-20161211.1019/htmlize
/home/victor/.emacs.d/site-lisp/other/xml-rpc hides
/home/victor/.emacs.d/elpa/xml-rpc-20160430.1458/xml-rpc
/usr/share/emacs/site-lisp/dictionaries-common/flyspell hides
/usr/share/emacs/25.3/lisp/textmodes/flyspell
/usr/share/emacs/site-lisp/dictionaries-common/ispell hides
/usr/share/emacs/25.3/lisp/textmodes/ispell

Features:
(shadow sort mail-extr emacsbug semantic/analyze/complete
semantic/db-typecache semantic/ia semantic/senator ispell misearch
multi-isearch semantic/tag-write time-stamp semantic/edit thingatpt
sh-script smie bug-reference inversion ede/locate ede/emacs ede/dired
ggtags ewoc vc-git semantic/tag-file semantic/db-file data-debug
cedet-files semantic/bovine/c semantic/decorate/include
semantic/decorate/mode semantic/decorate pulse hideif
semantic/bovine/c-by semantic/lex-spp semantic/bovine/gcc
semantic/bovine semantic/analyze/refs semantic/db-find semantic/db-ref
semantic/analyze semantic/sort semantic/scope semantic/analyze/fcn
eassist derived xcscope tempo-snippets tempo cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs savehist
desktop frameset yasnippet highlight-indentation flymake company elpy
pyvenv elpy-profile elpy-django elpy-refactor python tramp-sh tramp
tramp-compat auth-source tramp-loaddefs trampver ucs-normalize json map
grep compile files-x etags xref project magit-bookmark magit-obsolete
magit-blame magit-stash magit-bisect magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-branch magit-files
magit-refs magit-status magit magit-repos magit-apply magit-wip
magit-log magit-diff smerge-mode diff-mode magit-core magit-autorevert
autorevert filenotify magit-process magit-margin magit-mode magit-git
magit-section magit-popup git-commit magit-utils crm log-edit message
rfc822 mml mml-sec password-cache epg mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader pcvs-util add-log
with-editor async-bytecomp async shell dash linum ascii ind-util
ede/speedbar ede/files ede ede/detect ede/base ede/auto ede/source
eieio-speedbar speedbar sb-image dframe eieio-custom semantic/dep
cedet-cscope semantic/db-mode semantic/db eieio-base semantic/idle
semantic/format ezimage semantic/tag-ls semantic/find semantic/ctxt
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw eieio eieio-core mode-local cedet bookmark pp ox-latex
ox-icalendar ox-html ox-ascii ox-publish ox org-element org-w3m
org-rmail org-mhe org-irc org-info org-gnus gnus-util org-docview
doc-view subr-x jka-compr image-mode org-bibtex bibtex org-bbdb
org-timer org-agenda org-drill org-learn org-id hi-lock org org-macro
org-footnote org-pcomplete org-list org-faces org-entities foldout
noutline outline org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob
ob-table ob-exp org-src ob-keys ob-comint ob-core ob-eval org-compat
org-macs org-loaddefs format-spec review ediff-merg ediff-wind
ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff clearcase
tq executable find-dired em-smart pcomplete comint ansi-color esh-var
esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg esh-groups eshell
esh-module esh-mode esh-util windmove winner ring iedit-rect iedit
help-macro iedit-lib multiple-cursors-core advice rect sgml-mode server
find-func midnight timid dired-x dired ido-completing-read+ cl-seq
memoize s cus-edit ido avoid appt diary-lib diary-loaddefs cal-menu
calendar cal-loaddefs china-util color-theme edmacro kmacro wid-edit
sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr
mail-utils reporter tango-dark-theme which-func imenu paren cus-start
cus-load use-package diminish cl bind-key cl-macs easy-mmode finder-inf
info package epg-config seq byte-opt gv bytecomp byte-compile cl-extra
help-mode easymenu cconv cl-loaddefs pcase cl-lib time-date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core 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 charscript case-table epa-hook
jka-cmpr-hook help simple abbrev 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 dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 827761 49911)
 (symbols 48 60403 0)
 (miscs 40 6321 1476)
 (strings 32 187894 21294)
 (string-bytes 1 5238739)
 (vectors 16 83599)
 (vector-slots 8 1620433 24408)
 (floats 8 1710 398)
 (intervals 56 11676 53)
 (buffers 976 45)
 (heap 1024 103137 3680))