From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex =?UTF-8?Q?Benn=C3=A9e?= Subject: =?UTF-8?B?YnVnIzIzOTE3OiAgYnVnIzIzOTE3OiAgYnVnIzIzOTE3OiBQbGVh?= =?UTF-8?B?c2UgY29uc2lkZXIgbWFraW5nIEJ1ZyAjMjM5MTcgYSBibG9ja2VyIGZvciAy?= =?UTF-8?B?NS4xICh3YXMgUmU6IG9yZy1jYXB0dXJlOiBDYXB0dXJlIHRlbXBsYXRlIA==?= =?UTF-8?B?4oCYZ+KAmTogTWF0Y2ggZGF0YSBjbG9iYmVyZWQgYnkgYnVmZmVyIG1vZGlm?= =?UTF-8?B?aWNhdGlvbiBob29rcyk=?= Date: Wed, 20 Jul 2016 10:48:45 +0100 Message-ID: <877fcgmygy.fsf__46681.0876540423$1469008207$gmane$org@linaro.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPo7m-00073s-Vw for emacs-orgmode@gnu.org; Wed, 20 Jul 2016 05:49:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPo7i-00022n-Lw for emacs-orgmode@gnu.org; Wed, 20 Jul 2016 05:49:06 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-reply-to: <831t2p1n98.fsf@gnu.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Eli Zaretskii Cc: 23917@debbugs.gnu.org, rpluim@gmail.com, jwiegley@gmail.com, monnier@iro.umontreal.ca, nljlistbox2@gmail.com 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