From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: Error "while: Stack overflow in regexp matcher" Date: Thu, 03 Sep 2009 09:54:11 +0200 Message-ID: <87d468sbto.fsf@mundaneum.com> References: <87r5wi71id.fsf@mundaneum.com> <16C1834B-D718-41CB-8A76-BC50A08085A2@uva.nl> <87ws4h2uxp.fsf@mundaneum.com> <546CF294-9DD7-435D-A9C5-8A53D9EA6C0B@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: 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-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Carsten, Carsten Dominik wrote: > On Sep 2, 2009, at 6:05 PM, S=C3=A9bastien Vauban wrote: >> Carsten Dominik wrote: >>> On Jul 15, 2009, at 11:12 AM, S=C3=A9bastien Vauban wrote: >>>> >>>> I'm trying to publish my `.emacs' file onto the Web, for interested pe= ople >>>> 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 this >>> bug. Which is why it finally has been fixed. >> >> Thank you very much. This works as expected [=C2=B2]. Fan-tas-tic! >> >> Thanks for all, >> Seb >> >> [=C2=B2] The only minor thing -- this is a small detail! -- is that my b= uffer >> uses `outline-minor-mode' and Org-level-* titles in comments (based = on >> the code of Tassilo) for enhancing the readability of any long file >> (here, my `.emacs'). >> >> While these titles are properly highlighted (other color, bigger fon= t) >> when read under Emacs, they are not in the HTMLized version of 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,\\} \\(.*\\)"))) (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 file wh= ere 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' and cy= cle using `M-tab', `M-left' and `M-right' will collapse or expand all headings respectively. See the thread "Org-style folding for a .emacs" discussed here in mid-July: http://www.mail-archive.com/emacs-orgmode-mXXj517/zsQ@public.gmane.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=C3=A9bastien Vauban _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode