From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Long lines prevent Org mode! Date: Tue, 07 Jan 2014 23:41:39 -0500 Message-ID: <87d2k313wc.fsf@gmail.com> References: <87txdfw9ij.fsf@iro.umontreal.ca> 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]:54522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0kxu-0006cs-36 for emacs-orgmode@gnu.org; Tue, 07 Jan 2014 23:42:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0kxm-00031M-SP for emacs-orgmode@gnu.org; Tue, 07 Jan 2014 23:42:01 -0500 Received: from plane.gmane.org ([80.91.229.3]:57586) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0kxm-000315-LV for emacs-orgmode@gnu.org; Tue, 07 Jan 2014 23:41:54 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1W0kxk-0005hw-Q4 for emacs-orgmode@gnu.org; Wed, 08 Jan 2014 05:41:52 +0100 Received: from pool-98-110-175-184.bstnma.fios.verizon.net ([98.110.175.184]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Jan 2014 05:41:52 +0100 Received: from ndokos by pool-98-110-175-184.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Jan 2014 05:41:52 +0100 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org François Pinard writes: > Hi, Org maintainers. > > This morning, while using my little org-grep tool, I got a "Stack > overflow in regexp matcher" diagnostic. I first looked for a bug in my > things, but the problem lies in Org mode. It cannot be activated if the > Org buffer happens to contain a long line. > > In the *Scratch* buffer, I wrote this little function: > > (defun essai (n) > (with-temp-buffer > (insert (make-string n ?x)) > (org-mode))) > > and called it with various values of N. It works fine for small N, but > breaks when (on the machine here) N reaches 33333. > > I wonder if the following article could help: > > [[https://groups.google.com/forum/#!topic/gnu.emacs.help/pxfMC5f7JHg][Stack overflow in regexp matcher - Google Groupes]] > I think it is the same problem. The backtrace in this case is ,---- | Debugger entered--Lisp error: (error "Stack overflow in regexp matcher") | looking-at(".*:ARCHIVE:") | (if (looking-at (concat ".*:" org-archive-tag ":")) (message "%s" (substitute-command-keys "Subtree is archived and stays closed. Use \\[org-force-cycle-archived] to cycle it anyway."))) | ... | org-mode() | (progn (insert (make-string n 120)) (org-mode)) | (unwind-protect (progn (insert (make-string n 120)) (org-mode)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))) | (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert (make-string n 120)) (org-mode)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) | (let ((temp-buffer (generate-new-buffer " *temp*"))) ...) | essai(33333) | eval((essai 33333) nil) `---- and in fact, you can leave org out of the picture altogether: create an empty buffer, insert 33333 x's by hand, go to the beginning and evaluate (looking-at ".*foo") As Stefan says in the thread you pointed out, it's a limitation of the emacs regexp engine. > François > > P.S. Would someone be kind enough to teach me the wisdom about how to > insert Org mode fragments in an email so it is received the most legibly > possible at the other end? Presumably, there is a Gnus way (which is > it?) yet many people do not use it. > > I cut and paste and then use either C-c m (bound to message-mark-inserted-region) which produces this style: --8<---------------cut here---------------start------------->8--- some code --8<---------------cut here---------------end--------------->8--- or C-c q (bound to boxquote-region) which produces this style: ,---- | some quoted material `---- I use the first one for things that a recipient might want to cut and paste in order to experiment with them. I use the second to quote immutable stuff (e.g. doc strings). Of course, if your problem is that your mailer (or some mailer along the way) mangles the content, then the safest thing to do is to put it in an attachment or post it on some pastebin and send a link. -- Nick