From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: Error "while: Stack overflow in regexp matcher" Date: Thu, 3 Sep 2009 10:02:41 +0200 Message-ID: <7C74C9BF-ED75-42B8-9B4C-3B03C6918295@gmail.com> References: <87r5wi71id.fsf@mundaneum.com> <16C1834B-D718-41CB-8A76-BC50A08085A2@uva.nl> <87ws4h2uxp.fsf@mundaneum.com> <546CF294-9DD7-435D-A9C5-8A53D9EA6C0B@gmail.com> <87d468sbto.fsf@mundaneum.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mj7HR-0003mj-On for emacs-orgmode@gnu.org; Thu, 03 Sep 2009 04:02:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mj7HL-0003l7-5T for emacs-orgmode@gnu.org; Thu, 03 Sep 2009 04:02:52 -0400 Received: from [199.232.76.173] (port=36384 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mj7HK-0003kx-Ue for emacs-orgmode@gnu.org; Thu, 03 Sep 2009 04:02:46 -0400 Received: from mail-ew0-f211.google.com ([209.85.219.211]:46366) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mj7HJ-0002Yi-Vi for emacs-orgmode@gnu.org; Thu, 03 Sep 2009 04:02:46 -0400 Received: by ewy7 with SMTP id 7so318492ewy.31 for ; Thu, 03 Sep 2009 01:02:45 -0700 (PDT) In-Reply-To: <87d468sbto.fsf@mundaneum.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?ISO-8859-1?Q?S=E9bastien_Vauban?= Cc: emacs-orgmode@gnu.org Hi Sebastien, I see. Well, Org does not *visit* the file, so these variables are not evaluated. Also, the argument of the #+include line determines the major mode, not the local variable setting. You can hack your way through this by adding a function to org-src-mode-hook that will scan for mode: outline-minor and turn it on if found. I guess I could also consider to fully *visit* an include file, to work around these restrictions. The main reason why I am not doing this right now is because the exact same mechanism is used for inline examples and include files, and it would be significant work to change this..... - Carsten On Sep 3, 2009, at 9:54 AM, S=E9bastien Vauban wrote: > Hi Carsten, > > Carsten Dominik wrote: >> On Sep 2, 2009, at 6:05 PM, S=E9bastien Vauban wrote: >>> Carsten Dominik wrote: >>>> On Jul 15, 2009, at 11:12 AM, S=E9bastien Vauban wrote: >>>>> >>>>> I'm trying to publish my `.emacs' file onto the Web, for =20 >>>>> interested people >>>>> to come and copy stuff they find valuable. My turn to do it. >>>>> >>>>> But, now, I wanna do it... and I've always an error when trying to >>>>> publish my config file: "while: Stack overflow in regexp matcher". >>>> >>>> Sebastien has now (off-list) made it possible for me to reproduce =20= >>>> this >>>> bug. Which is why it finally has been fixed. >>> >>> Thank you very much. This works as expected [=B2]. Fan-tas-tic! >>> >>> Thanks for all, >>> Seb >>> >>> [=B2] The only minor thing -- this is a small detail! -- is that my =20= >>> buffer >>> uses `outline-minor-mode' and Org-level-* titles in comments =20 >>> (based on >>> the code of Tassilo) for enhancing the readability of any long =20= >>> file >>> (here, my `.emacs'). >>> >>> While these titles are properly highlighted (other color, =20 >>> bigger font) >>> when read under Emacs, they are not in the HTMLized version of =20= >>> the >>> buffer. >>> >>> --8<---------------cut here---------------start------------->8--- >>> ;;** --[ Environment ]--------------------- >>> --8<---------------cut here---------------end--------------->8--- >>> >>> simply becomes: >>> >>> --8<---------------cut here---------------start------------->8--- >>> ;; >>> ** -- >>> [ Environment ]--------------------- >>> --8<---------------cut here---------------end--------------->8--- >>> >>> in HTML, while it should be fontified as the Org-level-1 face: >>> >>> --8<---------------cut here---------------start------------->8--- >>> (org-level-1 ((t (:foreground "cornflower blue" :weight bold >>> :height 1.8 :family "Arial")))) >>> --8<---------------cut here---------------end--------------->8--- >> >> What is the setup for getting this special fontification? > > Having such a code in your `.emacs' file: > > --8<---------------cut here---------------start------------->8--- > ;; Org-style folding for a `.emacs' (and much more) > > (defun my-outline-regexp () > "Calculate the outline regexp for the current mode." > (let ((comment-starter (replace-regexp-in-string > "[[:space:]]+" "" comment-start))) > (when (string=3D comment-start ";") > (setq comment-starter ";;")) > (concat comment-starter "[*]+ "))) > > (defun my-outline-minor-mode-hook () > (interactive) > (setq outline-regexp (my-outline-regexp)) > > ;; highlight the headings > (let ((heading-1-regexp > (concat (substring outline-regexp 0 -1) "\\{1\\} \\(.*\\)")) > (heading-2-regexp > (concat (substring outline-regexp 0 -1) "\\{2\\} \\(.*\\)")) > (heading-3-regexp > (concat (substring outline-regexp 0 -1) "\\{3\\} \\(.*\\)")) > (heading-4-regexp > (concat (substring outline-regexp 0 -1) "\\{4,\\} \\(.*\=20 > \)"))) > (font-lock-add-keywords > nil > `((,heading-1-regexp 1 'org-level-1 t) > (,heading-2-regexp 1 'org-level-2 t) > (,heading-3-regexp 1 'org-level-3 t) > (,heading-4-regexp 1 'org-level-4 t))))) > > (add-hook 'outline-minor-mode-hook > 'my-outline-minor-mode-hook) > --8<---------------cut here---------------end--------------->8--- > > >> How do you activate it? In a mode hook? > > ... and adding "outline-minor" as a cookie or local variable in the =20= > file where > you want to use the `org-level-*' titles. > > In my case, I have this at the bottom of my `.emacs' file: > > --8<---------------cut here---------------start------------->8--- > ;; This is for the sake of Emacs. > ;; Local Variables: > ;; coding: utf-8 > ;; mode: emacs-lisp > ;; mode: outline-minor > ;; ispell-local-dictionary: "american" > ;; End: > > ;;; .emacs ends here > --8<---------------cut here---------------end--------------->8--- > > Now, you can add `;;*' and `;;**', etc. as headings in your `.emacs' =20= > and cycle > using `M-tab', `M-left' and `M-right' will collapse or expand all =20 > headings > respectively. > > See the thread "Org-style folding for a .emacs" discussed here in =20 > mid-July: > > http://www.mail-archive.com/emacs-orgmode@gnu.org/msg15439.html > > >> Org just sets the proper mode to get the fontification, so >> I do not understand why this would not work. > > Best regards, > Seb > > --=20 > S=E9bastien Vauban > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode