From unknown Wed Jun 18 23:06:30 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#23917 <23917@debbugs.gnu.org> To: bug#23917 <23917@debbugs.gnu.org> Subject: Status: 25.0.95; commit 3a9d6296b35e5317c497674d5725eb52699bd3b8 causing org-capture to error out Reply-To: bug#23917 <23917@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:06:30 +0000 retitle 23917 25.0.95; commit 3a9d6296b35e5317c497674d5725eb52699bd3b8 caus= ing org-capture to error out reassign 23917 emacs,org-mode submitter 23917 Robert Pluim severity 23917 normal tag 23917 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 08 08:42:21 2016 Received: (at submit) by debbugs.gnu.org; 8 Jul 2016 12:42:21 +0000 Received: from localhost ([127.0.0.1]:41841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLV6r-0007N8-Ck for submit@debbugs.gnu.org; Fri, 08 Jul 2016 08:42:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36277) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLV6p-0007Mv-Hy for submit@debbugs.gnu.org; Fri, 08 Jul 2016 08:42:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLV6j-0005He-Ed for submit@debbugs.gnu.org; Fri, 08 Jul 2016 08:42:14 -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,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:43803) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLV6j-0005HL-Ba for submit@debbugs.gnu.org; Fri, 08 Jul 2016 08:42:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLV6h-0007aB-8z for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2016 08:42:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLV6d-0005GD-12 for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2016 08:42:10 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:33279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLV6c-0005G0-Qk for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2016 08:42:06 -0400 Received: by mail-wm0-x241.google.com with SMTP id n127so6528627wme.0 for ; Fri, 08 Jul 2016 05:42:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version; bh=knSB1tA9SGEihqgTE8rHR5+QAlFuyiZWH+mvFMXqq8s=; b=anxQZdNRFUVbfVsHUXFfuCEg5WZ4H9AMT6OsZbPhrsyWIpokdI6BfrT6xgK08DovVt rURg/1+eMm/3gAMXl18l8GUEB1g8wWWOn4PrUfeAJKQTeCfSdUxhc1+fHa6WMi5tbwCp 7gNiVx68dLUcwbQpd+XKgjXEXpUpSzQtK6u0sznYPKzhy67JYZgfTia4N8DWFEsBACSL RUjj0i0M0G3Ygjs3zkWTzz8LZNlPfDlKjobd453yW26bzg86mbZf745wDqux9kFLicGK 3Sn70PSPIMNd2ks0kuQ5xAJ4CD0lpxiDR4nEmrgRVHlptgeUHoe1WaaYc/CUMbjccdtk HmZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=knSB1tA9SGEihqgTE8rHR5+QAlFuyiZWH+mvFMXqq8s=; b=PBgnoevlvuXiZelu5ewfi1p/5TagWztLG7A4wKvaXDTVs6H2vpRmECytKPsS3wEZFd dSqIOoQMnZm7eYCRYm6f+lnPq5joNgx7gfJFIWycc5QQPAhLHiH14Z6Yb2IbZPqNY5XW RpZWf+sr7iK83jY85dpCtRsbbZf4JVNWLhdNEgN2gpU/JV81kMTTvfULfdx4jQrYVFn5 OowfVipG3KmOg0+rBtT1adnTq1b5A0iIse2lUdeFW0KHu/Qh4HxpBgyKrYbwGWIkZC3t FCWeSs5Km+WKpU7W7RmwssfHidIlHJ0Jwf6CLz6dEnbOqJBRnqNivColgd18LLMYic5i 5ByA== X-Gm-Message-State: ALyK8tIcls+B+aEg0tfKfQP4eSVMnW+7Sk3bBkX56UGBHt/5yj41IMmHwzaVV4mxxtOGMw== X-Received: by 10.28.163.70 with SMTP id m67mr3202787wme.38.1467981725358; Fri, 08 Jul 2016 05:42:05 -0700 (PDT) Received: from rpluim-XPS-15-9530 ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id r130sm2869536wmf.20.2016.07.08.05.42.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Jul 2016 05:42:04 -0700 (PDT) From: Robert Pluim To: bug-gnu-emacs@gnu.org Subject: 25.0.95; commit 3a9d6296b35e5317c497674d5725eb52699bd3b8 causing org-capture to error out Date: Fri, 08 Jul 2016 14:42:02 +0200 Message-ID: <8760sgnvxh.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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 (----) (this is with org-20160704 from elpa. The org version ("8.2.10") in emacs-25 does not exhibit this error) This is from emacs -Q, with a subsequent changing of load-paths to point at the elpa org. Reverting the commit mentioned above makes the error go away. In gdb: Breakpoint 3, Freplace_match (newtext=8699012, fixedcase=, literal=0, string=, subexp=) at search.c:2710 2710 error ("Match data clobbered by buffer modification hooks"); (gdb) xbacktrace "replace-match" (0xffffc680) "org-capture-empty-lines-after" (0xffffc850) "org-capture-place-entry" (0xffffca30) "org-capture-place-template" (0xffffcc10) "org-capture" (0xffffcf20) "funcall-interactively" (0xffffcf18) "call-interactively" (0xffffd180) "command-execute" (0xffffd328) "execute-extended-command" (0xffffd580) "funcall-interactively" (0xffffd578) "call-interactively" (0xffffd820) "command-execute" (0xffffd998) Based on the discussion in Bug#23869, there's a hook somewhere that needs to do save-match-data, but I have no idea how to figure out which one. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 08 10:03:08 2016 Received: (at 23917) by debbugs.gnu.org; 8 Jul 2016 14:03:08 +0000 Received: from localhost ([127.0.0.1]:42801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLWN2-0002dt-Ml for submit@debbugs.gnu.org; Fri, 08 Jul 2016 10:03:08 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLWN1-0002dJ-9l for 23917@debbugs.gnu.org; Fri, 08 Jul 2016 10:03:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLWMs-0005jh-TQ for 23917@debbugs.gnu.org; Fri, 08 Jul 2016 10:03:02 -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.3 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47307) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLWMs-0005jV-Q7; Fri, 08 Jul 2016 10:02:58 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3343 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bLWMq-0004oU-5e; Fri, 08 Jul 2016 10:02:56 -0400 Date: Fri, 08 Jul 2016 17:02:46 +0300 Message-Id: <83lh1ci5x5.fsf@gnu.org> From: Eli Zaretskii To: Robert Pluim In-reply-to: <8760sgnvxh.fsf@gmail.com> (message from Robert Pluim on Fri, 08 Jul 2016 14:42:02 +0200) Subject: Re: bug#23917: 25.0.95; commit 3a9d6296b35e5317c497674d5725eb52699bd3b8 causing org-capture to error out References: <8760sgnvxh.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: -6.3 (------) X-Debbugs-Envelope-To: 23917 Cc: 23917@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: -6.3 (------) > From: Robert Pluim > Date: Fri, 08 Jul 2016 14:42:02 +0200 > > (this is with org-20160704 from elpa. The org version ("8.2.10") in > emacs-25 does not exhibit this error) > > This is from emacs -Q, with a subsequent changing of load-paths to > point at the elpa org. Reverting the commit mentioned above makes the > error go away. > > In gdb: > > Breakpoint 3, Freplace_match (newtext=8699012, fixedcase=, literal=0, string=, subexp=) > at search.c:2710 > 2710 error ("Match data clobbered by buffer modification hooks"); > (gdb) xbacktrace > "replace-match" (0xffffc680) > "org-capture-empty-lines-after" (0xffffc850) > "org-capture-place-entry" (0xffffca30) > "org-capture-place-template" (0xffffcc10) > "org-capture" (0xffffcf20) > "funcall-interactively" (0xffffcf18) > "call-interactively" (0xffffd180) > "command-execute" (0xffffd328) > "execute-extended-command" (0xffffd580) > "funcall-interactively" (0xffffd578) > "call-interactively" (0xffffd820) > "command-execute" (0xffffd998) > > Based on the discussion in Bug#23869, there's a hook somewhere that > needs to do save-match-data Right. > but I have no idea how to figure out which one. Run Emacs under a debugger, and set a breakpoint before the call to replace_range in Freplace_match. When the breakpoint breaks, make sure it's indeed being called from org-capture-empty-lines-after, and if so, do this: (gdb) watch -l search_regs.start[sub] (gdb) watch -l search_regs.end[sub] (gdb) watch -l search_regs.num_regs (gdb) continue Then GDB will kick in as soon as one of these 3 is clobbered, and the backtrace will show you whodunit. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 08 11:40:52 2016 Received: (at 23917) by debbugs.gnu.org; 8 Jul 2016 15:40:52 +0000 Received: from localhost ([127.0.0.1]:42827 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLXtc-0004q4-91 for submit@debbugs.gnu.org; Fri, 08 Jul 2016 11:40:52 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLXta-0004ps-CH for 23917@debbugs.gnu.org; Fri, 08 Jul 2016 11:40:50 -0400 Received: by mail-wm0-f67.google.com with SMTP id k123so8611203wme.2 for <23917@debbugs.gnu.org>; Fri, 08 Jul 2016 08:40:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:gmane-reply-to-list:date:in-reply-to :message-id:user-agent:mime-version; bh=DfYWsL+Y9XnCvbgRfZrFfw37AK69Yob38cv7Yw7nSR8=; b=yZxsLk2e6qyDJ8vLjQFfs+KbrNQWcIuzmyqp7Tlp7PcXPBu37LzKV/5BTrLqepIr/v hOLhIwlzLHe9sY/1ZO5NJsHazRK07Hur3WjbffWMPC1gSkae2fWsyJgd8RYv6niWWltJ ZJYaREWO0WapzkXhp+klwyS5ULdwSbX9udGilZC5CCOjdOG+ecKvsXvQP3aDN7swo0Is cfa4tcnOV7LPYgao4SSukIjahxrRO+dqv2BKxeJqE3XyMZZp12qrNXRC+OsxXd+hNx67 7giGDcEg+qlM7ghXIuLe2LOm2K6nHNno2Fv7iYiY90xV4t1HgIfnd/2YdNxIwLVSmj/R JhDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references :gmane-reply-to-list:date:in-reply-to:message-id:user-agent :mime-version; bh=DfYWsL+Y9XnCvbgRfZrFfw37AK69Yob38cv7Yw7nSR8=; b=JM72rE2tAG2tVmof9l6AOp9KaiGSrKvc+r7SmMDBc2XZdhQU7CBfjoQxSkNOwDvV6r qjxrVi7G7I/3rj/9djmCOXAzVxma3gdMMIGYPXw7KnXpwVBOEv6fvXWgWEAeh9eNPY38 pMBY78lEINvkV4geBEiEqaRJEE1hVDPAcy0N00kBDZljRuDnutVhJJwYFaVK+P1X94VQ t1LeM9B51dhVsNiKmDiYYAi33nLiPrntmqRwIkJa8DbSpyRux2HVEzwJ3D4fLA+tkk+k pndpYsbPz55LAdegdZ/SIgDQreNWGU/ZM1SJuaK34ZPXJwUJ6Iru/ZazwSZYQey0VSmw xYHw== X-Gm-Message-State: ALyK8tKbBnkFYtGiFUjsCyjArL4Ug3uP/8Hj2TokXkfHer/OAZK5L6Qg6xkrakTdln/h8A== X-Received: by 10.28.158.206 with SMTP id h197mr4274041wme.50.1467992443684; Fri, 08 Jul 2016 08:40:43 -0700 (PDT) Received: from rpluim-XPS-15-9530 ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id q63sm3618793wma.0.2016.07.08.08.40.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Jul 2016 08:40:42 -0700 (PDT) From: Robert Pluim To: Eli Zaretskii Subject: Re: bug#23917: 25.0.95; commit 3a9d6296b35e5317c497674d5725eb52699bd3b8 causing org-capture to error out References: <8760sgnvxh.fsf@gmail.com> <83lh1ci5x5.fsf@gnu.org> X-Debbugs-No-Ack: yes Gmane-Reply-To-List: yes Date: Fri, 08 Jul 2016 17:40:42 +0200 In-Reply-To: <83lh1ci5x5.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 08 Jul 2016 17:02:46 +0300") Message-ID: <87poqo6sud.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23917 Cc: 23917@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.7 (/) Eli Zaretskii writes: > Run Emacs under a debugger, and set a breakpoint before the call to > replace_range in Freplace_match. When the breakpoint breaks, make > sure it's indeed being called from org-capture-empty-lines-after, and > if so, do this: > > (gdb) watch -l search_regs.start[sub] > (gdb) watch -l search_regs.end[sub] > (gdb) watch -l search_regs.num_regs > (gdb) continue > > Then GDB will kick in as soon as one of these 3 is clobbered, and the > backtrace will show you whodunit. So that gives me (after recompiling with -O0 -g3 :-) ) Hardware watchpoint 6: -location search_regs.end[sub] Old value = 77 New value = 76 Fset_match_data (list=33497827, reseat=19440) at search.c:3010 3010 if (!NILP (reseat) && MARKERP (m)) Lisp Backtrace: "set-match-data" (0xffff9ad0) 0x1f6e8b0 PVEC_COMPILED "org-element--cache-after-change" (0xffffa6c8) "replace-match" (0xffffaa20) "org-capture-empty-lines-after" (0xffffaf60) "org-capture-place-entry" (0xffffb4b0) "org-capture-place-template" (0xffffba00) "org-capture" (0xffffc0b0) "funcall-interactively" (0xffffc0a8) "call-interactively" (0xffffc3e0) "command-execute" (0xffffc968) "execute-extended-command" (0xffffcfd0) "funcall-interactively" (0xffffcfc8) "call-interactively" (0xffffd360) "command-execute" (0xffffd8c8) (gdb) c Continuing. Breakpoint 4, Freplace_match (newtext=9563044, fixedcase=0, literal=0, string=0, subexp=0) at search.c:2710 2710 error ("Match data clobbered by buffer modification hooks"); org-element--cache-after-change is: (defun org-element--cache-after-change (beg end pre) "Update buffer modifications for current buffer. BEG and END are the beginning and end of the range of changed text, and the length in bytes of the pre-change text replaced by that range. See `after-change-functions' for more information." (when (org-element--cache-active-p) (org-with-wide-buffer (goto-char beg) (beginning-of-line) (save-match-data (let ((top (point)) (bottom (save-excursion (goto-char end) (line-end-position)))) ;; Determine if modified area needs to be extended, according ;; to both previous and current state. We make a special ;; case for headline editing: if a headline is modified but ;; not removed, do not extend. (when (case org-element--cache-change-warning ((t) t) (headline (not (and (org-with-limited-levels (org-at-heading-p)) (= (line-end-position) bottom)))) (otherwise (let ((case-fold-search t)) (re-search-forward org-element--cache-sensitive-re bottom t)))) ;; Effectively extend modified area. (org-with-limited-levels (setq top (progn (goto-char top) (when (outline-previous-heading) (forward-line)) (point))) (setq bottom (progn (goto-char bottom) (if (outline-next-heading) (1- (point)) (point)))))) ;; Store synchronization request. (let ((offset (- end beg pre))) (org-element--cache-submit-request top (- bottom offset) offset))))) ;; Activate a timer to process the request during idle time. (org-element--cache-set-timer (current-buffer)))) which already does save-match-data. If I globally disable the org element cache by (setq org-element-use-cache nil) the issue disappears, so now I'm confused as to what's going on. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 08 13:03:58 2016 Received: (at 23917) by debbugs.gnu.org; 8 Jul 2016 17:03:58 +0000 Received: from localhost ([127.0.0.1]:42877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLZC2-0008RK-G4 for submit@debbugs.gnu.org; Fri, 08 Jul 2016 13:03:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLZC0-0008R4-9y for 23917@debbugs.gnu.org; Fri, 08 Jul 2016 13:03:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLZBq-0005Hl-TL for 23917@debbugs.gnu.org; Fri, 08 Jul 2016 13:03:51 -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_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLZBq-0005Hf-QL; Fri, 08 Jul 2016 13:03:46 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3478 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bLZBp-0003q1-EN; Fri, 08 Jul 2016 13:03:46 -0400 Date: Fri, 08 Jul 2016 20:03:35 +0300 Message-Id: <83a8hshxjs.fsf@gnu.org> From: Eli Zaretskii To: Robert Pluim In-reply-to: <87poqo6sud.fsf@gmail.com> (message from Robert Pluim on Fri, 08 Jul 2016 17:40:42 +0200) Subject: Re: bug#23917: 25.0.95; commit 3a9d6296b35e5317c497674d5725eb52699bd3b8 causing org-capture to error out References: <8760sgnvxh.fsf@gmail.com> <83lh1ci5x5.fsf@gnu.org> <87poqo6sud.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: -6.3 (------) X-Debbugs-Envelope-To: 23917 Cc: 23917@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: -6.3 (------) > From: Robert Pluim > Cc: 23917@debbugs.gnu.org > Date: Fri, 08 Jul 2016 17:40:42 +0200 > > org-element--cache-after-change is: > > (defun org-element--cache-after-change (beg end pre) > "Update buffer modifications for current buffer. > BEG and END are the beginning and end of the range of changed > text, and the length in bytes of the pre-change text replaced by > that range. See `after-change-functions' for more information." > (when (org-element--cache-active-p) > (org-with-wide-buffer > (goto-char beg) > (beginning-of-line) > (save-match-data > (let ((top (point)) > (bottom (save-excursion (goto-char end) (line-end-position)))) > ;; Determine if modified area needs to be extended, according > ;; to both previous and current state. We make a special > ;; case for headline editing: if a headline is modified but > ;; not removed, do not extend. > (when (case org-element--cache-change-warning > ((t) t) > (headline > (not (and (org-with-limited-levels (org-at-heading-p)) > (= (line-end-position) bottom)))) > (otherwise > (let ((case-fold-search t)) > (re-search-forward > org-element--cache-sensitive-re bottom t)))) > ;; Effectively extend modified area. > (org-with-limited-levels > (setq top (progn (goto-char top) > (when (outline-previous-heading) (forward-line)) > (point))) > (setq bottom (progn (goto-char bottom) > (if (outline-next-heading) (1- (point)) > (point)))))) > ;; Store synchronization request. > (let ((offset (- end beg pre))) > (org-element--cache-submit-request top (- bottom offset) offset))))) > ;; Activate a timer to process the request during idle time. > (org-element--cache-set-timer (current-buffer)))) > > which already does save-match-data. If I globally disable the org > element cache by (setq org-element-use-cache nil) the issue > disappears, so now I'm confused as to what's going on. Load the file where this function lives as a .el file, and when the watchpoint triggers, show the results of "xbacktrace". From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 15 15:47:05 2016 Received: (at 23917) by debbugs.gnu.org; 15 Jul 2016 19:47:05 +0000 Received: from localhost ([127.0.0.1]:53308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bO94i-00088c-UK for submit@debbugs.gnu.org; Fri, 15 Jul 2016 15:47:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55285) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bO94i-000888-6Z for 23917@debbugs.gnu.org; Fri, 15 Jul 2016 15:47:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bO94Z-0007bK-LC for 23917@debbugs.gnu.org; Fri, 15 Jul 2016 15:46:58 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38946) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO94Z-0007bD-I1; Fri, 15 Jul 2016 15:46:55 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3905 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bO94X-0001Bw-MA; Fri, 15 Jul 2016 15:46:54 -0400 Date: Fri, 15 Jul 2016 22:46:42 +0300 Message-Id: <83y45265wd.fsf@gnu.org> From: Eli Zaretskii To: rpluim@gmail.com In-reply-to: <83a8hshxjs.fsf@gnu.org> (message from Eli Zaretskii on Fri, 08 Jul 2016 20:03:35 +0300) Subject: Re: bug#23917: 25.0.95; commit 3a9d6296b35e5317c497674d5725eb52699bd3b8 causing org-capture to error out References: <8760sgnvxh.fsf@gmail.com> <83lh1ci5x5.fsf@gnu.org> <87poqo6sud.fsf@gmail.com> <83a8hshxjs.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: -6.3 (------) X-Debbugs-Envelope-To: 23917 Cc: 23917@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: -6.3 (------) > Date: Fri, 08 Jul 2016 20:03:35 +0300 > From: Eli Zaretskii > Cc: 23917@debbugs.gnu.org > > > which already does save-match-data. If I globally disable the org > > element cache by (setq org-element-use-cache nil) the issue > > disappears, so now I'm confused as to what's going on. > > Load the file where this function lives as a .el file, and when the > watchpoint triggers, show the results of "xbacktrace". Actually, we might be looking in the wrong direction: since some of these functions do use save-match-data, the search registers might be legitimately changed and restored several times. So I think you need to type "continue" and see what other parts of code change the match data, all the way until the call to replace_range returns. Once we've seen all those changes, with backtraces for each of them, we will probably see the culprit. It is still advisable to load the involved files as *.el files, as the results of "xbacktrace" will then be more detailed. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 18 08:25:15 2016 Received: (at 23917) by debbugs.gnu.org; 18 Jul 2016 12:25:15 +0000 Received: from localhost ([127.0.0.1]:55083 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bP7bm-0004i7-M1 for submit@debbugs.gnu.org; Mon, 18 Jul 2016 08:25:14 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:37136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bP7bk-0004ht-25 for 23917@debbugs.gnu.org; Mon, 18 Jul 2016 08:25:13 -0400 Received: by mail-wm0-f47.google.com with SMTP id i5so114181791wmg.0 for <23917@debbugs.gnu.org>; Mon, 18 Jul 2016 05:25:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:references:cc:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=Uq2DNupO8mi4lNvO8+RAnREjsSQWOLHd5Twr2y5dVZg=; b=yd9mSmiRf5pDSJpOpw4WhCeTrsNnMz0KJrgSD54f97fD9/OgfOGhm1Nxm1fEZuoIaQ 0DZA9oIlT2agSG+X0yib39N623CX1MX3wPsSjfdGOZq7xu6H0IdvCoG5kksSQ37d1aSN ykFsM3smdqtfMDoJIcDb62/dDl2rsUQfK//cMUTb6FJhhFo4L+h/z0cpGqIF3IJ3grdq +d6z8uDVnGm+S8N21pL1OYreKbBRS2AcyDKUeovZi69aj9rtmfMjYyVl5TDguaq1IvEW dKdrLrtP9gsZux8cB9zwaYKEfD37N+j7bH4G2R4xFw42r6KYOgC65yqgxD+UqUcnaUUH mKCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:references:cc:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:user-agent :mime-version:content-transfer-encoding; bh=Uq2DNupO8mi4lNvO8+RAnREjsSQWOLHd5Twr2y5dVZg=; b=eUBXO/g5Zs40IlkZ9VzDo3uLKEjZ0n4q7NHeMfyzk4DQWhd3Qv4srAMRl5rZvX5ySr NcxZurMFy69fFpIWmweXjZyqvKtWoH+f+LRcZmkiX/CkFqKFZrA6c+jnlBGAhl1ogEMo +yRu1uzqCgVFzr7k0Tipj5hFT61qLZCgbb31ScJ9Mz7ljk+7hDX8ZgrvPysZ9blZVQEw Tl4W25wSD4k3aJA19BH1zhTUFnp3lP1/Z++BzswWPihGBkkZZbpPsGzYtjS8fzUAkFez ooxlLwuMPr/sRhdvGXqAowoyJmmkH3T/d+Y1ctyj0KW4b3G91937QDcGn+4/B/VFsmlF /PTA== X-Gm-Message-State: ALyK8tIaqwombOUShWn9xSCamL9cR20pD+yP/OS/qseSFI8Lg75H8DWHKSr7xM2kBRL7Sw== X-Received: by 10.28.35.86 with SMTP id j83mr35166213wmj.18.1468844706163; Mon, 18 Jul 2016 05:25:06 -0700 (PDT) Received: from rpluim-XPS-15-9530 ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id lx5sm1025970wjb.38.2016.07.18.05.25.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jul 2016 05:25:05 -0700 (PDT) From: Robert Pluim To: Eli Zaretskii Subject: Re: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> Mail-Copies-To: never Gmane-Reply-To-List: yes Date: Mon, 18 Jul 2016 14:24:59 +0200 In-Reply-To: <8360s42mcb.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 17 Jul 2016 20:41:56 +0300") Message-ID: <87eg6rgmlg.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, nljlistbox2@gmail.com, Alex =?utf-8?Q?Benn=C3=A9e?= , jwiegley@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: -0.7 (/) (I'm moving this discussion to the bug, let me know if that's not OK) Eli Zaretskii writes: >> From: Alex Benn=C3=A9e >> Cc: Eli Zaretskii , "N. Jackson" , = emacs-devel@gnu.org >> Date: Sun, 17 Jul 2016 18:28:36 +0100 >>=20 >> I've just uninstalled the ELPA installed org and run into the same >> problem with the bundled version. It certainly doesn't happen with all >> my capture templates but this particular entry with %a and %c does >> trigger the error. From my *Messages: >>=20 >> Clipboard pasted as level 2 subtree >> org-capture: Capture template =E2=80=98g=E2=80=99: Match data clobbe= red by buffer modification hooks >> "/home/alex/src/emacs/install/share/emacs/25.0.95/lisp/org/org.elc" > > Can you come up with a reproducible recipe, starting with "emacs -Q", > and then loading everything required for the reproduction? Otherwise, > I don't see how this problem could be resolved, given the sadly small > number of people on board who are capable of debugging such problems. > Make sure that you have org-20160704 from elpa. # emacs -Q ;evaluate the following=20 (custom-set-variables '(package-selected-packages (quote (org-20160704)))) (package-initialize) ; Now do: C-x C-f ~/.notes M-x org-mode M-x org-capture t ; This should result in: Capture template =E2=80=98t=E2=80=99: Match data clobbered by buffer modifi= cation hooks I've tried to follow who clobbers it via GDB, but I keep getting lost. For me it's always search_regs.end[sub] that has the unexpected value. Regards Robert From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 18 10:50:39 2016 Received: (at 23917) by debbugs.gnu.org; 18 Jul 2016 14:50:39 +0000 Received: from localhost ([127.0.0.1]:55879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bP9sU-0008Rl-Sk for submit@debbugs.gnu.org; Mon, 18 Jul 2016 10:50:39 -0400 Received: from mail-oi0-f44.google.com ([209.85.218.44]:34997) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bP9sS-0008RX-Rm for 23917@debbugs.gnu.org; Mon, 18 Jul 2016 10:50:37 -0400 Received: by mail-oi0-f44.google.com with SMTP id l72so109247852oig.2 for <23917@debbugs.gnu.org>; Mon, 18 Jul 2016 07:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8GBJAEc0StLdnAY82LHt+Lm9DmttuqA+RES5VJlpBiM=; b=w7re8pbN1jb0ebdsSzUkLxVpk8908YglRNsyw6PL5W55EYvdD1JbHIOHlNsR3kFuF8 tjJr7whxzJU8VrYCwUy8PO3756acQlCeoNerK61/G01gFiOWo5dRJ2F4cmNefDmm82in 91g44yZqgX4P0bIH5bVtckpCh3JdTph76LwuRINw3qdiqsWxLsrzI60ga2Lged/EGwLu hOonsBjgwewfTyk1evuFG5ugXF4b1uUbrHpyLP/7HCBu9paWeMa1Iy+CTymTXaQBQvPf CO6ELGVwzE/wgdlHMFN4AaT38C6twKwFBTbziFUP6+6bRYTWq3Dz1hileP3fseaRex0D azow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8GBJAEc0StLdnAY82LHt+Lm9DmttuqA+RES5VJlpBiM=; b=jhRjxj1/cSYf9zGEXrM2Gme+lhGVXkuqJiRLBRJazH2sLJfo30kq+epRGUXRunI4LE rUpTJkmTdhjg/2ShuX363sWaF/eAuivyMxksmdSe+cGYzYoMRXdXTHw4sc9GWdv52IqD xS6UKlu+7cBGmuejV3BAXVQhAIHQXQ7sDWpPdRqyAHJozRG0AXyO+8yrXR1R4LflAH32 Cfeh8VsGA+fvvBSUZz+b4vDaGhueld5gokVXMO9FU48uekGdKnEvrwJX6w5pl9i/OXC0 hA9bOMMvb3lF9X+qVqYaTO8A+m4sSEM4z26Z7XQIIHbKxQb5cjuP+l1DNS+A0fm7uFNd 2eZw== X-Gm-Message-State: ALyK8tIuShtUcov9eAhVfxwy6YK4jzFtnyi66xzbGcHfpo2uSL5epaloehs2HyRoyhpX62IA8cd32/qXLn/88g== X-Received: by 10.157.17.169 with SMTP id v38mr19072020otf.11.1468853431082; Mon, 18 Jul 2016 07:50:31 -0700 (PDT) MIME-Version: 1.0 References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> In-Reply-To: <8360s42mcb.fsf@gnu.org> From: Kaushal Modi Date: Mon, 18 Jul 2016 14:50:20 +0000 Message-ID: Subject: =?UTF-8?Q?Re=3A_Please_consider_making_Bug_=2323917_a_blocker_for_?= =?UTF-8?Q?25=2E1_=28was_Re=3A_org=2Dcapture=3A_Capture_template_=E2=80=98g=E2=80=99=3A_Match_d?= =?UTF-8?Q?ata_clobbered_by_buffer_modification_hooks=29?= To: Eli Zaretskii , 23917@debbugs.gnu.org Content-Type: multipart/alternative; boundary=94eb2c1917a0fca3650537ea16d2 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23917 Cc: jwiegley@gmail.com, Eric S Fraga 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.7 (/) --94eb2c1917a0fca3650537ea16d2 Content-Type: text/plain; charset=UTF-8 I use org-capture heavily, but I do not use a template that causes this issue. This issue was posted once again today on the org mailing list and I would vote for this to be made a blocking bug too. One useful update we get from Eric Fraga ( http://thread.gmane.org/gmane.emacs.orgmode/108289 ) is that this bug is seen only after 25.0.94 pretest. @Eric Would it be possible for you to provide a recipe to recreate this issue from an emacs -Q session? -- Kaushal Modi --94eb2c1917a0fca3650537ea16d2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I use org-capture heavily, but I do not use a template tha= t causes this issue.

This issue was posted once again to= day on the org mailing list and I would vote for this to be made a blocking= bug too.=C2=A0

One useful update we get from Eric= Fraga (=C2=A0http://thread.gmane.org/gmane.emacs.orgmode/108289=C2=A0) is that thi= s bug is seen only after 25.0.94 pretest.

@Eric Wo= uld it be possible for you to provide a recipe to recreate this issue from = an emacs -Q session?
--

Kaushal Modi

--94eb2c1917a0fca3650537ea16d2-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 18 13:00:01 2016 Received: (at 23917) by debbugs.gnu.org; 18 Jul 2016 17:00:01 +0000 Received: from localhost ([127.0.0.1]:55930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPBtg-00031K-Qa for submit@debbugs.gnu.org; Mon, 18 Jul 2016 13:00:01 -0400 Received: from mail-eopbgr10103.outbound.protection.outlook.com ([40.107.1.103]:26240 helo=EUR02-HE1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPBte-000317-KH for 23917@debbugs.gnu.org; Mon, 18 Jul 2016 12:59:59 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=e.fraga@ucl.ac.uk; Received: from localhost (95.149.137.203) by VI1PR01MB1902.eurprd01.prod.exchangelabs.com (10.166.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.544.10; Mon, 18 Jul 2016 16:59:50 +0000 From: Eric S Fraga To: Kaushal Modi Subject: Re: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) Organization: On the Interweb somewhere References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <9613abde4dbd48fdb2b5e780101a13a0@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> X-Url: http://twitter.com/ericsfraga/ Date: Mon, 18 Jul 2016 17:59:47 +0100 In-Reply-To: <9613abde4dbd48fdb2b5e780101a13a0@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> (Kaushal Modi's message of "Mon, 18 Jul 2016 14:50:20 +0000") Message-ID: <87eg6q2870.fsf@ucl.ac.uk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [95.149.137.203] X-ClientProxiedBy: DB4PR05CA0033.eurprd05.prod.outlook.com (10.160.40.43) To VI1PR01MB1902.eurprd01.prod.exchangelabs.com (10.166.40.146) X-MS-Office365-Filtering-Correlation-Id: 7dfe0cb7-eab3-49f3-3ce7-08d3af2cee74 X-Microsoft-Exchange-Diagnostics: 1; VI1PR01MB1902; 2:XISMJyAN0W94vxyH3r5JBXBfj1atyTBllMPag4fk/EbTnsuwjNezurd6U0F/3hS+CtrXc+KLHx5Pd3HzMC6MebuDjK1XsKidkpchYtmTLcxhdVaJ7eKAeBaWLtVPyxnN8u/wmFHEF7MdVB1zDAY0NFxTXqYEe3OQr80lgl/5kGwaa+tS9ME4JrIaTwPuI1+f; 3:5S6NYzH0SVLARFMCON3MqrsSQu7PmDMobPwmWMO/SlzTCFLIxr/zOhpoD+7qn4FZyCZQAKk9vjhjb47qDmA4VoGn8mqfSBYuvNs4/KXoWyu2OtmstQIVYip7V99omXhn; 25:WheelMU7eBfrwCkwT4TFEySrAgxGwne5uBFOjf/jjxPGLx08CWNpDRXDDbcDDG+Gn73hPLFMgBEBAYpJM4wpWvSBQMOIa9XNFrDgBViC+UF/OozMbBxd35Ut2efQ/oBN5wd4eV50cfzqQ4i32MWqBXbtLXPOfSUPIk+NtIxWPH1EKnr9cXYq/1ce9b9BIbb3ecb3t2fjVHSzjukMTiqxK5fpqma9kIL5zAh8PJbSrTi4bm0GvmgwUxnqjIo6iTt54fah42escuJCYUbbt1b/I+0yyNgM3SrvwkOHq2J2dD9HHaw2ITj7J5gXk5SsRSlL911sVpvNjpgQXfCndvX4bilkRdrMe+xW5HeYgATQyjNH0XCOWjH8eMjAbmcXWo3TSmEE5mnibBir+rCZrdio++t5zqFjUfRkaeg0fyfgA0c=; 31:XI2s9CdR2F/xNVwIns7E1LxSpLB2g8TTfIwQygWp+9Vp1ovND4+GMw/EfJcUiBs6mthr5JMP3AE930adq9Jq69Zj7kY6OFw8OU/egS8ByCuM9pCHsoIUzOTM3b+gZ4qMC2dgh0ibcD84UrX7FvLFWGI9K3QmoIlf56kCTCjQzRSG+2KKlLtBY01kNzHqJLx0Q4o/ZN8wO/RfiYjDDt7HyA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR01MB1902; X-UCLLIVE-SCLRULE: HASRUN X-Microsoft-Exchange-Diagnostics: 1; VI1PR01MB1902; 20:eCDHjWCZLQCGyZ7NuHnUPtAS17Aoi/7//K9yX/hQk+mdeVKq4NRYx6ZIHz7zeJ+Z9Jj3DpIhw6soUIRIbnAwRhO7PyHjaRfoN/NDGIy4PsUTtzTw0FLakt7Pf2BquqvF5Pq1UqPFFERTcghZWiCvPsw0biGHDYXPf3hQpmffdl5AP4TMSAkKLPI+9l9kR8mZJRsADNIZeG6ncgp/KqG67vSVNUy1J/m809przxp3TEW/SSOCAWKIDijbT8EtPLgqeeUxkN0Pyk4nHPZPpfGtaXYw+Fa164riBRN26MCVMSU1rjN1K5XjZKTrF5vmPZ432bTAroboqmO5db9U9A5gFOggHITYlbSn8RZOPuNT8Dgu8ZH//v0f6134+cp6hY1ahgfIreMvqP70UENGQK/vDpRq+YYeEbYw8BoVSUUtJlxvDfByescSz09ZWiDTcjrDGxhe/47W+1A7KWlLOFc7kkdjWLx6nFKABX4OuPui60GQsFeLcedgMs9x+MBO1C3pWhOxTDcsANgLzHzigspSd5U0pyMDROioQx+I9XpROCZzkEBP/ONI2SsYLjrCI79blSUf5M1Vh/yNy9QvjMgRVHw4cm90zJzJfzLEcxYmDpY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:VI1PR01MB1902; BCL:0; PCL:0; RULEID:; SRVR:VI1PR01MB1902; X-Microsoft-Exchange-Diagnostics: 1; VI1PR01MB1902; 4:zjuGtVZwUCmBrYVq+x5LyW9Mxqr6w5KLQH4Cte/Xzx57gAfUdRew+xoDnahI2o1hoO36DZH7ZWUmUUNHDV8vCLID10Dg6iuS0ghGaMSAg9xXuEsLmVw/e6mprGC/CjsIci2EvNUn2vpWgiz1IHrID8i2tWYoiF2mQH1IPFKanln5Lyd7iCPthP3vjzEv5YreNPcwY5qc/Mo6sVlPcqLxhrXv0VoW4OfzpL80laXIbOMUC3U06J68wM0sq86nTHqSWTJGpnOMJvYBZPWRdPUBqxZsAg13wVxT+fDwa85CgigctQPFa1A8P+boWpHaxGDKF3fxOZKLTL2VmqNvN7nhGjOGq6mHJpmThSCX6E96fly88Wd0Hl5YHy+HzG5lb2A5 X-Forefront-PRVS: 00073DB75F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6069001)(6009001)(7916002)(24454002)(199003)(52294002)(51884002)(189002)(377424004)(4326007)(36756003)(189998001)(6116002)(3846002)(74482002)(93886004)(106356001)(2950100001)(47776003)(77096005)(66066001)(586003)(74826001)(33646002)(68736007)(54356999)(81156014)(7846002)(50986999)(76176999)(7736002)(86362001)(305945005)(50466002)(8746002)(23676002)(53806999)(81166006)(3450700001)(76506005)(42186005)(97736004)(4001350100001)(105586002)(43066003)(101416001)(83506001)(19580395003)(2906002)(110136002); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR01MB1902; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: ucl.ac.uk does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjAxTUIxOTAyOzIzOjlMeHVhbDNRUzFqQm1ZbGoxUC9Ja09oY09J?= =?utf-8?B?cnlqRHluT0w4U1o2em5wVHBab0xuTGtzUXVGYzhVSXdvMCs0ZWpRUUl5MlA3?= =?utf-8?B?UWg0Sm5TUGdweTNrYkRlbDl3UjNkUnY4NzhBVGpiVElad1MwNHZNZUtoZFVo?= =?utf-8?B?NnFxcWZ5TkNGdjBYM2lyR2lYVVVsK24zNE9MekNBS2hYbW9JQXQ5SEY3d0VL?= =?utf-8?B?a2diYXhmNk54eWdXbjNrTWNieXprT3Y1dlJmTHpqWU4vN2NWTnJsUGxvSEFp?= =?utf-8?B?MytWdEZaS3Z3RlhoTlRGOGVZRkpERjQzby83V01UcmN5cCtwS2N1MjNnMFZa?= =?utf-8?B?d0VRKytHeW04WGljUUJCOTRaNGtRWXNnaFhMUDlhTzY4V0VFVC9Kb2E2dGhT?= =?utf-8?B?Q0h2amVQNXN1Z0VxZG1LMklLcVIwRnpiVEd3dDh2MHVJTzA3MnJWWjhMOHFm?= =?utf-8?B?QXFyMy9PUU9mc3hCaldGckFybmZsWEVlRWtYT1VzMlZvYXI3a1ZZQlVWZC9n?= =?utf-8?B?cWVtNHFvZlhuM2NUUUZXVlpOWkVBOWZpMzN0eTMvTCtHNnB4dCtXOVhubHdx?= =?utf-8?B?Z1Z2bnZRZWR2blVGUEpad0NPRVo1ZWtvWnh6YmRhbVBiTkJGMXhaRHRMaldl?= =?utf-8?B?ZkcxTGlrcktVSEJFNG1vTWQ0azBHU2V4NXVrdWlHNkZleE5QNElieHJ6LytV?= =?utf-8?B?Nm1WZW93NmVrNnp0UjRzc3doVjFJNW9PaEhoWEprSTJweVk4ZGE5WUxyV2Jz?= =?utf-8?B?MG9ZUU1ob2RkYXNRRk5icUF3TWR6MDdSa0Y2bHA3MFJMNGhITlJEWWUwbkVP?= =?utf-8?B?alhxY3lqSlJwVk1OQVFBNzIwcUgyaGN6TmpqUzdLQVpCZW50cnQxaGdqdjdt?= =?utf-8?B?TW5IdDB0MVhXb2R5L0NjVHFJM3dUWVhJdlgyeFNmRG1HYmRwWjF1SmtidmRh?= =?utf-8?B?SHMwYWxZclNwMHI0T2ovVmJFR2FwTGxvOUlOdmFVTVRTVncyQTc5SzU1NDFO?= =?utf-8?B?eFRScEpnTXZXV0RJTHpUUHA4K200V25kdVhwWVNrUkFSRDBvM0NUbE5GZElu?= =?utf-8?B?eW8yemlmUmFob0VZcys1MzVkcnROVElmVWVXWHd3R0sxb29lbGd5SVJvMFRP?= =?utf-8?B?djdqY0lKT0p4eitFeHV2Y0ZkSS9HYTRlQThHMWFYWWRuWE9KT1ZvekxhRFBC?= =?utf-8?B?Y3JXY3dWRmFYRERHcmhJMElLb1czMEF6aWxVdzZVNEViM0hWV1JlZkdoYnVv?= =?utf-8?B?SC9ZalJsZmFRY21udGNXeHF0V2NyOXFkUnVQdUtUdkczd01GTWN2YVZaZm5j?= =?utf-8?B?RXNmQStYY1ZQc2FjZDRpSDlYOGJXNkVRb0dSakd1SUhzV1U4Tm9kOGhSZlZu?= =?utf-8?B?V0wrcTBCZUx0U1RDQlZySklIRkh6WWVpZFAybU5pS05PMG1NZnRCcURtdVho?= =?utf-8?B?ZGh0WXZCbUplcVA0aGUyZVJNODhaeTFCQmxEV1FUZnpCOUJYTnJ2THJraWRq?= =?utf-8?B?d0FUNVlmRUV5b3RrYnVucExxMnByQWlFbGpOVGdVcFdvb3o0MWJLQVF6RHJz?= =?utf-8?B?UlRCZlFSRmdPN2lleE52TkdPaHRUOGtVUnc0TGhYWklmMlNFd1JDODZKc2py?= =?utf-8?B?WGFFUzhFejlrTWRGT3hpTGdKcVBiSktTaGQzM2NDWE83VVRvT3lUWnhXTzRl?= =?utf-8?Q?RY/RIs+REDL5dKKrB6tHW1UcL2VNACM5b9Hm2KQ?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR01MB1902; 6:7ZfsgEl1yvVO8CBgBos0oSYw1o+HvKEE9puEEFEAUwoosGZTOjwhKfHu88NqcoMv95xs64szrkrHxDEfia9se3ZXly/texnwyarN2gjNvR11l02WQIPDwpXp65qQWYaCswiKNqVW4npdpU4CrTX22nobgQt5XOIh6DITChYi6wX02R/ta/iqqTMX0VNYa+3ECxefgjVTDtWa2AlRv/S7Oww1Bz2/nHoLpwOahe3KFsvqGG8PsFHqgyVvInOt7MhTTfFFlzRyMLzVgon6KTSOIs4gTAzNe4Qf+nmCfnMs/AY=; 5:l0LfhxYgMfBDlU9W0LlXzkENbDwPm/lVRwRYH7oH/de0H9+9hnCdkjSg2BltFV36ZM3YhbJhQUEr6IikwZAit29Ke6ZX5Wa/7LNb9vKSVM8Y8s6FLQQY7ely4ofaTuXZQNREGjvAtLE35JFDwMYutw==; 24:YjSiXtiAONrQyGiEGjfRaXNXjSAfCucuEKy1lJeJutKbPjypz3Z6y6NysGwORHUXj3fx8dhufIXkh0Vm9qMPOkDFUBr9GIAhdWZy9+EZMuA=; 7:7GPHItlS0ceOwCLo6SMhIsJBmgwJouKpVnSo2k0n436qCYRXdzPROLl4ZceUvVSsY52rJ2mI+CBIJ95Jc3dyInldu/0TxtcQ5FlijcMFN9avfjpouMLtD0hkzJHDNXyFWlvhfV4H1TWuXBZdWmB1/zGZEIWd8YK+jjSDfsITj/nMdzVSmgDP/vHQN3Avjbp2O6EvCoE4XX7QAQWLKUjK773OtxkpLCw4KXPcKQSk+KJedgRsn/RSb3snQe8CRHk9 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ucl.ac.uk X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2016 16:59:50.0876 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR01MB1902 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 23917 Cc: "23917@debbugs.gnu.org" <23917@debbugs.gnu.org>, Eli Zaretskii , "jwiegley@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: , Reply-To: Eric S Fraga Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Monday, 18 Jul 2016 at 14:50, Kaushal Modi wrote: > @Eric Would it be possible for you to provide a recipe to recreate > this issue from an emacs -Q session? With emacs-snapshot (aka 25.0.95.1), and the following emacs-minimal.el file: --8<---------------cut here---------------start------------->8--- (add-to-list 'load-path "~/git/org-mode/lisp") (require 'org) (setq org-capture-templates '(("t" "todo" entry (file+datetree "/tmp/tasks.= org") "* TODO %^{Task} %^G\nSCHEDULED: %t\n%i%?"))) --8<---------------cut here---------------end--------------->8--- the following sequence: --8<---------------cut here---------------start------------->8--- emacs -Q -l emacs-minimal.el M-x org-capture RET t this is a test RET testing RET --8<---------------cut here---------------end--------------->8--- gives --8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (error "Capture template =E2=80=98t=E2=80=99:= Match data clobbered by buffer modification hooks") signal(error ("Capture template =E2=80=98t=E2=80=99: Match data clobbered= by buffer modification hooks")) error("Capture template `%s': %s" "t" "Match data clobbered by buffer mod= ification hooks") (condition-case error (org-capture-place-template (equal (car (org-captur= e-get :target)) (quote function))) ((error quit) (if (and (buffer-base-buff= er (current-buffer)) (string-match "\\`CAPTURE-" (buffer-name))) (kill-buff= er (current-buffer))) (set-window-configuration (org-capture-get :return-to= -wconf)) (error "Capture template `%s': %s" (org-capture-get :key) (nth 1 e= rror)))) (if (equal goto 0) (org-capture-insert-template-here) (condition-case err= or (org-capture-place-template (equal (car (org-capture-get :target)) (quot= e function))) ((error quit) (if (and (buffer-base-buffer (current-buffer)) = (string-match "\\`CAPTURE-" (buffer-name))) (kill-buffer (current-buffer)))= (set-window-configuration (org-capture-get :return-to-wconf)) (error "Capt= ure template `%s': %s" (org-capture-get :key) (nth 1 error)))) (if (and (de= rived-mode-p (quote org-mode)) (org-capture-get :clock-in)) (condition-case= nil (progn (if (org-clock-is-active) (org-capture-put :interrupted-clock (= copy-marker org-clock-marker))) (org-clock-in) (set (make-local-variable (q= uote org-capture-clock-was-started)) t)) (error "Could not start the clock = in this capture buffer"))) (if (org-capture-get :immediate-finish) (org-cap= ture-finalize))) (cond ((equal entry "C") (customize-variable (quote org-capture-templates= ))) ((equal entry "q") (user-error "Abort")) (t (org-capture-set-plist entr= y) (org-capture-get-template) (org-capture-put :original-buffer orig-buf :o= riginal-file (or (buffer-file-name orig-buf) (and (featurep (quote dired)) = (car (rassq orig-buf dired-buffers)))) :original-file-nondirectory (and (bu= ffer-file-name orig-buf) (file-name-nondirectory (buffer-file-name orig-buf= ))) :annotation annotation :initial initial :return-to-wconf (current-windo= w-configuration) :default-time (or org-overriding-default-time (org-current= -time))) (org-capture-set-target-location) (condition-case error (org-captu= re-put :template (org-capture-fill-template)) ((error quit) (if (get-buffer= "*Capture*") (kill-buffer "*Capture*")) (error "Capture abort: %s" error))= ) (setq org-capture-clock-keep (org-capture-get :clock-keep)) (if (equal go= to 0) (org-capture-insert-template-here) (condition-case error (org-capture= -place-template (equal (car (org-capture-get :target)) (quote function))) (= (error quit) (if (and (buffer-base-buffer ...) (string-match "\\`CAPTURE-" = ...)) (kill-buffer (current-buffer))) (set-window-configuration (org-captur= e-get :return-to-wconf)) (error "Capture template `%s': %s" (org-capture-ge= t :key) (nth 1 error)))) (if (and (derived-mode-p (quote org-mode)) (org-ca= pture-get :clock-in)) (condition-case nil (progn (if (org-clock-is-active) = (org-capture-put :interrupted-clock ...)) (org-clock-in) (set (make-local-v= ariable ...) t)) (error "Could not start the clock in this capture buffer")= )) (if (org-capture-get :immediate-finish) (org-capture-finalize))))) (let* ((orig-buf (current-buffer)) (annotation (if (and (boundp (quote or= g-capture-link-is-already-stored)) org-capture-link-is-already-stored) (pli= st-get org-store-link-plist :annotation) (condition-case nil (progn (org-st= ore-link nil)) (error nil)))) (entry (or org-capture-entry (org-capture-sel= ect-template keys))) initial) (setq initial (or org-capture-initial (and (o= rg-region-active-p) (buffer-substring (point) (mark))))) (if (stringp initi= al) (progn (remove-text-properties 0 (length initial) (quote (read-only t))= initial))) (if (stringp annotation) (progn (remove-text-properties 0 (leng= th annotation) (quote (read-only t)) annotation))) (cond ((equal entry "C")= (customize-variable (quote org-capture-templates))) ((equal entry "q") (us= er-error "Abort")) (t (org-capture-set-plist entry) (org-capture-get-templa= te) (org-capture-put :original-buffer orig-buf :original-file (or (buffer-f= ile-name orig-buf) (and (featurep (quote dired)) (car (rassq orig-buf dired= -buffers)))) :original-file-nondirectory (and (buffer-file-name orig-buf) (= file-name-nondirectory (buffer-file-name orig-buf))) :annotation annotation= :initial initial :return-to-wconf (current-window-configuration) :default-= time (or org-overriding-default-time (org-current-time))) (org-capture-set-= target-location) (condition-case error (org-capture-put :template (org-capt= ure-fill-template)) ((error quit) (if (get-buffer "*Capture*") (kill-buffer= "*Capture*")) (error "Capture abort: %s" error))) (setq org-capture-clock-= keep (org-capture-get :clock-keep)) (if (equal goto 0) (org-capture-insert-= template-here) (condition-case error (org-capture-place-template (equal (ca= r ...) (quote function))) ((error quit) (if (and ... ...) (kill-buffer ...)= ) (set-window-configuration (org-capture-get :return-to-wconf)) (error "Cap= ture template `%s': %s" (org-capture-get :key) (nth 1 error)))) (if (and (d= erived-mode-p (quote org-mode)) (org-capture-get :clock-in)) (condition-cas= e nil (progn (if ... ...) (org-clock-in) (set ... t)) (error "Could not sta= rt the clock in this capture buffer"))) (if (org-capture-get :immediate-fin= ish) (org-capture-finalize)))))) (cond ((equal goto (quote (4))) (org-capture-goto-target)) ((equal goto (= quote (16))) (org-capture-goto-last-stored)) (t (let* ((orig-buf (current-b= uffer)) (annotation (if (and (boundp ...) org-capture-link-is-already-store= d) (plist-get org-store-link-plist :annotation) (condition-case nil (progn = ...) (error nil)))) (entry (or org-capture-entry (org-capture-select-templa= te keys))) initial) (setq initial (or org-capture-initial (and (org-region-= active-p) (buffer-substring (point) (mark))))) (if (stringp initial) (progn= (remove-text-properties 0 (length initial) (quote (read-only t)) initial))= ) (if (stringp annotation) (progn (remove-text-properties 0 (length annotat= ion) (quote (read-only t)) annotation))) (cond ((equal entry "C") (customiz= e-variable (quote org-capture-templates))) ((equal entry "q") (user-error "= Abort")) (t (org-capture-set-plist entry) (org-capture-get-template) (org-c= apture-put :original-buffer orig-buf :original-file (or (buffer-file-name o= rig-buf) (and ... ...)) :original-file-nondirectory (and (buffer-file-name = orig-buf) (file-name-nondirectory ...)) :annotation annotation :initial ini= tial :return-to-wconf (current-window-configuration) :default-time (or org-= overriding-default-time (org-current-time))) (org-capture-set-target-locati= on) (condition-case error (org-capture-put :template (org-capture-fill-temp= late)) ((error quit) (if ... ...) (error "Capture abort: %s" error))) (setq= org-capture-clock-keep (org-capture-get :clock-keep)) (if (equal goto 0) (= org-capture-insert-template-here) (condition-case error (org-capture-place-= template ...) (... ... ... ...)) (if (and ... ...) (condition-case nil ... = ...)) (if (org-capture-get :immediate-finish) (org-capture-finalize)))))))) org-capture(nil) funcall-interactively(org-capture nil) call-interactively(org-capture record nil) command-execute(org-capture record) execute-extended-command(nil "org-capture" "org-capture") funcall-interactively(execute-extended-command nil "org-capture" "org-cap= ture") call-interactively(execute-extended-command nil nil) command-execute(execute-extended-command) --8<---------------cut here---------------end--------------->8--- and the /tmp/tasks.org file looks like this: --8<---------------cut here---------------start------------->8--- * 2016 ** 2016-07 July *** 2016-07-18 Monday **** TODO this is a test :testing: SCHEDULED: <2016-07-18 Mon> %? --8<---------------cut here---------------end--------------->8--- The file did not exist before org-capture was invoked so we can see that the majority of the template was invoked. HTH, eric --=20 : Eric S Fraga (0xFFFCF67D), Emacs 25.0.94.1, Org release_8.3.4-1049-g481709 From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 18 14:10:21 2016 Received: (at 23917) by debbugs.gnu.org; 18 Jul 2016 18:10:21 +0000 Received: from localhost ([127.0.0.1]:55971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPCzl-0004mu-Bp for submit@debbugs.gnu.org; Mon, 18 Jul 2016 14:10:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPCzj-0004mg-KW for 23917@debbugs.gnu.org; Mon, 18 Jul 2016 14:10:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPCzd-0007Jh-DR for 23917@debbugs.gnu.org; Mon, 18 Jul 2016 14:10:14 -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_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPCzW-0007Ds-4n; Mon, 18 Jul 2016 14:10:06 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2819 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bPCzT-00026w-3g; Mon, 18 Jul 2016 14:10:04 -0400 Date: Mon, 18 Jul 2016 21:09:53 +0300 Message-Id: <83lh0y24y6.fsf@gnu.org> From: Eli Zaretskii To: Robert Pluim , Stefan Monnier In-reply-to: <87eg6rgmlg.fsf@gmail.com> (message from Robert Pluim on Mon, 18 Jul 2016 14:24:59 +0200) Subject: Re: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> 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: -6.3 (------) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, nljlistbox2@gmail.com, alex.bennee@linaro.org, jwiegley@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.3 (------) > From: Robert Pluim > CC: 23917@debbugs.gnu.org, Alex Bennée > , jwiegley@gmail.com, nljlistbox2@gmail.com > Date: Mon, 18 Jul 2016 14:24:59 +0200 > > (I'm moving this discussion to the bug, let me know if that's not OK) Thanks. > Make sure that you have org-20160704 from elpa. > > # emacs -Q > > ;evaluate the following > (custom-set-variables > '(package-selected-packages > (quote > (org-20160704)))) > (package-initialize) > > ; Now do: > > C-x C-f ~/.notes > M-x org-mode > M-x org-capture > t > > ; This should result in: > Capture template ‘t’: Match data clobbered by buffer modification > hooks Thanks again. It turns out the validation added in 3a9d6296, to solve bug#23869, exposed a very serious bug we seem to have always had with save-match-data called from buffer-modification hooks. The basic problem is that set-marker restricts the buffer position passed as its argument to valid limits, between 1 and EOB. So if you call set-marker with a value beyond EOB, the marker's position will silently set to EOB. Now, when buffer-modification hooks run due to changes made by replace-match, the replacement has already been done. If that replacement shrinks the buffer, then when save-match-data is called, and calls match-data, the latter will see the new (smaller) value of EOB. By default, match-data records the data in markers it creates for beginning and end of each matched sub-expression. So the result is that beginning and/or end of any sub-expression that was beyond the new EOB will be recorded as EOB. Then restoring this saved match data will clobber the data of those sub-expressions. In the case in point, a single character at EOB (= 62) was deleted, which made EOB be 61, one less than its previous value. When save-match-data was called from within a hook set up by Org, it tried to record the end of the sub-expression as 62, but set-marker silently changed that to 61. That "corrected" value was subsequently restored when save-match-data was exited, whereas replace-match expected to see the original value of 62, and therefore barfed. My suggestion to fix this is below. I ask for opinions on (1) whether this looks like TRT, (2) whether it is safe enough for emacs-25, and (3) whether someone has better ideas. If someone thinks I've misunderstood the issue, don't hesitate to explain why, because frankly it feels very strange to find bugs that seem to have existed since 1990. diff --git a/lisp/subr.el b/lisp/subr.el index e9e19d3..1bb1cb3 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3466,7 +3466,7 @@ save-match-data ;; if you need to recompile all the Lisp files using interpreted code. (declare (indent 0) (debug t)) (list 'let - '((save-match-data-internal (match-data))) + '((save-match-data-internal (match-data 'integers))) (list 'unwind-protect (cons 'progn body) ;; It is safe to free (evaporate) markers immediately here, From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 18 15:04:29 2016 Received: (at 23917) by debbugs.gnu.org; 18 Jul 2016 19:04:29 +0000 Received: from localhost ([127.0.0.1]:56011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPDq9-00069C-15 for submit@debbugs.gnu.org; Mon, 18 Jul 2016 15:04:29 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:34793) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPDq7-00068z-Cf for 23917@debbugs.gnu.org; Mon, 18 Jul 2016 15:04:27 -0400 Received: by mail-pf0-f171.google.com with SMTP id p64so34823244pfb.1 for <23917@debbugs.gnu.org>; Mon, 18 Jul 2016 12:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:date:message-id:references :user-agent:mime-version; bh=FneFHS1VIqSVLr86CKcfpuHGEvb9n6NVf5I1wPXPZ3w=; b=NbhvJFg1yz4CRh4VyOOEQkYSUFiO8Up/1kC9lQ+qCu93tOjU8/i9max5bK7vTXyFyM xVPMVenc+WgIgjNWPk0K6iJid2BkP+/Ixp3r1pQgPs4GZ7eEnCHhrlGRAwuVVhheBGor Nw+X9zetCTLrKp+cqpZkDj1RTzLTIPjC/IVBqS8g7ELA7MrICAJ8+WDmp6wsNFp+qaOt r2biBlp+5RtiPuD3Yls7LUYtO5csLEpEtsfFSyo37pNKmTyWMgDKQbc4MrVF7i11Jpjy /U8D/D+giL7+4wGFe6MilvcmE8TIIdZStJJMdB9yWgAEvL0wlcPJXS5nndctoPiuBJCL jKIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:in-reply-to:date:message-id :references:user-agent:mime-version; bh=FneFHS1VIqSVLr86CKcfpuHGEvb9n6NVf5I1wPXPZ3w=; b=BVwM1C+klV7QvWs4lFU2g5ow+fP734/BCluVsg/1guf+tWygKnW7tD2/S1dBz5vXV7 UX9oSgx4a6K2poBTcCrNYBKxiyfUd5L0OWl5uGViJwmiBak8yPvp9/r/1N04ODJYsfpL uDDRpvc3k5Nxh751rIhMnTU/93ROQmMKf4WGMD6arJR2/gtWBfNO9e2yNDI9TZwP7Ivr cmsTfSrjyfo3I9wfh9i/SLDYucaywdhaHsIk1OnZfwuo6ndqEortGHIN+H4Pwi7TX1aa DWCoSynAJrvYDKIxNhD4HePuk/lKekyAYuOjcp4septRqd3J+t9PSDZ9Eqw9rDEzSVYj DllA== X-Gm-Message-State: ALyK8tLOW4OO+IwLommFtU6kIaaQE4pRf0EZNn3zNl5cg8ETo+FFtLoL7PiRyYSvZ0EpGQ== X-Received: by 10.98.62.65 with SMTP id l62mr48550625pfa.2.1468868661616; Mon, 18 Jul 2016 12:04:21 -0700 (PDT) Received: from Vulcan.local (76-234-68-79.lightspeed.frokca.sbcglobal.net. [76.234.68.79]) by smtp.gmail.com with ESMTPSA id i69sm6765893pfk.30.2016.07.18.12.04.19 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Jul 2016 12:04:19 -0700 (PDT) From: John Wiegley X-Google-Original-From: "John Wiegley" Received: by Vulcan.local (Postfix, from userid 501) id CCD9D1A25D5E; Mon, 18 Jul 2016 12:04:18 -0700 (PDT) To: Eli Zaretskii Subject: Re: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) In-Reply-To: <83lh0y24y6.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 18 Jul 2016 21:09:53 +0300") Date: Mon, 18 Jul 2016 12:04:11 -0700 Message-ID: References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.95 (darwin) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, Robert Pluim , alex.bennee@linaro.org, Stefan Monnier , nljlistbox2@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: -0.7 (/) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable >>>>> Eli Zaretskii writes: > My suggestion to fix this is below. I ask for opinions on (1) whether this > looks like TRT, (2) whether it is safe enough for emacs-25, and (3) wheth= er > someone has better ideas. I didn't even know match-data took arguments, so I defer to your judgment on this issue, Eli. =2D-=20 John Wiegley GPG fingerprint =3D 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGcBAEBCgAGBQJXjSgsAAoJEMFE2PTxn+Yw8B8L/R9ZD+pQA9v2lRgfXMv7VCjv Fxt6pLBmK/HixcarqM680GNWxAQm9uqS5EVXWNhSeJz/LHsip4//qv57IgMIlbRR ivrpABSpEX8UPhoNPKj4EDktEkilClPlNnIecLqPeI9Red1mQQXDMM7/JWUjUmwx PJynVCqJslazeZpOzUMzwdw1ZoIIOA6Xc5QaPHvdw1WV2UMyjfUhx43JQdIliEGp ofSLbmhvdcDVbm5TEDeGK5KkyB2USVTcgazPRr+9WvB36vpCBeFHezjEJuOqiMBM aiv6T9vEICG/JzTTg48uWz5MfnpgLQpOofT/x20UA6V5qAm4kOS1l+A/wsszCjwl wSrlse2zDo5Pnn5nLLutaJZPY8ZO08oIV8Ji6h3gMlHDCdAelzIwquF3BBIumgNO 7+kSS6G6G+QNM9URBM6pjMYV4w2NeeNltuTvcIVinoQaHbccNOMrkhZSjjPdskis oe49NDvtQLIvxM573ZvZ/WQw+i8XD4LBD0dArcaIWQ== =lPra -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 18 15:11:20 2016 Received: (at 23917) by debbugs.gnu.org; 18 Jul 2016 19:11:20 +0000 Received: from localhost ([127.0.0.1]:56019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPDwm-0006JC-30 for submit@debbugs.gnu.org; Mon, 18 Jul 2016 15:11:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPDwk-0006J0-Fl for 23917@debbugs.gnu.org; Mon, 18 Jul 2016 15:11:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPDwe-0005AB-IQ for 23917@debbugs.gnu.org; Mon, 18 Jul 2016 15:11:13 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPDwX-000586-Jn; Mon, 18 Jul 2016 15:11:05 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2947 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bPDwT-0005fi-Ii; Mon, 18 Jul 2016 15:11:04 -0400 Date: Mon, 18 Jul 2016 22:10:42 +0300 Message-Id: <83h9bm224t.fsf@gnu.org> From: Eli Zaretskii To: John Wiegley In-reply-to: (message from John Wiegley on Mon, 18 Jul 2016 12:04:11 -0700) Subject: Re: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> 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: -6.3 (------) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, rpluim@gmail.com, alex.bennee@linaro.org, monnier@iro.umontreal.ca, nljlistbox2@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.3 (------) > From: John Wiegley > Cc: Robert Pluim , Stefan Monnier , 23917@debbugs.gnu.org, alex.bennee@linaro.org, nljlistbox2@gmail.com > Date: Mon, 18 Jul 2016 12:04:11 -0700 > > >>>>> Eli Zaretskii writes: > > > My suggestion to fix this is below. I ask for opinions on (1) whether this > > looks like TRT, (2) whether it is safe enough for emacs-25, and (3) whether > > someone has better ideas. > > I didn't even know match-data took arguments, so I defer to your judgment on > this issue, Eli. Neither did I, but I've read the code through which I stepped ;-) From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 18 20:58:42 2016 Received: (at 23917) by debbugs.gnu.org; 19 Jul 2016 00:58:42 +0000 Received: from localhost ([127.0.0.1]:56116 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPJMw-0001EO-KU for submit@debbugs.gnu.org; Mon, 18 Jul 2016 20:58:42 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:64143) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPJMv-0001EC-QP for 23917@debbugs.gnu.org; Mon, 18 Jul 2016 20:58:42 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AjDgA731xV/3mcpUVcgxCEAghGyBIEAgKBPD0QAQEBAQEBAYEKQQWDXQEBAwEMFzMjBQsJAhoCGAcHAgIUGA0TEYg3CI18nRCkFwEBCAIBH4EhihmEUjMHgmiBRQEEkDSOY4NrkD2BRSOBZiQcFYFZIoJ4AQEB X-IPAS-Result: A0AjDgA731xV/3mcpUVcgxCEAghGyBIEAgKBPD0QAQEBAQEBAYEKQQWDXQEBAwEMFzMjBQsJAhoCGAcHAgIUGA0TEYg3CI18nRCkFwEBCAIBH4EhihmEUjMHgmiBRQEEkDSOY4NrkD2BRSOBZiQcFYFZIoJ4AQEB X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="248457055" Received: from 69-165-156-121.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([69.165.156.121]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Jul 2016 20:58:36 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id B5141AE2BB; Mon, 18 Jul 2016 20:58:35 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) Message-ID: References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> Date: Mon, 18 Jul 2016 20:58:35 -0400 In-Reply-To: <83lh0y24y6.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 18 Jul 2016 21:09:53 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, Robert Pluim , alex.bennee@linaro.org, nljlistbox2@gmail.com, jwiegley@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: 0.3 (/) > In the case in point, a single character at EOB (=3D 62) was deleted, > which made EOB be 61, one less than its previous value. When > save-match-data was called from within a hook set up by Org, it tried > to record the end of the sub-expression as 62, but set-marker silently > changed that to 61. That "corrected" value was subsequently restored > when save-match-data was exited, whereas replace-match expected to see > the original value of 62, and therefore barfed. I think this change performed by save-match-data is harmless: the old value (62) was not valid any more anyway. So I think a safe fix is to try and relax the check we added to replace-match so it doesn't get all worked up when something =E2=89=A5 EOB = gets changed to something else that's also =E2=89=A5 EOB. Or maybe instead of signaling an error, we could simply skip the "Adjust search data for this change". I like the idea of signaling an error, as a debugging help, but maybe for emacs-25 we should go for something less intrusive after all? This said, I don't fully understand what's going on: bug#23869 reported a crash, but AFAICT the match-data here is only used to adjust search_regs which seems like it wouldn't cause a crash, even if the new values are bogus. So maybe signaling an error is important because the crash happens further down. > - '((save-match-data-internal (match-data))) > + '((save-match-data-internal (match-data 'integers))) That looks risky. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 18 22:40:31 2016 Received: (at 23917) by debbugs.gnu.org; 19 Jul 2016 02:40:31 +0000 Received: from localhost ([127.0.0.1]:56143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPKxS-0003dY-NE for submit@debbugs.gnu.org; Mon, 18 Jul 2016 22:40:30 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52113) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPKxQ-0003dH-68 for 23917@debbugs.gnu.org; Mon, 18 Jul 2016 22:40:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPKxJ-0007tT-OO for 23917@debbugs.gnu.org; Mon, 18 Jul 2016 22:40:22 -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_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35920) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPKxB-0007qw-42; Mon, 18 Jul 2016 22:40:13 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3160 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bPKx9-0004AS-2h; Mon, 18 Jul 2016 22:40:11 -0400 Date: Tue, 19 Jul 2016 05:40:11 +0300 Message-Id: <83eg6q1hbo.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Mon, 18 Jul 2016 20:58:35 -0400) Subject: Re: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> 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: -6.3 (------) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, rpluim@gmail.com, alex.bennee@linaro.org, nljlistbox2@gmail.com, jwiegley@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.3 (------) > From: Stefan Monnier > Cc: Robert Pluim , 23917@debbugs.gnu.org, alex.bennee@linaro.org, jwiegley@gmail.com, nljlistbox2@gmail.com > Date: Mon, 18 Jul 2016 20:58:35 -0400 > > > In the case in point, a single character at EOB (= 62) was deleted, > > which made EOB be 61, one less than its previous value. When > > save-match-data was called from within a hook set up by Org, it tried > > to record the end of the sub-expression as 62, but set-marker silently > > changed that to 61. That "corrected" value was subsequently restored > > when save-match-data was exited, whereas replace-match expected to see > > the original value of 62, and therefore barfed. > > I think this change performed by save-match-data is harmless: the old > value (62) was not valid any more anyway. In this particular case, yes. But only in this case, because (a) there's actually only one sub-expression, and (b) it ends exactly at EOB. The more general problem is when there's at least one more sub-expression, whose start and/or end are after the new EOB. Those sub-expression's data will be completely bogus after the adjustment, should the buffer-modification hooks use save-match-data. > So I think a safe fix is to try and relax the check we added to > replace-match so it doesn't get all worked up when something ≥ EOB gets > changed to something else that's also ≥ EOB. And lose the other sub-expressions in a more general case? Really? > Or maybe instead of signaling an error, we could simply skip the "Adjust > search data for this change". That would still sweep the problem under the carpet, leaving the match data bogus, so I don't like doing that. > This said, I don't fully understand what's going on: bug#23869 reported > a crash, but AFAICT the match-data here is only used to adjust > search_regs which seems like it wouldn't cause a crash, even if the new > values are bogus. The crash in bug#23869 was due to this: newpoint = search_regs.start[sub] + SCHARS (newtext); [...] /* Now move point "officially" to the start of the inserted replacement. */ move_if_not_intangible (newpoint); <<<<<<<<<<<<<<<<<<<<<<< because due to clobbering, newpoint became -1. > > - '((save-match-data-internal (match-data))) > > + '((save-match-data-internal (match-data 'integers))) > > That looks risky. Then how about manually doing the equivalent of save-match-data around the call to replace_range, calling match-data with non-nil argument? From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 19 00:48:29 2016 Received: (at 23917) by debbugs.gnu.org; 19 Jul 2016 04:48:29 +0000 Received: from localhost ([127.0.0.1]:56291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPMxJ-0006dS-9d for submit@debbugs.gnu.org; Tue, 19 Jul 2016 00:48:29 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:7021) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPMxH-0006dE-1R for 23917@debbugs.gnu.org; Tue, 19 Jul 2016 00:48:27 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AmDgA731xV/3mcpUVcgxCEAghGxUWCTQQCAoE8PRABAQEBAQEBgQpBBYNdAQEDAQwXMyMFCwkCGgIYBwcCAhQYDRMRiDcIjXydEKQXAQEBBwEBAQEegSGKGYRSMweCaIFFAQSfF4NrkD2BRSOBZlWBWSKCeAEBAQ X-IPAS-Result: A0AmDgA731xV/3mcpUVcgxCEAghGxUWCTQQCAoE8PRABAQEBAQEBgQpBBYNdAQEDAQwXMyMFCwkCGgIYBwcCAhQYDRMRiDcIjXydEKQXAQEBBwEBAQEegSGKGYRSMweCaIFFAQSfF4NrkD2BRSOBZlWBWSKCeAEBAQ X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="248473132" Received: from 69-165-156-121.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([69.165.156.121]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 Jul 2016 00:48:19 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id AF1F9AE2BB; Tue, 19 Jul 2016 00:48:19 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) Message-ID: References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> Date: Tue, 19 Jul 2016 00:48:19 -0400 In-Reply-To: <83eg6q1hbo.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 19 Jul 2016 05:40:11 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, rpluim@gmail.com, alex.bennee@linaro.org, nljlistbox2@gmail.com, jwiegley@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: 0.3 (/) > The more general problem is when there's at least one more > sub-expression, whose start and/or end are after the new EOB. > Those sub-expression's data will be completely bogus after the > adjustment, If they were after the EOB, they were already bogus to start with. So there's really not much harm moving them around. And in any case, that's what has been happening for ever and has proved safe enough. >> So I think a safe fix is to try and relax the check we added to >> replace-match so it doesn't get all worked up when something =E2=89=A5 E= OB gets >> changed to something else that's also =E2=89=A5 EOB. > And lose the other sub-expressions in a more general case? Really? I'm not sure what you mean by "losing sub-expressions". But yes, I think the behavior of save-match-data you describe is not a real problem. Arguably if save-match-data moves positions from outside BEGV...ZV to inside it it's a problem. But if it moves them from outside BEG...Z to inside it, I think it's perfectly fine. >> Or maybe instead of signaling an error, we could simply skip the "Adjust >> search data for this change". > That would still sweep the problem under the carpet, leaving the match > data bogus, so I don't like doing that. Maybe I'm not 100% satisfied with the behavior either, but I don't think it's a significant problem and I don't think it'd cause the crash we saw in bug#23869. > The crash in bug#23869 was due to this: > > newpoint =3D search_regs.start[sub] + SCHARS (newtext); > [...] > /* Now move point "officially" to the start of the inserted replacement= . */ > move_if_not_intangible (newpoint); <<<<<<<<<<<<<<<<<<<<<<< > > because due to clobbering, newpoint became -1. Ah, I see. Then maybe another fix is to compute newpoint before we call replace_range, so it uses search_regs.start[sub] before the *-change-functions can mess it up. IOW: @@ -2726,9 +2726,9 @@ since only regular expressions have distinguished= subexpressions. */) unsigned num_regs =3D search_regs.num_regs; =20=20=20=20=20 /* Replace the old text with the new in the cleanest possible way. = */ + newpoint =3D search_regs.start[sub] + SCHARS (newtext); replace_range (search_regs.start[sub], search_regs.end[sub], newtext, 1, 0, 1); - newpoint =3D search_regs.start[sub] + SCHARS (newtext); =20=20=20=20=20 if (case_action =3D=3D all_caps) Fupcase_region (make_number (search_regs.start[sub]), Would that be sufficient to avoid the crash? Why not? Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 19 11:36:07 2016 Received: (at 23917) by debbugs.gnu.org; 19 Jul 2016 15:36:07 +0000 Received: from localhost ([127.0.0.1]:57449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPX42-0001y0-VJ for submit@debbugs.gnu.org; Tue, 19 Jul 2016 11:36:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPX41-0001xX-FY for 23917@debbugs.gnu.org; Tue, 19 Jul 2016 11:36:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPX3s-0007wl-8z for 23917@debbugs.gnu.org; Tue, 19 Jul 2016 11:36:00 -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_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPX3h-0007v4-Be; Tue, 19 Jul 2016 11:35:45 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3429 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bPX3g-0004Qp-A6; Tue, 19 Jul 2016 11:35:44 -0400 Date: Tue, 19 Jul 2016 18:35:45 +0300 Message-Id: <83a8hd1vzi.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Tue, 19 Jul 2016 00:48:19 -0400) Subject: Re: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> 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: -6.3 (------) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, rpluim@gmail.com, alex.bennee@linaro.org, nljlistbox2@gmail.com, jwiegley@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.3 (------) > From: Stefan Monnier > Cc: rpluim@gmail.com, 23917@debbugs.gnu.org, alex.bennee@linaro.org, jwiegley@gmail.com, nljlistbox2@gmail.com > Date: Tue, 19 Jul 2016 00:48:19 -0400 > > > The more general problem is when there's at least one more > > sub-expression, whose start and/or end are after the new EOB. > > Those sub-expression's data will be completely bogus after the > > adjustment, > > If they were after the EOB, they were already bogus to start with. I think we are mis-communicating. I mean the following scenario: Before call to replace_range in replace-match: |---------------------------|---|------|----| s1 e1 s2 e2 EOB (s1, e1, etc. are the start and end of the corresponding sub-expressions.) After the call to replace_range in replace-match: |---------|---|------|----| s1 e1 s2 e2 EOB IOW, the 1st sub-expression got replaced with a much shorter text, which made EOB be smaller than the original beginning and end of the 2nd sub-expression. There's nothing bogus with this, is there? The user will expect to get match-data adjusted as shown in the second diagram, and that's what she will really get -- unless there are buffer-modification hooks that use save-match-data. In the latter case, what the user will get instead is this: |---------|---|------|----| s1 EOB e1 s2 e2 and that is even before the adjustment code kicks in and makes "adjustments" with an incorrect adjustment value, which is computed as newpoint = search_regs.start[sub] + SCHARS (newtext); [...] ptrdiff_t change = newpoint - search_regs.end[sub]; and so will use the new EOB as search_regs.end[sub], instead of the correct original value of e1 from the first diagram above. IOW, the call to save-match-data in a buffer-modification hook _disrupts_ the normal operation of replace-match in this case, by indirectly sabotaging the adjustment of match data after the replacement. Am I missing something? > And in any case, that's what has been happening for ever and has > proved safe enough. So you are saying that if a bug has been happening "for ever", it doesn't have to be fixed? (I disagree about "safe enough": the amount of bug reports in our data base that are not reproducible and about whose reasons we have no clear idea is non-negligible, so we don't really know whether this particular issue caused trouble in the past or not.) > >> So I think a safe fix is to try and relax the check we added to > >> replace-match so it doesn't get all worked up when something ≥ EOB gets > >> changed to something else that's also ≥ EOB. > > And lose the other sub-expressions in a more general case? Really? > > I'm not sure what you mean by "losing sub-expressions". See above: the match data for any sub-expressions beyond the one that shrunk too much is now bogus. Thus "losing". > >> Or maybe instead of signaling an error, we could simply skip the "Adjust > >> search data for this change". > > That would still sweep the problem under the carpet, leaving the match > > data bogus, so I don't like doing that. > > Maybe I'm not 100% satisfied with the behavior either, but I don't think > it's a significant problem and I don't think it'd cause the crash we saw > in bug#23869. We don't only solve bugs that cause crashes, do we? When I debugged the crash in bug#23869, I found and tried to solve the root cause of it, not just the symptom that caused the assertion violation. I still think we should strive to solve the root cause. As for the significance of the problem, I hope you will reconsider this after reading the above description of the scenario I have in mind. (Or tell me where I am wrong.) > > The crash in bug#23869 was due to this: > > > > newpoint = search_regs.start[sub] + SCHARS (newtext); > > [...] > > /* Now move point "officially" to the start of the inserted replacement. */ > > move_if_not_intangible (newpoint); <<<<<<<<<<<<<<<<<<<<<<< > > > > because due to clobbering, newpoint became -1. > > Ah, I see. > > Then maybe another fix is to compute newpoint before we call > replace_range, so it uses search_regs.start[sub] before the > *-change-functions can mess it up. IOW: > > @@ -2726,9 +2726,9 @@ since only regular expressions have distinguished > subexpressions. */) > unsigned num_regs = search_regs.num_regs; > > /* Replace the old text with the new in the cleanest possible way. */ > + newpoint = search_regs.start[sub] + SCHARS (newtext); > replace_range (search_regs.start[sub], search_regs.end[sub], > newtext, 1, 0, 1); > - newpoint = search_regs.start[sub] + SCHARS (newtext); > > if (case_action == all_caps) > Fupcase_region (make_number (search_regs.start[sub]), > > Would that be sufficient to avoid the crash? Why not? To avoid the crash in that particular use case, yes (but it can be avoided even easier, by validating the value of newpoint before the call to move_if_not_intangible). But what about the root cause? It is a clear bug, and could even cause crashes, if one of the match-data end-point positions becomes negative as result of the bogus adjustment, and someone then uses those positions for something. What's worse, these bugs happen in programs that are completely valid on the Lisp level. From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 19 11:36:30 2016 Received: (at 23917) by debbugs.gnu.org; 19 Jul 2016 15:36:30 +0000 Received: from localhost ([127.0.0.1]:57452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPX4Q-0001yb-E8 for submit@debbugs.gnu.org; Tue, 19 Jul 2016 11:36:30 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34866) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPX4O-0001yO-Ag for 23917@debbugs.gnu.org; Tue, 19 Jul 2016 11:36:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPX4E-0007yq-VY for 23917@debbugs.gnu.org; Tue, 19 Jul 2016 11:36:23 -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_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46623) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPX44-0007xT-Hb; Tue, 19 Jul 2016 11:36:08 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3433 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bPX42-0004yy-H2; Tue, 19 Jul 2016 11:36:06 -0400 Date: Tue, 19 Jul 2016 18:36:08 +0300 Message-Id: <838twx1vyv.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Mon, 18 Jul 2016 20:58:35 -0400) Subject: Re: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> 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: -6.3 (------) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, rpluim@gmail.com, alex.bennee@linaro.org, nljlistbox2@gmail.com, jwiegley@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.3 (------) > From: Stefan Monnier > Cc: Robert Pluim , 23917@debbugs.gnu.org, alex.bennee@linaro.org, jwiegley@gmail.com, nljlistbox2@gmail.com > Date: Mon, 18 Jul 2016 20:58:35 -0400 > > > I think this change performed by save-match-data is harmless: the old > > value (62) was not valid any more anyway. > > In this particular case, yes. But only in this case, because (a) > there's actually only one sub-expression, and (b) it ends exactly at > EOB. Moreover, if the value of 62 was left alone by save-match-data, the adjustment code in replace-match would have fixed it. That's what that code is all about: it fixes the match data due to changes to the buffer made by replacing the old text by the new. Any attempts to "fix" those values under that code's feet are not helpful; quite the contrary. > > So I think a safe fix is to try and relax the check we added to > > replace-match so it doesn't get all worked up when something ≥ EOB gets > > changed to something else that's also ≥ EOB. > > And lose the other sub-expressions in a more general case? Really? What really bothers me is that by just loosening the conditions under which we signal an error we defeat _valid_ code, which did use save-match-data, and yet the match data still ends up being clobbered. I don't mind making the test more loose so that invalid programs have a longer rope to hang themselves, but valid programs should not be failed, IMO. > > Or maybe instead of signaling an error, we could simply skip the "Adjust > > search data for this change". > That would still sweep the problem under the carpet, leaving the match > data bogus, so I don't like doing that. > > This said, I don't fully understand what's going on: bug#23869 reported > > a crash, but AFAICT the match-data here is only used to adjust > > search_regs which seems like it wouldn't cause a crash, even if the new > > values are bogus. > The crash in bug#23869 was due to this: > newpoint = search_regs.start[sub] + SCHARS (newtext); > [...] > /* Now move point "officially" to the start of the inserted replacement. */ > move_if_not_intangible (newpoint); <<<<<<<<<<<<<<<<<<<<<<< > because due to clobbering, newpoint became -1. > > > - '((save-match-data-internal (match-data))) > > > + '((save-match-data-internal (match-data 'integers))) > > > > That looks risky. > > Then how about manually doing the equivalent of save-match-data around > the call to replace_range, calling match-data with non-nil argument? Here are some more alternatives for dealing with this issue: (1) Make match-data use integers instead of markers by default when a call to replace-match is in progress, i.e. when match-data is called from some buffer-modification hook triggered by replace-match (2) Don't signal an error, even if match data seems clobbered, if the new value of point is valid and either (a) there's only one search register, or (b) the adjustment value is zero (i.e. the registers will be left unchanged). I like (1) better than (2) because (1) will let valid programs avoid clobbering match data, but maybe it's too risky for emacs-25. Also, is it plausible that some buffer-modification hook will edit the buffer in the save-match-data forms, and expect the match data to be adjusted, or is this something that a buffer-modification hook should never do? If valid programs can do this, then (1) is probably not a good idea. From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 19 12:04:02 2016 Received: (at 23917) by debbugs.gnu.org; 19 Jul 2016 16:04:02 +0000 Received: from localhost ([127.0.0.1]:57482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPXV4-0002dd-CB for submit@debbugs.gnu.org; Tue, 19 Jul 2016 12:04:02 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:15645) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPXV2-0002dB-RE for 23917@debbugs.gnu.org; Tue, 19 Jul 2016 12:04:01 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AfDgA731xV/3mcpUVcgxCEAgjIWAQCAoE8PRABAQEBAQEBgQpBBYNdAQEDAQxKIwULCQI0BwsUGA0TEYg3CI18wScBAQgCAR+LOoUFB4QtBYZlmDKDa44pghSBRSOBZlWBWSKCeAEBAQ X-IPAS-Result: A0AfDgA731xV/3mcpUVcgxCEAgjIWAQCAoE8PRABAQEBAQEBgQpBBYNdAQEDAQxKIwULCQI0BwsUGA0TEYg3CI18wScBAQgCAR+LOoUFB4QtBYZlmDKDa44pghSBRSOBZlWBWSKCeAEBAQ X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="248549229" Received: from 69-165-156-121.dsl.teksavvy.com (HELO pastel.home) ([69.165.156.121]) by ironport2-out.teksavvy.com with ESMTP; 19 Jul 2016 12:03:52 -0400 Received: by pastel.home (Postfix, from userid 20848) id D4FC264C98; Tue, 19 Jul 2016 12:03:51 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) Message-ID: References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> Date: Tue, 19 Jul 2016 12:03:51 -0400 In-Reply-To: <83a8hd1vzi.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 19 Jul 2016 18:35:45 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, rpluim@gmail.com, alex.bennee@linaro.org, nljlistbox2@gmail.com, jwiegley@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: 0.3 (/) > Before call to replace_range in replace-match: > > |---------------------------|---|------|----| > s1 e1 s2 e2 EOB > > (s1, e1, etc. are the start and end of the corresponding > sub-expressions.) > > After the call to replace_range in replace-match: > > |---------|---|------|----| > s1 e1 s2 e2 EOB Ah, right, now I see my confusion, thank you. So, the data is within bounds before replace_range but after bounds afterwards and the subsequent adjustments should fix it, but an intervening save-match-data will mess it up. Hmm... indeed, the adjustment isn't working correctly in this case. I don't think we can safely change the way save-match-data works, so I guess the next best thing is: - copy search_regs.start and search_regs.end before calling replace_range. - use that copy when adjusting the match data. Or equivalently, use save-match-data. IOW go back to your original patch. Duh! Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 19 12:14:03 2016 Received: (at 23917) by debbugs.gnu.org; 19 Jul 2016 16:14:03 +0000 Received: from localhost ([127.0.0.1]:57503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPXel-0002si-8w for submit@debbugs.gnu.org; Tue, 19 Jul 2016 12:14:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPXek-0002s7-0m for 23917@debbugs.gnu.org; Tue, 19 Jul 2016 12:14:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPXeZ-0000GC-J9 for 23917@debbugs.gnu.org; Tue, 19 Jul 2016 12:13:56 -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.3 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPXeT-0000Ev-Eq; Tue, 19 Jul 2016 12:13:45 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3531 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bPXeO-0004dL-Pv; Tue, 19 Jul 2016 12:13:43 -0400 Date: Tue, 19 Jul 2016 19:13:21 +0300 Message-Id: <834m7l1u8u.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Tue, 19 Jul 2016 12:03:51 -0400) Subject: Re: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> 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: -6.3 (------) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, rpluim@gmail.com, alex.bennee@linaro.org, nljlistbox2@gmail.com, jwiegley@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.3 (------) > From: Stefan Monnier > Cc: rpluim@gmail.com, 23917@debbugs.gnu.org, alex.bennee@linaro.org, jwiegley@gmail.com, nljlistbox2@gmail.com > Date: Tue, 19 Jul 2016 12:03:51 -0400 > > I guess the next best thing is: > - copy search_regs.start and search_regs.end before calling replace_range. > - use that copy when adjusting the match data. > Or equivalently, use save-match-data. IOW go back to your original patch. > Duh! Do we care that using save-match-data in every call to replace-match might mean a performance hit? If it will, then this will again punish most of the users for the benefit of those few who (1) have buffer-modification hooks, and (2) those hooks call save-match-data. From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 19 13:05:45 2016 Received: (at 23917) by debbugs.gnu.org; 19 Jul 2016 17:05:45 +0000 Received: from localhost ([127.0.0.1]:57530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPYSn-0005jL-5W for submit@debbugs.gnu.org; Tue, 19 Jul 2016 13:05:45 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:35834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPYSk-0005j5-JR for 23917@debbugs.gnu.org; Tue, 19 Jul 2016 13:05:43 -0400 Received: by mail-wm0-f51.google.com with SMTP id f65so145800385wmi.0 for <23917@debbugs.gnu.org>; Tue, 19 Jul 2016 10:05:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=biMJ2VWZSwMYPFIpfHsuzTm3b+68RUrGgjZrX++ts0c=; b=SdXuy/BGUEqT2MljMdDP4G3QMMznNj6aN9TpR84RWFmFqMcgMaDu3yFDf7CQFCnlO4 aiu2wdJHBj1NPb8AWixqOVnR02dK3sGYcal/iLhENuM/eFl2dvNtJPP1DfyabInc3Rc/ ZQPJd9JzbGFfykqyKGCBEAIbjHWk0a1IMf4w0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=biMJ2VWZSwMYPFIpfHsuzTm3b+68RUrGgjZrX++ts0c=; b=d8DCfDaMo7kOekUAwc6pSsbEv1wXgIPyslbp1h5gLpOgV2lsgskD+RSJetquUdBlCD PQ2uUCWZxbZ3DFKGi0549qH8CkXy7c9Lu/BdG+eGtCsixVJWSYdY5stM4gK8zHZkUrjC 7hTot3QxJesb0DA827hnfj4FPrKdeTgpXZ2w8vrMzHEuOfALSXId+XVkOGfrq/NuF7JF BOJ3l5uaK7AmtuNvwv/c++AIZ6RLWRmGW5SrrKEN9W2/OCAbnOmuzOpYCGQourinhuk/ YvPVkd3A6PPo8AheRxD9ve0EldBaGPCKVMgNktriFVKTVrqaGE/6zrDvAbscC8z4wAwF 8CQg== X-Gm-Message-State: ALyK8tJHeqLvr+DMM07xMGtRlSUmydgV/oIsDK08lLip3Z09bUjqjKmOeEgtHIQgE+9PbJGB X-Received: by 10.28.54.229 with SMTP id y98mr5371238wmh.96.1468947936897; Tue, 19 Jul 2016 10:05:36 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id x62sm24411016wmf.13.2016.07.19.10.05.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2016 10:05:35 -0700 (PDT) Received: from zen (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTPS id 6484C3E0404; Tue, 19 Jul 2016 18:05:37 +0100 (BST) References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> User-agent: mu4e 0.9.17; emacs 25.0.95.10 From: Alex =?utf-8?Q?Benn=C3=A9e?= To: Eli Zaretskii Subject: Re: [O] bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) In-reply-to: <834m7l1u8u.fsf@gnu.org> Date: Tue, 19 Jul 2016 18:05:37 +0100 Message-ID: <87a8hdmuce.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, rpluim@gmail.com, nljlistbox2@gmail.com, Stefan Monnier , jwiegley@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: -0.7 (/) Eli Zaretskii writes: >> From: Stefan Monnier >> Cc: rpluim@gmail.com, 23917@debbugs.gnu.org, alex.bennee@linaro.org, jwiegley@gmail.com, nljlistbox2@gmail.com >> Date: Tue, 19 Jul 2016 12:03:51 -0400 >> >> I guess the next best thing is: >> - copy search_regs.start and search_regs.end before calling replace_range. >> - use that copy when adjusting the match data. >> Or equivalently, use save-match-data. IOW go back to your original patch. >> Duh! > > Do we care that using save-match-data in every call to replace-match > might mean a performance hit? If it will, then this will again punish > most of the users for the benefit of those few who (1) have > buffer-modification hooks, and (2) those hooks call save-match-data. I care unless there is an easy way to identify which buffer modification hooks are responsible so I can take steps as a user to mitigate the problems. -- Alex Bennée From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 19 13:21:13 2016 Received: (at 23917) by debbugs.gnu.org; 19 Jul 2016 17:21:13 +0000 Received: from localhost ([127.0.0.1]:57537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPYhl-00064v-JL for submit@debbugs.gnu.org; Tue, 19 Jul 2016 13:21:13 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34559) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPYhk-00064j-6s for 23917@debbugs.gnu.org; Tue, 19 Jul 2016 13:21:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPYhe-0001og-4V for 23917@debbugs.gnu.org; Tue, 19 Jul 2016 13:21: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.3 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPYhW-0001mU-0x; Tue, 19 Jul 2016 13:20:58 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3639 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bPYhT-0005BM-2O; Tue, 19 Jul 2016 13:20:56 -0400 Date: Tue, 19 Jul 2016 20:20:48 +0300 Message-Id: <8337n51r4f.fsf@gnu.org> From: Eli Zaretskii To: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <87a8hdmuce.fsf@linaro.org> (message from Alex =?utf-8?Q?Benn?= =?utf-8?Q?=C3=A9e?= on Tue, 19 Jul 2016 18:05:37 +0100) Subject: Re: [O] bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <87a8hdmuce.fsf@linaro.org> 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: -6.3 (------) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, rpluim@gmail.com, nljlistbox2@gmail.com, monnier@iro.umontreal.ca, jwiegley@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.3 (------) > From: Alex Bennée > Cc: Stefan Monnier , 23917@debbugs.gnu.org, rpluim@gmail.com, jwiegley@gmail.com, nljlistbox2@gmail.com > Date: Tue, 19 Jul 2016 18:05:37 +0100 > > > Do we care that using save-match-data in every call to replace-match > > might mean a performance hit? If it will, then this will again punish > > most of the users for the benefit of those few who (1) have > > buffer-modification hooks, and (2) those hooks call save-match-data. > > I care unless there is an easy way to identify which buffer modification > hooks are responsible so I can take steps as a user to mitigate the > problems. Any hook in before-change-functions or after-change-functions that calls save-match-data. If we care about the performance hit, we need to come up with a different solution for this problem (or measure the performance hit and convince ourselves it is not a big deal). From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 19 13:45:53 2016 Received: (at 23917) by debbugs.gnu.org; 19 Jul 2016 17:45:53 +0000 Received: from localhost ([127.0.0.1]:57546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPZ5c-0006e6-V5 for submit@debbugs.gnu.org; Tue, 19 Jul 2016 13:45:53 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:38800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPZ5a-0006dr-0H for 23917@debbugs.gnu.org; Tue, 19 Jul 2016 13:45:52 -0400 Received: by mail-wm0-f49.google.com with SMTP id o80so35679299wme.1 for <23917@debbugs.gnu.org>; Tue, 19 Jul 2016 10:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=GrBePFiVsjUnA/Q0w6gKOB/1IDk0Gkeeua1SPauvabM=; b=O97lDgQruRjoYhz/hCjmCEIE3YhbX3TsGqbi9hHx24UKLNkA4USdKQDrYReF8G34Yg 7bnkxd7W2lW04V6obPbGMJwbuLo56GGPbrX7YUQWJKwOZUOHxaSmptYDHHeoaQCsiR+N X9ZBGEzd6MZqbC4YFOTVCCB7TNqj7ilESqgT4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=GrBePFiVsjUnA/Q0w6gKOB/1IDk0Gkeeua1SPauvabM=; b=FSUHIAI2fCDG4n57Bz3sAHAPjn1PbYheSCe23/wv9eB6UcZHdyHfhBznb67TmYXoUq iGJ/QW1c4gjuFGqNkrDWNzNERHvkWVuLt2G6oZbvoHWPcI4HMnF6VRG7VDixL3QzlKSE J0YlQtnWW4rjRDGfBb/wD5AZ8YZ1yqU+a0IGwUBwS4NOXKXfP6rT0mqTnTY/IH7qEYB/ Hqq71AjN9S7kv5onPc0ROH8jbWyX72HGYb9drP1yIiFZh4OLw9Ut9Nb0QS1QyVXuFe0B nq3H+h1qpT3ak62asKXQQ+vY2NFt7CWrcnQjeBoBRBGJ+TyxpG8ym3XJQ5dv9HnrcM4d lRWg== X-Gm-Message-State: ALyK8tIe8URHBdTiGSA9dx1hde0CB0b49cFnRkS8HLaVyRapTdVwGNZXVAlc9s9vRssZ9Hpv X-Received: by 10.28.55.197 with SMTP id e188mr6092971wma.32.1468950344179; Tue, 19 Jul 2016 10:45:44 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id i80sm8501029wmf.11.2016.07.19.10.45.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2016 10:45:42 -0700 (PDT) Received: from zen (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTPS id D350B3E0404; Tue, 19 Jul 2016 18:45:44 +0100 (BST) References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <87a8hdmuce.fsf@linaro.org> <8337n51r4f.fsf@gnu.org> User-agent: mu4e 0.9.17; emacs 25.0.95.10 From: Alex =?utf-8?Q?Benn=C3=A9e?= To: Eli Zaretskii Subject: Re: [O] bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) In-reply-to: <8337n51r4f.fsf@gnu.org> Date: Tue, 19 Jul 2016 18:45:44 +0100 Message-ID: <878twxmshj.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23917 Cc: nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, me@lunaryorn.com, 23917@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: -0.7 (/) Eli Zaretskii writes: >> From: Alex Bennée >> Cc: Stefan Monnier , 23917@debbugs.gnu.org, rpluim@gmail.com, jwiegley@gmail.com, nljlistbox2@gmail.com >> Date: Tue, 19 Jul 2016 18:05:37 +0100 >> >> > Do we care that using save-match-data in every call to replace-match >> > might mean a performance hit? If it will, then this will again punish >> > most of the users for the benefit of those few who (1) have >> > buffer-modification hooks, and (2) those hooks call save-match-data. >> >> I care unless there is an easy way to identify which buffer modification >> hooks are responsible so I can take steps as a user to mitigate the >> problems. > > Any hook in before-change-functions or after-change-functions that > calls save-match-data. > > If we care about the performance hit, we need to come up with a > different solution for this problem (or measure the performance hit > and convince ourselves it is not a big deal). Thanks for the hint. So in my case it was flycheck-handle-change which was triggering the problem: (defun flycheck-handle-change (beg end _len) "Handle a buffer change between BEG and END. BEG and END mark the beginning and end of the change text. _LEN is ignored. Start a syntax check if a new line has been inserted into the buffer." ;; Save and restore the match data, as recommended in (elisp)Change Hooks (save-match-data (when flycheck-mode ;; The buffer was changed, thus clear the idle timer (flycheck-clear-idle-change-timer) (if (string-match-p (rx "\n") (buffer-substring beg end)) (flycheck-buffer-automatically 'new-line 'force-deferred) (setq flycheck-idle-change-timer (run-at-time flycheck-idle-change-delay nil #'flycheck-handle-idle-change)))))) However it doesn't look as though it tweaks the buffer until idle timer has run. Weird.... -- Alex Bennée From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 19 14:44:41 2016 Received: (at 23917) by debbugs.gnu.org; 19 Jul 2016 18:44:41 +0000 Received: from localhost ([127.0.0.1]:57592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPa0W-00086W-QC for submit@debbugs.gnu.org; Tue, 19 Jul 2016 14:44:41 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53687) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPa0U-00086F-U9 for 23917@debbugs.gnu.org; Tue, 19 Jul 2016 14:44:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPa0O-0004is-S1 for 23917@debbugs.gnu.org; Tue, 19 Jul 2016 14:44:33 -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.3 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPa0I-0004i2-B4; Tue, 19 Jul 2016 14:44:26 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3775 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bPa0G-0006I2-JE; Tue, 19 Jul 2016 14:44:25 -0400 Date: Tue, 19 Jul 2016 21:44:19 +0300 Message-Id: <831t2p1n98.fsf@gnu.org> From: Eli Zaretskii To: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <878twxmshj.fsf@linaro.org> (message from Alex =?utf-8?Q?Benn?= =?utf-8?Q?=C3=A9e?= on Tue, 19 Jul 2016 18:45:44 +0100) Subject: Re: [O] bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <87a8hdmuce.fsf@linaro.org> <8337n51r4f.fsf@gnu.org> <878twxmshj.fsf@linaro.org> 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: -6.3 (------) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, rpluim@gmail.com, nljlistbox2@gmail.com, monnier@iro.umontreal.ca, jwiegley@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.3 (------) > From: Alex Bennée > Cc: monnier@iro.umontreal.ca, 23917@debbugs.gnu.org, rpluim@gmail.com, jwiegley@gmail.com, nljlistbox2@gmail.com, me@lunaryorn.com > Date: Tue, 19 Jul 2016 18:45:44 +0100 > > ;; Save and restore the match data, as recommended in (elisp)Change Hooks > (save-match-data > (when flycheck-mode > ;; The buffer was changed, thus clear the idle timer > (flycheck-clear-idle-change-timer) > (if (string-match-p (rx "\n") (buffer-substring beg end)) > (flycheck-buffer-automatically 'new-line 'force-deferred) > (setq flycheck-idle-change-timer > (run-at-time flycheck-idle-change-delay nil > #'flycheck-handle-idle-change)))))) > > However it doesn't look as though it tweaks the buffer until idle timer > has run. Weird.... Tweaking the buffer is not what causes the problem. It's the call to save-match-data itself. It doesn't matter at all what the code inside save-match-data does. From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 19 14:58:51 2016 Received: (at 23917) by debbugs.gnu.org; 19 Jul 2016 18:58:51 +0000 Received: from localhost ([127.0.0.1]:57597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPaEF-0008TA-52 for submit@debbugs.gnu.org; Tue, 19 Jul 2016 14:58:51 -0400 Received: from mx1.mailbox.org ([80.241.60.212]:37007) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPZR1-00078j-79 for 23917@debbugs.gnu.org; Tue, 19 Jul 2016 14:08:00 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id CEB7243A3D; Tue, 19 Jul 2016 20:07:52 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id IFH1Lgr4h5C5; Tue, 19 Jul 2016 20:07:51 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: =?utf-8?Q?Re:_[O]_bug#23917:_Please_consider_making_Bug_#23917_a?= =?utf-8?Q?_blocker_for_25.1_=28was_Re:_org-capture:_Capture_templa?= =?utf-8?Q?te_=E2=80=98g=E2=80=99:_Match_data_clobbered_by_buffer?= =?utf-8?Q?_modification_hooks=29?= From: Sebastian Wiesner In-Reply-To: <878twxmshj.fsf@linaro.org> Date: Tue, 19 Jul 2016 20:07:38 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <87a8hdmuce.fsf@linaro.org> <8337n51r4f.fsf@gnu.org> <878twxmshj.fsf@linaro.org> To: =?utf-8?Q?Alex_Benn=C3=A9e?= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23917 X-Mailman-Approved-At: Tue, 19 Jul 2016 14:58:50 -0400 Cc: nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, monnier@iro.umontreal.ca, Eli Zaretskii 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.7 (/) Please do not CC me on Emacs bug threads. If there's an issue in Flycheck p= lease take it to our issue tracker at https://github.com/flycheck/flycheck/i= ssues where we can keep track of it.= From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 19 19:18:46 2016 Received: (at 23917) by debbugs.gnu.org; 19 Jul 2016 23:18:46 +0000 Received: from localhost ([127.0.0.1]:57700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPeHm-00080d-1k for submit@debbugs.gnu.org; Tue, 19 Jul 2016 19:18:46 -0400 Received: from mail-it0-f43.google.com ([209.85.214.43]:37481) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPeHi-00080M-Ub for 23917@debbugs.gnu.org; Tue, 19 Jul 2016 19:18:44 -0400 Received: by mail-it0-f43.google.com with SMTP id f6so34347330ith.0 for <23917@debbugs.gnu.org>; Tue, 19 Jul 2016 16:18:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=MXE6IzwjCXlD30feJVo3yGvf3hvQaN399e+9ojqxuyk=; b=eZ8k9uGmF+6j5aS4eKLJpMS8MqEgUcweTuMNuJjStqlJZOCS7blQnSub33gmNp9ooi CI8//sVSenTm6beYun4BLKTASLI7xNSikRGzMZmcbEel72WjkaAhkdElTjnzwslut0DL +BIxGiJiFZfyY2cJzipU7TyISxSpS9BmTvID0JWgbJ8hGRdQk4efPygL9RmoaPHS31Kj I2jqf07c+5vDLybAj6eRjOCgQExgxwt1SKHBtIOdEJHlDUnl0FrhSCoowwnWJjw/Km7b wgXBRW0DSPL1O5xD6EZBufifpfchSZGY5lxYOIIXZTMHxP1BWNVTgM+5HNVUw7pNcYhI nsaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=MXE6IzwjCXlD30feJVo3yGvf3hvQaN399e+9ojqxuyk=; b=OJPBy9dGqsl6bFjTeloPriN5Up/2xGQGyQmQu+9Ykl0GyIESVLFFJZDI/87Ngdg9/t F7QRl75qpEYIZtH+YkTzigw2uOurvj+XGJKet79OQl2SmxCTZ91DPL1n5ZzIShJZbg8W x+LfaVWUjVOykP2l57yN4AGfNne4bz0oMRy+UbLGw64E0wuBbgRPwZh9o3X9QlN11X9f vzt654g3ApU9JhHcN57UYxn7EzuVNowZgvaHC8EDvd35HJrtAYU+iY4B3Yc/X2EU8Jmx VEfoJM3dVnBfA5y/8v7hHdq9ymglKt0+ZsT5e/wVLbMJWW+tnLg5QSbFtAC978dbrBMn k0eQ== X-Gm-Message-State: ALyK8tKVPyCNOkf7KXU9GXu4HHo9gtBhmMLe5mkeDLNNfcoqeU54gaRec3ihSced5yhTTA== X-Received: by 10.36.20.75 with SMTP id 72mr32451981itg.83.1468970317481; Tue, 19 Jul 2016 16:18:37 -0700 (PDT) Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id o15sm10022998ith.2.2016.07.19.16.18.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2016 16:18:36 -0700 (PDT) From: npostavs@users.sourceforge.net To: Eli Zaretskii Subject: Re: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> Date: Tue, 19 Jul 2016 19:18:36 -0400 In-Reply-To: <83a8hd1vzi.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 19 Jul 2016 18:35:45 +0300") Message-ID: <87k2ghcj3n.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23917 Cc: nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, Stefan Monnier , alex.bennee@linaro.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.7 (/) Eli Zaretskii writes: >> From: Stefan Monnier >> Cc: rpluim@gmail.com, 23917@debbugs.gnu.org, alex.bennee@linaro.org, jwiegley@gmail.com, nljlistbox2@gmail.com >> Date: Tue, 19 Jul 2016 00:48:19 -0400 >> >> > The more general problem is when there's at least one more >> > sub-expression, whose start and/or end are after the new EOB. >> > Those sub-expression's data will be completely bogus after the >> > adjustment, >> >> If they were after the EOB, they were already bogus to start with. > > I think we are mis-communicating. I mean the following scenario: > > Before call to replace_range in replace-match: > > |---------------------------|---|------|----| > s1 e1 s2 e2 EOB > > (s1, e1, etc. are the start and end of the corresponding > sub-expressions.) > > After the call to replace_range in replace-match: > > |---------|---|------|----| > s1 e1 s2 e2 EOB > > IOW, the 1st sub-expression got replaced with a much shorter text, > which made EOB be smaller than the original beginning and end of the > 2nd sub-expression. There's nothing bogus with this, is there? The > user will expect to get match-data adjusted as shown in the second > diagram, and that's what she will really get -- unless there are > buffer-modification hooks that use save-match-data. In the latter > case, what the user will get instead is this: > > |---------|---|------|----| > s1 EOB > e1 > s2 > e2 > > and that is even before the adjustment code kicks in and makes > "adjustments" with an incorrect adjustment value, which is computed as > > newpoint = search_regs.start[sub] + SCHARS (newtext); > [...] > ptrdiff_t change = newpoint - search_regs.end[sub]; > > and so will use the new EOB as search_regs.end[sub], instead of the > correct original value of e1 from the first diagram above. > > IOW, the call to save-match-data in a buffer-modification hook > _disrupts_ the normal operation of replace-match in this case, by > indirectly sabotaging the adjustment of match data after the > replacement. Is it not possible to adjust the match data *before* calling buffer modification hooks? Seems to me the root of the problem is that buffer modification hooks get to see this invalid intermediate state where the match data is out of sync with the buffer. From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 19 21:50:15 2016 Received: (at 23917) by debbugs.gnu.org; 20 Jul 2016 01:50:15 +0000 Received: from localhost ([127.0.0.1]:57743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPgeN-0003Wb-KE for submit@debbugs.gnu.org; Tue, 19 Jul 2016 21:50:15 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:22734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPgeL-0003WN-KN for 23917@debbugs.gnu.org; Tue, 19 Jul 2016 21:50:15 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CtDgA731xV/3mcpUVcgxCEAgjIWAICAQECgTw9EAEBAQEBAQGBCkEFg10BAQMBDEojBQsJAjQHCxQYDRMRiDcIjXzBJwEBCAIBH4o4gQKFBQeELQWfF4NrkD2BRSOCO4FZIoJ4AQEB X-IPAS-Result: A0CtDgA731xV/3mcpUVcgxCEAgjIWAICAQECgTw9EAEBAQEBAQGBCkEFg10BAQMBDEojBQsJAjQHCxQYDRMRiDcIjXzBJwEBCAIBH4o4gQKFBQeELQWfF4NrkD2BRSOCO4FZIoJ4AQEB X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="248602596" Received: from 69-165-156-121.dsl.teksavvy.com (HELO pastel.home) ([69.165.156.121]) by ironport2-out.teksavvy.com with ESMTP; 19 Jul 2016 21:50:09 -0400 Received: by pastel.home (Postfix, from userid 20848) id B001464CD0; Tue, 19 Jul 2016 21:50:07 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) Message-ID: References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> Date: Tue, 19 Jul 2016 21:50:07 -0400 In-Reply-To: <834m7l1u8u.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 19 Jul 2016 19:13:21 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, rpluim@gmail.com, alex.bennee@linaro.org, nljlistbox2@gmail.com, jwiegley@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: 0.3 (/) > Do we care that using save-match-data in every call to replace-match > might mean a performance hit? I do but: - to be honest, it's probably lost in the noise. - if we copy search_regs.start and search_regs.end with something like alloca+memcpy (instead of calling Fmatch_data), the cost should be even more lost in the noise. Especially if you consider that the current code already loops through the match-data to adjust it. - it's the best fix we've found so far. > If it will, then this will again punish > most of the users for the benefit of those few who (1) have > buffer-modification hooks, and (2) those hooks call save-match-data. I think the combination of 1 and 2 is actually pretty frequent. Stefan PS: I can think of one (theoretical) other/better way to fix this problem: move the match-data adjustment so it's done within replace_range before running the after-change-functions. I think this would be very satisfactory, since it would mean that the Elisp code would always see the valid match-data (whereas currently the after-change-functions get passed not-yet-adjusted match-data), so save-match-data wouldn't mess it up. But I fear this would require much larger changes (and might involve a heavier performance cost as well). From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 20 05:48:59 2016 Received: (at 23917) by debbugs.gnu.org; 20 Jul 2016 09:48:59 +0000 Received: from localhost ([127.0.0.1]:57915 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPo7f-0001IS-8f for submit@debbugs.gnu.org; Wed, 20 Jul 2016 05:48:59 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:37855) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPo7c-0001IE-P0 for 23917@debbugs.gnu.org; Wed, 20 Jul 2016 05:48:57 -0400 Received: by mail-wm0-f49.google.com with SMTP id i5so60124357wmg.0 for <23917@debbugs.gnu.org>; Wed, 20 Jul 2016 02:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=c5nH1iyKUG9EQJPUDcSe9YPmdpSvpVtH4kK9ijW+Ogk=; b=CZLoSOFsLU9XAqy0KKtnzFazuAlvMJQ77pUGUO1KUfN/9rYY1PLJu7w9U3bpsWxTWw quxqlioA4nBoof9xZBGQtCA1O6qSJvaPS2hbUNIcBW7yi1dOijDQUeRm/IT9pj9PLBfR xjvJM52FxGRLsJfn3NxReukn7CYLKJR+lLTOU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=c5nH1iyKUG9EQJPUDcSe9YPmdpSvpVtH4kK9ijW+Ogk=; b=TRTP8+AsyPRPcUJCsldVCErRL286Q0Y1CN7NPVQA1eDe2u+cYY0dl0OPaBAX/6EHdb tosPr1Ja2J3BzLTZHrnmwdUEa/X7zo++T4928uaDGNF9gUVc2e3tEIlxGhv2D0DLOEVF EOzgBrFLiL4S0nMdj3CKmvlo+b7M81YijbBROZifQjW6YTSrZ7IhjxM5c1ANFG42VgMs 3QqTAVek4GxxthRgIqMpcqAj3hf+zWFLB/3mloBYAVXt0aTTotAr9lZoMYhiCXrFae5K zA3w8d/uvF6ZvVlWtk0FdIPUpmoWnWUnOka/aeLcYqb64hwbWBa5hCHjzDdirCWp6p3I H7qg== X-Gm-Message-State: ALyK8tI3SG/5VlX7m75zl0VdoVt7V0sIXt5md1qrpwJBJUvYJ4TLat1SZNBPaNGhm+589Bgw X-Received: by 10.28.169.203 with SMTP id s194mr10760144wme.95.1469008130840; Wed, 20 Jul 2016 02:48:50 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id m127sm28615403wmm.21.2016.07.20.02.48.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jul 2016 02:48:49 -0700 (PDT) Received: from zen (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTPS id AB4973E0366; Wed, 20 Jul 2016 10:48:45 +0100 (BST) References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <87a8hdmuce.fsf@linaro.org> <8337n51r4f.fsf@gnu.org> <878twxmshj.fsf@linaro.org> <831t2p1n98.fsf@gnu.org> User-agent: mu4e 0.9.17; emacs 25.0.95.10 From: Alex =?utf-8?Q?Benn=C3=A9e?= To: Eli Zaretskii Subject: Re: [O] bug#23917: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCY?= =?utf-8?B?Z+KAmTo=?= Match data clobbered by buffer modification hooks) In-reply-to: <831t2p1n98.fsf@gnu.org> Date: Wed, 20 Jul 2016 10:48:45 +0100 Message-ID: <877fcgmygy.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, rpluim@gmail.com, nljlistbox2@gmail.com, monnier@iro.umontreal.ca, jwiegley@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: -0.7 (/) Eli Zaretskii writes: >> From: Alex Bennée >> Cc: monnier@iro.umontreal.ca, 23917@debbugs.gnu.org, rpluim@gmail.com, jwiegley@gmail.com, nljlistbox2@gmail.com, me@lunaryorn.com >> Date: Tue, 19 Jul 2016 18:45:44 +0100 >> >> ;; Save and restore the match data, as recommended in (elisp)Change Hooks >> (save-match-data >> (when flycheck-mode >> ;; The buffer was changed, thus clear the idle timer >> (flycheck-clear-idle-change-timer) >> (if (string-match-p (rx "\n") (buffer-substring beg end)) >> (flycheck-buffer-automatically 'new-line 'force-deferred) >> (setq flycheck-idle-change-timer >> (run-at-time flycheck-idle-change-delay nil >> #'flycheck-handle-idle-change)))))) >> >> However it doesn't look as though it tweaks the buffer until idle timer >> has run. Weird.... > > Tweaking the buffer is not what causes the problem. It's the call to > save-match-data itself. It doesn't matter at all what the code inside > save-match-data does. Ahh I misunderstood the description of the problem. I thought it was a changing of the buffer underneath that meant the match data wasn't updated and hence got out of sync. So is the match data already out of sync by the time the save-match-data call is made? -- Alex Bennée From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 20 10:55:42 2016 Received: (at 23917) by debbugs.gnu.org; 20 Jul 2016 14:55:42 +0000 Received: from localhost ([127.0.0.1]:58741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPsuQ-0001rx-9n for submit@debbugs.gnu.org; Wed, 20 Jul 2016 10:55:41 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42211) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPsuL-0001rh-Ep for 23917@debbugs.gnu.org; Wed, 20 Jul 2016 10:55:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPsuF-0008M7-JZ for 23917@debbugs.gnu.org; Wed, 20 Jul 2016 10:55:28 -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.3 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPsty-0008EF-Cw; Wed, 20 Jul 2016 10:55:10 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4242 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bPstw-0007q5-5e; Wed, 20 Jul 2016 10:55:08 -0400 Date: Wed, 20 Jul 2016 17:55:11 +0300 Message-Id: <83shv4z7e8.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Tue, 19 Jul 2016 21:50:07 -0400) Subject: Re: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> 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: -6.3 (------) X-Debbugs-Envelope-To: 23917 Cc: nljlistbox2@gmail.com, npostavs@users.sourceforge.net, jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, alex.bennee@linaro.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: -6.3 (------) > From: Stefan Monnier > Cc: rpluim@gmail.com, 23917@debbugs.gnu.org, alex.bennee@linaro.org, jwiegley@gmail.com, nljlistbox2@gmail.com > Date: Tue, 19 Jul 2016 21:50:07 -0400 > > > Do we care that using save-match-data in every call to replace-match > > might mean a performance hit? > > I do but: > - to be honest, it's probably lost in the noise. > - if we copy search_regs.start and search_regs.end with something like > alloca+memcpy (instead of calling Fmatch_data), the cost should be even more > lost in the noise. Especially if you consider that the current code > already loops through the match-data to adjust it. > - it's the best fix we've found so far. What about Noam's suggestion: > Is it not possible to adjust the match data *before* calling buffer > modification hooks? Seems to me the root of the problem is that buffer > modification hooks get to see this invalid intermediate state where the > match data is out of sync with the buffer. Is it OK to adjust the match data before actually making the replacement? If so, I think it's a simpler solution. > PS: I can think of one (theoretical) other/better way to fix this > problem: move the match-data adjustment so it's done within > replace_range before running the after-change-functions. Isn't that almost the same as what Noam suggested? From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 20 11:00:12 2016 Received: (at 23917) by debbugs.gnu.org; 20 Jul 2016 15:00:12 +0000 Received: from localhost ([127.0.0.1]:58759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPsym-00020w-OF for submit@debbugs.gnu.org; Wed, 20 Jul 2016 11:00:12 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44283) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPsyh-0001yy-BO for 23917@debbugs.gnu.org; Wed, 20 Jul 2016 11:00:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPsyb-0001J3-Hl for 23917@debbugs.gnu.org; Wed, 20 Jul 2016 10:59:58 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPsyS-0001HR-Ps; Wed, 20 Jul 2016 10:59:48 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4248 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bPsyR-00061c-OO; Wed, 20 Jul 2016 10:59:48 -0400 Date: Wed, 20 Jul 2016 17:59:51 +0300 Message-Id: <83oa5sz76g.fsf@gnu.org> From: Eli Zaretskii To: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <877fcgmygy.fsf@linaro.org> (message from Alex =?utf-8?Q?Benn?= =?utf-8?Q?=C3=A9e?= on Wed, 20 Jul 2016 10:48:45 +0100) Subject: Re: [O] bug#23917: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCY?= =?utf-8?B?Z+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <87a8hdmuce.fsf@linaro.org> <8337n51r4f.fsf@gnu.org> <878twxmshj.fsf@linaro.org> <831t2p1n98.fsf@gnu.org> <877fcgmygy.fsf@linaro.org> 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: -6.3 (------) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, rpluim@gmail.com, nljlistbox2@gmail.com, monnier@iro.umontreal.ca, jwiegley@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.3 (------) > From: Alex Bennée > Cc: 23917@debbugs.gnu.org, rpluim@gmail.com, jwiegley@gmail.com, monnier@iro.umontreal.ca, nljlistbox2@gmail.com > Date: Wed, 20 Jul 2016 10:48:45 +0100 > > So is the match data already out of sync by the time the > save-match-data call is made? Yes. From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 20 14:20:08 2016 Received: (at 23917) by debbugs.gnu.org; 20 Jul 2016 18:20:08 +0000 Received: from localhost ([127.0.0.1]:58907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPw6K-0000C8-1K for submit@debbugs.gnu.org; Wed, 20 Jul 2016 14:20:08 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:18698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPw6I-0000BX-Ok for 23917@debbugs.gnu.org; Wed, 20 Jul 2016 14:20:07 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CnDgA731xV/3mcpUVcgxCEAgjIWAICAQECgTw8EQEBAQEBAQGBCkEFg10BAQMBDEojBQsJAjQHCxQYDRMRLogJCI18wScBAQEBBgEBAQEeizqFBQeELQWfF4NrkD2BRSOCO4FZIoJ4AQEB X-IPAS-Result: A0CnDgA731xV/3mcpUVcgxCEAgjIWAICAQECgTw8EQEBAQEBAQGBCkEFg10BAQMBDEojBQsJAjQHCxQYDRMRLogJCI18wScBAQEBBgEBAQEeizqFBQeELQWfF4NrkD2BRSOCO4FZIoJ4AQEB X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="248685461" Received: from 69-165-156-121.dsl.teksavvy.com (HELO pastel.home) ([69.165.156.121]) by ironport2-out.teksavvy.com with ESMTP; 20 Jul 2016 14:20:00 -0400 Received: by pastel.home (Postfix, from userid 20848) id CA7DF64CAE; Wed, 20 Jul 2016 14:19:59 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) Message-ID: References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> Date: Wed, 20 Jul 2016 14:19:59 -0400 In-Reply-To: <83shv4z7e8.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 20 Jul 2016 17:55:11 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 23917 Cc: nljlistbox2@gmail.com, npostavs@users.sourceforge.net, jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, alex.bennee@linaro.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.3 (/) > Is it OK to adjust the match data before actually making the > replacement? If so, I think it's a simpler solution. >> PS: I can think of one (theoretical) other/better way to fix this >> problem: move the match-data adjustment so it's done within >> replace_range before running the after-change-functions. > Isn't that almost the same as what Noam suggested? Yes, it's the same. And yes, I like the idea, but I just don't know what it would look like as a patch. I have the impression that it could prove either expensive in CPU time and backward incompatible (e.g. adjust markers for every buffer modification), or require extensive code surgery and/or breaking some abstractions. This is just an impression, tho. I think it'd definitely be the better solution, so it's worth investigating anyway, if only for "master" rather than for "emacs-25". Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 20 14:56:05 2016 Received: (at 23917) by debbugs.gnu.org; 20 Jul 2016 18:56:05 +0000 Received: from localhost ([127.0.0.1]:58928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPwf7-0002mF-0b for submit@debbugs.gnu.org; Wed, 20 Jul 2016 14:56:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPwf4-0002li-Uv for 23917@debbugs.gnu.org; Wed, 20 Jul 2016 14:56:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPwey-0000mq-FB for 23917@debbugs.gnu.org; Wed, 20 Jul 2016 14:55:57 -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.3 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPwee-0000Wz-ND; Wed, 20 Jul 2016 14:55:36 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4439 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bPweb-0001zN-14; Wed, 20 Jul 2016 14:55:35 -0400 Date: Wed, 20 Jul 2016 21:55:29 +0300 Message-Id: <83inw0yw9q.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Wed, 20 Jul 2016 14:19:59 -0400) Subject: Re: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> 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: -6.3 (------) X-Debbugs-Envelope-To: 23917 Cc: nljlistbox2@gmail.com, npostavs@users.sourceforge.net, jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, alex.bennee@linaro.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: -6.3 (------) > From: Stefan Monnier > Cc: rpluim@gmail.com, 23917@debbugs.gnu.org, alex.bennee@linaro.org, jwiegley@gmail.com, nljlistbox2@gmail.com, npostavs@users.sourceforge.net > Date: Wed, 20 Jul 2016 14:19:59 -0400 > > > Is it OK to adjust the match data before actually making the > > replacement? If so, I think it's a simpler solution. > >> PS: I can think of one (theoretical) other/better way to fix this > >> problem: move the match-data adjustment so it's done within > >> replace_range before running the after-change-functions. > > Isn't that almost the same as what Noam suggested? > > Yes, it's the same. And yes, I like the idea, but I just don't know > what it would look like as a patch. I have the impression that it could > prove either expensive in CPU time and backward incompatible > (e.g. adjust markers for every buffer modification), or require > extensive code surgery and/or breaking some abstractions. > > This is just an impression, tho. I think it'd definitely be the better > solution, so it's worth investigating anyway, if only for "master" rather > than for "emacs-25". Maybe there's a misunderstanding. What Noam suggested was just to move the code which adjusts search_regs.start[i] and .end[i] to before the call to replace_range. The above values are not markers, and no other markers are involved, so I'm not sure which markers did you allude to. Or why it would be CPU intensive. What did I miss? From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 20 16:51:54 2016 Received: (at 23917) by debbugs.gnu.org; 20 Jul 2016 20:51:54 +0000 Received: from localhost ([127.0.0.1]:58964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPyTC-0005VL-2k for submit@debbugs.gnu.org; Wed, 20 Jul 2016 16:51:54 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:22746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPyTA-0005V6-I0 for 23917@debbugs.gnu.org; Wed, 20 Jul 2016 16:51:52 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AZDgA731xV/3mcpUVcgxCEAgjIWAQCAoE8PBEBAQEBAQEBgQpBBYNdAQEDAQxKIwULCQI0BwsUGA0TEYg3CI18wScBAQEBBgEBAQEeizqFBQeELQWfF4NrkD2BRSOCO4FZIoJ4AQEB X-IPAS-Result: A0AZDgA731xV/3mcpUVcgxCEAgjIWAQCAoE8PBEBAQEBAQEBgQpBBYNdAQEDAQxKIwULCQI0BwsUGA0TEYg3CI18wScBAQEBBgEBAQEeizqFBQeELQWfF4NrkD2BRSOCO4FZIoJ4AQEB X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="248699999" Received: from 69-165-156-121.dsl.teksavvy.com (HELO ceviche.home) ([69.165.156.121]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 Jul 2016 16:51:47 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 547E46629A; Wed, 20 Jul 2016 16:54:03 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) Message-ID: References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> Date: Wed, 20 Jul 2016 16:54:03 -0400 In-Reply-To: <83inw0yw9q.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 20 Jul 2016 21:55:29 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 23917 Cc: nljlistbox2@gmail.com, npostavs@users.sourceforge.net, jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, alex.bennee@linaro.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.3 (/) > Maybe there's a misunderstanding. What Noam suggested was just to > move the code which adjusts search_regs.start[i] and .end[i] to before > the call to replace_range. Oh, right, that's also an option. It might suffer from another problem, which is that the match-data will be broken while the before-change-functions are run, so if there's a save-match-data there we're back to square one. Admittedly, before-change-functions is used less often, so it might be good enough. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 20 20:56:35 2016 Received: (at 23917) by debbugs.gnu.org; 21 Jul 2016 00:56:35 +0000 Received: from localhost ([127.0.0.1]:59099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ2Hz-0004Ja-8q for submit@debbugs.gnu.org; Wed, 20 Jul 2016 20:56:35 -0400 Received: from mail-it0-f45.google.com ([209.85.214.45]:36975) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ2Hx-0004JN-7x for 23917@debbugs.gnu.org; Wed, 20 Jul 2016 20:56:33 -0400 Received: by mail-it0-f45.google.com with SMTP id f6so3797074ith.0 for <23917@debbugs.gnu.org>; Wed, 20 Jul 2016 17:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=btcwXwfhqzakL56GdeVbyM1Dc3Amc2EInTK0x6RIJ5s=; b=dUrY1GLusWEDePIRXEtMKAqpZTirrXTMc71BbMUFR3ANTSqP/+jBpJ9a/VzzKOo93B 7oiVO0+3Lujop5J3btY0MKL4kChRjEgvKPE0ZJ9JYzb9uyY9wNB+yKDWZqSGog6vKztg jmHFNu7teypBPtzPE/H2ChtGswFWzhnhc8EKimrQ2hE4lhJgerxXy4JX0jkDeazE+Az3 WIzoNPTN3p9jzP7KDF6DgRS1noCF2VFU8gETkZRMPvqGCxaJ6jqpajltpKWqarFLB0gI KhKU7kaKuz+6MCSPYRE7mkMSPGu3kckoCRN9uHhrryPaLcsb42FGf4HL9Jl7SHIwaEWK 2VPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=btcwXwfhqzakL56GdeVbyM1Dc3Amc2EInTK0x6RIJ5s=; b=jXwS90V9x8gd8n7CgEhH9Da+j1ldrt6W+ObACzO8MniRGD0jCKc7AcWf2aoT2jG3Bc 1T9VK0bb93qZa0ErXX/66rucdRaNPMVsJ6XawDkMCB9EpWvBppu3XyfWddLl0pZTgBVm 0sQLpMjkLZqGH2CZckKEYjyVNeMpp75yA9ucBR4tDTvkpxr3Y81e3oNToFHTTdV3s7Oh W8603OlKZrU4mQccmS5XXnCAzRRR1hlP5RMEGTzvGwQpuUbCwUBu7xjOmxB2nT4ALUIH w6EnFMqy7LcwiYzsPgiZDs/3tRY6zjvSsxwI6hRLqNSiAPTDLk8ODEQTnXE4JE1619jk zGeA== X-Gm-Message-State: ALyK8tIRQiccIyUsIdT3LYpx1S8ymy+Xfc7f7JThGNV9GETIo9lS4ROiN760s7xsUDjPHQ== X-Received: by 10.36.64.5 with SMTP id n5mr10546657ita.78.1469062587682; Wed, 20 Jul 2016 17:56:27 -0700 (PDT) Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id b89sm2566469iod.30.2016.07.20.17.56.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jul 2016 17:56:26 -0700 (PDT) From: npostavs@users.sourceforge.net To: Stefan Monnier Subject: Re: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> Date: Wed, 20 Jul 2016 20:56:28 -0400 In-Reply-To: (Stefan Monnier's message of "Wed, 20 Jul 2016 16:54:03 -0400") Message-ID: <87bn1rdd1f.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23917 Cc: nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, Eli Zaretskii , alex.bennee@linaro.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.7 (/) --=-=-= Content-Type: text/plain Stefan Monnier writes: >> Maybe there's a misunderstanding. What Noam suggested was just to >> move the code which adjusts search_regs.start[i] and .end[i] to before >> the call to replace_range. > > Oh, right, that's also an option. It might suffer from another problem, > which is that the match-data will be broken while the > before-change-functions are run, so if there's a save-match-data there > we're back to square one. Solution: adjust in between the before and after change functions. Patch below. I think there shouldn't be performance problems, although it does add yet another flag to replace_range (by the way, I noticed that the MARKERS flags is never 0, so it's redundant). I tested with the attached bug-23917-match-data-buffer-modhook.el. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v1-0001-Adjust-match-data-before-calling-after-change-fun.patch Content-Description: patch >From a8098080dff5f83f7cbcbec2bc263f9db3b45ad9 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Wed, 20 Jul 2016 20:15:14 -0400 Subject: [PATCH v1] Adjust match data before calling after-change-funs * src/insdel.c (replace_range): Add new parameter ADJUST_MATCH_DATA, if true. Update all callers except Freplace_match to pass 0 for the new parameter. * src/search.c (update_search_regs): New function, extracted from Freplace_match. (Freplace_match): Remove match data adjustment code, pass 1 for ADJUST_MATCH_DATA to replace_range instead. --- src/cmds.c | 2 +- src/editfns.c | 6 +++--- src/insdel.c | 10 ++++++++-- src/lisp.h | 4 +++- src/search.c | 50 +++++++++++++++++++++++++++++--------------------- 5 files changed, 44 insertions(+), 28 deletions(-) diff --git a/src/cmds.c b/src/cmds.c index 1e44ddd..4003d8b 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -447,7 +447,7 @@ internal_self_insert (int c, EMACS_INT n) string = concat2 (string, tem); } - replace_range (PT, PT + chars_to_delete, string, 1, 1, 1); + replace_range (PT, PT + chars_to_delete, string, 1, 1, 1, 0); Fforward_char (make_number (n)); } else if (n > 1) diff --git a/src/editfns.c b/src/editfns.c index 412745d..32c8bec 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3192,7 +3192,7 @@ DEFUN ("subst-char-in-region", Fsubst_char_in_region, /* replace_range is less efficient, because it moves the gap, but it handles combining correctly. */ replace_range (pos, pos + 1, string, - 0, 0, 1); + 0, 0, 1, 0); pos_byte_next = CHAR_TO_BYTE (pos); if (pos_byte_next > pos_byte) /* Before combining happened. We should not increment @@ -3405,7 +3405,7 @@ DEFUN ("translate-region-internal", Ftranslate_region_internal, /* This is less efficient, because it moves the gap, but it should handle multibyte characters correctly. */ string = make_multibyte_string ((char *) str, 1, str_len); - replace_range (pos, pos + 1, string, 1, 0, 1); + replace_range (pos, pos + 1, string, 1, 0, 1, 0); len = str_len; } else @@ -3446,7 +3446,7 @@ DEFUN ("translate-region-internal", Ftranslate_region_internal, { string = Fmake_string (make_number (1), val); } - replace_range (pos, pos + len, string, 1, 0, 1); + replace_range (pos, pos + len, string, 1, 0, 1, 0); pos_byte += SBYTES (string); pos += SCHARS (string); cnt += SCHARS (string); diff --git a/src/insdel.c b/src/insdel.c index 4ad1074..fc3f19f 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1268,7 +1268,9 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t from_byte, /* Replace the text from character positions FROM to TO with NEW, If PREPARE, call prepare_to_modify_buffer. If INHERIT, the newly inserted text should inherit text properties - from the surrounding non-deleted text. */ + from the surrounding non-deleted text. + If ADJUST_MATCH_DATA, then adjust the match data before calling + signal_after_change. */ /* Note that this does not yet handle markers quite right. Also it needs to record a single undo-entry that does a replacement @@ -1279,7 +1281,8 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t from_byte, void replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new, - bool prepare, bool inherit, bool markers) + bool prepare, bool inherit, bool markers, + bool adjust_match_data) { ptrdiff_t inschars = SCHARS (new); ptrdiff_t insbytes = SBYTES (new); @@ -1426,6 +1429,9 @@ replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new, MODIFF++; CHARS_MODIFF = MODIFF; + if (adjust_match_data) + update_search_regs (from, to, from + SCHARS (new)); + signal_after_change (from, nchars_del, GPT - from); update_compositions (from, GPT, CHECK_BORDER); } diff --git a/src/lisp.h b/src/lisp.h index 6a98adb..25f811e 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3516,7 +3516,7 @@ extern void adjust_after_insert (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t); extern void adjust_markers_for_delete (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t); -extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, bool, bool, bool); +extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, bool, bool, bool, bool); extern void replace_range_2 (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, const char *, ptrdiff_t, ptrdiff_t, bool); extern void syms_of_insdel (void); @@ -3994,6 +3994,8 @@ extern Lisp_Object make_temp_name (Lisp_Object, bool); /* Defined in search.c. */ extern void shrink_regexp_cache (void); extern void restore_search_regs (void); +extern void update_search_regs (ptrdiff_t oldstart, + ptrdiff_t oldend, ptrdiff_t newend); extern void record_unwind_save_match_data (void); struct re_registers; extern struct re_pattern_buffer *compile_pattern (Lisp_Object, diff --git a/src/search.c b/src/search.c index 5c949ad..1b82c94 100644 --- a/src/search.c +++ b/src/search.c @@ -2727,8 +2727,15 @@ DEFUN ("replace-match", Freplace_match, Sreplace_match, 1, 5, 0, /* Replace the old text with the new in the cleanest possible way. */ replace_range (search_regs.start[sub], search_regs.end[sub], - newtext, 1, 0, 1); + newtext, 1, 0, 1, 1); newpoint = search_regs.start[sub] + SCHARS (newtext); + /* Update saved data to match adjustment made by replace_range. */ + { + ptrdiff_t change = newpoint - sub_end; + if (sub_start >= sub_end) + sub_start += change; + sub_end += change; + } if (case_action == all_caps) Fupcase_region (make_number (search_regs.start[sub]), @@ -2742,26 +2749,6 @@ DEFUN ("replace-match", Freplace_match, Sreplace_match, 1, 5, 0, || search_regs.num_regs != num_regs) error ("Match data clobbered by buffer modification hooks"); - /* Adjust search data for this change. */ - { - ptrdiff_t oldend = search_regs.end[sub]; - ptrdiff_t oldstart = search_regs.start[sub]; - ptrdiff_t change = newpoint - search_regs.end[sub]; - ptrdiff_t i; - - for (i = 0; i < search_regs.num_regs; i++) - { - if (search_regs.start[i] >= oldend) - search_regs.start[i] += change; - else if (search_regs.start[i] > oldstart) - search_regs.start[i] = oldstart; - if (search_regs.end[i] >= oldend) - search_regs.end[i] += change; - else if (search_regs.end[i] > oldstart) - search_regs.end[i] = oldstart; - } - } - /* Put point back where it was in the text. */ if (opoint <= 0) TEMP_SET_PT (opoint + ZV); @@ -3102,6 +3089,27 @@ restore_search_regs (void) } } +/* Called from replace-match via replace_range. */ +void +update_search_regs (ptrdiff_t oldstart, ptrdiff_t oldend, ptrdiff_t newend) +{ + /* Adjust search data for this change. */ + ptrdiff_t change = newend - oldend; + ptrdiff_t i; + + for (i = 0; i < search_regs.num_regs; i++) + { + if (search_regs.start[i] >= oldend) + search_regs.start[i] += change; + else if (search_regs.start[i] > oldstart) + search_regs.start[i] = oldstart; + if (search_regs.end[i] >= oldend) + search_regs.end[i] += change; + else if (search_regs.end[i] > oldstart) + search_regs.end[i] = oldstart; + } +} + static void unwind_set_match_data (Lisp_Object list) { -- 2.8.0 --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=bug-23917-match-data-buffer-modhook.el Content-Transfer-Encoding: quoted-printable Content-Description: test elisp (defun bug-23917-after-modhook (beg end length) (message "match-data-post1: %S" (mapcar #'marker-position (match-data))) (save-match-data nil) (message "match-data-post2: %S" (mapcar #'marker-position (match-data)))) (defun bug-23917-before-modhook (beg end) (message "match-data-pre-1: %S" (mapcar #'marker-position (match-data))) (save-match-data nil) (message "match-data-pre-2: %S" (mapcar #'marker-position (match-data)))) (defun bug-23917-doit () (interactive) (with-current-buffer (get-buffer-create "*bug 23917*") (switch-to-buffer (current-buffer)) (erase-buffer) (insert "xxxxxxxxx yyyyyyyyy zzzzzzzzz") (goto-char 1) (re-search-forward "\\(x+\\) \\(y+\\) \\(z+\\)") (let ((after-change-functions '(bug-23917-after-modhook)) (before-change-functions '(bug-23917-before-modhook))) (replace-match "3" t t nil 3)) (view-echo-area-messages))) (bug-23917-doit) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 20 21:47:21 2016 Received: (at 23917) by debbugs.gnu.org; 21 Jul 2016 01:47:21 +0000 Received: from localhost ([127.0.0.1]:59128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ357-0005VJ-Ct for submit@debbugs.gnu.org; Wed, 20 Jul 2016 21:47:21 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:21058) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ355-0005V7-VY for 23917@debbugs.gnu.org; Wed, 20 Jul 2016 21:47:20 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AkDgA731xV/3mcpUVcgxCBMoJQCMhYBAICgTw9EAEBAQEBAQGBCkEFg1wBAQEBAgEMSiMFCwkCEQMBAh0HCxQNCw0TAyEbh3wDCgiNfLwjDYR3AQEBAQYBAQEBAR2LOoJNgjgHhC0BBIZllTWCfYNriitbhTeBRSOCChwVgVkiMYJHAQEB X-IPAS-Result: A0AkDgA731xV/3mcpUVcgxCBMoJQCMhYBAICgTw9EAEBAQEBAQGBCkEFg1wBAQEBAgEMSiMFCwkCEQMBAh0HCxQNCw0TAyEbh3wDCgiNfLwjDYR3AQEBAQYBAQEBAR2LOoJNgjgHhC0BBIZllTWCfYNriitbhTeBRSOCChwVgVkiMYJHAQEB X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="248714077" Received: from 69-165-156-121.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([69.165.156.121]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 Jul 2016 21:47:13 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id A072FAE0F1; Wed, 20 Jul 2016 21:47:13 -0400 (EDT) From: Stefan Monnier To: npostavs@users.sourceforge.net Subject: Re: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) Message-ID: References: <87vb066ejv.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> <87bn1rdd1f.fsf@users.sourceforge.net> Date: Wed, 20 Jul 2016 21:47:13 -0400 In-Reply-To: <87bn1rdd1f.fsf@users.sourceforge.net> (npostavs's message of "Wed, 20 Jul 2016 20:56:28 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 23917 Cc: nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, Eli Zaretskii , alex.bennee@linaro.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.3 (/) > Solution: adjust in between the before and after change functions. > Patch below. I think there shouldn't be performance problems, although > it does add yet another flag to replace_range (by the way, I noticed > that the MARKERS flags is never 0, so it's redundant). I tested with > the attached bug-23917-match-data-buffer-modhook.el. Looks pretty good, indeed. More specifically, looks like the better fix. 2 comments: - I'd take advantage of this change to replace the 0/1 booleans with false/true [but that's just my preference of bikeshed color). - maybe we can even adjust_match_data in every call to replace_range rather than just in the one from Freplace_match. Thanks, Stefan > From a8098080dff5f83f7cbcbec2bc263f9db3b45ad9 Mon Sep 17 00:00:00 2001 > From: Noam Postavsky > Date: Wed, 20 Jul 2016 20:15:14 -0400 > Subject: [PATCH v1] Adjust match data before calling after-change-funs > * src/insdel.c (replace_range): Add new parameter ADJUST_MATCH_DATA, if > true. Update all callers except Freplace_match to pass 0 for the new > parameter. > * src/search.c (update_search_regs): New function, extracted from > Freplace_match. > (Freplace_match): Remove match data adjustment code, pass 1 for > ADJUST_MATCH_DATA to replace_range instead. > --- > src/cmds.c | 2 +- > src/editfns.c | 6 +++--- > src/insdel.c | 10 ++++++++-- > src/lisp.h | 4 +++- > src/search.c | 50 +++++++++++++++++++++++++++++--------------------- > 5 files changed, 44 insertions(+), 28 deletions(-) > diff --git a/src/cmds.c b/src/cmds.c > index 1e44ddd..4003d8b 100644 > --- a/src/cmds.c > +++ b/src/cmds.c > @@ -447,7 +447,7 @@ internal_self_insert (int c, EMACS_INT n) > string = concat2 (string, tem); > } > - replace_range (PT, PT + chars_to_delete, string, 1, 1, 1); > + replace_range (PT, PT + chars_to_delete, string, 1, 1, 1, 0); > Fforward_char (make_number (n)); > } > else if (n > 1) > diff --git a/src/editfns.c b/src/editfns.c > index 412745d..32c8bec 100644 > --- a/src/editfns.c > +++ b/src/editfns.c > @@ -3192,7 +3192,7 @@ DEFUN ("subst-char-in-region", Fsubst_char_in_region, > /* replace_range is less efficient, because it moves the gap, > but it handles combining correctly. */ > replace_range (pos, pos + 1, string, > - 0, 0, 1); > + 0, 0, 1, 0); > pos_byte_next = CHAR_TO_BYTE (pos); > if (pos_byte_next > pos_byte) > /* Before combining happened. We should not increment > @@ -3405,7 +3405,7 @@ DEFUN ("translate-region-internal", Ftranslate_region_internal, > /* This is less efficient, because it moves the gap, > but it should handle multibyte characters correctly. */ > string = make_multibyte_string ((char *) str, 1, str_len); > - replace_range (pos, pos + 1, string, 1, 0, 1); > + replace_range (pos, pos + 1, string, 1, 0, 1, 0); > len = str_len; > } > else > @@ -3446,7 +3446,7 @@ DEFUN ("translate-region-internal", Ftranslate_region_internal, > { > string = Fmake_string (make_number (1), val); > } > - replace_range (pos, pos + len, string, 1, 0, 1); > + replace_range (pos, pos + len, string, 1, 0, 1, 0); > pos_byte += SBYTES (string); > pos += SCHARS (string); > cnt += SCHARS (string); > diff --git a/src/insdel.c b/src/insdel.c > index 4ad1074..fc3f19f 100644 > --- a/src/insdel.c > +++ b/src/insdel.c > @@ -1268,7 +1268,9 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t from_byte, > /* Replace the text from character positions FROM to TO with NEW, > If PREPARE, call prepare_to_modify_buffer. > If INHERIT, the newly inserted text should inherit text properties > - from the surrounding non-deleted text. */ > + from the surrounding non-deleted text. > + If ADJUST_MATCH_DATA, then adjust the match data before calling > + signal_after_change. */ > /* Note that this does not yet handle markers quite right. > Also it needs to record a single undo-entry that does a replacement > @@ -1279,7 +1281,8 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t from_byte, > void > replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new, > - bool prepare, bool inherit, bool markers) > + bool prepare, bool inherit, bool markers, > + bool adjust_match_data) > { > ptrdiff_t inschars = SCHARS (new); > ptrdiff_t insbytes = SBYTES (new); > @@ -1426,6 +1429,9 @@ replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new, > MODIFF++; > CHARS_MODIFF = MODIFF; > + if (adjust_match_data) > + update_search_regs (from, to, from + SCHARS (new)); > + > signal_after_change (from, nchars_del, GPT - from); > update_compositions (from, GPT, CHECK_BORDER); > } > diff --git a/src/lisp.h b/src/lisp.h > index 6a98adb..25f811e 100644 > --- a/src/lisp.h > +++ b/src/lisp.h > @@ -3516,7 +3516,7 @@ extern void adjust_after_insert (ptrdiff_t, ptrdiff_t, ptrdiff_t, > ptrdiff_t, ptrdiff_t); > extern void adjust_markers_for_delete (ptrdiff_t, ptrdiff_t, > ptrdiff_t, ptrdiff_t); > -extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, bool, bool, bool); > +extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, bool, bool, bool, bool); > extern void replace_range_2 (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, > const char *, ptrdiff_t, ptrdiff_t, bool); > extern void syms_of_insdel (void); > @@ -3994,6 +3994,8 @@ extern Lisp_Object make_temp_name (Lisp_Object, bool); > /* Defined in search.c. */ > extern void shrink_regexp_cache (void); > extern void restore_search_regs (void); > +extern void update_search_regs (ptrdiff_t oldstart, > + ptrdiff_t oldend, ptrdiff_t newend); > extern void record_unwind_save_match_data (void); > struct re_registers; > extern struct re_pattern_buffer *compile_pattern (Lisp_Object, > diff --git a/src/search.c b/src/search.c > index 5c949ad..1b82c94 100644 > --- a/src/search.c > +++ b/src/search.c > @@ -2727,8 +2727,15 @@ DEFUN ("replace-match", Freplace_match, Sreplace_match, 1, 5, 0, > /* Replace the old text with the new in the cleanest possible way. */ > replace_range (search_regs.start[sub], search_regs.end[sub], > - newtext, 1, 0, 1); > + newtext, 1, 0, 1, 1); > newpoint = search_regs.start[sub] + SCHARS (newtext); > + /* Update saved data to match adjustment made by replace_range. */ > + { > + ptrdiff_t change = newpoint - sub_end; > + if (sub_start >= sub_end) > + sub_start += change; > + sub_end += change; > + } > if (case_action == all_caps) > Fupcase_region (make_number (search_regs.start[sub]), > @@ -2742,26 +2749,6 @@ DEFUN ("replace-match", Freplace_match, Sreplace_match, 1, 5, 0, > || search_regs.num_regs != num_regs) > error ("Match data clobbered by buffer modification hooks"); > - /* Adjust search data for this change. */ > - { > - ptrdiff_t oldend = search_regs.end[sub]; > - ptrdiff_t oldstart = search_regs.start[sub]; > - ptrdiff_t change = newpoint - search_regs.end[sub]; > - ptrdiff_t i; > - > - for (i = 0; i < search_regs.num_regs; i++) > - { > - if (search_regs.start[i] >= oldend) > - search_regs.start[i] += change; > - else if (search_regs.start[i] > oldstart) > - search_regs.start[i] = oldstart; > - if (search_regs.end[i] >= oldend) > - search_regs.end[i] += change; > - else if (search_regs.end[i] > oldstart) > - search_regs.end[i] = oldstart; > - } > - } > - > /* Put point back where it was in the text. */ > if (opoint <= 0) > TEMP_SET_PT (opoint + ZV); > @@ -3102,6 +3089,27 @@ restore_search_regs (void) > } > } > +/* Called from replace-match via replace_range. */ > +void > +update_search_regs (ptrdiff_t oldstart, ptrdiff_t oldend, ptrdiff_t newend) > +{ > + /* Adjust search data for this change. */ > + ptrdiff_t change = newend - oldend; > + ptrdiff_t i; > + > + for (i = 0; i < search_regs.num_regs; i++) > + { > + if (search_regs.start[i] >= oldend) > + search_regs.start[i] += change; > + else if (search_regs.start[i] > oldstart) > + search_regs.start[i] = oldstart; > + if (search_regs.end[i] >= oldend) > + search_regs.end[i] += change; > + else if (search_regs.end[i] > oldstart) > + search_regs.end[i] = oldstart; > + } > +} > + > static void > unwind_set_match_data (Lisp_Object list) > { > -- > 2.8.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 20 22:34:54 2016 Received: (at 23917) by debbugs.gnu.org; 21 Jul 2016 02:34:54 +0000 Received: from localhost ([127.0.0.1]:59142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ3p7-0006aD-UB for submit@debbugs.gnu.org; Wed, 20 Jul 2016 22:34:54 -0400 Received: from mail-oi0-f41.google.com ([209.85.218.41]:36326) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ3p6-0006a0-LO for 23917@debbugs.gnu.org; Wed, 20 Jul 2016 22:34:52 -0400 Received: by mail-oi0-f41.google.com with SMTP id w18so98566600oiw.3 for <23917@debbugs.gnu.org>; Wed, 20 Jul 2016 19:34:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=40wK/sm2tBMfKaNO1wuFQztMJxBz+u8EfC1cYckooog=; b=PMOs83q3TeG7E9ipeQ3gw8XvLdfRJdvU7ThtYLZkEz/TJXDoVuUwpjSBbfOiFa6mba 5Tv6eQNVbHwacaeXUq2yQUfVey4dgAeMUz/a/qd2X3cLKFv2rDqNXHuCKYEOoCPXc3jy dFACCe0AV/AIsaHkyMH1tcKj/XCGeCBnWV6cd5+/PMXy+4SoK1D/sRs0qVYl1/UpFu3V ZjhBKXt9Kk0MkYQBocH9P5ZdAkrYQlqJcNdh7LrU00w5m1eXmyrwxEfAYOnNm+/7SOwF pOdWAc+X9RZyo9BEi0Bkh6/Ksg7AzayYI0q5w+xdWt69qIgPcoSDkJWzs/yE2C2WQNzO WGxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=40wK/sm2tBMfKaNO1wuFQztMJxBz+u8EfC1cYckooog=; b=G+VX5EW8Dl2AIV8rPLgURUuwggdw18BlNDoObJ+Qzl/3DWoUD18pIKvfy6iSe8waw7 3ou1ULBA9+k6Lud8/i3gEwuurW4F22UdPfVlLm/HolVq498dLp0YBQqJeRecklwa8TuM 8mIPu7G7KvN5G7bJb17HA9Y4/GXDbZNGRkKEpMG2zD5qW15WP2wXhoDDAQDxGL7jPTj2 0BVyyXJJcM06CHx6ELHTYB5HA8wJwSeVfZoC2Bn+5j5S0pPfjHZTNDbe1PaVpSn19G4i pcwRi8Y7EVqrh8ab1Zv0xaYTWy8+NkvmlBdOc1Q//lVYWWyUH5JMR4d8VMssq7oTNm9v ymsg== X-Gm-Message-State: ALyK8tK1pcmu9FbSCPZetefpF5ML+f2+SlaRNJyMQDwak95gB77BwRhToIrw4om6TXruPe8Hk3HSuMLGj8pHhg== X-Received: by 10.202.245.214 with SMTP id t205mr14276627oih.202.1469068487114; Wed, 20 Jul 2016 19:34:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.7.161 with HTTP; Wed, 20 Jul 2016 19:34:46 -0700 (PDT) In-Reply-To: References: <87vb066ejv.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> <87bn1rdd1f.fsf@users.sourceforge.net> From: Noam Postavsky Date: Wed, 20 Jul 2016 22:34:46 -0400 X-Google-Sender-Auth: rOsHJr4wqA-SyNw7bIt0pgo52Y0 Message-ID: Subject: =?UTF-8?Q?Re=3A_bug=2323917=3A_Please_consider_making_Bug_=2323917_a_b?= =?UTF-8?Q?locker_for_25=2E1_=28was_Re=3A_org=2Dcapture=3A_Capture_template_=E2=80=98g?= =?UTF-8?Q?=E2=80=99=3A_Match_data_clobbered_by_buffer_modification_hooks=29?= To: Stefan Monnier Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23917 Cc: nljlistbox2@gmail.com, John Wiegley , Robert Pluim , 23917@debbugs.gnu.org, Eli Zaretskii , =?UTF-8?B?QWxleCBCZW5uw6ll?= 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.7 (/) On Wed, Jul 20, 2016 at 9:47 PM, Stefan Monnier wrote: > - maybe we can even adjust_match_data in every call to replace_range > rather than just in the one from Freplace_match. That would be simpler, though I wasn't sure if it would be correct. From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 20 22:44:08 2016 Received: (at 23917) by debbugs.gnu.org; 21 Jul 2016 02:44:08 +0000 Received: from localhost ([127.0.0.1]:59147 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ3y3-0006n3-R7 for submit@debbugs.gnu.org; Wed, 20 Jul 2016 22:44:08 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47134) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ3y2-0006mS-JW for 23917@debbugs.gnu.org; Wed, 20 Jul 2016 22:44:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQ3xw-0006N4-FI for 23917@debbugs.gnu.org; Wed, 20 Jul 2016 22:44: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.8 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41527) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQ3xn-0006F1-6y; Wed, 20 Jul 2016 22:43:51 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4663 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bQ3xl-0000Pr-0w; Wed, 20 Jul 2016 22:43:49 -0400 Date: Thu, 21 Jul 2016 05:43:53 +0300 Message-Id: <83h9bjzp5i.fsf@gnu.org> From: Eli Zaretskii To: npostavs@users.sourceforge.net In-reply-to: <87bn1rdd1f.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) Subject: Re: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> <87bn1rdd1f.fsf@users.sourceforge.net> 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: -6.3 (------) X-Debbugs-Envelope-To: 23917 Cc: nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, monnier@iro.umontreal.ca, alex.bennee@linaro.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: -6.3 (------) > From: npostavs@users.sourceforge.net > Cc: Eli Zaretskii , 23917@debbugs.gnu.org, nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, alex.bennee@linaro.org > Date: Wed, 20 Jul 2016 20:56:28 -0400 > > >> Maybe there's a misunderstanding. What Noam suggested was just to > >> move the code which adjusts search_regs.start[i] and .end[i] to before > >> the call to replace_range. > > > > Oh, right, that's also an option. It might suffer from another problem, > > which is that the match-data will be broken while the > > before-change-functions are run, so if there's a save-match-data there > > we're back to square one. > > Solution: adjust in between the before and after change functions. > Patch below. I think there shouldn't be performance problems, although > it does add yet another flag to replace_range (by the way, I noticed > that the MARKERS flags is never 0, so it's redundant). I tested with > the attached bug-23917-match-data-buffer-modhook.el. Thanks. Please also make sure bug#23869 is still fixed after this. From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 20 23:01:07 2016 Received: (at 23917) by debbugs.gnu.org; 21 Jul 2016 03:01:07 +0000 Received: from localhost ([127.0.0.1]:59152 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ4EV-0007BE-CN for submit@debbugs.gnu.org; Wed, 20 Jul 2016 23:01:07 -0400 Received: from mail-it0-f54.google.com ([209.85.214.54]:32799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ4ER-0007Ac-C7 for 23917@debbugs.gnu.org; Wed, 20 Jul 2016 23:01:05 -0400 Received: by mail-it0-f54.google.com with SMTP id f6so877828ith.0 for <23917@debbugs.gnu.org>; Wed, 20 Jul 2016 20:01:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=m/lEXf/iA9czPXxyHY+moOFGN7fLdFrRuT5wR1IfMpE=; b=ylIamaj0wdsZvOYHg6YkNiXrg1XawhZxAvO7hCPU+1GEURvRIQbD605vqOAwIE2YK3 kUE4msHKDGtFlntTY4nONMWE32XQy9OqKYwjs9gfSAaWkBk8p8B8zlVHD5whCmZFYeGs kiB5ygYwi6frLo15iAd+F8AAzh8UYRrTMePoz56w++MnUWNPf5MRD8lternweLSJpR9q 18WzfSEexOI4KAFxCFgFZQ4RDKuyNs9H8HWxUceWzlf7Oow8XHlklomYWwCgLynEgqe4 FgBvpZkpnBeZWi6wPDpMdIDXlrxqeCmHN2krwDuhSJd4UliNQupGFHd0X+gTcoWAXzkG /img== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=m/lEXf/iA9czPXxyHY+moOFGN7fLdFrRuT5wR1IfMpE=; b=iHCtYodumNK/vP8CvNztB7+/BOFnRWSmbHYQbgtS/eL1Vb6ylyOZidY9E39OwkPQYp 7Rn1MV9UiSY6zq0aviiiaOxZiDZ5HKexIORX205c90LGv2fVzMzbeJ6NioN2gPTrsXmY 3o3IQVHdoc7694dBBKmdw5kPzAc6dpHwnqx/+gy2oIo6SdcRk7y3raG2vMQeu4L2mBIb 0/Ie2pak8/AsiugWbnE1TLEtNC6ZAtaxh1GSmGGEVwpYMhsR34nDxleQV6bJZDCUBO0G 2EjtSLS3vM/alrgd2Qh8Fp+jwadPjjTQ+zy/J4KCrc11fUsj1v35g/2X44QgZZZ9ebaG xcxg== X-Gm-Message-State: ALyK8tLeC7kHAnLfCoJlxeJ0BXbSEZLmKgnz0dRxJieezkM2lsflYKnYIgirTutGpSIyAg== X-Received: by 10.36.192.9 with SMTP id u9mr6104268itf.86.1469070057871; Wed, 20 Jul 2016 20:00:57 -0700 (PDT) Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id q1sm504318itb.2.2016.07.20.20.00.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jul 2016 20:00:57 -0700 (PDT) From: npostavs@users.sourceforge.net To: Eli Zaretskii Subject: Re: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> <87bn1rdd1f.fsf@users.sourceforge.net> <83h9bjzp5i.fsf@gnu.org> Date: Wed, 20 Jul 2016 23:00:59 -0400 In-Reply-To: <83h9bjzp5i.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 21 Jul 2016 05:43:53 +0300") Message-ID: <877fcfd79w.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23917 Cc: nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, monnier@iro.umontreal.ca, alex.bennee@linaro.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.7 (/) Eli Zaretskii writes: >> From: npostavs@users.sourceforge.net >> Cc: Eli Zaretskii , 23917@debbugs.gnu.org, nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, alex.bennee@linaro.org >> Date: Wed, 20 Jul 2016 20:56:28 -0400 >> >> >> Maybe there's a misunderstanding. What Noam suggested was just to >> >> move the code which adjusts search_regs.start[i] and .end[i] to before >> >> the call to replace_range. >> > >> > Oh, right, that's also an option. It might suffer from another problem, >> > which is that the match-data will be broken while the >> > before-change-functions are run, so if there's a save-match-data there >> > we're back to square one. >> >> Solution: adjust in between the before and after change functions. >> Patch below. I think there shouldn't be performance problems, although >> it does add yet another flag to replace_range (by the way, I noticed >> that the MARKERS flags is never 0, so it's redundant). I tested with >> the attached bug-23917-match-data-buffer-modhook.el. > > Thanks. > > Please also make sure bug#23869 is still fixed after this. Following the recipe in http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23869#11 gives me 'Lisp error: (error "Match data clobbered by buffer modification hooks")', that indicates it's still fixed, right? From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 20 23:06:44 2016 Received: (at 23917) by debbugs.gnu.org; 21 Jul 2016 03:06:44 +0000 Received: from localhost ([127.0.0.1]:59156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ4Jw-0007IZ-0q for submit@debbugs.gnu.org; Wed, 20 Jul 2016 23:06:44 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:49531) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ4Jt-0007IN-US for 23917@debbugs.gnu.org; Wed, 20 Jul 2016 23:06:42 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AZDgA731xV/3mcpUVcgxCEAgjIWAQCAoE8PBEBAQEBAQEBgQpBBYNdAQEEDEojEAkCDiYHCxQYDRMRiD+NfMEnAQEBBwEBAQEeizqFBQeELQEEnxeDa5A9gUUjgjuBWSKCeAEBAQ X-IPAS-Result: A0AZDgA731xV/3mcpUVcgxCEAgjIWAQCAoE8PBEBAQEBAQEBgQpBBYNdAQEEDEojEAkCDiYHCxQYDRMRiD+NfMEnAQEBBwEBAQEeizqFBQeELQEEnxeDa5A9gUUjgjuBWSKCeAEBAQ X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="248716683" Received: from 69-165-156-121.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([69.165.156.121]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 Jul 2016 23:06:34 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 509C9AE0F1; Wed, 20 Jul 2016 23:06:34 -0400 (EDT) From: Stefan Monnier To: Noam Postavsky Subject: Re: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) Message-ID: References: <87vb066ejv.fsf@linaro.org> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> <87bn1rdd1f.fsf@users.sourceforge.net> Date: Wed, 20 Jul 2016 23:06:34 -0400 In-Reply-To: (Noam Postavsky's message of "Wed, 20 Jul 2016 22:34:46 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 23917 Cc: nljlistbox2@gmail.com, John Wiegley , Robert Pluim , 23917@debbugs.gnu.org, Eli Zaretskii , Alex =?windows-1252?Q?Benn=E9e?= 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.3 (/) >> - maybe we can even adjust_match_data in every call to replace_range >> rather than just in the one from Freplace_match. > That would be simpler, though I wasn't sure if it would be correct. I think it's definitely not an option for emacs-25. But maybe we can try it on master. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 21 03:52:51 2016 Received: (at 23917) by debbugs.gnu.org; 21 Jul 2016 07:52:51 +0000 Received: from localhost ([127.0.0.1]:59257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ8mp-0005US-CC for submit@debbugs.gnu.org; Thu, 21 Jul 2016 03:52:51 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:34420) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ8mo-0005UG-00 for 23917@debbugs.gnu.org; Thu, 21 Jul 2016 03:52:50 -0400 Received: by mail-io0-f194.google.com with SMTP id g86so4955909ioj.1 for <23917@debbugs.gnu.org>; Thu, 21 Jul 2016 00:52:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=0NMYrpcWpSUHeyHqDuOaRNhvJOwuAKOwUWZRqcSeh9k=; b=H+IQjr4K/jYG7zJb18iTDfEMHArgTi/aEIZFQZ42pFC9rMSUeMk0Gl/Dl1aHE+QMPF O+PZO3tm/z9LKI98iE/kD2TMI4oxBi1xPomt82x8gyHA1D674Q3+H4L/WPJ/j15hy6yO dmtLAXqSHQJu117JtBOOgO8KQb4GIWJsCRwSMAIUFDT/Ll58bFrCzYiKkgcCMSzkUJkI 4omdC+LoG973atCNJ35hjOcdeAOESur9/NCgHZm+ptq3mBEfNCwJCZOEj67xFbLs5DBs z0XX2Y4duDDTsnZnaVVJz5NqxiRAmZpgGe08eLthvy6o2Uii80+BLfs/bLTDeY/kAqUN JwHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=0NMYrpcWpSUHeyHqDuOaRNhvJOwuAKOwUWZRqcSeh9k=; b=X8vWpjhVa0+AFc6tgLPGafOSqMebBJR1tUDmqt9HpWaDL5xnBnj7MpODvOM7rb0QAg oatKR7qPH0Vz6HJIabwhMD/Bvd/fWtFD2bA+jZ2WVs9LgezFqfWUCscGBY6t1zKunq+h IpV6UnBgjEFHe+o4hLvR8tSs4yUsNLmmVqpsXyhm2MdLoA6iUwhtBFK1JWcHtxmf+GS1 Y5WPzr3+Pm3RKZB5UTC4nZmW6PIRVF3i9Lc8KmveZrY9DuojcesYYLUBK9gG0jbmawDL YrfnR+LGni0x7tqOUj5pYXN4ptxDdN7tTmCoSCw0kvnjPZG7oTij/IrN5GeBAg4hJyZR 2Q2Q== X-Gm-Message-State: ALyK8tLKAd3RUnbLO0EhTEXwkErBGiZGjkijfXfGGIAbv2iwARFNvEgZFtQ27jOHzxPNiw== X-Received: by 10.107.201.138 with SMTP id z132mr49676115iof.156.1469087564270; Thu, 21 Jul 2016 00:52:44 -0700 (PDT) Received: from moondust.nodomain.none (blk-138-64-179.eastlink.ca. [24.138.64.179]) by smtp.gmail.com with ESMTPSA id o15sm1149681ith.2.2016.07.21.00.52.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Jul 2016 00:52:43 -0700 (PDT) From: nljlistbox2@gmail.com (N. Jackson) To: Eli Zaretskii Subject: bug#23917: 25.0.95; commit 3a9d6296b35e5317c497674d5725eb52699bd3b8 causing org-capture to error out References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> Date: Thu, 21 Jul 2016 04:52:42 -0300 In-Reply-To: <83lh0y24y6.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 18 Jul 2016 21:09:53 +0300") Message-ID: <87h9bj2zsl.fsf_-_@moondust.awandering> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, Robert Pluim , 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: -0.4 (/) At 21:09 +0300 on Monday 2016-07-18, Eli Zaretskii wrote: > My suggestion to fix this is below. I ask for opinions on (1) whether > this looks like TRT, (2) whether it is safe enough for emacs-25, and > (3) whether someone has better ideas. If someone thinks I've > misunderstood the issue, don't hesitate to explain why, because > frankly it feels very strange to find bugs that seem to have existed > since 1990. > > diff --git a/lisp/subr.el b/lisp/subr.el > index e9e19d3..1bb1cb3 100644 > --- a/lisp/subr.el > +++ b/lisp/subr.el > @@ -3466,7 +3466,7 @@ save-match-data > ;; if you need to recompile all the Lisp files using interpreted code. > (declare (indent 0) (debug t)) > (list 'let > - '((save-match-data-internal (match-data))) > + '((save-match-data-internal (match-data 'integers))) > (list 'unwind-protect > (cons 'progn body) > ;; It is safe to free (evaporate) markers immediately here, FWIW on my system applying this patch does not resolve the org-capture issue. I'm testing with org-20160718 from GNU Elpa and latest Emacs 25 branch from the git (Repository revision: 4157159a37b43712440da91a45a6d5f71= eb96e8a). With these versions of Org and Emacs and your patch applied, with a recipe similar to that posted by Robert Pluim on 2016-07-18, specifically src/emacs -Q M-: (custom-set-variables '(package-selected-packages (quote (org-2016071= 8)))) RET M-x package-initialize RET C-x C-f ; find file. C-S-backspace ; kill-whole-line. ~/.notes RET ; Open the file expected by default capture template. M-x org-mode RET ; put the buffer into Org Mode. M-x org-capture RET t ; Run the default "Task" capture template bound to = the t key. I get the error:=20 org-capture: Capture template =E2=80=98t=E2=80=99: Match data clobbered b= y buffer modification hooks . I also get a similar error with your patch and my full configuration loaded and using my own capture templates: org-capture: Capture abort: (error Match data clobbered by buffer modific= ation hooks) . The results above are same as I get if I do not apply your patch. [On the other hand, with the same version of Org as above and Emacs from the 25.0.95 tarball, I do not see these error.] From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 21 03:59:56 2016 Received: (at 23917) by debbugs.gnu.org; 21 Jul 2016 07:59:56 +0000 Received: from localhost ([127.0.0.1]:59261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ8tg-0005ds-5n for submit@debbugs.gnu.org; Thu, 21 Jul 2016 03:59:56 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:35727) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ8te-0005de-8l for 23917@debbugs.gnu.org; Thu, 21 Jul 2016 03:59:54 -0400 Received: by mail-io0-f194.google.com with SMTP id q83so4984149iod.2 for <23917@debbugs.gnu.org>; Thu, 21 Jul 2016 00:59:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=AEKDHqHK8g6lnDtgzhaq6ZROh8df3UcLVUyLqgp9ias=; b=K14OSqDHV5fhm1dm1NO/C7ad3VDrGpSQuO907twp73z5m+2Baj0lvmXTv+J57NusN1 QN21qjhzMi7d8iV3dwNUtn43804kjrtu/Aiexd5GgPD9Iiszem0KMiyuXCV1hW3/l+5f q2Qt0Ck1hnBye57pJLuPJW+R1X2LUqfPy79pK7VIzkB3mlv/zSAozaRzobO8YE0WI6mh HJPgAIbz2BcfwLUJWL0Pd3uBZgGo2tQFWD3SKq87V21FYbVHXuhQwQjFzOO2yijwoJ/j eA9sbnyvwwBAKBH1PuUb0aNe770MD+RHXxKIQUgokBbEmWue/afnfOCQT2EFP+q+XuEg ggpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=AEKDHqHK8g6lnDtgzhaq6ZROh8df3UcLVUyLqgp9ias=; b=jvPCFGFayz+aY78244NRas7j2zUwYzoDU0HXZRFSQGpiaygK50doIh+p/xTLEFaFZn HmLJnnLt0A3v3HY+zW5x57Vywq9JTnKOn2TPm2d8tsyN+uGgEcBYYwbLmQe41ariHEVw ng/p+sl7sNfok3z/h6S/20g1HG47p3ftnkM1E+1Op+kiLhEq0wByV49GhBHg+W6BOIuA 1+mXXCUM0yRXemCJs+k2cPpA5pj190VhimfSRuR1kj3dFFMBpFe56NwZpm+tlD9WjJyP jpixqwnwykYhr0d7Oi+LBSGRJzL2WVstF1iydltBRpz4aOtUtBdC8G/V6FdrXBPGzHsC A08w== X-Gm-Message-State: ALyK8tL0Jqyh0pikh6KrhRQfv412Fn5Bjfz1JtqnX8qLtA+slDWcVZzzTz3oNXzBpQI4Hg== X-Received: by 10.107.4.198 with SMTP id 189mr12833000ioe.143.1469087988764; Thu, 21 Jul 2016 00:59:48 -0700 (PDT) Received: from moondust.nodomain.none (blk-138-64-179.eastlink.ca. [24.138.64.179]) by smtp.gmail.com with ESMTPSA id w192sm3100480iof.24.2016.07.21.00.59.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Jul 2016 00:59:48 -0700 (PDT) From: nljlistbox2@gmail.com (N. Jackson) To: npostavs@users.sourceforge.net Subject: bug#23917: 25.0.95; commit 3a9d6296b35e5317c497674d5725eb52699bd3b8 causing org-capture to error out References: <87vb066ejv.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> <87bn1rdd1f.fsf@users.sourceforge.net> Date: Thu, 21 Jul 2016 04:59:46 -0300 In-Reply-To: <87bn1rdd1f.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Wed, 20 Jul 2016 20:56:28 -0400") Message-ID: <87a8hb2zgt.fsf_-_@moondust.awandering> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, Eli Zaretskii , Stefan Monnier , rpluim@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: -0.4 (/) At 20:56 -0400 on Wednesday 2016-07-20, npostavs@users.sourceforge.net wrot= e: > > From a8098080dff5f83f7cbcbec2bc263f9db3b45ad9 Mon Sep 17 00:00:00 2001 > From: Noam Postavsky > Date: Wed, 20 Jul 2016 20:15:14 -0400 > Subject: [PATCH v1] Adjust match data before calling after-change-funs > > * src/insdel.c (replace_range): Add new parameter ADJUST_MATCH_DATA, if > true. Update all callers except Freplace_match to pass 0 for the new > parameter. > * src/search.c (update_search_regs): New function, extracted from > Freplace_match. > (Freplace_match): Remove match data adjustment code, pass 1 for > ADJUST_MATCH_DATA to replace_range instead. > --- > src/cmds.c | 2 +- > src/editfns.c | 6 +++--- > src/insdel.c | 10 ++++++++-- > src/lisp.h | 4 +++- > src/search.c | 50 +++++++++++++++++++++++++++++--------------------- > 5 files changed, 44 insertions(+), 28 deletions(-) > > diff --git a/src/cmds.c b/src/cmds.c > index 1e44ddd..4003d8b 100644 > --- a/src/cmds.c > +++ b/src/cmds.c > @@ -447,7 +447,7 @@ internal_self_insert (int c, EMACS_INT n) > string =3D concat2 (string, tem); > } >=20=20 > - replace_range (PT, PT + chars_to_delete, string, 1, 1, 1); > + replace_range (PT, PT + chars_to_delete, string, 1, 1, 1, 0); > Fforward_char (make_number (n)); > } > else if (n > 1) > diff --git a/src/editfns.c b/src/editfns.c > index 412745d..32c8bec 100644 > --- a/src/editfns.c > +++ b/src/editfns.c > @@ -3192,7 +3192,7 @@ DEFUN ("subst-char-in-region", Fsubst_char_in_regio= n, > /* replace_range is less efficient, because it moves the gap, > but it handles combining correctly. */ > replace_range (pos, pos + 1, string, > - 0, 0, 1); > + 0, 0, 1, 0); > pos_byte_next =3D CHAR_TO_BYTE (pos); > if (pos_byte_next > pos_byte) > /* Before combining happened. We should not increment > @@ -3405,7 +3405,7 @@ DEFUN ("translate-region-internal", Ftranslate_regi= on_internal, > /* This is less efficient, because it moves the gap, > but it should handle multibyte characters correctly. */ > string =3D make_multibyte_string ((char *) str, 1, str_len); > - replace_range (pos, pos + 1, string, 1, 0, 1); > + replace_range (pos, pos + 1, string, 1, 0, 1, 0); > len =3D str_len; > } > else > @@ -3446,7 +3446,7 @@ DEFUN ("translate-region-internal", Ftranslate_regi= on_internal, > { > string =3D Fmake_string (make_number (1), val); > } > - replace_range (pos, pos + len, string, 1, 0, 1); > + replace_range (pos, pos + len, string, 1, 0, 1, 0); > pos_byte +=3D SBYTES (string); > pos +=3D SCHARS (string); > cnt +=3D SCHARS (string); > diff --git a/src/insdel.c b/src/insdel.c > index 4ad1074..fc3f19f 100644 > --- a/src/insdel.c > +++ b/src/insdel.c > @@ -1268,7 +1268,9 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t from= _byte, > /* Replace the text from character positions FROM to TO with NEW, > If PREPARE, call prepare_to_modify_buffer. > If INHERIT, the newly inserted text should inherit text properties > - from the surrounding non-deleted text. */ > + from the surrounding non-deleted text. > + If ADJUST_MATCH_DATA, then adjust the match data before calling > + signal_after_change. */ >=20=20 > /* Note that this does not yet handle markers quite right. > Also it needs to record a single undo-entry that does a replacement > @@ -1279,7 +1281,8 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t from= _byte, >=20=20 > void > replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new, > - bool prepare, bool inherit, bool markers) > + bool prepare, bool inherit, bool markers, > + bool adjust_match_data) > { > ptrdiff_t inschars =3D SCHARS (new); > ptrdiff_t insbytes =3D SBYTES (new); > @@ -1426,6 +1429,9 @@ replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_O= bject new, > MODIFF++; > CHARS_MODIFF =3D MODIFF; >=20=20 > + if (adjust_match_data) > + update_search_regs (from, to, from + SCHARS (new)); > + > signal_after_change (from, nchars_del, GPT - from); > update_compositions (from, GPT, CHECK_BORDER); > } > diff --git a/src/lisp.h b/src/lisp.h > index 6a98adb..25f811e 100644 > --- a/src/lisp.h > +++ b/src/lisp.h > @@ -3516,7 +3516,7 @@ extern void adjust_after_insert (ptrdiff_t, ptrdiff= _t, ptrdiff_t, > ptrdiff_t, ptrdiff_t); > extern void adjust_markers_for_delete (ptrdiff_t, ptrdiff_t, > ptrdiff_t, ptrdiff_t); > -extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, bool, bool= , bool); > +extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, bool, bool= , bool, bool); > extern void replace_range_2 (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, > const char *, ptrdiff_t, ptrdiff_t, bool); > extern void syms_of_insdel (void); > @@ -3994,6 +3994,8 @@ extern Lisp_Object make_temp_name (Lisp_Object, boo= l); > /* Defined in search.c. */ > extern void shrink_regexp_cache (void); > extern void restore_search_regs (void); > +extern void update_search_regs (ptrdiff_t oldstart, > + ptrdiff_t oldend, ptrdiff_t newend); > extern void record_unwind_save_match_data (void); > struct re_registers; > extern struct re_pattern_buffer *compile_pattern (Lisp_Object, > diff --git a/src/search.c b/src/search.c > index 5c949ad..1b82c94 100644 > --- a/src/search.c > +++ b/src/search.c > @@ -2727,8 +2727,15 @@ DEFUN ("replace-match", Freplace_match, Sreplace_m= atch, 1, 5, 0, >=20=20 > /* Replace the old text with the new in the cleanest possible way. */ > replace_range (search_regs.start[sub], search_regs.end[sub], > - newtext, 1, 0, 1); > + newtext, 1, 0, 1, 1); > newpoint =3D search_regs.start[sub] + SCHARS (newtext); > + /* Update saved data to match adjustment made by replace_range. */ > + { > + ptrdiff_t change =3D newpoint - sub_end; > + if (sub_start >=3D sub_end) > + sub_start +=3D change; > + sub_end +=3D change; > + } >=20=20 > if (case_action =3D=3D all_caps) > Fupcase_region (make_number (search_regs.start[sub]), > @@ -2742,26 +2749,6 @@ DEFUN ("replace-match", Freplace_match, Sreplace_m= atch, 1, 5, 0, > || search_regs.num_regs !=3D num_regs) > error ("Match data clobbered by buffer modification hooks"); >=20=20 > - /* Adjust search data for this change. */ > - { > - ptrdiff_t oldend =3D search_regs.end[sub]; > - ptrdiff_t oldstart =3D search_regs.start[sub]; > - ptrdiff_t change =3D newpoint - search_regs.end[sub]; > - ptrdiff_t i; > - > - for (i =3D 0; i < search_regs.num_regs; i++) > - { > - if (search_regs.start[i] >=3D oldend) > - search_regs.start[i] +=3D change; > - else if (search_regs.start[i] > oldstart) > - search_regs.start[i] =3D oldstart; > - if (search_regs.end[i] >=3D oldend) > - search_regs.end[i] +=3D change; > - else if (search_regs.end[i] > oldstart) > - search_regs.end[i] =3D oldstart; > - } > - } > - > /* Put point back where it was in the text. */ > if (opoint <=3D 0) > TEMP_SET_PT (opoint + ZV); > @@ -3102,6 +3089,27 @@ restore_search_regs (void) > } > } >=20=20 > +/* Called from replace-match via replace_range. */ > +void > +update_search_regs (ptrdiff_t oldstart, ptrdiff_t oldend, ptrdiff_t newe= nd) > +{ > + /* Adjust search data for this change. */ > + ptrdiff_t change =3D newend - oldend; > + ptrdiff_t i; > + > + for (i =3D 0; i < search_regs.num_regs; i++) > + { > + if (search_regs.start[i] >=3D oldend) > + search_regs.start[i] +=3D change; > + else if (search_regs.start[i] > oldstart) > + search_regs.start[i] =3D oldstart; > + if (search_regs.end[i] >=3D oldend) > + search_regs.end[i] +=3D change; > + else if (search_regs.end[i] > oldstart) > + search_regs.end[i] =3D oldstart; > + } > +} > + > static void > unwind_set_match_data (Lisp_Object list) > { FWIW on my system applying this patch only partially resolves the org-capture issue. I'm testing with org-20160718 from GNU Elpa and latest Emacs 25 branch from the git (Repository revision: 4157159a37b43712440da91a45a6d5f71eb96e8a). The patch successfully eliminates the match-data-clobbered error/abort during org-capture with all my capture templates when I have my entire config loaded, but with a minimal recipe from emacs -Q the org-capture match-data-clobbered error still occurs. The minimal recipe I'm testing with is similar to that posted by Robert Pluim on 2016-07-18, specifically src/emacs -Q M-: (custom-set-variables '(package-selected-packages (quote (org-2016071= 8)))) RET M-x package-initialize RET C-x C-f ; find file. C-S-backspace ; kill-whole-line. ~/.notes RET ; Open the file expected by default capture template. M-x org-mode RET ; put the buffer into Org Mode. M-x org-capture RET t ; Run the default "Task" capture template bound to = the t key. With your patch I still get the error:=20 org-capture: Capture template =E2=80=98t=E2=80=99: Match data clobbered b= y buffer modification hooks . It puzzles me that your patch doesn't work for the emacs -Q recipe but does work for my normal configuration, so much so that I suspected that I had made a mistake, but I have reset and reapplied the patch three times and I continue to see the same results. I hope this helps. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 21 04:08:45 2016 Received: (at 23917) by debbugs.gnu.org; 21 Jul 2016 08:08:45 +0000 Received: from localhost ([127.0.0.1]:59265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ92D-0005rg-9K for submit@debbugs.gnu.org; Thu, 21 Jul 2016 04:08:45 -0400 Received: from mail-wm0-f52.google.com ([74.125.82.52]:36682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ92B-0005rH-F8 for 23917@debbugs.gnu.org; Thu, 21 Jul 2016 04:08:44 -0400 Received: by mail-wm0-f52.google.com with SMTP id q128so12889902wma.1 for <23917@debbugs.gnu.org>; Thu, 21 Jul 2016 01:08:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:gmane-reply-to-list:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=ApmAsfOVTCmiJQoahnR3v3rcGhn9dnDJHDKcdp+qKsE=; b=N6aYvgDZOy2hpwaqb4M209X9zPqZKg+h8Q3CQJbVkdEzKXWZWtevC0eyWrq+PPc4mW paOzA6OU/YlMT62TXDiqaOHLhVFDSff+ODN5HhZWMM3dnzkHrZzN7SJlhuMvcnoGeHVy nJqO38gfUYedujdRPao/mNYN8yhz5tdDEYtCiMSdHDvE9qEmWKTkrmUsWUTqca5TAWvk oujjCYjLXUuq4EuHkizh8QtAdtUH8A+LbT8hhdADWcKv2QbuCoNstfYSQDYNqg7BGm1S AOEG93vASrp6+pnztXpAhAa6RihOts++Ji1DoOph6q/xvnlh1+NPz9vCZT9/XRKN/CSd Y1bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references :gmane-reply-to-list:date:in-reply-to:message-id:user-agent :mime-version:content-transfer-encoding; bh=ApmAsfOVTCmiJQoahnR3v3rcGhn9dnDJHDKcdp+qKsE=; b=Zy5KNWuzj/YTizPh7Io8/fi5brLsFGMJrIuK3l12TkFQVBeTshHH7RjYC0uYATkfLl tYvF6nuxOiCF8ag6Hi3AUqrNVnhjwg7s6ZJTQLDRZo6oOCvgY3JO+LEuCuJwctmXzEBB x8LDFfywVobXoEgYuLQdznx9ivyEPS/aFmtauf7cNDKtN6KsOxdGaeX2XwCVd+xGmoNq duBSdMKL/tg6d7i1Bp/Ubjr0Z1Tg5bkvkDHSuBcLTsXE1c6r4Rto+7gM3tIfy5N1a04q uuBHR61INNP/G5lmNSTZ6DoLV0ivZxv1fzZJ/OxLNPFcRPHrZhZae9P4Xug9uU5N+f2c XreA== X-Gm-Message-State: ALyK8tItO+N9+fLUeuxAC88Ms5WjT5imxzl0gSxwhSLEf7tO0pk6By7XW7vVjbQKPM+zfw== X-Received: by 10.194.60.193 with SMTP id j1mr5674402wjr.52.1469088517727; Thu, 21 Jul 2016 01:08:37 -0700 (PDT) Received: from rpluim-XPS-15-9530 ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id u125sm2017943wmg.22.2016.07.21.01.08.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jul 2016 01:08:36 -0700 (PDT) From: Robert Pluim To: nljlistbox2@gmail.com (N. Jackson) Subject: Re: bug#23917: 25.0.95; commit 3a9d6296b35e5317c497674d5725eb52699bd3b8 causing org-capture to error out References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <87h9bj2zsl.fsf_-_@moondust.awandering> X-Debbugs-No-Ack: yes Gmane-Reply-To-List: yes Date: Thu, 21 Jul 2016 10:08:33 +0200 In-Reply-To: <87h9bj2zsl.fsf_-_@moondust.awandering> (N. Jackson's message of "Thu, 21 Jul 2016 04:52:42 -0300") Message-ID: <87poq7xvjy.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, Eli Zaretskii , 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: -0.7 (/) nljlistbox2@gmail.com (N. Jackson) writes: > At 21:09 +0300 on Monday 2016-07-18, Eli Zaretskii wrote: > >> diff --git a/lisp/subr.el b/lisp/subr.el >> index e9e19d3..1bb1cb3 100644 >> --- a/lisp/subr.el >> +++ b/lisp/subr.el >> @@ -3466,7 +3466,7 @@ save-match-data >> ;; if you need to recompile all the Lisp files using interpreted code. >> (declare (indent 0) (debug t)) >> (list 'let >> - '((save-match-data-internal (match-data))) >> + '((save-match-data-internal (match-data 'integers))) >> (list 'unwind-protect >> (cons 'progn body) >> ;; It is safe to free (evaporate) markers immediately here, > > FWIW on my system applying this patch does not resolve the org-capture > issue. I'm testing with org-20160718 from GNU Elpa and latest Emacs 25 > branch from the git (Repository revision: 4157159a37b43712440da91a45a6d5f= 71eb96e8a). > > With these versions of Org and Emacs and your patch applied, with a > recipe similar to that posted by Robert Pluim on 2016-07-18, > specifically > > src/emacs -Q > > M-: (custom-set-variables '(package-selected-packages (quote (org-20160= 718)))) RET > M-x package-initialize RET > > C-x C-f ; find file. > C-S-backspace ; kill-whole-line. > ~/.notes RET ; Open the file expected by default capture template. > M-x org-mode RET ; put the buffer into Org Mode. > M-x org-capture RET t ; Run the default "Task" capture template bound t= o the t key. > > I get the error:=20 > > org-capture: Capture template =E2=80=98t=E2=80=99: Match data clobbered= by buffer modification hooks save-match-data is a macro. Did you recompile org with the modified emacs? That patch works for me when using that version of org uncompiled. Regards Robert From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 21 04:19:52 2016 Received: (at 23917) by debbugs.gnu.org; 21 Jul 2016 08:19:52 +0000 Received: from localhost ([127.0.0.1]:59270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ9Cy-00067R-BK for submit@debbugs.gnu.org; Thu, 21 Jul 2016 04:19:52 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33105) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ9Cw-00067E-AU for 23917@debbugs.gnu.org; Thu, 21 Jul 2016 04:19:50 -0400 Received: by mail-wm0-f66.google.com with SMTP id o80so1651295wme.0 for <23917@debbugs.gnu.org>; Thu, 21 Jul 2016 01:19:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:gmane-reply-to-list:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=Y7XZ2CHJ0JJxUaRyZzjRBJ85ReB7NqyxHMyPFOKkDBA=; b=oOT6lpJ8744ftadhYujWGlbA0iIbNgleuJibVj240eM/Q/CGIjAuhue4mmVjf3cWB6 S1P4HcPDVvQyrA4bvbMlD8F+sD5cP8MB/ijvx8sq0kG9VxU0i3wr4ZnOFD55cwhajaUW DylOh1zX76A6Gu083qLnVZOxw5rV3mHT5QioFD2Aa8ujjucOHnMuCoeIrd81LYnyv8nx DIzRsY/8UaYmjc5iSXB42fWvViLGgXjvkKHL2ALkahnpcNK/71w5GXEkFnwq/6ZmUfFm 0uMjKdoYhNWbA1lz99ipcO0EkJdLNuVS0uQObeREYJ+dK2hcZx2O7vlMPtqhYk3N2tKH 0NQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references :gmane-reply-to-list:date:in-reply-to:message-id:user-agent :mime-version:content-transfer-encoding; bh=Y7XZ2CHJ0JJxUaRyZzjRBJ85ReB7NqyxHMyPFOKkDBA=; b=cJOnhmHOYlE7lmsDZdtgYLD9vjm5yRgR/vYoU5FSqYOqY1KBqdC/AQPPU+fRxRelq1 UkZEEEkzz1q1h0yMB2FmHB69K3hxpjON2omqajPkrTYBLLczahTmZ2J8Rpba4xVEK/v7 YXEldhc0KRdKNS3fQGV+PJ3WP4ayVyYStxKYbDEHslSh0TNRllj0R23cYXspWHx0c29u ynOfOpuandXtpCrG8todLsv2P5yilFRUyaBPJbcf9YwXweDQLsvlkhYlAg6qsKjhYFqK 1jQoHY46jh1+GmjOqVIXeYBqeQ35GghJkcfye6tyGkUL5MzQElxWtXZvmQtyc2G6ofrw 7WPA== X-Gm-Message-State: ALyK8tJvG1E2+YEjqrVuZY+Gk7QBZ63cMjsbFC9Totr/2qKijLsEmrEpY10XRA8M7DPakg== X-Received: by 10.28.175.16 with SMTP id y16mr6958015wme.64.1469089184782; Thu, 21 Jul 2016 01:19:44 -0700 (PDT) Received: from rpluim-XPS-15-9530 ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id r13sm2103638wmf.12.2016.07.21.01.19.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jul 2016 01:19:44 -0700 (PDT) From: Robert Pluim To: nljlistbox2@gmail.com (N. Jackson) Subject: Re: bug#23917: 25.0.95; commit 3a9d6296b35e5317c497674d5725eb52699bd3b8 causing org-capture to error out References: <87vb066ejv.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> <87bn1rdd1f.fsf@users.sourceforge.net> <87a8hb2zgt.fsf_-___1286.15575745261$1469088239$gmane$org@moondust.awandering> X-Debbugs-No-Ack: yes Gmane-Reply-To-List: yes Date: Thu, 21 Jul 2016 10:19:43 +0200 In-Reply-To: <87a8hb2zgt.fsf_-___1286.15575745261$1469088239$gmane$org@moondust.awandering> (N. Jackson's message of "Thu, 21 Jul 2016 04:59:46 -0300") Message-ID: <874m7js8rk.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, Stefan Monnier , npostavs@users.sourceforge.net 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.7 (/) nljlistbox2@gmail.com (N. Jackson) writes: > At 20:56 -0400 on Wednesday 2016-07-20, npostavs@users.sourceforge.net wr= ote: >> >> From a8098080dff5f83f7cbcbec2bc263f9db3b45ad9 Mon Sep 17 00:00:00 2001 >> From: Noam Postavsky >> Date: Wed, 20 Jul 2016 20:15:14 -0400 >> Subject: [PATCH v1] Adjust match data before calling after-change-funs >> >> * src/insdel.c (replace_range): Add new parameter ADJUST_MATCH_DATA, if >> true. Update all callers except Freplace_match to pass 0 for the new >> parameter. >> * src/search.c (update_search_regs): New function, extracted from >> Freplace_match. >> (Freplace_match): Remove match data adjustment code, pass 1 for >> ADJUST_MATCH_DATA to replace_range instead. > FWIW on my system applying this patch only partially resolves the > org-capture issue. I'm testing with org-20160718 from GNU Elpa and > latest Emacs 25 branch from the git (Repository revision: > 4157159a37b43712440da91a45a6d5f71eb96e8a). > > The patch successfully eliminates the match-data-clobbered error/abort > during org-capture with all my capture templates when I have my entire > config loaded, but with a minimal recipe from emacs -Q the org-capture > match-data-clobbered error still occurs. > > The minimal recipe I'm testing with is similar to that posted by Robert > Pluim on 2016-07-18, specifically > > src/emacs -Q > > M-: (custom-set-variables '(package-selected-packages (quote (org-20160= 718)))) RET > M-x package-initialize RET > > C-x C-f ; find file. > C-S-backspace ; kill-whole-line. > ~/.notes RET ; Open the file expected by default capture template. > M-x org-mode RET ; put the buffer into Org Mode. > M-x org-capture RET t ; Run the default "Task" capture template bound t= o the t key. > > With your patch I still get the error:=20 > > org-capture: Capture template =E2=80=98t=E2=80=99: Match data clobbered= by buffer modification hooks > > . > > It puzzles me that your patch doesn't work for the emacs -Q recipe but > does work for my normal configuration, so much so that I suspected that > I had made a mistake, but I have reset and reapplied the patch three > times and I continue to see the same results. You're not alone: this patch doesn't fix the issue for me either with emacs -Q or with my normal capture templates. Regards Robert From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 21 09:20:07 2016 Received: (at 23917) by debbugs.gnu.org; 21 Jul 2016 13:20:07 +0000 Received: from localhost ([127.0.0.1]:59392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQDtX-0006tu-BZ for submit@debbugs.gnu.org; Thu, 21 Jul 2016 09:20:07 -0400 Received: from mail-it0-f54.google.com ([209.85.214.54]:36260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQDtV-0006tL-1C for 23917@debbugs.gnu.org; Thu, 21 Jul 2016 09:20:05 -0400 Received: by mail-it0-f54.google.com with SMTP id f6so13730025ith.1 for <23917@debbugs.gnu.org>; Thu, 21 Jul 2016 06:20:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=kSP65N5+azmCzjKQHnfysZIC3PG2JZ3sRUOMwVYlmIY=; b=cvujRAuZa1sbyd/0EisBopGiMsgMV+eKxwHR4tYqGqvwzDoulIO+5tRb6kbk7cwX3r 4A5451sbmpKWODzdXPUmByklRHrL6IHJs9+bmYiSJDZBCJfj0kTaspGWCy7+AHGNF8Uk /PBOrfXS5Y50Tuuf81GHVRfD3NF2Qm3tC7WGwHNQKfqq6wbcGjTmqkPSoGtJkl6HMRNW A2W8zG4IluCgIE4tvRThsIHW6kHQ57j/ryTA1x4CFXFFmd/WBFJTzwlCtner6ek9oT/3 B0nmQLH9rE9+42n3bVJtOtMS7xoUWVUQryizDhNAMLFpwGdtmXhPgq5kA9ou+O6SFlMd pqCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=kSP65N5+azmCzjKQHnfysZIC3PG2JZ3sRUOMwVYlmIY=; b=LhMfXyWUIZCJOuizX0bXKHGo+25+bmhNCisq/fql6Et8jhKDVqFdVBjG4dJvP7v8ma SAy3wJ+Ag7bV5xnWeStX7viXAEoeZlioBgn/6JDq2vWIXCQNWVfbRxHQT3UsCEOAonYf sE+QeplznBZgscs74zgVfWvBEz9pGJK4pAkvQX2v8SrAvhDrGgpu15MEd8Ak5C4jXBTa dodNLtxkBHCd4aibzGGA62PrTBEWkrb2yGPwPt8Ayer/EkL4wMfPldI2yBW2MO2m2EVq 7U/NLnFw1ogtZNDa2HGzpFlwjBJv1TepX0/Pl8cFoQHuGBA4JJ7xQeBJaim9WUOOt2N6 vuqw== X-Gm-Message-State: ALyK8tKhtBiDqnNV8Zsa0tR8ix1qxyBXkcd44luN82SbHjmPcxNGnRzAZJDp/mzV4twvkg== X-Received: by 10.36.125.70 with SMTP id b67mr62357521itc.24.1469107199479; Thu, 21 Jul 2016 06:19:59 -0700 (PDT) Received: from moondust.nodomain.none (blk-138-64-179.eastlink.ca. [24.138.64.179]) by smtp.gmail.com with ESMTPSA id o188sm1247149itg.11.2016.07.21.06.19.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Jul 2016 06:19:58 -0700 (PDT) From: nljlistbox2@gmail.com (N. Jackson) To: Robert Pluim Subject: Re: bug#23917: 25.0.95; commit 3a9d6296b35e5317c497674d5725eb52699bd3b8 causing org-capture to error out References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <87h9bj2zsl.fsf_-_@moondust.awandering> <87poq7xvjy.fsf@gmail.com> Date: Thu, 21 Jul 2016 10:19:57 -0300 In-Reply-To: <87poq7xvjy.fsf@gmail.com> (Robert Pluim's message of "Thu, 21 Jul 2016 10:08:33 +0200") Message-ID: <871t2nyvpe.fsf@moondust.awandering> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, Eli Zaretskii , 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: -0.5 (/) At 10:08 +0200 on Thursday 2016-07-21, Robert Pluim wrote: >> > nljlistbox2@gmail.com (N. Jackson) writes: > >> At 21:09 +0300 on Monday 2016-07-18, Eli Zaretskii wrote: >> >>> diff --git a/lisp/subr.el b/lisp/subr.el >>> index e9e19d3..1bb1cb3 100644 >>> --- a/lisp/subr.el >>> +++ b/lisp/subr.el >>> @@ -3466,7 +3466,7 @@ save-match-data >>> ;; if you need to recompile all the Lisp files using interpreted code. >>> (declare (indent 0) (debug t)) >>> (list 'let >>> - '((save-match-data-internal (match-data))) >>> + '((save-match-data-internal (match-data 'integers))) >>> (list 'unwind-protect >>> (cons 'progn body) >>> ;; It is safe to free (evaporate) markers immediately here, >> >> FWIW on my system applying this patch does not resolve the org-capture >> issue. I'm testing with org-20160718 from GNU Elpa and latest Emacs 25 >> branch from the git (Repository revision: 4157159a37b43712440da91a45a6d5f71eb96e8a). > > save-match-data is a macro. Did you recompile org with the modified > emacs? Thanks Robert. I failed to take that into account. After re-applying Eli's patch above and then rebuilding Org Mode from GNU Elpa (now org-20160719), the org-capture match-data-clobbered error/abort no longer occurs, neither with the simple recipe in emacs -Q nor with my own capture templates with my full config loaded. Sorry for the noise. [For completeness, I should say that I then removed the patch and rebuilt org-20160719 again, and confirmed that it does trigger the bug in both emacs -Q and with my configuration.] N. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 21 10:25:14 2016 Received: (at 23917) by debbugs.gnu.org; 21 Jul 2016 14:25:14 +0000 Received: from localhost ([127.0.0.1]:60549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQEuS-0000Gu-MD for submit@debbugs.gnu.org; Thu, 21 Jul 2016 10:25:14 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:36327) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQEuL-0000G7-O9 for 23917@debbugs.gnu.org; Thu, 21 Jul 2016 10:25:07 -0400 Received: by mail-it0-f65.google.com with SMTP id j124so1257233ith.3 for <23917@debbugs.gnu.org>; Thu, 21 Jul 2016 07:25:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:message-id:user-agent :mime-version; bh=2K+LGOnV+ml/PWusXDjxBgWvprikgy3g4kqIlT4R4Uk=; b=arO5KeouHXfIRL+PHH8wB0MdAztenlkG+os+lPhZtP67yUKmL7NLUOc8CkkTjnOL/O mwxEXcDI98regF58DEsfEndnyzO27xOc+9Pdg4MqjSnyG4ehOcfmMYO3c8E/jPdCBMhw 0ttSlL8dzc4aOAMBYYN10Dl+5PJ5KhjZOyV5PPxINUXGUL37raddYr4Kb9/djyvbPaX/ XfRtwiFUXhltVW6Ui7oGmhSKutCtZb0AuVruNBBKrYKdeMidQqey3TtDM8xhIsFe4M85 pRnXp24TNpa6LtFnRWuIEdZ0afHg4g4YptvJPsDP2pixW0jS7H9nBz2fpNIl+Pv7E5/S GVtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:message-id :user-agent:mime-version; bh=2K+LGOnV+ml/PWusXDjxBgWvprikgy3g4kqIlT4R4Uk=; b=Rn1zg9wEYASbXHz1GnFRN1DWrGEDn5G3yH9741/yC5PL+uIdp2hPaprmq4tWS19xLJ ubEkFkquhFr3Kg+ihQFcUFvU9oRoeY17SpfsJoxfa5kUHT1bZmv/FYvv4/4W5VHIbGAT gQmIbWSnoEQp4SOiDytJsi3WxeIzanTL25N6S/dbT/bS1O7M8zVZWO8sxjEm5++TaUXp 91+G4fhyMoZypv1vq61WlKD9eV4wvBAJBoWvTRzbxCeAtrKqAIHer8eC66B+leu776/A oUk5WApCqFGih6kbSRbk2mH2iDJwlqA0/M41ZlkwFSbTpOjeaDe9vI0A8jt5XkjXxpMe TPIA== X-Gm-Message-State: ALyK8tLYsC7XrTVP6A2EGYmfYDJSUeEotdKOyh0HozVp/Ij29P95Zr0lP4AZAX2Y+HTDiA== X-Received: by 10.36.135.133 with SMTP id f127mr15482061ite.23.1469111096024; Thu, 21 Jul 2016 07:24:56 -0700 (PDT) Received: from moondust.nodomain.none (blk-138-64-179.eastlink.ca. [24.138.64.179]) by smtp.gmail.com with ESMTPSA id s69sm571100ios.20.2016.07.21.07.24.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Jul 2016 07:24:55 -0700 (PDT) From: nljlistbox2@gmail.com (N. Jackson) To: Robert Pluim Subject: Re: bug#23917: 25.0.95; commit 3a9d6296b35e5317c497674d5725eb52699bd3b8 causing org-capture to error out References: <87vb066ejv.fsf@linaro.org> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> <87bn1rdd1f.fsf@users.sourceforge.net> <87a8hb2zgt.fsf_-___1286.15575745261$1469088239$gmane$org@moondust.awandering> <874m7js8rk.fsf@gmail.com> Date: Thu, 21 Jul 2016 11:24:53 -0300 Message-ID: <87lh0vvzka.fsf@moondust.awandering> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 23917 Cc: 23917@debbugs.gnu.org, Eli Zaretskii , Stefan Monnier , npostavs@users.sourceforge.net 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.4 (/) At 10:19 +0200 on Thursday 2016-07-21, Robert Pluim wrote: > > nljlistbox2@gmail.com (N. Jackson) writes: > >> At 20:56 -0400 on Wednesday 2016-07-20, npostavs@users.sourceforge.net wrote: >>> >>> From: Noam Postavsky >>> Subject: [PATCH v1] Adjust match data before calling after-change-funs >> >> It puzzles me that your patch doesn't work for the emacs -Q recipe but >> does work for my normal configuration, so much so that I suspected that >> I had made a mistake, but I have reset and reapplied the patch three >> times and I continue to see the same results. > > You're not alone: this patch doesn't fix the issue for me either with > emacs -Q or with my normal capture templates. FWIW, taking into account that I needed to rebuild Org Mode using the patched Emacs, I redid my tests of Noam's patch and got the same puzzling results as before. That is the patch *does* fix the problem for me with my normal caputure templates, but it does not fix the problem with the simple recipe in emacs -Q. N. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 21 10:26:38 2016 Received: (at 23917) by debbugs.gnu.org; 21 Jul 2016 14:26:38 +0000 Received: from localhost ([127.0.0.1]:60554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQEvq-0000J2-Iv for submit@debbugs.gnu.org; Thu, 21 Jul 2016 10:26:38 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46521) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQEvl-0000Im-NA for 23917@debbugs.gnu.org; Thu, 21 Jul 2016 10:26:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQEvd-00022W-DH for 23917@debbugs.gnu.org; Thu, 21 Jul 2016 10:26: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=-0.5 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49334) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQEvT-00020Q-Jo; Thu, 21 Jul 2016 10:26:11 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4915 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bQEvR-0006yv-Ek; Thu, 21 Jul 2016 10:26:09 -0400 Date: Thu, 21 Jul 2016 17:26:15 +0300 Message-Id: <83a8hbysmw.fsf@gnu.org> From: Eli Zaretskii To: npostavs@users.sourceforge.net In-reply-to: <877fcfd79w.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) Subject: Re: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> <87bn1rdd1f.fsf@users.sourceforge.net> <83h9bjzp5i.fsf@gnu.org> <877fcfd79w.fsf@users.sourceforge.net> 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: -6.3 (------) X-Debbugs-Envelope-To: 23917 Cc: nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, monnier@iro.umontreal.ca, alex.bennee@linaro.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: -6.3 (------) > From: npostavs@users.sourceforge.net > Cc: 23917@debbugs.gnu.org, nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, monnier@iro.umontreal.ca, alex.bennee@linaro.org > Date: Wed, 20 Jul 2016 23:00:59 -0400 > > > Please also make sure bug#23869 is still fixed after this. > > Following the recipe in > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23869#11 gives me 'Lisp > error: (error "Match data clobbered by buffer modification hooks")', > that indicates it's still fixed, right? Yes, but I thought we want to remove the error-out code. Since we now protect ourselves from clobbered data, we don't need that extra protection, and I think leaving it in place will cause false positives (as a few people already reported). That's because the adjustment of the search registers in the new function you introduce will itself trigger the error message, won't it? Perhaps we should error out only if the number of registers changed, because that can never be valid, I think. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 21 21:08:51 2016 Received: (at 23917) by debbugs.gnu.org; 22 Jul 2016 01:08:51 +0000 Received: from localhost ([127.0.0.1]:60680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQOxO-0006wQ-VS for submit@debbugs.gnu.org; Thu, 21 Jul 2016 21:08:51 -0400 Received: from mail-it0-f41.google.com ([209.85.214.41]:37147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQOxM-0006w6-Ar for 23917@debbugs.gnu.org; Thu, 21 Jul 2016 21:08:50 -0400 Received: by mail-it0-f41.google.com with SMTP id f6so33426225ith.0 for <23917@debbugs.gnu.org>; Thu, 21 Jul 2016 18:08:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=HkTS3ak4LBxMjkJfrVTx/f1xUO79p1G/TDuUP5eTTDw=; b=clVm7p9Bp0TKmbt4q46pXkdghRlXrypO5CI4hzq95GAkGZRrMmIYRVw6S1Fo7lMqce MpeaOGdZ+lXyFGs01tw2g2yQtf8XFQiAD6I+BeaNjuL1SrF3amx5GKPg21to270sONmk FmStzX4e0VpegOcch/Fu+i+RRYSQZ/zdIelsgM5EEtw6XdNoaRcmtq/BnXgOlI2vhlys jv3Pydm79qjJjTxzPM4/dx5XHIIFnW5WV/bbMNJKD/U3hpmaUQsHbl7vo3LRezYhchQf A3BKzCZDsmNLk/qvgUiZ9C6fhnF0i5ZNzjpBoTOMALzkNle2N0Z0VlrUlZLNMs1Z0IuR RzGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=HkTS3ak4LBxMjkJfrVTx/f1xUO79p1G/TDuUP5eTTDw=; b=PpAGzWTVKr3z45yORw1Tm5k2OtYjIohx1lXIcPcIfWEwBuohEKIRVnbp7klvZUDIN5 naXEERPF2rMBBXi0LpQPi+yCChiUNFa6rPEHCySrBuT72fxvgvDoBjSIIeIsQMh6Px4n o5Huhxv1w3BLKtUXscL3KaKzO0N4bP+cKKJEPo7TTb2YdiFyvORrnojqA/65tkjEK4Li AxMzbUa0Wu2uyU7TXT53WoBGJ0kUlNB+92i9LUpDw7XRb5Cm+B8OLg/Ap/9M2QBFuljc /lkuSOjMaw6dIDhp0Sm+4pomG19H53PnH6fpLIm+p9i6y48PRdJ15n6ngdixAJon5F8W CimA== X-Gm-Message-State: AEkoousXQlZVJjcs36FX+Z66pYJzzMc+E5DilE2y+B2mpSA1f4DpkVmNqzfLrOLU/QIZEA== X-Received: by 10.36.57.211 with SMTP id l202mr1312491ita.22.1469149722870; Thu, 21 Jul 2016 18:08:42 -0700 (PDT) Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id a65sm2400228itd.18.2016.07.21.18.08.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jul 2016 18:08:41 -0700 (PDT) From: npostavs@users.sourceforge.net To: Eli Zaretskii Subject: Re: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> <87bn1rdd1f.fsf@users.sourceforge.net> <83h9bjzp5i.fsf@gnu.org> <877fcfd79w.fsf@users.sourceforge.net> <83a8hbysmw.fsf@gnu.org> Date: Thu, 21 Jul 2016 21:08:43 -0400 In-Reply-To: <83a8hbysmw.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 21 Jul 2016 17:26:15 +0300") Message-ID: <874m7icwdg.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23917 Cc: nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, monnier@iro.umontreal.ca, alex.bennee@linaro.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.7 (/) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: npostavs@users.sourceforge.net >> Cc: 23917@debbugs.gnu.org, nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, monnier@iro.umontreal.ca, alex.bennee@linaro.org >> Date: Wed, 20 Jul 2016 23:00:59 -0400 >> >> > Please also make sure bug#23869 is still fixed after this. >> >> Following the recipe in >> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23869#11 gives me 'Lisp >> error: (error "Match data clobbered by buffer modification hooks")', >> that indicates it's still fixed, right? > > Yes, but I thought we want to remove the error-out code. Since we now > protect ourselves from clobbered data, we don't need that extra > protection, and I think leaving it in place will cause false positives > (as a few people already reported). That's because the adjustment of > the search registers in the new function you introduce will itself > trigger the error message, won't it? I made the same adjustments to the saved sub_start and sub_end variables, but I had a mistake in that adjustment which caused the false positives. Fixed in the attached v2 patch. We could just drop the check, though I've already found it useful to catch bugs (https://github.com/joaotavora/yasnippet/issues/720). If I drop the checks (see attached v3 patch), then after following the bug#23869 recipe, I get: ## -*- Octave -*- -module(bug). -export([identity/1, is_even/1, size/1, reverse/1]). --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=v2-0001-Adjust-match-data-before-calling-after-change-fun.patch Content-Description: patch v2 >From 3e8f9b9f89108bcebf04e06e41a5ce2c719c6ad2 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Wed, 20 Jul 2016 20:15:14 -0400 Subject: [PATCH v2] Adjust match data before calling after-change-funs * src/insdel.c (replace_range): Add new parameter ADJUST_MATCH_DATA, if true call update_search_regs. Update all callers (except Freplace_match) to pass 0 for the new parameter. * src/search.c (update_search_regs): New function, extracted from Freplace_match. (Freplace_match): Remove match data adjustment code, pass 1 for ADJUST_MATCH_DATA to replace_range instead. --- src/cmds.c | 2 +- src/editfns.c | 6 +++--- src/insdel.c | 10 ++++++++-- src/lisp.h | 4 +++- src/search.c | 52 ++++++++++++++++++++++++++++++---------------------- 5 files changed, 45 insertions(+), 29 deletions(-) diff --git a/src/cmds.c b/src/cmds.c index 1e44ddd..4003d8b 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -447,7 +447,7 @@ internal_self_insert (int c, EMACS_INT n) string = concat2 (string, tem); } - replace_range (PT, PT + chars_to_delete, string, 1, 1, 1); + replace_range (PT, PT + chars_to_delete, string, 1, 1, 1, 0); Fforward_char (make_number (n)); } else if (n > 1) diff --git a/src/editfns.c b/src/editfns.c index 412745d..32c8bec 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3192,7 +3192,7 @@ DEFUN ("subst-char-in-region", Fsubst_char_in_region, /* replace_range is less efficient, because it moves the gap, but it handles combining correctly. */ replace_range (pos, pos + 1, string, - 0, 0, 1); + 0, 0, 1, 0); pos_byte_next = CHAR_TO_BYTE (pos); if (pos_byte_next > pos_byte) /* Before combining happened. We should not increment @@ -3405,7 +3405,7 @@ DEFUN ("translate-region-internal", Ftranslate_region_internal, /* This is less efficient, because it moves the gap, but it should handle multibyte characters correctly. */ string = make_multibyte_string ((char *) str, 1, str_len); - replace_range (pos, pos + 1, string, 1, 0, 1); + replace_range (pos, pos + 1, string, 1, 0, 1, 0); len = str_len; } else @@ -3446,7 +3446,7 @@ DEFUN ("translate-region-internal", Ftranslate_region_internal, { string = Fmake_string (make_number (1), val); } - replace_range (pos, pos + len, string, 1, 0, 1); + replace_range (pos, pos + len, string, 1, 0, 1, 0); pos_byte += SBYTES (string); pos += SCHARS (string); cnt += SCHARS (string); diff --git a/src/insdel.c b/src/insdel.c index 4ad1074..fc3f19f 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1268,7 +1268,9 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t from_byte, /* Replace the text from character positions FROM to TO with NEW, If PREPARE, call prepare_to_modify_buffer. If INHERIT, the newly inserted text should inherit text properties - from the surrounding non-deleted text. */ + from the surrounding non-deleted text. + If ADJUST_MATCH_DATA, then adjust the match data before calling + signal_after_change. */ /* Note that this does not yet handle markers quite right. Also it needs to record a single undo-entry that does a replacement @@ -1279,7 +1281,8 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t from_byte, void replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new, - bool prepare, bool inherit, bool markers) + bool prepare, bool inherit, bool markers, + bool adjust_match_data) { ptrdiff_t inschars = SCHARS (new); ptrdiff_t insbytes = SBYTES (new); @@ -1426,6 +1429,9 @@ replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new, MODIFF++; CHARS_MODIFF = MODIFF; + if (adjust_match_data) + update_search_regs (from, to, from + SCHARS (new)); + signal_after_change (from, nchars_del, GPT - from); update_compositions (from, GPT, CHECK_BORDER); } diff --git a/src/lisp.h b/src/lisp.h index 6a98adb..25f811e 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3516,7 +3516,7 @@ extern void adjust_after_insert (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t); extern void adjust_markers_for_delete (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t); -extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, bool, bool, bool); +extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, bool, bool, bool, bool); extern void replace_range_2 (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, const char *, ptrdiff_t, ptrdiff_t, bool); extern void syms_of_insdel (void); @@ -3994,6 +3994,8 @@ extern Lisp_Object make_temp_name (Lisp_Object, bool); /* Defined in search.c. */ extern void shrink_regexp_cache (void); extern void restore_search_regs (void); +extern void update_search_regs (ptrdiff_t oldstart, + ptrdiff_t oldend, ptrdiff_t newend); extern void record_unwind_save_match_data (void); struct re_registers; extern struct re_pattern_buffer *compile_pattern (Lisp_Object, diff --git a/src/search.c b/src/search.c index 5c949ad..4bd6a46 100644 --- a/src/search.c +++ b/src/search.c @@ -2724,11 +2724,18 @@ DEFUN ("replace-match", Freplace_match, Sreplace_match, 1, 5, 0, ptrdiff_t sub_start = search_regs.start[sub]; ptrdiff_t sub_end = search_regs.end[sub]; unsigned num_regs = search_regs.num_regs; + newpoint = search_regs.start[sub] + SCHARS (newtext); /* Replace the old text with the new in the cleanest possible way. */ replace_range (search_regs.start[sub], search_regs.end[sub], - newtext, 1, 0, 1); - newpoint = search_regs.start[sub] + SCHARS (newtext); + newtext, 1, 0, 1, 1); + /* Update saved data to match adjustment made by replace_range. */ + { + ptrdiff_t change = newpoint - sub_end; + if (sub_start >= sub_end) + sub_start += change; + sub_end += change; + } if (case_action == all_caps) Fupcase_region (make_number (search_regs.start[sub]), @@ -2742,26 +2749,6 @@ DEFUN ("replace-match", Freplace_match, Sreplace_match, 1, 5, 0, || search_regs.num_regs != num_regs) error ("Match data clobbered by buffer modification hooks"); - /* Adjust search data for this change. */ - { - ptrdiff_t oldend = search_regs.end[sub]; - ptrdiff_t oldstart = search_regs.start[sub]; - ptrdiff_t change = newpoint - search_regs.end[sub]; - ptrdiff_t i; - - for (i = 0; i < search_regs.num_regs; i++) - { - if (search_regs.start[i] >= oldend) - search_regs.start[i] += change; - else if (search_regs.start[i] > oldstart) - search_regs.start[i] = oldstart; - if (search_regs.end[i] >= oldend) - search_regs.end[i] += change; - else if (search_regs.end[i] > oldstart) - search_regs.end[i] = oldstart; - } - } - /* Put point back where it was in the text. */ if (opoint <= 0) TEMP_SET_PT (opoint + ZV); @@ -3102,6 +3089,27 @@ restore_search_regs (void) } } +/* Called from replace-match via replace_range. */ +void +update_search_regs (ptrdiff_t oldstart, ptrdiff_t oldend, ptrdiff_t newend) +{ + /* Adjust search data for this change. */ + ptrdiff_t change = newend - oldend; + ptrdiff_t i; + + for (i = 0; i < search_regs.num_regs; i++) + { + if (search_regs.start[i] >= oldend) + search_regs.start[i] += change; + else if (search_regs.start[i] > oldstart) + search_regs.start[i] = oldstart; + if (search_regs.end[i] >= oldend) + search_regs.end[i] += change; + else if (search_regs.end[i] > oldstart) + search_regs.end[i] = oldstart; + } +} + static void unwind_set_match_data (Lisp_Object list) { -- 2.8.0 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=v3-0001-Adjust-match-data-before-calling-after-change-fun.patch Content-Description: patch v3 >From bb533ffd333a28d2ea8bdb6c81b79eb4eda89fcc Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Wed, 20 Jul 2016 20:15:14 -0400 Subject: [PATCH v3] Adjust match data before calling after-change-funs * src/insdel.c (replace_range): Add new parameter ADJUST_MATCH_DATA, if true call update_search_regs. Update all callers (except Freplace_match) to pass 0 for the new parameter. * src/search.c (update_search_regs): New function, extracted from Freplace_match. (Freplace_match): Remove match data adjustment code, pass 1 for ADJUST_MATCH_DATA to replace_range instead. Remove checks for match data modification. --- src/cmds.c | 2 +- src/editfns.c | 6 +++--- src/insdel.c | 10 ++++++++-- src/lisp.h | 4 +++- src/search.c | 57 +++++++++++++++++++++++---------------------------------- 5 files changed, 38 insertions(+), 41 deletions(-) diff --git a/src/cmds.c b/src/cmds.c index 1e44ddd..4003d8b 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -447,7 +447,7 @@ internal_self_insert (int c, EMACS_INT n) string = concat2 (string, tem); } - replace_range (PT, PT + chars_to_delete, string, 1, 1, 1); + replace_range (PT, PT + chars_to_delete, string, 1, 1, 1, 0); Fforward_char (make_number (n)); } else if (n > 1) diff --git a/src/editfns.c b/src/editfns.c index 412745d..32c8bec 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3192,7 +3192,7 @@ DEFUN ("subst-char-in-region", Fsubst_char_in_region, /* replace_range is less efficient, because it moves the gap, but it handles combining correctly. */ replace_range (pos, pos + 1, string, - 0, 0, 1); + 0, 0, 1, 0); pos_byte_next = CHAR_TO_BYTE (pos); if (pos_byte_next > pos_byte) /* Before combining happened. We should not increment @@ -3405,7 +3405,7 @@ DEFUN ("translate-region-internal", Ftranslate_region_internal, /* This is less efficient, because it moves the gap, but it should handle multibyte characters correctly. */ string = make_multibyte_string ((char *) str, 1, str_len); - replace_range (pos, pos + 1, string, 1, 0, 1); + replace_range (pos, pos + 1, string, 1, 0, 1, 0); len = str_len; } else @@ -3446,7 +3446,7 @@ DEFUN ("translate-region-internal", Ftranslate_region_internal, { string = Fmake_string (make_number (1), val); } - replace_range (pos, pos + len, string, 1, 0, 1); + replace_range (pos, pos + len, string, 1, 0, 1, 0); pos_byte += SBYTES (string); pos += SCHARS (string); cnt += SCHARS (string); diff --git a/src/insdel.c b/src/insdel.c index 4ad1074..fc3f19f 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1268,7 +1268,9 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t from_byte, /* Replace the text from character positions FROM to TO with NEW, If PREPARE, call prepare_to_modify_buffer. If INHERIT, the newly inserted text should inherit text properties - from the surrounding non-deleted text. */ + from the surrounding non-deleted text. + If ADJUST_MATCH_DATA, then adjust the match data before calling + signal_after_change. */ /* Note that this does not yet handle markers quite right. Also it needs to record a single undo-entry that does a replacement @@ -1279,7 +1281,8 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t from_byte, void replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new, - bool prepare, bool inherit, bool markers) + bool prepare, bool inherit, bool markers, + bool adjust_match_data) { ptrdiff_t inschars = SCHARS (new); ptrdiff_t insbytes = SBYTES (new); @@ -1426,6 +1429,9 @@ replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new, MODIFF++; CHARS_MODIFF = MODIFF; + if (adjust_match_data) + update_search_regs (from, to, from + SCHARS (new)); + signal_after_change (from, nchars_del, GPT - from); update_compositions (from, GPT, CHECK_BORDER); } diff --git a/src/lisp.h b/src/lisp.h index 6a98adb..25f811e 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3516,7 +3516,7 @@ extern void adjust_after_insert (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t); extern void adjust_markers_for_delete (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t); -extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, bool, bool, bool); +extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, bool, bool, bool, bool); extern void replace_range_2 (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, const char *, ptrdiff_t, ptrdiff_t, bool); extern void syms_of_insdel (void); @@ -3994,6 +3994,8 @@ extern Lisp_Object make_temp_name (Lisp_Object, bool); /* Defined in search.c. */ extern void shrink_regexp_cache (void); extern void restore_search_regs (void); +extern void update_search_regs (ptrdiff_t oldstart, + ptrdiff_t oldend, ptrdiff_t newend); extern void record_unwind_save_match_data (void); struct re_registers; extern struct re_pattern_buffer *compile_pattern (Lisp_Object, diff --git a/src/search.c b/src/search.c index 5c949ad..7da1d86 100644 --- a/src/search.c +++ b/src/search.c @@ -2717,18 +2717,11 @@ DEFUN ("replace-match", Freplace_match, Sreplace_match, 1, 5, 0, xfree (substed); } - /* The functions below modify the buffer, so they could trigger - various modification hooks (see signal_before_change and - signal_after_change), which might clobber the match data we need - to adjust after the replacement. If that happens, we error out. */ - ptrdiff_t sub_start = search_regs.start[sub]; - ptrdiff_t sub_end = search_regs.end[sub]; - unsigned num_regs = search_regs.num_regs; + newpoint = search_regs.start[sub] + SCHARS (newtext); /* Replace the old text with the new in the cleanest possible way. */ replace_range (search_regs.start[sub], search_regs.end[sub], - newtext, 1, 0, 1); - newpoint = search_regs.start[sub] + SCHARS (newtext); + newtext, 1, 0, 1, 1); if (case_action == all_caps) Fupcase_region (make_number (search_regs.start[sub]), @@ -2737,31 +2730,6 @@ DEFUN ("replace-match", Freplace_match, Sreplace_match, 1, 5, 0, Fupcase_initials_region (make_number (search_regs.start[sub]), make_number (newpoint)); - if (search_regs.start[sub] != sub_start - || search_regs.end[sub] != sub_end - || search_regs.num_regs != num_regs) - error ("Match data clobbered by buffer modification hooks"); - - /* Adjust search data for this change. */ - { - ptrdiff_t oldend = search_regs.end[sub]; - ptrdiff_t oldstart = search_regs.start[sub]; - ptrdiff_t change = newpoint - search_regs.end[sub]; - ptrdiff_t i; - - for (i = 0; i < search_regs.num_regs; i++) - { - if (search_regs.start[i] >= oldend) - search_regs.start[i] += change; - else if (search_regs.start[i] > oldstart) - search_regs.start[i] = oldstart; - if (search_regs.end[i] >= oldend) - search_regs.end[i] += change; - else if (search_regs.end[i] > oldstart) - search_regs.end[i] = oldstart; - } - } - /* Put point back where it was in the text. */ if (opoint <= 0) TEMP_SET_PT (opoint + ZV); @@ -3102,6 +3070,27 @@ restore_search_regs (void) } } +/* Called from replace-match via replace_range. */ +void +update_search_regs (ptrdiff_t oldstart, ptrdiff_t oldend, ptrdiff_t newend) +{ + /* Adjust search data for this change. */ + ptrdiff_t change = newend - oldend; + ptrdiff_t i; + + for (i = 0; i < search_regs.num_regs; i++) + { + if (search_regs.start[i] >= oldend) + search_regs.start[i] += change; + else if (search_regs.start[i] > oldstart) + search_regs.start[i] = oldstart; + if (search_regs.end[i] >= oldend) + search_regs.end[i] += change; + else if (search_regs.end[i] > oldstart) + search_regs.end[i] = oldstart; + } +} + static void unwind_set_match_data (Lisp_Object list) { -- 2.8.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 22 02:43:22 2016 Received: (at 23917) by debbugs.gnu.org; 22 Jul 2016 06:43:22 +0000 Received: from localhost ([127.0.0.1]:60739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQUB7-0007LF-PE for submit@debbugs.gnu.org; Fri, 22 Jul 2016 02:43:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46936) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQUB6-0007L2-3n for 23917@debbugs.gnu.org; Fri, 22 Jul 2016 02:43:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQUAz-0007eV-Nh for 23917@debbugs.gnu.org; Fri, 22 Jul 2016 02:43:14 -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.3 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQUAm-0007cM-GU; Fri, 22 Jul 2016 02:43:00 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1380 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bQUAk-00070o-9M; Fri, 22 Jul 2016 02:42:58 -0400 Date: Fri, 22 Jul 2016 09:43:05 +0300 Message-Id: <83fur2xjeu.fsf@gnu.org> From: Eli Zaretskii To: npostavs@users.sourceforge.net In-reply-to: <874m7icwdg.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) Subject: Re: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> <87bn1rdd1f.fsf@users.sourceforge.net> <83h9bjzp5i.fsf@gnu.org> <877fcfd79w.fsf@users.sourceforge.net> <83a8hbysmw.fsf@gnu.org> <874m7icwdg.fsf@users.sourceforge.net> 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: -6.3 (------) X-Debbugs-Envelope-To: 23917 Cc: nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, monnier@iro.umontreal.ca, alex.bennee@linaro.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: -6.3 (------) > From: npostavs@users.sourceforge.net > Cc: 23917@debbugs.gnu.org, nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, monnier@iro.umontreal.ca, alex.bennee@linaro.org > Date: Thu, 21 Jul 2016 21:08:43 -0400 > > I made the same adjustments to the saved sub_start and sub_end > variables, but I had a mistake in that adjustment which caused the false > positives. Fixed in the attached v2 patch. We could just drop the > check, though I've already found it useful to catch bugs > (https://github.com/joaotavora/yasnippet/issues/720). > > If I drop the checks (see attached v3 patch), then after following the > bug#23869 recipe, I get: > > ## -*- Octave -*- > -module(bug). > -export([identity/1, is_even/1, size/1, reverse/1]). OK, let's wait for a few days to give time to the people who were affected by the issue to test the patch, and if no new issues come up, please push the version with the error code to emacs-25. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 22 10:01:29 2016 Received: (at 23917) by debbugs.gnu.org; 22 Jul 2016 14:01:29 +0000 Received: from localhost ([127.0.0.1]:33840 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQb17-0004Yd-3z for submit@debbugs.gnu.org; Fri, 22 Jul 2016 10:01:29 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:38185) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQb15-0004YR-LT for 23917@debbugs.gnu.org; Fri, 22 Jul 2016 10:01:28 -0400 Received: by mail-wm0-f46.google.com with SMTP id o80so68017512wme.1 for <23917@debbugs.gnu.org>; Fri, 22 Jul 2016 07:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:gmane-reply-to-list:date:in-reply-to :message-id:user-agent:mime-version; bh=oF6gD52JxyKJJwTqDsk4yKG1YiMa7qs4W3we/jGT1Ew=; b=FmQT/T0asQ5pQAZ8GR0Vjs6ZaxJQr2f8ASxlKPkNXxfcdW67uVsVbTmYy1jNARifnQ M8jTbKzXuhoWTBbvSwf67utfKEwn0EcYX8qRko3NPTz8GZkOBW/MP1i//w2EbmOMnV9I cLr3TAYfeBmap6fu372ae/qrO8/lBrn0754MFITStBecSZUXh7T6o07AVfByNw4TMNwK WWSnKs+Vd/eP/RKc2u6osMcMNedYiCXd3JjZ6a1zo2aedMiZaRApxq7FLKFnOklQ4156 7LWw8lZ4WIKIBS7iaGV6vdHJtR7fRI2IQ32FPsaFIyL2XWuIwSI3cMSyrxx52Ylvm5Lt WYLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references :gmane-reply-to-list:date:in-reply-to:message-id:user-agent :mime-version; bh=oF6gD52JxyKJJwTqDsk4yKG1YiMa7qs4W3we/jGT1Ew=; b=cefr92WTadd7ukjikoxMGP2/bBklftbJujVMa2zEvVNsHlop+C0O84uRJf09/QZOCZ p6kx81zfyGZO7Vv0bt+TRman02DoxbyOMPS+t8AakFGvlpTqWYYLb/VrSYXPnRT2RHiZ EEC1OhQn/kkKzkk0M4Q672V9sdA7jUfQdW8nujAqbq8ubAPr491yl2cxx2P+ZV9sQkOd JHiWhXXwvVyeKkZ2qMXd9tp2KKkUwrXozjppYcV6NDdtPnDFv+fXzSGrCARe3IZpqL8W mFUUZN9dZBdsQ1rRJ+4TJKbX/o5t9v7a7AL+f8TaYwJnX0pdRGf0hn3+9gmEfI3D6jyC a8YQ== X-Gm-Message-State: ALyK8tJaqy9NkwAkhqqRERkiAN/X9nqRP2Q/T5tVVAcxt1iSk1EeaGPCzzityWc+aj+Oww== X-Received: by 10.28.229.19 with SMTP id c19mr27363179wmh.0.1469196082009; Fri, 22 Jul 2016 07:01:22 -0700 (PDT) Received: from rpluim-XPS-15-9530 ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id r127sm12695011wmf.23.2016.07.22.07.01.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jul 2016 07:01:20 -0700 (PDT) From: Robert Pluim To: Eli Zaretskii Subject: Re: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> <87bn1rdd1f.fsf@users.sourceforge.net> <83h9bjzp5i.fsf@gnu.org> <877fcfd79w.fsf@users.sourceforge.net> <83a8hbysmw.fsf@gnu.org> <874m7icwdg.fsf@users.sourceforge.net> <83fur2xjeu.fsf@gnu.org> X-Debbugs-No-Ack: yes Gmane-Reply-To-List: yes Date: Fri, 22 Jul 2016 16:01:19 +0200 In-Reply-To: <83fur2xjeu.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 22 Jul 2016 09:43:05 +0300") Message-ID: <87poq54vrk.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23917 Cc: nljlistbox2@gmail.com, npostavs@users.sourceforge.net, jwiegley@gmail.com, 23917@debbugs.gnu.org, monnier@iro.umontreal.ca, alex.bennee@linaro.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.7 (/) Eli Zaretskii writes: >> From: npostavs@users.sourceforge.net >> Cc: 23917@debbugs.gnu.org, nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, monnier@iro.umontreal.ca, alex.bennee@linaro.org >> Date: Thu, 21 Jul 2016 21:08:43 -0400 >> >> I made the same adjustments to the saved sub_start and sub_end >> variables, but I had a mistake in that adjustment which caused the false >> positives. Fixed in the attached v2 patch. We could just drop the >> check, though I've already found it useful to catch bugs >> (https://github.com/joaotavora/yasnippet/issues/720). >> >> If I drop the checks (see attached v3 patch), then after following the >> bug#23869 recipe, I get: >> >> ## -*- Octave -*- >> -module(bug). >> -export([identity/1, is_even/1, size/1, reverse/1]). > > OK, let's wait for a few days to give time to the people who were > affected by the issue to test the patch, and if no new issues come up, > please push the version with the error code to emacs-25. > Patch v2 fixes 'emacs -Q' and my normal capture templates, and I'm using the patched emacs for this email. I'll keep running with it for the next few days. Regards Robert From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 22 15:30:49 2016 Received: (at 23917) by debbugs.gnu.org; 22 Jul 2016 19:30:49 +0000 Received: from localhost ([127.0.0.1]:33994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQg9p-000489-Bh for submit@debbugs.gnu.org; Fri, 22 Jul 2016 15:30:49 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:43357) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQg9n-000481-Rd for 23917@debbugs.gnu.org; Fri, 22 Jul 2016 15:30:48 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 2A0C9204D9; Fri, 22 Jul 2016 15:30:47 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Fri, 22 Jul 2016 15:30:47 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=KPZUuTAQwRNxK8QpsWYFbqJ70Es=; b=Djm4m EcP8T7hRctQZuLY3P8pY4Oe3m88sXgPzvCNH7lFrK9LkjgWiQgI277tA2Wx0UsOG TaaasFoHnt7uKjGfSHuDlS/OcU679oi7l/4VgDgQ70jnUE8h+tYHhcaPct/luQ7K 4egryVkbRdW2PvJ4YsuWsS5yXOsrqJRWqqvM+I= X-Sasl-enc: b2ktS09qX2ULnwur/bFEHHgfHf06ULYJh3YTkBnBo5DF 1469215846 Received: from strawberry (lfbn-1-7726-61.w92-167.abo.wanadoo.fr [92.167.139.61]) by mail.messagingengine.com (Postfix) with ESMTPA id EC7F9CCDA7; Fri, 22 Jul 2016 15:30:45 -0400 (EDT) From: Nicolas Petton To: Eli Zaretskii , npostavs@users.sourceforge.net Subject: Re: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) In-Reply-To: <83fur2xjeu.fsf@gnu.org> References: <87vb066ejv.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> <87bn1rdd1f.fsf@users.sourceforge.net> <83h9bjzp5i.fsf@gnu.org> <877fcfd79w.fsf@users.sourceforge.net> <83a8hbysmw.fsf@gnu.org> <874m7icwdg.fsf@users.sourceforge.net> <83fur2xjeu.fsf@gnu.org> User-Agent: Notmuch/0.21 (https://notmuchmail.org) Emacs/25.1.50.1 (x86_64-unknown-linux-gnu) Date: Fri, 22 Jul 2016 21:30:32 +0200 Message-ID: <87lh0t8o87.fsf@petton.fr> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23917 Cc: nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, monnier@iro.umontreal.ca, alex.bennee@linaro.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.7 (/) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > OK, let's wait for a few days to give time to the people who were > affected by the issue to test the patch, and if no new issues come up, > please push the version with the error code to emacs-25. I'll wait until Monday for the first release candidate to give time to this patch to be applied to emacs-25. Nico --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: GPGTools - http://gpgtools.org iQEcBAEBCAAGBQJXknRYAAoJECM1h6R8IHkQ5tAIAMhcH+G1aJwC8PqTiNYzLEXy xMfKKP7tfqntCAQA2tjA+m3tV5eVGqUiRR3b1+XqPui8q+lydDqofdN3lIuArgba yt6cntLeagarxJWLoiZxwUCueC/jNwco9a3yoPHhcEL36AcwyVPKNMqC9G4mYLkN MvW85G1SuyxoNcmXkwPljbG28GieOeGAIMaD4j76TWVIJGMKW4rnHikxHtdeou85 0LEGmP0w/Jhox+XQq+VhpUWOoq67taAOmjA4aVUGkJwG8hUa/2KOHOLBz374htke WQuPz/HYB3TTJ5g7AnQblME74rrnsBSq12mnVOSqoiijizmGMySrqog+2d30Vog= =hn1F -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 22 20:42:20 2016 Received: (at 23917) by debbugs.gnu.org; 23 Jul 2016 00:42:21 +0000 Received: from localhost ([127.0.0.1]:34105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQl1I-0004gl-Ll for submit@debbugs.gnu.org; Fri, 22 Jul 2016 20:42:20 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:35304) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQl1E-0004gW-IG for 23917@debbugs.gnu.org; Fri, 22 Jul 2016 20:42:18 -0400 Received: by mail-it0-f65.google.com with SMTP id f6so4013627ith.2 for <23917@debbugs.gnu.org>; Fri, 22 Jul 2016 17:42:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=KomYZQv9fFl9FEUzNh5Ohx87MkE0af1FvgEoOlZT+Rs=; b=KZbXGPt3Po+Q3C/kiOkw9pfcXMWEYvZtDHj3/+BZ9JxExk0z5R/1XFRi0lDkn0uTGP 4xftE3S+kW9yFYnYJl1UlRLbTTkjqS4N077YSO3wvTmIrxBQ1OyCV6VKFu/dX9266PO8 yqv51684AjdiOJj+ZfNfNQNdE+IJMFwfIq80jSPzANS9oCdpciQaH5KA8eK1edbylr9/ sf0Si/weiX1/GbrygmQiDNHLldNb02sYOhcy6m+umcVrvd4aB27juB5y8aaVPF553qKm pBUktb/qpkVyk7xzQBW/aDjF9frhWvQuVphmaUcaUqvh5PjUwEiNc5Ujr/HgZ8ppF5zD XJZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=KomYZQv9fFl9FEUzNh5Ohx87MkE0af1FvgEoOlZT+Rs=; b=GMHPrj0MjgMVhPLLrINpnAuW2UhERE8uF3M9wenfYlNtfiBfpfXKfwBqWm4nObgMdg rHWLaiA8VRkZdHcFUpthyyO8TrrZ+DmaTpksI1K4JGL7QEc9BC+K++WKRgpDav5UKzoh xUAWv4rlF7E/V7x3CAOcn8rQh12ypW0xuWEG0wdJpy/zQ5mbXHwvRviRfZlGJR83gFxR kgx4d6FTxn21vjB7El5OMPTUODKU/jU9jRw5czefXH+ZyUv6oC2DAjS4d8pSrbx4pXl3 Jy6VhYzsmIdkdWKq9+2T7MIvD56vOpWrZEytAwf+/w0XCnwoUxvlqzBa2wMAgKPmFfJm nRrA== X-Gm-Message-State: AEkoousV320ID0aAspJRam1Nx6BJOMsrt9vTH/3yiiqjMg7trTdmdzaiNXyQZlo+fTTLTw== X-Received: by 10.36.37.146 with SMTP id g140mr7546028itg.58.1469234531000; Fri, 22 Jul 2016 17:42:11 -0700 (PDT) Received: from moondust.nodomain.none (TC334.WPA.Dal.Ca. [134.190.195.52]) by smtp.gmail.com with ESMTPSA id n23sm6601238ioe.18.2016.07.22.17.42.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Jul 2016 17:42:10 -0700 (PDT) From: nljlistbox2@gmail.com (N. Jackson) To: npostavs@users.sourceforge.net Subject: Re: Re: bug#23917: 25.0.95; commit 3a9d6296b35e5317c497674d5725eb52699bd3b8 causing org-capture to error out References: <87vb066ejv.fsf@linaro.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> <87bn1rdd1f.fsf@users.sourceforge.net> <83h9bjzp5i.fsf@gnu.org> <877fcfd79w.fsf@users.sourceforge.net> <83a8hbysmw.fsf@gnu.org> <874m7icwdg.fsf@users.sourceforge.net> Date: Fri, 22 Jul 2016 21:42:08 -0300 In-Reply-To: <874m7icwdg.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Thu, 21 Jul 2016 21:08:43 -0400") Message-ID: <878twtqj6n.fsf_-_@moondust.awandering> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 23917 Cc: jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, monnier@iro.umontreal.ca, Eli Zaretskii , alex.bennee@linaro.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.5 (/) At 21:08 -0400 on Thursday 2016-07-21, npostavs@users.sourceforge.net wrote: > I made the same adjustments to the saved sub_start and sub_end > variables, but I had a mistake in that adjustment which caused the false > positives. Fixed in the attached v2 patch. We could just drop the > check, though I've already found it useful to catch bugs > (https://github.com/joaotavora/yasnippet/issues/720). > > If I drop the checks (see attached v3 patch), then after following the > bug#23869 recipe, I get: > > ## -*- Octave -*- > -module(bug). > -export([identity/1, is_even/1, size/1, reverse/1]). Thanks Noam, Both the v2 and the v3 patch work for me with all my Org captures under my full config, and with the simple recipe under `emacs -Q". I'm not familiar with the details of the bug or the patches, but turning off checks doesn't sound right, so I've stayed with the v2 patch. I am now running the v2 patch as my every day Emacs. FWIW, my versions of Emacs and Org are: GNU Emacs 25.0.95.15 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.9) of 2016-07-22 built on moondust Repository revision: 4157159a37b43712440da91a45a6d5f71eb96e8a and Org-mode version 8.3.5 (8.3.5-elpa @ /home/nlj/.emacs.d/elpa/org-20160719/) . From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 23 00:19:06 2016 Received: (at 23917) by debbugs.gnu.org; 23 Jul 2016 04:19:06 +0000 Received: from localhost ([127.0.0.1]:34136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQoP4-0001SE-8I for submit@debbugs.gnu.org; Sat, 23 Jul 2016 00:19:06 -0400 Received: from mail-qk0-f169.google.com ([209.85.220.169]:36158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQoP2-0001Rg-5G; Sat, 23 Jul 2016 00:19:04 -0400 Received: by mail-qk0-f169.google.com with SMTP id x1so117626881qkb.3; Fri, 22 Jul 2016 21:19:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=mk8PypvaDxgxS4z/qmbt+rWWKfWKoSwWheMFDRadMbA=; b=qksrbPWZoeEINso3LYBn6BjgyEZ+MydkC05tC7LQJNXGSKdoKSKcs3MDHnAXNLI0D9 JDy1ygED8dJp6v1IFAENkGYLje6rYd5bAyJ5fcKFlq7/oGBYSn+iO99Tf8HNBK71RhxX Uif3bBND6l0SpOT57kBgeTlk6PP6xKwMXVOdPaBz5JTRiR5uHu4shqD96EPVj3Ji/m2T Pjwgl5xS69i31YevN9gcZtPa5ezAJdGdHdqoTEa8WzbsXT6Qq72BpzbWkBRyUcfUwW+Y OFnmfcBMsoizQYwUyP9OICKWpAru0qZKWOU4FHTwXUUw/Plt+5RswZv/vEIAJFg7I/by k2HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=mk8PypvaDxgxS4z/qmbt+rWWKfWKoSwWheMFDRadMbA=; b=maNeX8q6NRaRSLVp2SefYNtOCHah455kiLmN4a+VL+wC5zmLQap396zNMjYODg0m0f +z/jso0mHgDhocicOpJpwbW1XKypwXQ3psp6qgSqFcvG+UbygIZqkS/RHFlWZ2baEkLT mo8qc8ZiLpgmait/CV0LFF5qTAkwpUowSZZNWPVdorK9RBzc6P+6UdaJmXRYCWYuiEeg XrKUZtE9IFIK0I7T/SJbl1uHU/BjP5qhuxd9QzAGY7MUo268U3MIVQm9g3cR8K9Ovj1V m474U5lnHlQezbWOS7AVpLQJKC0PoJzJlZsuAU3lxxYpM/wSofV0GFgwBHgEZp1rO3gE Tq0A== X-Gm-Message-State: AEkoouthwdgEJQs+WfPWgNeFcs7IFOpJ1+eSgfEQA4uoXAFJtsUwoQ+3MQCoKEx+SCJelg== X-Received: by 10.55.17.88 with SMTP id b85mr8821674qkh.104.1469247538569; Fri, 22 Jul 2016 21:18:58 -0700 (PDT) Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id l129sm9203867qke.27.2016.07.22.21.18.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jul 2016 21:18:57 -0700 (PDT) From: npostavs@users.sourceforge.net To: Eli Zaretskii Subject: Re: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template =?utf-8?B?4oCYZ+KAmTo=?= Match data clobbered by buffer modification hooks) References: <87vb066ejv.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> <87bn1rdd1f.fsf@users.sourceforge.net> <83h9bjzp5i.fsf@gnu.org> <877fcfd79w.fsf@users.sourceforge.net> <83a8hbysmw.fsf@gnu.org> <874m7icwdg.fsf@users.sourceforge.net> <83fur2xjeu.fsf@gnu.org> Date: Sat, 23 Jul 2016 00:19:00 -0400 In-Reply-To: <83fur2xjeu.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 22 Jul 2016 09:43:05 +0300") Message-ID: <87y44taswb.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23917 Cc: nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, monnier@iro.umontreal.ca, alex.bennee@linaro.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.7 (/) tags 23917 fixed close 23917 25.1 quit Eli Zaretskii writes: >> From: npostavs@users.sourceforge.net >> Cc: 23917@debbugs.gnu.org, nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, monnier@iro.umontreal.ca, alex.bennee@linaro.org >> Date: Thu, 21 Jul 2016 21:08:43 -0400 >> >> I made the same adjustments to the saved sub_start and sub_end >> variables, but I had a mistake in that adjustment which caused the false >> positives. Fixed in the attached v2 patch. We could just drop the >> check, though I've already found it useful to catch bugs >> (https://github.com/joaotavora/yasnippet/issues/720). >> >> If I drop the checks (see attached v3 patch), then after following the >> bug#23869 recipe, I get: >> >> ## -*- Octave -*- >> -module(bug). >> -export([identity/1, is_even/1, size/1, reverse/1]). > > OK, let's wait for a few days to give time to the people who were > affected by the issue to test the patch, and if no new issues come up, > please push the version with the error code to emacs-25. Since they've now reported that the new patch is working well, I've pushed it as e1def617. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 23 03:38:23 2016 Received: (at 23917) by debbugs.gnu.org; 23 Jul 2016 07:38:23 +0000 Received: from localhost ([127.0.0.1]:34159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQrVv-0007oO-AP for submit@debbugs.gnu.org; Sat, 23 Jul 2016 03:38:23 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQrVt-0007oB-Cq for 23917@debbugs.gnu.org; Sat, 23 Jul 2016 03:38:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQrVl-0002QR-81 for 23917@debbugs.gnu.org; Sat, 23 Jul 2016 03:38:16 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQrVc-0002Nn-KC; Sat, 23 Jul 2016 03:38:04 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2347 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bQrVZ-0001IK-KT; Sat, 23 Jul 2016 03:38:02 -0400 Date: Sat, 23 Jul 2016 10:38:11 +0300 Message-Id: <83invwx0rg.fsf@gnu.org> From: Eli Zaretskii To: nljlistbox2@gmail.com (N. Jackson) In-reply-to: <878twtqj6n.fsf_-_@moondust.awandering> (nljlistbox2@gmail.com) Subject: Re: bug#23917: 25.0.95; commit 3a9d6296b35e5317c497674d5725eb52699bd3b8 causing org-capture to error out References: <87vb066ejv.fsf@linaro.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> <87bn1rdd1f.fsf@users.sourceforge.net> <83h9bjzp5i.fsf@gnu.org> <877fcfd79w.fsf@users.sourceforge.net> <83a8hbysmw.fsf@gnu.org> <874m7icwdg.fsf@users.sourceforge.net> <878twtqj6n.fsf_-_@moondust.awandering> 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: -6.3 (------) X-Debbugs-Envelope-To: 23917 Cc: npostavs@users.sourceforge.net, jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, monnier@iro.umontreal.ca, alex.bennee@linaro.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: -6.3 (------) > From: nljlistbox2@gmail.com (N. Jackson) > Cc: 23917@debbugs.gnu.org, Eli Zaretskii , jwiegley@gmail.com, rpluim@gmail.com, monnier@iro.umontreal.ca, alex.bennee@linaro.org > Date: Fri, 22 Jul 2016 21:42:08 -0300 > > Both the v2 and the v3 patch work for me with all my Org captures under > my full config, and with the simple recipe under `emacs -Q". > > I'm not familiar with the details of the bug or the patches, but turning > off checks doesn't sound right, so I've stayed with the v2 patch. > > I am now running the v2 patch as my every day Emacs. Thanks. Noam, I think this means your v2 patch can be pushed to emacs-25, let's say by end of today. From unknown Wed Jun 18 23:06:30 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 20 Aug 2016 11:24:03 +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