From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 15 00:16:17 2018 Received: (at submit) by debbugs.gnu.org; 15 Mar 2018 04:16:17 +0000 Received: from localhost ([127.0.0.1]:33898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ewKJM-0001Cw-TI for submit@debbugs.gnu.org; Thu, 15 Mar 2018 00:16:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49207) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ewKJI-0001Ch-UJ for submit@debbugs.gnu.org; Thu, 15 Mar 2018 00:16:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewKJB-0002lm-Ok for submit@debbugs.gnu.org; Thu, 15 Mar 2018 00:16:07 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42165) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ewKJB-0002le-Ks for submit@debbugs.gnu.org; Thu, 15 Mar 2018 00:16:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewKJ9-0006CZ-Im for bug-gnu-emacs@gnu.org; Thu, 15 Mar 2018 00:16:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewKJ7-0002jL-TP for bug-gnu-emacs@gnu.org; Thu, 15 Mar 2018 00:16:03 -0400 Received: from mail-lf0-x234.google.com ([2a00:1450:4010:c07::234]:37717) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ewKJ7-0002ii-GH for bug-gnu-emacs@gnu.org; Thu, 15 Mar 2018 00:16:01 -0400 Received: by mail-lf0-x234.google.com with SMTP id y19-v6so8078288lfd.4 for ; Wed, 14 Mar 2018 21:16:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=5QWMIu7GL963WC8XpPsqgztbtnYsS9lRreIy0C3uRcQ=; b=DJNeCbgVtI9h3y3xkfZRIo72lAydVxLunHvQlI55JeHcq+Ou7vwBjXzkPGR4N+ipln FQg9MZflHreMtjP1U288aePK1Y68pofQ6Lokg5/X02tjTWJYx23TG62cVWY24MsMhJ9f uy0TPjEBoVy5UUB44sQa1gjZUydZyoS1ZrST6X8O8Cn1Ajxgqh2HMGK1EQRsNUVbWSZM qfY59/vBjDL+Fa12QN1dsFkN1K+bTrU/NY06rtqZhWGRsHqhNBSJI7+faxe7lv5GXvk3 GdJ21ClIByUwj99cM48skO/ECxAtP858gyEM6dA19YEy1xiNeUH3norNW007C9hbjpy5 u5hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=5QWMIu7GL963WC8XpPsqgztbtnYsS9lRreIy0C3uRcQ=; b=RE6sqONbPEAdEnOB0Czx5zedhzsf5S7DRmXUkI4R/0yGBUBsQ/wGefhqAzZkUbYGXc hfd/jEECszfUlZZubmJC+7Xe3qyl9nZIkc1mNFNwAwXT1wIkcFNkU0JeHcXvGv80uuVd 18WtfJ3FIiqoyb0o3ovd71O78qTMH1rYXdX5h9spPtsUI9G2p6ogHZmAQp5W5HMV4k+K drXt+UMNQog9bfFrm/BAH5jLYF+KmquG6TVxkgGfpA/1f0spSRH/x96aI/rqJGN9CWRK sAxv9X4bzhMexWXlS9cbqSRd+GaVK3QYhSfrUvcnLTy1bq45NDKfpEcPBdVKmIREAYNW /s4A== X-Gm-Message-State: AElRT7EFxAi3dZ6FQDgdD7yQV9rOC3qNjK7WzSjUCfwnujH7hf+r5FdL hg2q51waeukU2Ac2KVvQctna9LodPYNVORmCrpTKSA== X-Google-Smtp-Source: AG47ELtlTN77lHy6xnl5YSJ0b7iwM/HNCXiSVDzDoju8G6fyUqsIa2ybAmgIOYXdbZmdQpihP6RzpThgaAS8ri+rgLQ= X-Received: by 2002:a19:fe2:: with SMTP id 95-v6mr5329132lfp.13.1521087357975; Wed, 14 Mar 2018 21:15:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.157.146 with HTTP; Wed, 14 Mar 2018 21:15:57 -0700 (PDT) From: Ren Victor Date: Thu, 15 Mar 2018 12:15:57 +0800 Message-ID: Subject: 25.3; modification-hooks of overlays are not run in some cases To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Two factors=EF=BC=9A 1. A commit of Emacs=EF=BC=8C modification-hooks might not be run in so= me cases: http://git.savannah.gnu.org/cgit/emacs.git/commit/src?id=3D564d81172559= 6f15ecf543777e11504b47d2af86 2. In ggtags, an overlay is deleted in the overlay's modification-hooks= : https://github.com/leoliu/ggtags/blob/eec392d2d639030c5a51bce8431f2815a= d8e7bc5/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=3Dx86_64-linux-gnu --prefix=3D/usr '--includedir=3D${prefix}/include' '--mandir=3D${prefix}/share/man' '--infodir=3D${prefix}/share/info' --sysconfdir=3D/etc --localstatedir=3D/= var --disable-silent-rules '--libdir=3D${prefix}/lib/x86_64-linux-gnu' '--libexecdir=3D${prefix}/lib/x86_64-linux-gnu' --disable-maintainer-mode --disable-dependency-tracking --prefix=3D/usr --sharedstatedir=3D/var/lib --program-suffix=3D25 --with-modules --with-x=3Dyes --with-x-toolkit=3Dgtk= 3 'CFLAGS=3D-g -O2 -fstack-protector-strong -Wformat -Werror=3Dformat-security' 'CPPFLAGS=3D-Wdate-time -D_FORTIFY_SOURCE=3D2' 'LDFLAGS=3D-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=3Dfcitx 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 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)) From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 15 02:00:53 2018 Received: (at 30823) by debbugs.gnu.org; 15 Mar 2018 06:00:53 +0000 Received: from localhost ([127.0.0.1]:33934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ewLwb-00047S-GA for submit@debbugs.gnu.org; Thu, 15 Mar 2018 02:00:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60903) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ewLwa-00047G-3l for 30823@debbugs.gnu.org; Thu, 15 Mar 2018 02:00:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewLwR-0001VL-Ky for 30823@debbugs.gnu.org; Thu, 15 Mar 2018 02:00:46 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewLwR-0001VD-Gg; Thu, 15 Mar 2018 02:00:43 -0400 Received: from [176.228.60.248] (port=2206 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ewLwQ-0007FE-Pe; Thu, 15 Mar 2018 02:00:43 -0400 Date: Thu, 15 Mar 2018 08:00:40 +0200 Message-Id: <83lgetri7r.fsf@gnu.org> From: Eli Zaretskii To: Ren Victor In-reply-to: (message from Ren Victor on Thu, 15 Mar 2018 12:15:57 +0800) Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30823 Cc: 30823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Ren Victor > 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. Thanks. Can you provide a recipe starting from "emacs -Q" to reproduce the problem? From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 15 03:30:01 2018 Received: (at 30823) by debbugs.gnu.org; 15 Mar 2018 07:30:01 +0000 Received: from localhost ([127.0.0.1]:33983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ewNKq-0006Ko-Pf for submit@debbugs.gnu.org; Thu, 15 Mar 2018 03:30:01 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:41539) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ewNKp-0006KX-6b for 30823@debbugs.gnu.org; Thu, 15 Mar 2018 03:29:59 -0400 Received: by mail-lf0-f49.google.com with SMTP id m69-v6so8581172lfe.8 for <30823@debbugs.gnu.org>; Thu, 15 Mar 2018 00:29:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=W+XyePt+Yjyq4rEDuZr3dzLYsDwjdJAsn4avtSxiKFc=; b=nfU7xdO+u6yGVGTPqeVDFXVxktmHZabonDxYEH1+1USzbzNCmxZFMikpcjrm0Z+WeN nwI/N5zYb6zftxFZnQ6hZFXJL+0HQyYp0IrwOzTNn7VZHKV0EMVZuZHQe7YQwWe+AtcL EbMgse0i62D3m2tM3eUlZEGt7TTJQiKpVTDxhT3TMMJBsIUy7FIHzbFIWwZOIsXiicEG iABoGcAglcBRdu1zYf30yngWRCVO3YTi3wROwkvBK5wRdKinvgebca6g4Zi5Lbs79EYz of43FQX71ebNnUmSgcDUrEBGWL/JRA6Zb6BkI0musZVbTPMmReJ3iP5I6tW84Jwym/mu 0z7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=W+XyePt+Yjyq4rEDuZr3dzLYsDwjdJAsn4avtSxiKFc=; b=c8zy61uC4AHLpt9Q8FPYpaJ6oSeSwll8a/oMI2rbNSVWI+sc7XeZBANr5EP7gEQs8C jSfbiGnzx8sjCa7mkI9ilfM4fz9/MZCOeok6kBPzfXelumKrp0g6hmjuKfLahrbm1kwI h8VQwG9Nb4l/SME1k1gs04tZNGxL8gRhVY2nSr2HtJ2xmv6FZINl6KYCqhwXQsXp0O6h 2oL+6INpXwNvebsEfjV04PE+9hW5pdabmFsKl1O+9rH5FrWNTp/XlHt1KW6ylqn9IM+9 4wkFJ/h48+hfLSCtp0k9R7E/6KhKue2AdXrEufv8hlzUAOAAdXLdy/wOD9XLHBdYXhuf 28+w== X-Gm-Message-State: AElRT7Eqxg6GAC+pE53S02I000wC0W4f3IbiiAFtrgbgloI1aGq+A6u3 0c74d6yWWYOIJ6O3P3z5F8D7aTw9lVcBzTPH7SE= X-Google-Smtp-Source: AG47ELtWsMJ1Po86fruwqKzerqwpINgEYuLdERErj3brsP+JAXeJSYTKZlOgC8zpzni1V8TJR0L0UCQDHqugfXtVqoE= X-Received: by 2002:a19:da1a:: with SMTP id r26-v6mr5701912lfg.76.1521098993397; Thu, 15 Mar 2018 00:29:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.157.146 with HTTP; Thu, 15 Mar 2018 00:29:52 -0700 (PDT) In-Reply-To: <83lgetri7r.fsf@gnu.org> References: <83lgetri7r.fsf@gnu.org> From: Ren Victor Date: Thu, 15 Mar 2018 15:29:52 +0800 Message-ID: Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases To: Eli Zaretskii Content-Type: multipart/mixed; boundary="0000000000002b8c6505676e75a6" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30823 Cc: 30823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --0000000000002b8c6505676e75a6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 15, 2018 at 2:00 PM, Eli Zaretskii wrote: >> From: Ren Victor >> Date: Thu, 15 Mar 2018 12:15:57 +0800 >> >> Two factors=EF=BC=9A >> >> 1. A commit of Emacs=EF=BC=8C modification-hooks might not be run in= some cases: >> http://git.savannah.gnu.org/cgit/emacs.git/commit/src?id=3D564d81172= 5596f15ecf543777e11504b47d2af86 >> >> 2. In ggtags, an overlay is deleted in the overlay's modification-ho= oks: >> https://github.com/leoliu/ggtags/blob/eec392d2d639030c5a51bce8431f28= 15ad8e7bc5/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. > > Thanks. Can you provide a recipe starting from "emacs -Q" to > reproduce the problem? I wrote a ert case which is encolsed. emacs -Q -batch -l ert -l bug30823.el -f ert-run-tests-batch-and-exit --0000000000002b8c6505676e75a6 Content-Type: text/x-emacs-lisp; charset="US-ASCII"; name="bug30823.el" Content-Disposition: attachment; filename="bug30823.el" Content-Transfer-Encoding: base64 X-Attachment-Id: f_jes70jr00 KHJlcXVpcmUgJ2VydCkKCihlcnQtZGVmdGVzdCB0ZXN0LW1vZGlmaWNhdGlvbi1ob29rcyAoKQog ICJUZXN0IGZvciBidWcjMzA4MjMuIgogIChsZXQgKChjaGVjay1wb2ludCBuaWwpCgkob3YtZGVs ZXRlIG5pbCkKCShvdi1zZXQgbmlsKSkKICAgICh3aXRoLXRlbXAtYnVmZmVyCiAgICAgIChpbnNl cnQgImFiYyIpCiAgICAgIChzZXRxIG92LXNldCAobWFrZS1vdmVybGF5IDEgMykpCiAgICAgIChv dmVybGF5LXB1dCBvdi1zZXQgJ21vZGlmaWNhdGlvbi1ob29rcwoJCSAgIChsaXN0IChsYW1iZGEg KG8gYWZ0ZXIgJnJlc3QgX2FyZ3MpCgkJCSAgIChhbmQgYWZ0ZXIgKHNldHEgY2hlY2stcG9pbnQg dCkpKSkpCiAgICAgIChzZXRxIG92LWRlbGV0ZSAobWFrZS1vdmVybGF5IDEgMykpCiAgICAgIChv dmVybGF5LXB1dCBvdi1kZWxldGUgJ21vZGlmaWNhdGlvbi1ob29rcwoJCSAgIChsaXN0IChsYW1i ZGEgKG8gYWZ0ZXIgJnJlc3QgX2FyZ3MpCgkJCSAgIChhbmQgKG5vdCBhZnRlcikgKGRlbGV0ZS1v dmVybGF5IG8pKSkpKQogICAgICAoZ290by1jaGFyIDIpCiAgICAgIChpbnNlcnQgIjEiKQogICAg ICAoc2hvdWxkIChlcSBjaGVjay1wb2ludCB0KSkpKSkKCg== --0000000000002b8c6505676e75a6-- From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 31 09:52:03 2018 Received: (at 30823) by debbugs.gnu.org; 31 Mar 2018 13:52:03 +0000 Received: from localhost ([127.0.0.1]:60698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f2GvL-00006s-5E for submit@debbugs.gnu.org; Sat, 31 Mar 2018 09:52:03 -0400 Received: from mail-it0-f42.google.com ([209.85.214.42]:39490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f2GvJ-000064-A0; Sat, 31 Mar 2018 09:52:01 -0400 Received: by mail-it0-f42.google.com with SMTP id e98-v6so13988477itd.4; Sat, 31 Mar 2018 06:52:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=efiXiqMbAtBGCD20hpywbnyLUcWAJcSspP0ReVSJDqE=; b=JXjOXVw9oV/caXi7pQg0lkQoR2AWKUCY/8u1ntyfpNBi491n9uJai8KIhyHt3Vzalu XtG4Ka6xA3QcRMaUm0OeeTkWcYpFzRHLDV4sX+1imxeNPByLd4q7mkiLiR1iyiUhSbye ouhDXgY9m9J0HNlZyCVAq9STq5wUKVXyPevQXNno4fJZ9SZdAzr/MDMzFay1JDvKUKaE M3esM2MUjEm+o2ioO4aG1BTjQzCurvgVAC+Oy6tn1ng6ZLCE3v/Vn/fNYNbcr6VWfd0V LraFwZOkSx2fvUNFz/VUxaTGLD/FLesxtnZiUxAPGOpIG4YFaNa4TeeuIbDgAs3p49fG PGRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=efiXiqMbAtBGCD20hpywbnyLUcWAJcSspP0ReVSJDqE=; b=rM8KzrY/Kamnc7plejF5QiF1sOienVcPP9j/PAMkQJaPM7iMblxECj4ugaCq1NcAMu DwfzinjP8ksKRy+G9f3s3ZWyy/llsK3g66ht79YrJ0C14AiGKgVCJMBuAdAGSZkXhnSo RnBPJbyexOqGlEXNP6bzgyS/Fmqp9ORPaspm3tW8BBiezPctDnREpkZfY5KcW3lKdMLV RbqNXcITjFqVmVclYr0whCgQg5UHblXCMpW52sMZt/yRXbFkaK4o/2tGTEQoCIRMYA5v lbw15yaIbG3DyiF74EddqwVf1ROkAEnTqmDF2JfD5XGRoyIPie+vrdnbPJ9G+Oh74yxn IM/A== X-Gm-Message-State: ALQs6tD3PnqADiKWwki81FSrbJwNfEYgSsrkp2/wu+AcxPvN4/f9yux4 UAHgoygdaHet/czyhRRb8HjYrA== X-Google-Smtp-Source: AIpwx49IylrI7bVGgOdDtzMAUqG46HbY0s2MXL2IWpqMSwQ9uYjN1u4E7EEYS+yJuovV+cJ9tmdOdQ== X-Received: by 2002:a24:d3d0:: with SMTP id n199-v6mr6626010itg.141.1522504315501; Sat, 31 Mar 2018 06:51:55 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id d1sm6142205ioj.76.2018.03.31.06.51.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 31 Mar 2018 06:51:54 -0700 (PDT) From: Noam Postavsky To: Ren Victor Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> Date: Sat, 31 Mar 2018 09:51:53 -0400 In-Reply-To: (Ren Victor's message of "Thu, 15 Mar 2018 15:29:52 +0800") Message-ID: <87in9cpd3a.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30823 Cc: Eli Zaretskii , 30823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain tags 30823 + patch quit Ren Victor writes: > I wrote a ert case which is encolsed. > > emacs -Q -batch -l ert -l bug30823.el -f ert-run-tests-batch-and-exit Thanks, this patch seems to fix it. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v1-0001-Don-t-skip-modification-hooks-if-1st-overlay-is-d.patch Content-Description: patch >From 41cb2b33bc62a23a0561b94f3d25e1282935a08c Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 31 Mar 2018 09:33:41 -0400 Subject: [PATCH v1] Don't skip modification hooks if 1st overlay is deleted (Bug#30823) The fix for Bug#21824 "Don't invoke overlay modification hooks in wrong buffer" from 2015-11-06 prevented running of overlay hooks if the first overlay registered when running the hooks with after=nil was deleted (since a deleted overlay has no buffer, it was considered as not from the current buffer). Therefore, revert that change and instead just inhibit modification hooks when performing message coalescing (because in that case, we aren't doing the necessary preparation for running modification hooks, or even running them with after=nil at all). * src/buffer.c (report_overlay_modification): Remove checking of buffer overlay. * src/xdisp.c (message_dolog): Let-bind inhibit-modification-hooks to t around del_range_both calls * test/src/buffer-tests.el (test-modification-hooks): New test. --- src/buffer.c | 17 ----------------- src/xdisp.c | 9 +++++++++ test/src/buffer-tests.el | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/buffer.c b/src/buffer.c index 14837372d3..a5d65da2e8 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -4543,23 +4543,6 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after, Lisp_Object *copy; ptrdiff_t i; - if (size) - { - Lisp_Object ovl - = XVECTOR (last_overlay_modification_hooks)->contents[1]; - - /* If the buffer of the first overlay in the array doesn't - match the current buffer, then these modification hooks - should not be run in this buffer. This could happen when - some code calls some insdel functions, such as del_range_1, - with the PREPARE argument false -- in that case this - function is never called to record the overlay modification - hook functions in the last_overlay_modification_hooks - array, so anything we find there is not ours. */ - if (XMARKER (OVERLAY_START (ovl))->buffer != current_buffer) - return; - } - USE_SAFE_ALLOCA; SAFE_ALLOCA_LISP (copy, size); memcpy (copy, XVECTOR (last_overlay_modification_hooks)->contents, diff --git a/src/xdisp.c b/src/xdisp.c index df5335e4ac..082b40b742 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10403,6 +10403,13 @@ message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte) ptrdiff_t this_bol, this_bol_byte, prev_bol, prev_bol_byte; printmax_t dups; + /* Since we call del_range_both passing false for PREPARE, + we aren't prepared to run modification hooks (we could + end up calling modification hooks from another buffer and + only with AFTER=t, Bug#21824). */ + ptrdiff_t count = SPECPDL_INDEX (); + specbind (Qinhibit_modification_hooks, Qt); + insert_1_both ("\n", 1, 1, true, false, false); scan_newline (Z, Z_BYTE, BEG, BEG_BYTE, -2, false); @@ -10448,6 +10455,8 @@ message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte) -XFASTINT (Vmessage_log_max) - 1, false); del_range_both (BEG, BEG_BYTE, PT, PT_BYTE, false); } + + unbind_to (count, Qnil); } BEGV = marker_position (oldbegv); BEGV_BYTE = marker_byte_position (oldbegv); diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el index f9c477fbfd..5d091875b5 100644 --- a/test/src/buffer-tests.el +++ b/test/src/buffer-tests.el @@ -45,6 +45,25 @@ (should (eq buf (current-buffer)))) (when msg-ov (delete-overlay msg-ov)))))) +(ert-deftest test-modification-hooks () + "Test for bug#30823." + (let ((check-point nil) + (ov-delete nil) + (ov-set nil)) + (with-temp-buffer + (insert "abc") + (setq ov-set (make-overlay 1 3)) + (overlay-put ov-set 'modification-hooks + (list (lambda (_o after &rest _args) + (and after (setq check-point t))))) + (setq ov-delete (make-overlay 1 3)) + (overlay-put ov-delete 'modification-hooks + (list (lambda (o after &rest _args) + (and (not after) (delete-overlay o))))) + (goto-char 2) + (insert "1") + (should (eq check-point t))))) + (ert-deftest test-generate-new-buffer-name-bug27966 () (should-not (string-equal "nil" (progn (get-buffer-create "nil") -- 2.11.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 17 16:53:03 2018 Received: (at 30823) by debbugs.gnu.org; 17 Aug 2018 20:53:03 +0000 Received: from localhost ([127.0.0.1]:53792 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fqljz-0002e6-3w for submit@debbugs.gnu.org; Fri, 17 Aug 2018 16:53:03 -0400 Received: from mail-io0-f176.google.com ([209.85.223.176]:38495) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fqljx-0002dY-Ir for 30823@debbugs.gnu.org; Fri, 17 Aug 2018 16:53:01 -0400 Received: by mail-io0-f176.google.com with SMTP id y3-v6so3572723ioc.5 for <30823@debbugs.gnu.org>; Fri, 17 Aug 2018 13:53:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Ix1Uszu56y7NKacC1rNwRASfJaiY7imjdeL+SgNvGcw=; b=bZAcPu7gvl9Xik1VoecOnMw6Ea9cpSjW+BniHsUu46e1AehVGj7RQkfFdaesboI2Hm QRS8Un9JVkyDW9dSQmr6fijLLWx0c9stSKXmpJsgVC99R5mpJtGLiUp9+/eiGWdhUme8 rxBDbz0/eHtVVP+7RYlDPojKqIDd1PDQu0l1gGDdCs41cmXaZZukiuED37pxHNkoJkov Mn4QUr62aSbaebB6OPBrCuYNHeVikdwgHI+Q6XqjPlS/K+6L4PSGD+YnDWKyM3/Jok2j 1zguo9RI3Zrxl78ZS3kG4EkYQ/Od0PHejuHaufnCEWjGV7r6tt5vr+awoIUJtb/fnciC UvrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Ix1Uszu56y7NKacC1rNwRASfJaiY7imjdeL+SgNvGcw=; b=Hsog+n+JQlve+wN76CJ/17/FrxpSJTToJ9qhnb/03eKz3CUo7seCat2fzhE4yRHA55 bCQFaPCMYfJC/QOYNGhwivPfK16IRqz1OYSf4i9UKQmU7A507Le1fGseU3h/cSf3XFD+ StJpDSDdP0gxT0txE3M+azkPFtQOIktA8miqpl2TM54ubxsdPK/M9YrNhCq0yaEbAxew zNJcEDDQVpoFACXOX9PlY7QA3jBIEBVAcazB6DBJNhzNVn8uOJfDNFYWSUxupmsSpAMy Xz7tWDkGQhLpWhfrnTeKdwrd93gikjVvSYAnLKY6SCpMrdEmMTEXKiNNFW6Bi4wI30um WvqA== X-Gm-Message-State: AOUpUlFEtcqTOOldRDqbCOMyj4uoCWdLBV88LqeelxwpqUK2ldCKlfQm 40d4zDvbELcD+t3h9U3e8Z8= X-Google-Smtp-Source: AA+uWPzcJMqMFuHo7jO5S99VGLoBsfd4JVSJYOKxAm6rHlP01dNeY5UCVx+X67IJhGaweGgZ8pRoiQ== X-Received: by 2002:a6b:b0c5:: with SMTP id z188-v6mr30441071ioe.220.1534539175911; Fri, 17 Aug 2018 13:52:55 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id r3-v6sm1257387ioo.11.2018.08.17.13.52.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Aug 2018 13:52:55 -0700 (PDT) From: Noam Postavsky To: Ren Victor Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> Date: Fri, 17 Aug 2018 16:52:54 -0400 In-Reply-To: <87in9cpd3a.fsf@gmail.com> (Noam Postavsky's message of "Sat, 31 Mar 2018 09:51:53 -0400") Message-ID: <87in48ww9l.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30823 Cc: Eli Zaretskii , 30823@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Noam Postavsky writes: > @@ -10403,6 +10403,13 @@ message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte) > ptrdiff_t this_bol, this_bol_byte, prev_bol, prev_bol_byte; > printmax_t dups; > > + /* Since we call del_range_both passing false for PREPARE, > + we aren't prepared to run modification hooks (we could > + end up calling modification hooks from another buffer and > + only with AFTER=t, Bug#21824). */ > + ptrdiff_t count = SPECPDL_INDEX (); > + specbind (Qinhibit_modification_hooks, Qt); > + > insert_1_both ("\n", 1, 1, true, false, false); > > scan_newline (Z, Z_BYTE, BEG, BEG_BYTE, -2, false); Coming back to this, there is also the possibility of passing true for PREPARE, though I'm not sure if that would be better or worse. Any comments? (adding Stefan to Cc since I think this somewhat relates to/collides with the patch for *Messages* buffer text properties in https://lists.gnu.org/archive/html/emacs-devel/2018-05/msg00600.html). From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 18 02:49:33 2018 Received: (at 30823) by debbugs.gnu.org; 18 Aug 2018 06:49:33 +0000 Received: from localhost ([127.0.0.1]:53905 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fqv3F-0005Rg-B3 for submit@debbugs.gnu.org; Sat, 18 Aug 2018 02:49:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45075) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fqv3D-0005Qx-I0 for 30823@debbugs.gnu.org; Sat, 18 Aug 2018 02:49:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fqv37-0005cm-AN for 30823@debbugs.gnu.org; Sat, 18 Aug 2018 02:49:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqv30-0005bO-C3; Sat, 18 Aug 2018 02:49:18 -0400 Received: from [176.228.60.248] (port=4819 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fqv2z-0007th-MV; Sat, 18 Aug 2018 02:49:18 -0400 Date: Sat, 18 Aug 2018 09:49:08 +0300 Message-Id: <83o9e0f9uj.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-reply-to: <87in48ww9l.fsf@gmail.com> (message from Noam Postavsky on Fri, 17 Aug 2018 16:52:54 -0400) Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30823 Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Noam Postavsky > Cc: Eli Zaretskii , 30823@debbugs.gnu.org, Stefan Monnier > Date: Fri, 17 Aug 2018 16:52:54 -0400 > > Noam Postavsky writes: > > > @@ -10403,6 +10403,13 @@ message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte) > > ptrdiff_t this_bol, this_bol_byte, prev_bol, prev_bol_byte; > > printmax_t dups; > > > > + /* Since we call del_range_both passing false for PREPARE, > > + we aren't prepared to run modification hooks (we could > > + end up calling modification hooks from another buffer and > > + only with AFTER=t, Bug#21824). */ > > + ptrdiff_t count = SPECPDL_INDEX (); > > + specbind (Qinhibit_modification_hooks, Qt); > > + > > insert_1_both ("\n", 1, 1, true, false, false); > > > > scan_newline (Z, Z_BYTE, BEG, BEG_BYTE, -2, false); > > Coming back to this, there is also the possibility of passing true for > PREPARE, though I'm not sure if that would be better or worse. Any > comments? AFAIR, we never want to use PREPARE = true when dealing with the *Messages* buffer, you can see that elsewhere in message_dolog. The reason I believe is that we might trigger infinite recursion if the modification hooks log a message for some reason. Btw, I'm somewhat worried by the solution being proposed: it removes a general safety device and replaces it by a solution that targets only bug#21824, a much narrower class of problems. Is that wise? Can we turn the table and ask whether it makes sense to delete an overlay from the modification hooks of that same overlay? Maybe ggtags needs to find a better/safer solution for whatever feature it wants to implement? From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 18 23:48:10 2018 Received: (at 30823) by debbugs.gnu.org; 19 Aug 2018 03:48:10 +0000 Received: from localhost ([127.0.0.1]:54334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frEhG-0002yT-8Z for submit@debbugs.gnu.org; Sat, 18 Aug 2018 23:48:10 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:35603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frEhD-0002y0-EB for 30823@debbugs.gnu.org; Sat, 18 Aug 2018 23:48:08 -0400 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w7J3m3kP022413; Sat, 18 Aug 2018 23:48:04 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 756F5AE1ED; Sat, 18 Aug 2018 23:48:02 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases Message-ID: References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> Date: Sat, 18 Aug 2018 23:48:02 -0400 In-Reply-To: <83o9e0f9uj.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 18 Aug 2018 09:49:08 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6354=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6354> : inlines <6821> : streams <1795910> : uri <2691523> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 30823 Cc: victorhge@gmail.com, Noam Postavsky , 30823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Can we turn the table and ask whether it makes sense to delete an > overlay from the modification hooks of that same overlay? Yes, it very much does make sense: e.g. you want to keep track of a "region unmodified" status, so you place an overlay over that region with a modification hook that sets a variable to nil to indicate that the region was modified, and once that is done there's no point in keeping the overlay any more so you can delete it immediately from that modification-hook. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 19 10:47:12 2018 Received: (at 30823) by debbugs.gnu.org; 19 Aug 2018 14:47:12 +0000 Received: from localhost ([127.0.0.1]:54734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frOz1-0000ea-No for submit@debbugs.gnu.org; Sun, 19 Aug 2018 10:47:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54259) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frOyz-0000eN-Hy for 30823@debbugs.gnu.org; Sun, 19 Aug 2018 10:47:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1frOyr-0002xu-8r for 30823@debbugs.gnu.org; Sun, 19 Aug 2018 10:47:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50564) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frOyr-0002xq-6F; Sun, 19 Aug 2018 10:47:01 -0400 Received: from [176.228.60.248] (port=2920 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1frOyq-0002GF-QZ; Sun, 19 Aug 2018 10:47:01 -0400 Date: Sun, 19 Aug 2018 17:46:55 +0300 Message-Id: <834lfqfm74.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Sat, 18 Aug 2018 23:48:02 -0400) Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30823 Cc: victorhge@gmail.com, npostavs@gmail.com, 30823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Stefan Monnier > Cc: Noam Postavsky , victorhge@gmail.com, > 30823@debbugs.gnu.org > Date: Sat, 18 Aug 2018 23:48:02 -0400 > > > Can we turn the table and ask whether it makes sense to delete an > > overlay from the modification hooks of that same overlay? > > Yes, it very much does make sense: e.g. you want to keep track of > a "region unmodified" status, so you place an overlay over that region > with a modification hook that sets a variable to nil to indicate that > the region was modified, and once that is done there's no point in > keeping the overlay any more so you can delete it immediately from that > modification-hook. I see that I tried too hard to be gentle, and that must have made my question unclear, because that's not what I was asking. I was asking whether we want to support code which does this, because maybe it is unreasonable to delete an overlay from within its modification hook. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 19 11:44:04 2018 Received: (at 30823) by debbugs.gnu.org; 19 Aug 2018 15:44:04 +0000 Received: from localhost ([127.0.0.1]:54746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frPs4-0002cb-EH for submit@debbugs.gnu.org; Sun, 19 Aug 2018 11:44:04 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:45398) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frPs1-0002bz-Iw for 30823@debbugs.gnu.org; Sun, 19 Aug 2018 11:44:02 -0400 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w7JFhwNb017817; Sun, 19 Aug 2018 11:43:59 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 5C11EAE1ED; Sun, 19 Aug 2018 11:43:57 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases Message-ID: References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> <834lfqfm74.fsf@gnu.org> Date: Sun, 19 Aug 2018 11:43:57 -0400 In-Reply-To: <834lfqfm74.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 19 Aug 2018 17:46:55 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6354=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6354> : inlines <6821> : streams <1795957> : uri <2691819> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 30823 Cc: victorhge@gmail.com, npostavs@gmail.com, 30823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > I see that I tried too hard to be gentle, and that must have made my > question unclear, because that's not what I was asking. I was asking > whether we want to support code which does this, because maybe it is > unreasonable to delete an overlay from within its modification hook. My answer was saying that yes we want to support that. I don't see a good reason why this should be technically difficult to support. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 19 12:14:00 2018 Received: (at 30823) by debbugs.gnu.org; 19 Aug 2018 16:14:00 +0000 Received: from localhost ([127.0.0.1]:54776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frQL1-0003uK-TJ for submit@debbugs.gnu.org; Sun, 19 Aug 2018 12:14:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41007) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frQL0-0003u7-MW for 30823@debbugs.gnu.org; Sun, 19 Aug 2018 12:13:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1frQKs-0002ad-DI for 30823@debbugs.gnu.org; Sun, 19 Aug 2018 12:13:53 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51703) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frQKs-0002aV-AY; Sun, 19 Aug 2018 12:13:50 -0400 Received: from [176.228.60.248] (port=4417 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1frQKr-0000Vd-UJ; Sun, 19 Aug 2018 12:13:50 -0400 Date: Sun, 19 Aug 2018 19:13:44 +0300 Message-Id: <83wosme3lz.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Sun, 19 Aug 2018 11:43:57 -0400) Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> <834lfqfm74.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30823 Cc: victorhge@gmail.com, npostavs@gmail.com, 30823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Stefan Monnier > Cc: npostavs@gmail.com, victorhge@gmail.com, 30823@debbugs.gnu.org > Date: Sun, 19 Aug 2018 11:43:57 -0400 > > My answer was saying that yes we want to support that. I don't see > a good reason why this should be technically difficult to support. Well, the bugs in question are one reason. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 19 16:46:19 2018 Received: (at 30823) by debbugs.gnu.org; 19 Aug 2018 20:46:19 +0000 Received: from localhost ([127.0.0.1]:54841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frUaZ-0002Sr-7G for submit@debbugs.gnu.org; Sun, 19 Aug 2018 16:46:19 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:49985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frUaV-0002Sh-QX for 30823@debbugs.gnu.org; Sun, 19 Aug 2018 16:46:16 -0400 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w7JKkA18001834; Sun, 19 Aug 2018 16:46:11 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id E28E8AE1ED; Sun, 19 Aug 2018 16:46:09 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases Message-ID: References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> Date: Sun, 19 Aug 2018 16:46:09 -0400 In-Reply-To: <83o9e0f9uj.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 18 Aug 2018 09:49:08 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.1 X-NAI-Spam-Rules: 3 Rules triggered TRK_NCM1=0.1, EDT_SA_DN_PASS=0, RV6354=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6354> : inlines <6821> : streams <1795977> : uri <2691919> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 30823 Cc: victorhge@gmail.com, Noam Postavsky , 30823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> Coming back to this, there is also the possibility of passing true for >> PREPARE, though I'm not sure if that would be better or worse. Any >> comments? > AFAIR, we never want to use PREPARE = true when dealing with the > *Messages* buffer, you can see that elsewhere in message_dolog. The > reason I believe is that we might trigger infinite recursion if the > modification hooks log a message for some reason. The current code already allows running `message` in this way (and that leads to suboptimal behavior, tho nothing really serious). I think we should use `true` here and then actively try and detect nested uses of `message` and deal with those in an ad-hoc way (e.g. bind inhibit-modification-hooks during the nested call so the recursion is at most 2 deep). The benefit is that it makes this part of the code more "normal" and will probably fix/avoid other bugs like this one. The patch I sent in https://lists.gnu.org/archive/html/emacs-devel/2018-05/msg00600.html went in this direction and my experimentation with it did not encounter any serious problem. IOW I think the comment near message_dolog is largely out of date. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 19 23:03:08 2018 Received: (at 30823) by debbugs.gnu.org; 20 Aug 2018 03:03:08 +0000 Received: from localhost ([127.0.0.1]:54966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fraTE-0007g0-0k for submit@debbugs.gnu.org; Sun, 19 Aug 2018 23:03:08 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fraTC-0007fR-Br for 30823@debbugs.gnu.org; Sun, 19 Aug 2018 23:03:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fraT6-0007LI-Jc for 30823@debbugs.gnu.org; Sun, 19 Aug 2018 23:03:01 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fraT0-0007H2-A8; Sun, 19 Aug 2018 23:02:54 -0400 Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1fraT0-00072R-4E; Sun, 19 Aug 2018 23:02:54 -0400 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Sun, 19 Aug 2018 11:43:57 -0400) Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> <834lfqfm74.fsf@gnu.org> Message-Id: Date: Sun, 19 Aug 2018 23:02:54 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30823 Cc: eliz@gnu.org, victorhge@gmail.com, npostavs@gmail.com, 30823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > I was asking > > whether we want to support code which does this, because maybe it is > > unreasonable to delete an overlay from within its modification hook. I think I see natural occasions to want to do just that, so I think we had better support it. -- Dr Richard Stallman President, Free Software Foundation (https://gnu.org, https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 20 12:34:18 2018 Received: (at 30823) by debbugs.gnu.org; 20 Aug 2018 16:34:18 +0000 Received: from localhost ([127.0.0.1]:55819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frn8E-0005Fh-8d for submit@debbugs.gnu.org; Mon, 20 Aug 2018 12:34:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43887) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frn8D-0005FU-DY for 30823@debbugs.gnu.org; Mon, 20 Aug 2018 12:34:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1frn84-0008TW-S4 for 30823@debbugs.gnu.org; Mon, 20 Aug 2018 12:34:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frn84-0008TP-OV; Mon, 20 Aug 2018 12:34:08 -0400 Received: from [176.228.60.248] (port=1084 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1frn84-0004DW-CK; Mon, 20 Aug 2018 12:34:08 -0400 Date: Mon, 20 Aug 2018 19:34:04 +0300 Message-Id: <83d0uddmkj.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Sun, 19 Aug 2018 16:46:09 -0400) Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30823 Cc: victorhge@gmail.com, npostavs@gmail.com, 30823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Stefan Monnier > Cc: Noam Postavsky , victorhge@gmail.com, > 30823@debbugs.gnu.org > Date: Sun, 19 Aug 2018 16:46:09 -0400 > > >> Coming back to this, there is also the possibility of passing true for > >> PREPARE, though I'm not sure if that would be better or worse. Any > >> comments? > > AFAIR, we never want to use PREPARE = true when dealing with the > > *Messages* buffer, you can see that elsewhere in message_dolog. The > > reason I believe is that we might trigger infinite recursion if the > > modification hooks log a message for some reason. > > The current code already allows running `message` in this way (and that > leads to suboptimal behavior, tho nothing really serious). I think we > should use `true` here and then actively try and detect nested uses of > `message` and deal with those in an ad-hoc way (e.g. bind > inhibit-modification-hooks during the nested call so the recursion is at > most 2 deep). That doesn't cater to some of the uses of 'message', as I explained in the discussion to which you pointed. > The patch I sent in > https://lists.gnu.org/archive/html/emacs-devel/2018-05/msg00600.html > went in this direction and my experimentation with it did not encounter > any serious problem. IOW I think the comment near message_dolog is > largely out of date. Once again, interested readers may wish to read the whole discussion, because some of the issues raised there are not taken care of by this function, and some of the comment is justified, as I tried to explain. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 20 12:38:17 2018 Received: (at 30823) by debbugs.gnu.org; 20 Aug 2018 16:38:17 +0000 Received: from localhost ([127.0.0.1]:55823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frnC4-0005MS-Rc for submit@debbugs.gnu.org; Mon, 20 Aug 2018 12:38:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44969) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frnC3-0005ME-1u for 30823@debbugs.gnu.org; Mon, 20 Aug 2018 12:38:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1frnBt-0002Zo-SO for 30823@debbugs.gnu.org; Mon, 20 Aug 2018 12:38:09 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37511) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frnBt-0002Zg-OI; Mon, 20 Aug 2018 12:38:05 -0400 Received: from [176.228.60.248] (port=1322 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1frnBm-0004WX-1g; Mon, 20 Aug 2018 12:37:59 -0400 Date: Mon, 20 Aug 2018 19:37:55 +0300 Message-Id: <83bm9xdme4.fsf@gnu.org> From: Eli Zaretskii To: rms@gnu.org In-reply-to: (message from Richard Stallman on Sun, 19 Aug 2018 23:02:54 -0400) Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> <834lfqfm74.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30823 Cc: 30823@debbugs.gnu.org, victorhge@gmail.com, monnier@IRO.UMontreal.CA, npostavs@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Richard Stallman > Cc: eliz@gnu.org, victorhge@gmail.com, npostavs@gmail.com, > 30823@debbugs.gnu.org > Date: Sun, 19 Aug 2018 23:02:54 -0400 > > > I was asking > > > whether we want to support code which does this, because maybe it is > > > unreasonable to delete an overlay from within its modification hook. > > I think I see natural occasions to want to do just that, so I think we had > better support it. I have no doubt that it's be nice to have. However, there are practical difficulties with allowing that, and in particular a simple enough device I added to try to support it doesn't work in a slightly more complicated case. When this stuff fails, it is usually goes up in smoke, and debugging that is not easy. So if someone has better ideas, patches are welcome. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 23 08:14:08 2018 Received: (at 30823) by debbugs.gnu.org; 23 Aug 2018 12:14:08 +0000 Received: from localhost ([127.0.0.1]:58341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fsoV6-0002JQ-L0 for submit@debbugs.gnu.org; Thu, 23 Aug 2018 08:14:08 -0400 Received: from mail-it0-f46.google.com ([209.85.214.46]:35951) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fsoV5-0002Iy-BX for 30823@debbugs.gnu.org; Thu, 23 Aug 2018 08:14:07 -0400 Received: by mail-it0-f46.google.com with SMTP id p81-v6so7270005itp.1 for <30823@debbugs.gnu.org>; Thu, 23 Aug 2018 05:14:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Da9omGGaJr7/MEf/gGM4hb7FHtaQwnoFy1uPJHFWflk=; b=OndJGjLzOHfYjilB+VZoIpeCWL/sGdJ3g5i/XD7grC7aIsoT0SITtt5J301BN/fQBv eYPZgeldYElnpCoXZLA7LO680/J98Vb489BXpPUg3KhfiTBVdoOThk3uvWdjIMWV1DJA 2hoJvEm9fbbDHnJ57e53V5WAczoVFNpPp2OAwS9Pzq9nmzq5b+sGwZoiIgrz/PkKkmMx kwHV82RF2OdX57AvBYPjK5mcOrouTD+Uejl6Eurj+BrDYAIXbOj1AmQLDVPqiV5FJAcv ElluoDkwOJIazR4AEfuZW5zxWnUWpZ3WtIHU5mi+KGJSm3e6Dp3jWZFGif6KwMAKUNrH bW0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Da9omGGaJr7/MEf/gGM4hb7FHtaQwnoFy1uPJHFWflk=; b=NwfriAVdsMQs2qDaOobjcxgM222YF+W4//3XeFSsoq+rrjjRlmaLmNnsLIj2Lj7Y/n a+tGKuaibKMGcU5Bf15JAQOuxnqVQT594UOdkTi3qletzUetxNY8N9halcEB8NycBCce 4OpoyqhsA1hB6o8jPPTPjvnmUa4ar7ABAnPjQGmC5V25r8mFJbnYye0FIEdPKeHK4SUf 0icLbIn2SOvt79BKXq1XFbknXnEHbbKKuBrtqc816dUdEmfQZR+LOgAPpns7IFy1stvP n902vCiYHiB8i/Qp2N94Yx9jRp97R3oie6/7Os8bant6SuRVTA76fnML3g7uaAOnezJb es6Q== X-Gm-Message-State: APzg51ChvQd+WMe1F22kwbmbRNihxk2ENjCnp/iUMX5HwQSCGIFbb530 nWOLG2n+NHOZH6gNPHiHd/E= X-Google-Smtp-Source: ANB0VdYjPDGjxkmxm1mBJR5/0tEGb8X4lOn5tVV2mBhS1D9v5oDVyxvuVI4irFQ/JhYAPeHbd8RYHw== X-Received: by 2002:a24:f68c:: with SMTP id u134-v6mr6711582ith.17.1535026441672; Thu, 23 Aug 2018 05:14:01 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id d134-v6sm1418567iog.84.2018.08.23.05.14.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Aug 2018 05:14:00 -0700 (PDT) From: Noam Postavsky To: Eli Zaretskii Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> Date: Thu, 23 Aug 2018 08:13:59 -0400 In-Reply-To: <83o9e0f9uj.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 18 Aug 2018 09:49:08 +0300") Message-ID: <87tvnluvp4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30823 Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > Btw, I'm somewhat worried by the solution being proposed: it removes a > general safety device and replaces it by a solution that targets only > bug#21824, a much narrower class of problems. Is that wise? IMO, a safety device which causes new bugs is disqualified from its job. So yes, replacing this device with a more targeted fix seems like the Right Thing to me. Furthermore, we're currently calling the after change hooks without the before change hooks which is just asking for trouble (as exemplified by Bug#21824 and this one). From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 23 09:58:02 2018 Received: (at 30823) by debbugs.gnu.org; 23 Aug 2018 13:58:02 +0000 Received: from localhost ([127.0.0.1]:58955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fsq7e-00051Z-53 for submit@debbugs.gnu.org; Thu, 23 Aug 2018 09:58:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60059) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fsq7d-000515-1q for 30823@debbugs.gnu.org; Thu, 23 Aug 2018 09:58:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsq7S-0001HY-Ow for 30823@debbugs.gnu.org; Thu, 23 Aug 2018 09:57:55 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34075) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsq7H-0001BS-Kb; Thu, 23 Aug 2018 09:57:40 -0400 Received: from [176.228.60.248] (port=4110 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fsq7H-0003uQ-86; Thu, 23 Aug 2018 09:57:39 -0400 Date: Thu, 23 Aug 2018 16:57:24 +0300 Message-Id: <83bm9tb2yj.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-reply-to: <87tvnluvp4.fsf@gmail.com> (message from Noam Postavsky on Thu, 23 Aug 2018 08:13:59 -0400) Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> <87tvnluvp4.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30823 Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Noam Postavsky > Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Thu, 23 Aug 2018 08:13:59 -0400 > > Eli Zaretskii writes: > > > Btw, I'm somewhat worried by the solution being proposed: it removes a > > general safety device and replaces it by a solution that targets only > > bug#21824, a much narrower class of problems. Is that wise? > > IMO, a safety device which causes new bugs is disqualified from its job. I'm not sure it caused a new bug. I'm hard pressed for free time lately, so I'd be grateful if you could see whether it would be possible to make the original change smarter, so that it avoids causing the current issue. If not, I will try to look into it in a couple of weeks or so. > Furthermore, we're currently calling the after change hooks without > the before change hooks which is just asking for trouble (as > exemplified by Bug#21824 and this one). That's a separate issue, isn't it? We could refrain from calling the after-change hooks as well. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 30 23:15:05 2018 Received: (at 30823) by debbugs.gnu.org; 31 Aug 2018 03:15:05 +0000 Received: from localhost ([127.0.0.1]:39646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fvZtp-0007bL-5F for submit@debbugs.gnu.org; Thu, 30 Aug 2018 23:15:05 -0400 Received: from mail-it0-f53.google.com ([209.85.214.53]:52645) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fvZtn-0007aT-Mk for 30823@debbugs.gnu.org; Thu, 30 Aug 2018 23:15:04 -0400 Received: by mail-it0-f53.google.com with SMTP id h3-v6so5407329ita.2 for <30823@debbugs.gnu.org>; Thu, 30 Aug 2018 20:15:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=9zNU3PQaMzaQjZTHMeZCNmIH3MGWQSgDQfUr0YJTM2c=; b=o/qd7c6QSKk5Bai4jphbC3WqUHG7+a5yl80KOywb56wj6OYnsE7fbX4GHAYwA7rUpG ROKTuzI51zF2mWcyekhNeECyoHuIQLFh29BrkmXqnslmROibJqBye/Dn4JW09F9LjP2D 05Vnnv6MqD00/EGVkpDGBkHVYKenfeLpnLLDZkPZ6a816feOiIEKooCzs3qIPBHiW/D8 sKANbcrbpYZGWmf2TZi3ewOt7MYB52F94gR7MAv69D2XzPGd5QcLyAxYJ3oCHhRc6e0h VlStQkVR+9KYqG0sdRMRg6NwtuotySmXuZJW7CR1eVWhPPKYStUt3Rg/co8rRKXU8Bro z+5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=9zNU3PQaMzaQjZTHMeZCNmIH3MGWQSgDQfUr0YJTM2c=; b=G4SLDHZN42nPUoll+cAWnjkhQETVtJZI71USrgcGOelLBre24sBEHq7x7jeRj51cjN MW+80/owPiVKmoDhJkgqHLkWZ/2sqtgcsATmUrbbEgH5DjdEUyaog/pgACV8+brQP0Wu 1bSwVzulUNRdvctis4Bom8iig5zEvjarnpxmPooltGu3xuLsY08bMpvlZdmlzICqrBN6 uTol1aysOdzX/WF9Tr8fpJQax9kAMbja9VN09nDxY1xHgN9QXLJjLZg0hLczdieM/df/ tNhZPOikfsym1b+8WCGojGc7hyNEA4qQ4wIucuvBd8xUHis4+5XvSvl1UXuT8DnymKvb Le6A== X-Gm-Message-State: APzg51AMCeMmYZUQwxu4bBKlheKBvVRceQ+esCUIZiLT1cP1PqZRwzX5 f9QJ04tPQdsZ1bXNC4JgU6c= X-Google-Smtp-Source: ANB0VdaIRvdHTlzN46CsI1vl7kyhd/+JpdHCX+/tMT3Y9nRIK2R6kLY5rpvzHsrqVQPs4A4Uzsz3KQ== X-Received: by 2002:a24:46cd:: with SMTP id j196-v6mr4038798itb.0.1535685298285; Thu, 30 Aug 2018 20:14:58 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id i2-v6sm3349472ioh.80.2018.08.30.20.14.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Aug 2018 20:14:56 -0700 (PDT) From: Noam Postavsky To: Eli Zaretskii Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> <87tvnluvp4.fsf@gmail.com> <83bm9tb2yj.fsf@gnu.org> Date: Thu, 30 Aug 2018 23:14:53 -0400 In-Reply-To: <83bm9tb2yj.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 23 Aug 2018 16:57:24 +0300") Message-ID: <875zzrrzv6.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 30823 Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: Noam Postavsky >> Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca >> Date: Thu, 23 Aug 2018 08:13:59 -0400 >> >> Eli Zaretskii writes: >> >> > Btw, I'm somewhat worried by the solution being proposed: it removes a >> > general safety device and replaces it by a solution that targets only >> > bug#21824, a much narrower class of problems. Is that wise? >> >> IMO, a safety device which causes new bugs is disqualified from its job. > > I'm not sure it caused a new bug. It causes it in the sense that reverting the fix for #21284 stops this new bug from happening. > I'm hard pressed for free time lately, so I'd be grateful if you could > see whether it would be possible to make the original change smarter, > so that it avoids causing the current issue. If not, I will try to > look into it in a couple of weeks or so. > >> Furthermore, we're currently calling the after change hooks without >> the before change hooks which is just asking for trouble (as >> exemplified by Bug#21824 and this one). > > That's a separate issue, isn't it? We could refrain from calling the > after-change hooks as well. It's not a separate issue. The original reason for #21824 is that we called the after-change hooks without doing the setup (i.e., passing PREPARE=false to del_range_both). With the addition of the "safety device", #21824 is avoided, but this bug is caused instead. Refraining from calling after-change hooks is exactly what my patch does, this fixes both cases. This makes the "safety device" redundant, but with the after-change suppression added it doesn't do any harm; so if you insist, we can leave it in. I don't think it's a good idea to have such things cluttering up the source though. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 31 10:26:13 2018 Received: (at 30823) by debbugs.gnu.org; 31 Aug 2018 14:26:13 +0000 Received: from localhost ([127.0.0.1]:40746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fvkNJ-00051j-7S for submit@debbugs.gnu.org; Fri, 31 Aug 2018 10:26:13 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fvkNH-00051T-EY for 30823@debbugs.gnu.org; Fri, 31 Aug 2018 10:26:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fvkNB-0001St-8u for 30823@debbugs.gnu.org; Fri, 31 Aug 2018 10:26:06 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59908) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvkN5-0001Kt-V7; Fri, 31 Aug 2018 10:26:00 -0400 Received: from [176.228.60.248] (port=4271 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fvkN4-000793-Fh; Fri, 31 Aug 2018 10:25:59 -0400 Date: Fri, 31 Aug 2018 17:25:36 +0300 Message-Id: <83h8ja395r.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-reply-to: <875zzrrzv6.fsf@gmail.com> (message from Noam Postavsky on Thu, 30 Aug 2018 23:14:53 -0400) Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> <87tvnluvp4.fsf@gmail.com> <83bm9tb2yj.fsf@gnu.org> <875zzrrzv6.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30823 Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Noam Postavsky > Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Thu, 30 Aug 2018 23:14:53 -0400 > > This makes the "safety device" redundant, but with the after-change > suppression added it doesn't do any harm; so if you insist, we can leave > it in. I don't think it's a good idea to have such things cluttering up > the source though. Not sure I follow this part: are you saying that we shouldn't protect ourselves from overlay modification hooks that record a wrong buffer? From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 01 12:38:29 2018 Received: (at 30823) by debbugs.gnu.org; 1 Sep 2018 16:38:29 +0000 Received: from localhost ([127.0.0.1]:42051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fw8uq-0007wT-UC for submit@debbugs.gnu.org; Sat, 01 Sep 2018 12:38:29 -0400 Received: from mail-it0-f54.google.com ([209.85.214.54]:55741) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fw8up-0007wF-LR for 30823@debbugs.gnu.org; Sat, 01 Sep 2018 12:38:28 -0400 Received: by mail-it0-f54.google.com with SMTP id d10-v6so10878692itj.5 for <30823@debbugs.gnu.org>; Sat, 01 Sep 2018 09:38:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=T9bs6UBkJKHmDaxcmyOwyMaanFbNtdGSaX0alSxCEYE=; b=k7epBSZXCkDoYRlpiZPCtKkshdcWfbGvGflcKCmP92AYU0c9+71IDCTz2UxdvevbuB If7dPc+X/nRNXEkRHClT4J4CzJd0F5DyPiuC+wED4dZbd+XYx9Ps8K21dAnkaUSw7N9i gzzXHvCjKTsnZU5NWsD1MB+Woix1d2b95p/VL3+PtQASJJxP/L+pVDQYqCvnB6RoemTG PyPNcohffWvaDcmcu6puDNRRxgwjyttwW4Uvs1H65Dv7cZjddsVUe2SvmviOTuSKN2mI lfPQNcDE9HxZpL8h9+FPV8veZ9hQ+0AWqitep3rwGgNouJgnKT6h1+bk4Lue1VrvwbNv ee0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=T9bs6UBkJKHmDaxcmyOwyMaanFbNtdGSaX0alSxCEYE=; b=Fu4SuaZgQTV1Dl23E0SZIc3lQD50x/97MwYT6PTfPM/6VERcQUN58bo4qyDClwub0k zOkEUiiY0Eql1hhlPkpOQzb8QqGKEgc+Kope2tXrSKtgipOeAM3eSh+cHpcGFTH/3War lc7oWD0UzWWQJriExL2kWnUP9oK70CnZEthlc6Z0H+SVvsVW0T/P7/uGrBHRhei13oHK pGbMQ2+H2vnkWOmDslUGiiicdHjcXKSXHLoJSunpSvB5I0HGSEbs+1SaKB+V1vdYKd2P CEsDjw672lW2YFI0soHDoexuDMY40+JfJUp29Hd9d8eSoQZ8zEE+E60Cy0QmK6++Vc0q gdlQ== X-Gm-Message-State: APzg51DKGebohkE0mGy2W5EkjB2nUCrMhuvk1CmuDB0ldEFQGfI/GRPo OFhRUJQfqOB1w8sk7T9y1hk= X-Google-Smtp-Source: ANB0VdZ6HELrsNm5XXrRkmNSecCGgU3PMx8+5I7kAtUBHXQWr9TDo4bnWlj/0iFtYmqXCs1LpF7rgw== X-Received: by 2002:a02:5651:: with SMTP id o78-v6mr16179775jab.8.1535819902147; Sat, 01 Sep 2018 09:38:22 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id e140-v6sm4942154iof.50.2018.09.01.09.38.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 01 Sep 2018 09:38:20 -0700 (PDT) From: Noam Postavsky To: Eli Zaretskii Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> <87tvnluvp4.fsf@gmail.com> <83bm9tb2yj.fsf@gnu.org> <875zzrrzv6.fsf@gmail.com> <83h8ja395r.fsf@gnu.org> Date: Sat, 01 Sep 2018 12:38:19 -0400 In-Reply-To: <83h8ja395r.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 31 Aug 2018 17:25:36 +0300") Message-ID: <87sh2tqikk.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 30823 Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: Noam Postavsky >> Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca >> Date: Thu, 30 Aug 2018 23:14:53 -0400 >> >> This makes the "safety device" redundant, but with the after-change >> suppression added it doesn't do any harm; so if you insist, we can leave >> it in. I don't think it's a good idea to have such things cluttering up >> the source though. > > Not sure I follow this part: are you saying that we shouldn't protect > ourselves from overlay modification hooks that record a wrong buffer? Hmm, I'm not sure I follow you on this. As far as I can tell, it rather protects against a particular bug in the C code: calling modification hooks without calling prepare_to_modify_buffer. Once this is fixed, there is no need for it. Furthermore, the "protection" is somewhat dubious, since it also prevents running hooks in the correct buffer (i.e., this bug). From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 11 07:59:15 2018 Received: (at 30823) by debbugs.gnu.org; 11 Sep 2018 11:59:15 +0000 Received: from localhost ([127.0.0.1]:36260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzhK7-0007LZ-39 for submit@debbugs.gnu.org; Tue, 11 Sep 2018 07:59:15 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49578) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzhK5-0007LN-IM for 30823@debbugs.gnu.org; Tue, 11 Sep 2018 07:59:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzhJx-0001N6-Gc for 30823@debbugs.gnu.org; Tue, 11 Sep 2018 07:59:07 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37746) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzhJr-0001HH-1O; Tue, 11 Sep 2018 07:58:59 -0400 Received: from [176.228.60.248] (port=2178 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fzhJq-0002sr-J6; Tue, 11 Sep 2018 07:58:58 -0400 Date: Tue, 11 Sep 2018 14:59:07 +0300 Message-Id: <83sh2gmeic.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-reply-to: <87sh2tqikk.fsf@gmail.com> (message from Noam Postavsky on Sat, 01 Sep 2018 12:38:19 -0400) Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> <87tvnluvp4.fsf@gmail.com> <83bm9tb2yj.fsf@gnu.org> <875zzrrzv6.fsf@gmail.com> <83h8ja395r.fsf@gnu.org> <87sh2tqikk.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30823 Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Noam Postavsky > Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Sat, 01 Sep 2018 12:38:19 -0400 > > Eli Zaretskii writes: > > >> From: Noam Postavsky > >> Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca > >> Date: Thu, 30 Aug 2018 23:14:53 -0400 > >> > >> This makes the "safety device" redundant, but with the after-change > >> suppression added it doesn't do any harm; so if you insist, we can leave > >> it in. I don't think it's a good idea to have such things cluttering up > >> the source though. > > > > Not sure I follow this part: are you saying that we shouldn't protect > > ourselves from overlay modification hooks that record a wrong buffer? > > Hmm, I'm not sure I follow you on this. As far as I can tell, it rather > protects against a particular bug in the C code: calling modification > hooks without calling prepare_to_modify_buffer. No, the protection was meant to be more general: to avoid calling overlay modification hooks when the overlay in question is from the wrong buffer. The particular bug in C code which unearthed the problem was just one such case, but we have no reason to believe that it's the only such case. I'm not opposed to making the change you suggested for xdisp.c (although maybe it should go to master, not to emacs-26), but I would like to keep the protection in buffer.c. It just needs to be more fine-grained, to avoid causing adverse side effects, such as the problem reported here. With that in mind, WDYT about the patch below, which replaces the buffer.c portion of your patch? I've ran the tests for both bug#21824 and for this bug, and they both pass with the patch installed and with unmodified xdisp.c. Thanks. diff --git a/src/buffer.c b/src/buffer.c index b0cee71..179360c 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -4543,23 +4543,6 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after, Lisp_Object *copy; ptrdiff_t i; - if (size) - { - Lisp_Object ovl - = XVECTOR (last_overlay_modification_hooks)->contents[1]; - - /* If the buffer of the first overlay in the array doesn't - match the current buffer, then these modification hooks - should not be run in this buffer. This could happen when - some code calls some insdel functions, such as del_range_1, - with the PREPARE argument false -- in that case this - function is never called to record the overlay modification - hook functions in the last_overlay_modification_hooks - array, so anything we find there is not ours. */ - if (XMARKER (OVERLAY_START (ovl))->buffer != current_buffer) - return; - } - USE_SAFE_ALLOCA; SAFE_ALLOCA_LISP (copy, size); memcpy (copy, XVECTOR (last_overlay_modification_hooks)->contents, @@ -4570,7 +4553,12 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after, Lisp_Object prop_i, overlay_i; prop_i = copy[i++]; overlay_i = copy[i++]; - call_overlay_mod_hooks (prop_i, overlay_i, after, arg1, arg2, arg3); + /* It is possible that the recorded overlay has been deleted + (which makes its markers' buffers be nil), or that (due to + some bug) it belongs to a different buffer. Only run this + hook if the overlay belongs to the current buffer. */ + if (XMARKER (OVERLAY_START (overlay_i))->buffer == current_buffer) + call_overlay_mod_hooks (prop_i, overlay_i, after, arg1, arg2, arg3); } SAFE_FREE (); From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 12 21:34:48 2018 Received: (at 30823) by debbugs.gnu.org; 13 Sep 2018 01:34:48 +0000 Received: from localhost ([127.0.0.1]:38568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0GWt-0007t1-QP for submit@debbugs.gnu.org; Wed, 12 Sep 2018 21:34:47 -0400 Received: from mail-it0-f52.google.com ([209.85.214.52]:39981) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0GWs-0007sn-Nx for 30823@debbugs.gnu.org; Wed, 12 Sep 2018 21:34:47 -0400 Received: by mail-it0-f52.google.com with SMTP id h23-v6so5716197ita.5 for <30823@debbugs.gnu.org>; Wed, 12 Sep 2018 18:34:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=GqGFXb7qVmm9UWdffiPXJxrSSITwZ6qiBUrpThCheX0=; b=hSbDrYH3CooJJmgz0T63YNkBMz0VyHyfXpH4z5sB4O/+lkRD7YuyvnJx7tT1ikMvR5 oHMJM4O8oFWzAzzUxxjnW20zXqWXpT3/KLrSRNqD5xkjJGqcWf6w94KyPu3lWqV1AKGw 5L40VX7d36LFreXmnRIgS78XCmI7z3H2r5uYfY6pN4MF/eO1CS7ff/U5jZH6ztmF3Gc/ +/EXhBTMoshqAGn/lMBgr46/cQaXN3KGXHtxuVwMJRSTEFbi29QVz+QF/nzd36I0YptH 8feSumZwTjpD6AzZ7fNK3hUA9EGrgiDoy9cqVintuWsdxXWY7qeqg/z18iLCuQjYXdMK QrKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=GqGFXb7qVmm9UWdffiPXJxrSSITwZ6qiBUrpThCheX0=; b=Q7B1y2ZCNLKbv0WVwo09+U49P3NABS3QGgu828w/er5XJ+3YZwM9sSsCRdxEzs0T6v quHrnn4MCnVtxKkZQMTD4iWcwrictUkrQs2m7B2TjQnGT1ejWSeMr9mK/GUdw2Fw/qqR REfFBxwHpvrE9PoeD3NkGgG4hAQlpMi/95JHzP0VCABdrQJ5SfGCz3/9y+V9hLoZzBt/ 9WV5YlAWR4IbR/7Ns/h8vJK55+2z+hu+dKtTkqa2G0Xcfqg+NCsGp/iTMy4yja4Xz8s3 EhX3wOIzHsJUPobh4pjUx9Y15MA4zTB6VMG2X6XHYbwZU+nlsTa8NwR5cGuHGc/S2Gqx HKbA== X-Gm-Message-State: APzg51C4Ihn+r1OlIk5i8oMkX8l9oOx5euEJIpViUmzEzOQrciy4MIm6 2xxygmWw0ePSg5xSUE5zPPE= X-Google-Smtp-Source: ANB0Vdb09OXxSmZGC026I47T7EoC7uIjrGp6hnAR1m/mgxTUOgSVVS8pZ4Kbt1HyNzhcaKNi6tooWA== X-Received: by 2002:a02:3b2c:: with SMTP id c44-v6mr4615154jaa.41.1536802481063; Wed, 12 Sep 2018 18:34:41 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id n5-v6sm912044ioj.62.2018.09.12.18.34.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Sep 2018 18:34:39 -0700 (PDT) From: Noam Postavsky To: Eli Zaretskii Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> <87tvnluvp4.fsf@gmail.com> <83bm9tb2yj.fsf@gnu.org> <875zzrrzv6.fsf@gmail.com> <83h8ja395r.fsf@gnu.org> <87sh2tqikk.fsf@gmail.com> <83sh2gmeic.fsf@gnu.org> Date: Wed, 12 Sep 2018 21:34:37 -0400 In-Reply-To: <83sh2gmeic.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 11 Sep 2018 14:59:07 +0300") Message-ID: <87in3afadu.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30823 Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > No, the protection was meant to be more general: to avoid calling > overlay modification hooks when the overlay in question is from the > wrong buffer. Ah, well I see your new patch fulfills this mission better (the old one only looked the first overlay, so it seemed rather specific to bug#21824). > I'm not opposed to making the change you suggested for xdisp.c > (although maybe it should go to master, not to emacs-26), but I would > like to keep the protection in buffer.c. Funny, I feel the same but in reverse. Your patch should only affect the case where overlays are deleted/moved by modification hooks which is already a grey area, so the change is *probably* okay; but I would put it in master in case of unforseen side effects. > With that in mind, WDYT about the patch below, which replaces the > buffer.c portion of your patch? I've ran the tests for both bug#21824 > and for this bug, and they both pass with the patch installed and with > unmodified xdisp.c. I can confirm it works, and the change seems generally sensible. I think it does make sense to have the xdisp.c change as well. The choice of branch is up to you, of course. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 13 09:44:31 2018 Received: (at 30823) by debbugs.gnu.org; 13 Sep 2018 13:44:31 +0000 Received: from localhost ([127.0.0.1]:38863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0Rv5-0003iA-Ir for submit@debbugs.gnu.org; Thu, 13 Sep 2018 09:44:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43092) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0Rv3-0003hv-Gq for 30823@debbugs.gnu.org; Thu, 13 Sep 2018 09:44:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g0Ruu-0004XL-Vd for 30823@debbugs.gnu.org; Thu, 13 Sep 2018 09:44:24 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0Rud-0004Hi-L5; Thu, 13 Sep 2018 09:44:03 -0400 Received: from [176.228.60.248] (port=4558 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g0Rud-000717-5O; Thu, 13 Sep 2018 09:44:03 -0400 Date: Thu, 13 Sep 2018 16:43:50 +0300 Message-Id: <83h8itldgp.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-reply-to: <87in3afadu.fsf@gmail.com> (message from Noam Postavsky on Wed, 12 Sep 2018 21:34:37 -0400) Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> <87tvnluvp4.fsf@gmail.com> <83bm9tb2yj.fsf@gnu.org> <875zzrrzv6.fsf@gmail.com> <83h8ja395r.fsf@gnu.org> <87sh2tqikk.fsf@gmail.com> <83sh2gmeic.fsf@gnu.org> <87in3afadu.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30823 Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Noam Postavsky > Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Wed, 12 Sep 2018 21:34:37 -0400 > > Eli Zaretskii writes: > > > No, the protection was meant to be more general: to avoid calling > > overlay modification hooks when the overlay in question is from the > > wrong buffer. > > Ah, well I see your new patch fulfills this mission better (the old one > only looked the first overlay, so it seemed rather specific to > bug#21824). Yes, because the original change only considered the case of a wrong buffer, it didn't consider the case of a deleted overlay, where the buffer is nil. > > I'm not opposed to making the change you suggested for xdisp.c > > (although maybe it should go to master, not to emacs-26), but I would > > like to keep the protection in buffer.c. > > Funny, I feel the same but in reverse. Your patch should only affect > the case where overlays are deleted/moved by modification hooks which is > already a grey area, so the change is *probably* okay; but I would put > it in master in case of unforseen side effects. My rationale was that the changes in buffer.c fix a regression, whereas the changes in xdisp.c fix a potential problem for which we don't yet have a bug report. > I can confirm it works, and the change seems generally sensible. I > think it does make sense to have the xdisp.c change as well. The choice > of branch is up to you, of course. Well, unless you feel strongly against, I'd prefer to have the xdisp.c change on master, and the buffer.c change (with the added test) on emacs-26. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 14 08:03:44 2018 Received: (at 30823) by debbugs.gnu.org; 14 Sep 2018 12:03:44 +0000 Received: from localhost ([127.0.0.1]:40111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0mp5-0007cG-Rb for submit@debbugs.gnu.org; Fri, 14 Sep 2018 08:03:44 -0400 Received: from mail-io1-f52.google.com ([209.85.166.52]:36790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0mp3-0007c1-By for 30823@debbugs.gnu.org; Fri, 14 Sep 2018 08:03:41 -0400 Received: by mail-io1-f52.google.com with SMTP id q5-v6so5802909iop.3 for <30823@debbugs.gnu.org>; Fri, 14 Sep 2018 05:03:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=hZClMCrHUSk+5Hq+pvh7uFE5XHSI6RuMA/058DjQI6E=; b=XIQAEOCRGppD4hggmDSy+l57+xANVnVSNP/syBvL/74ZjZrlYlvHKmghTDtvOexsA7 XlM38jNcjsgwSaRoWZ+IulzStlBczy5uC25FHX2tigbxZUhhFh+CUSV+jk5fkPBSCjbB GAhc1hz4EXt8M1bKQmZtaaDcxi9nstIol2CQMFuztl1hM6DkIpG/4BmuMUhtfDWU28zU dC+5STXcdQYrzGSgNw4MUWMLdEsmVRkl42NQGjokGkuSXQ+W3toH879NShhVr4wFAFaa Bs+fM8GNV8sCKUSp+DfvjUX7nU3Be8adWQN5yBiwBy+k7X20MWfP4NPn/5d48KoFuBna r+bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=hZClMCrHUSk+5Hq+pvh7uFE5XHSI6RuMA/058DjQI6E=; b=dAXXx5BsJaam4Rt0JRO5y4AjkBB6yzAqFuowxddxG/g8A5or/wjAWrkQA/1ESOS3+G okGbGUZoDwdmnHOFaZUVwkPrh7rcd32aX3XOGk2CmCQqELw3dMXhFh9STrQDwBB9t+QV m7PWn39PpkNXMkbz1DtFM+vILRFQA3CreA50WQaKX9eLYuFzZdPPmqKHZbIbmBIgZ4LI hKnPkBsi57wrUo5iQgbBv9vacIScYGGMOoh3EmDFnC7/EOsZOCO92Q3G082FY43zI7ah W/JswYlB3lpaX7Pm83SAeaf6IpRJ07GLoLD+3CI/oHDZxjkYOXTnG7s+j8QJZ/g7krui Vugg== X-Gm-Message-State: APzg51DJgZ4bSqu+1E9JLwYjIdFCJTeWX00jQXVPtJPEheuZysTmD2eA RJXjCFwtCk6n4viXR5t/+Rc= X-Google-Smtp-Source: ANB0Vda03oOxRdybno07YeaywN8yjU6hGOXEezInmHUwUy8gsWAmXCc3HfRCzsEhg2n02RRbwdkLTQ== X-Received: by 2002:a6b:5b17:: with SMTP id v23-v6mr9754758ioh.39.1536926615810; Fri, 14 Sep 2018 05:03:35 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id 138-v6sm5150123ioe.20.2018.09.14.05.03.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Sep 2018 05:03:34 -0700 (PDT) From: Noam Postavsky To: Eli Zaretskii Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> <87tvnluvp4.fsf@gmail.com> <83bm9tb2yj.fsf@gnu.org> <875zzrrzv6.fsf@gmail.com> <83h8ja395r.fsf@gnu.org> <87sh2tqikk.fsf@gmail.com> <83sh2gmeic.fsf@gnu.org> <87in3afadu.fsf@gmail.com> <83h8itldgp.fsf@gnu.org> Date: Fri, 14 Sep 2018 08:03:21 -0400 In-Reply-To: <83h8itldgp.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 13 Sep 2018 16:43:50 +0300") Message-ID: <87k1nos2uu.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30823 Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > Well, unless you feel strongly against, I'd prefer to have the xdisp.c > change on master, and the buffer.c change (with the added test) on > emacs-26. I'm okay with that. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 15 05:23:47 2018 Received: (at 30823) by debbugs.gnu.org; 15 Sep 2018 09:23:47 +0000 Received: from localhost ([127.0.0.1]:41113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g16nq-0000ez-ND for submit@debbugs.gnu.org; Sat, 15 Sep 2018 05:23:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g16np-0000el-M8 for 30823@debbugs.gnu.org; Sat, 15 Sep 2018 05:23:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g16nj-0006Z8-UA for 30823@debbugs.gnu.org; Sat, 15 Sep 2018 05:23:40 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g16nf-0006Ha-Lv; Sat, 15 Sep 2018 05:23:35 -0400 Received: from [176.228.60.248] (port=4788 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g16nf-0007XA-9E; Sat, 15 Sep 2018 05:23:35 -0400 Date: Sat, 15 Sep 2018 12:23:27 +0300 Message-Id: <83tvmri06o.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-reply-to: <87k1nos2uu.fsf@gmail.com> (message from Noam Postavsky on Fri, 14 Sep 2018 08:03:21 -0400) Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> <87tvnluvp4.fsf@gmail.com> <83bm9tb2yj.fsf@gnu.org> <875zzrrzv6.fsf@gmail.com> <83h8ja395r.fsf@gnu.org> <87sh2tqikk.fsf@gmail.com> <83sh2gmeic.fsf@gnu.org> <87in3afadu.fsf@gmail.com> <83h8itldgp.fsf@gnu.org> <87k1nos2uu.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30823 Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Noam Postavsky > Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Fri, 14 Sep 2018 08:03:21 -0400 > > Eli Zaretskii writes: > > > Well, unless you feel strongly against, I'd prefer to have the xdisp.c > > change on master, and the buffer.c change (with the added test) on > > emacs-26. > > I'm okay with that. OK, I've now pushed the buffer.c changes to the emacs-26 branch. Please push the xdisp.c changes to master, and then we can close this bug report. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 15 10:10:49 2018 Received: (at 30823) by debbugs.gnu.org; 15 Sep 2018 14:10:49 +0000 Received: from localhost ([127.0.0.1]:41690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g1BHc-0001db-PG for submit@debbugs.gnu.org; Sat, 15 Sep 2018 10:10:49 -0400 Received: from mail-it0-f42.google.com ([209.85.214.42]:55410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g1BHa-0001dI-JD; Sat, 15 Sep 2018 10:10:46 -0400 Received: by mail-it0-f42.google.com with SMTP id d10-v6so6091780itj.5; Sat, 15 Sep 2018 07:10:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=+NZOZq8tC3JWmZdvtSkk04yWpyRy2PCP63RT+WNkoi4=; b=TbqxEYSeKuuyKB5SrJX1QA3ROjhJfYPRNrX9AArcs+JHi3blMLyj3qQ33BAz4qJXXK GkimTv8MHxPWDY0B657Bz9wa36fzoikk8orClhht91r1d+RsHkilyunRYsnDATMpqjwY T92WiCf/Db0+iFiYlGXMRc7evx9Ubjl8rOMlvv6sRwaH719MM7G9AvEn7dv0Bb0LTlT7 KqU/KHwdFsQnLyn/VqwFcZMlfs7PdiWS0eOxKbfVYgP8hFI+B0SOMVfVY4EUtGVbqZmD lYvFOOwYMVxzlfXyc7cEJ7Ctq/JumktN38LMAdLf6bwYh1LkREL9PCLF3ZTKiJ+tfh2H rgVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=+NZOZq8tC3JWmZdvtSkk04yWpyRy2PCP63RT+WNkoi4=; b=c+d7wJ8lhOdhhB+ESz5moTZXuQSuoTGRlrCtVm8fNiL79Qb995UtHqMJAzRendUoc5 prK3Ep0D5AlxeieVGDnDs7zkkjARKwFLTX/3+K3JfWfFejq711IExUsw28ZAj7nO1EOh yh/xY/Nkmsaq/XJ0uNbXNSkq7dcw0K+9h1A9Lub08Z61ZhzWl8ecIE7x034AHHjaXpwz FZwX9L7StuKXt7FfqRcV0iaX1/zetvA6BaRRF9Ua8vs/aMZG5gS7He7Gqz/6j35hZlsJ gQBPVcaCnQeb+XNodOy3ViTO7w9pcIvrIfCBzTtkIMufrCdrtfPgvC9MN3xrgNls4XCU N+ng== X-Gm-Message-State: APzg51BunVhlWbDNq5OYcswpbZABhVj0rh9p0VjTsWeIr2BFD26mZu+M XSttqfUvfAWrE/PeAIhjDcWJtgQH X-Google-Smtp-Source: ANB0VdZNucs87kHRr0R3lBlb1AYBYGrAyXAlSrQgqKKhGq68uVvB686wpT6s0uj0C1mc1eUmIeqnRw== X-Received: by 2002:a02:b09b:: with SMTP id v27-v6mr15714760jah.24.1537020640955; Sat, 15 Sep 2018 07:10:40 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id q19-v6sm1178147ith.1.2018.09.15.07.10.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Sep 2018 07:10:39 -0700 (PDT) From: Noam Postavsky To: Eli Zaretskii Subject: Re: bug#30823: 25.3; modification-hooks of overlays are not run in some cases References: <83lgetri7r.fsf@gnu.org> <87in9cpd3a.fsf@gmail.com> <87in48ww9l.fsf@gmail.com> <83o9e0f9uj.fsf@gnu.org> <87tvnluvp4.fsf@gmail.com> <83bm9tb2yj.fsf@gnu.org> <875zzrrzv6.fsf@gmail.com> <83h8ja395r.fsf@gnu.org> <87sh2tqikk.fsf@gmail.com> <83sh2gmeic.fsf@gnu.org> <87in3afadu.fsf@gmail.com> <83h8itldgp.fsf@gnu.org> <87k1nos2uu.fsf@gmail.com> <83tvmri06o.fsf@gnu.org> Date: Sat, 15 Sep 2018 10:10:38 -0400 In-Reply-To: <83tvmri06o.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 15 Sep 2018 12:23:27 +0300") Message-ID: <875zz6svfl.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30823 Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 30823 fixed close 30823 26.2 quit Eli Zaretskii writes: > OK, I've now pushed the buffer.c changes to the emacs-26 branch. > Please push the xdisp.c changes to master, and then we can close this > bug report. Done. [1: ffbe561ee5]: 2018-09-15 09:44:30 -0400 Don't call modification hooks unprepared https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=ffbe561ee5acb0b9edc5f4c995c287fb2485c315 From unknown Sun Aug 17 01:42:12 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 14 Oct 2018 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator