From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: Publishing with auto-sitemap is broken [7.7 (release_7.7.497.gae02e)] Date: Tue, 01 Nov 2011 11:47:28 +0100 Message-ID: <87pqhcce67.fsf@gmail.com> References: <87sjmbmzt1.fsf@norang.ca> <87r51tc6di.fsf@gmail.com> <87lis0n7er.fsf@norang.ca> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:48627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLBtj-0000tI-KU for emacs-orgmode@gnu.org; Tue, 01 Nov 2011 06:48:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RLBti-0002jg-5V for emacs-orgmode@gnu.org; Tue, 01 Nov 2011 06:48:51 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:39092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLBth-0002jP-Nb for emacs-orgmode@gnu.org; Tue, 01 Nov 2011 06:48:50 -0400 Received: by wwe3 with SMTP id 3so2485038wwe.30 for ; Tue, 01 Nov 2011 03:48:48 -0700 (PDT) In-Reply-To: <87lis0n7er.fsf@norang.ca> (Bernt Hansen's message of "Mon, 31 Oct 2011 18:05:48 -0400") 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: Bernt Hansen Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hello, Bernt Hansen writes: > Nicolas Goaziou writes: > >> Bernt Hansen writes: >> >>> Publishing with an automatically generated index file is broken for me. >>> >>> With org-publish-projects set with >>> >>> :auto-sitemap t >>> :sitemap-filename "index.html" >>> :sitemap-title "Test Publishing Area" >>> :sitemap-style "tree" >> >> I think reverting changes on headlines in HTML and DocBook exporters is >> the best option for now. >> >> Does the following patch work? > > Yes, this patch works for me. Would you mind dismissing the previous patch and test the following instead? I think that the approach is better. Thank you in advance. Regards, -- Nicolas Goaziou --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Globalize-some-variables-to-make-them-available-in-b.patch >From e31e89430aa9f1b5de545c3bfd1503acc848d527 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 1 Nov 2011 11:40:11 +0100 Subject: [PATCH] Globalize some variables to make them available in buffers not in Org mode * lisp/org.el (org-heading-regexp, org-heading-keyword-regexp-format, org-heading-keyword-maybe-regexp-format): Globalize variables so they are accessible even in buffers not in Org mode. --- lisp/org.el | 38 ++++++++++++++++---------------------- 1 files changed, 16 insertions(+), 22 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 318ccfd..c3c7bdf 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4246,10 +4246,6 @@ collapsed state." ;;; Variables for pre-computed regular expressions, all buffer local -(defvar org-heading-regexp nil - "Matches an headline. -Stars are put in group 1 and the trimmed body in group 2.") -(make-variable-buffer-local 'org-heading-regexp) (defvar org-drawer-regexp nil "Matches first line of a hidden block.") (make-variable-buffer-local 'org-drawer-regexp) @@ -4273,18 +4269,6 @@ group 3: Priority cookie group 4: True headline group 5: Tags") (make-variable-buffer-local 'org-complex-heading-regexp) -(defvar org-heading-keyword-regexp-format nil - "Printf format to make regexp to match an headline with some keyword. -This regexp will match the headline of any node which has the -exact keyword that is put into the format. The keyword isn't in -any group by default, but the stars and the body are.") -(make-variable-buffer-local 'org-heading-keyword-regexp-format) -(defvar org-heading-keyword-maybe-regexp-format nil - "Printf format to make regexp to match an headline with some keyword. -This regexp can match any headline with the specified keyword, or -a without a keyword. The keyword isn't in any group by default, -but the stars and the body are.") -(make-variable-buffer-local 'org-heading-keyword-maybe-regexp-format) (defvar org-complex-heading-regexp-format nil "Printf format to make regexp to match an exact headline. This regexp will match the headline of any node which has the @@ -4661,12 +4645,6 @@ means to push this value onto the list in the variable.") (concat "\\(" (mapconcat 'regexp-quote org-not-done-keywords "\\|") "\\)") - org-heading-regexp - "^\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ \t]*$" - org-heading-keyword-regexp-format - "^\\(\\*+\\)\\(?: +%s\\)\\(?: +\\(.*?\\)\\)?[ \t]*$" - org-heading-keyword-maybe-regexp-format - "^\\(\\*+\\)\\(?: +%s\\)?\\(?: +\\(.*?\\)\\)?[ \t]*$" org-not-done-heading-regexp (format org-heading-keyword-regexp-format org-not-done-regexp) org-todo-line-regexp @@ -4854,6 +4832,22 @@ This variable is set by `org-before-change-function'. This is similar to `org-outline-regexp' but additionally makes sure that we are at the beginning of the line.") +(defconst org-heading-regexp "^\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ \t]*$" + "Matches an headline, putting stars and text into groups. +Stars are put in group 1 and the trimmed body in group 2.") +(defconst org-heading-keyword-regexp-format + "^\\(\\*+\\)\\(?: +%s\\)\\(?: +\\(.*?\\)\\)?[ \t]*$" + "Printf format for a regexp matching an headline with some keyword. +This regexp will match the headline of any node which has the +exact keyword that is put into the format. The keyword isn't in +any group by default, but the stars and the body are.") +(defconst org-heading-keyword-maybe-regexp-format + "^\\(\\*+\\)\\(?: +%s\\)?\\(?: +\\(.*?\\)\\)?[ \t]*$" + "Printf format for a regexp matching an headline, possibly with some keyword. +This regexp can match any headline with the specified keyword, or +without a keyword. The keyword isn't in any group by default, +but the stars and the body are.") + ;;;###autoload (define-derived-mode org-mode outline-mode "Org" "Outline-based notes management and organizer, alias -- 1.7.7.1 --=-=-=--