From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#16832: Emacs goes crazy when deleting lines Date: Sat, 15 Mar 2014 17:47:58 +0200 Message-ID: <83y50bbh01.fsf__44076.0778300048$1394898566$gmane$org@gnu.org> References: <86d2igl9x3.fsf@somewhere.org> <861tys93qy.fsf@somewhere.org> <86eh2r4ipj.fsf@somewhere.org> <86bnxugmkv.fsf@somewhere.org> <83txbly9xq.fsf@gnu.org> <86y50xirtv.fsf@somewhere.org> <861ty4ojm1.fsf@somewhere.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1394898552 20337 80.91.229.3 (15 Mar 2014 15:49:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Mar 2014 15:49:12 +0000 (UTC) Cc: emacs-orgmode@gnu.org, 16832@debbugs.gnu.org To: Fabrice Niessen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 15 16:49:16 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WOqpo-00053c-FN for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Mar 2014 16:49:16 +0100 Original-Received: from localhost ([::1]:50390 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOqpo-0007nz-5L for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Mar 2014 11:49:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOqpg-0007ns-C8 for bug-gnu-emacs@gnu.org; Sat, 15 Mar 2014 11:49:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WOqpa-0003vh-VO for bug-gnu-emacs@gnu.org; Sat, 15 Mar 2014 11:49:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOqpa-0003vd-S8 for bug-gnu-emacs@gnu.org; Sat, 15 Mar 2014 11:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WOqpa-0000MX-42 for bug-gnu-emacs@gnu.org; Sat, 15 Mar 2014 11:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Mar 2014 15:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16832 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16832-submit@debbugs.gnu.org id=B16832.13948984851307 (code B ref 16832); Sat, 15 Mar 2014 15:49:02 +0000 Original-Received: (at 16832) by debbugs.gnu.org; 15 Mar 2014 15:48:05 +0000 Original-Received: from localhost ([127.0.0.1]:37617 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WOqof-0000Kz-2h for submit@debbugs.gnu.org; Sat, 15 Mar 2014 11:48:05 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:59324) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WOqob-0000KW-AE for 16832@debbugs.gnu.org; Sat, 15 Mar 2014 11:48:02 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0N2H00300I5RUH00@a-mtaout22.012.net.il> for 16832@debbugs.gnu.org; Sat, 15 Mar 2014 17:47:59 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N2H003V2IJZB070@a-mtaout22.012.net.il>; Sat, 15 Mar 2014 17:47:59 +0200 (IST) In-reply-to: <861ty4ojm1.fsf@somewhere.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:86879 Archived-At: > From: Fabrice Niessen > Cc: 16832@debbugs.gnu.org, emacs-orgmode > Date: Fri, 14 Mar 2014 17:00:54 +0100 > > I realized that Emacs did not into an infloop, but simply gave me back > control after a very long time (more than 2 mins). Good news #1. > > I thought at using the profiler of Emacs 24, and it gives meaningful > results. Good news #2. > > Here they are: > > --8<---------------cut here---------------start------------->8--- > - flyspell-post-command-hook 3271 98% > - apply 3271 98% > - ad-Advice-flyspell-post-command-hook 3271 98% > - # 3271 98% > - byte-code 3271 98% > - flyspell-word 3271 98% > - org-mode-flyspell-verify 3246 97% > - if 3246 97% > - let* 3246 97% > - prog1 3053 91% > - catch 3053 91% > - while 3053 91% > - if 3053 91% > - progn 3053 91% > - setq 3053 91% > - org-element--get-next-object-candidates 3053 91% > - delq 3053 91% > - if 3053 91% > - mapcar 3053 91% > - # 3053 91% > - funcall 3053 91% > - org-element-inline-babel-call-successor 2873 86% > - save-excursion 2873 86% > if 2873 86% Thanks. So this looks like a problem with Org Mode. In particular, org-element-inline-babel-call-successor takes a lot of time in this case. That function traverses the buffer from top to bottom: (while (search-forward "call_" nil t) (save-excursion (goto-char (match-beginning 0)) (when (looking-at org-babel-inline-lob-one-liner-regexp) (throw 'exit (cons 'inline-babel-call (point))))))))) Perhaps this takes too long in such a huge buffer with such long lines. > Though, I don't understand yet why Flyspell seems to be a problem in Org > mode buffers Clearly, that's because Org functions, in particular org-mode-flyspell-verify, are called from flyspell-post-command-hook: - flyspell-post-command-hook 3271 98% - apply 3271 98% - ad-Advice-flyspell-post-command-hook 3271 98% - # 3271 98% - byte-code 3271 98% - flyspell-word 3271 98% - org-mode-flyspell-verify 3246 97% If org-mode-flyspell-verify is expensive, it is not a good idea to use it as flyspell-generic-check-word-predicate in huge Org buffers, since Flyspell will invoke it after each command. I hope Org developers will respond. Or maybe you should simply submit this bug report to Org bug tracker/list.