From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: [Accepted] Make the latex export preprocessor rewrite #+INDEX to \index. Date: Wed, 4 May 2011 09:59:43 +0200 (CEST) Message-ID: <20110504075943.46A1743B538@u016822.science.uva.nl> References: <1303991243-30731-2-git-send-email-rpgoldman@sift.info> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:39167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHWzq-0005Da-Is for emacs-orgmode@gnu.org; Wed, 04 May 2011 03:59:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHWzp-00027s-Ga for emacs-orgmode@gnu.org; Wed, 04 May 2011 03:59:46 -0400 Received: from u016822.science.uva.nl ([146.50.39.34]:53614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHWzp-00027o-83 for emacs-orgmode@gnu.org; Wed, 04 May 2011 03:59:45 -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: emacs-orgmode@gnu.org Patch 767 (http://patchwork.newartisans.com/patch/767/) is now "Accepted". Maintainer comment: Pushed with modifications. Some optimization, and the original patch would have stopped at the first #+index line that was missing the entry... Please verify that it still works This relates to the following submission: http://mid.gmane.org/%3C1303991243-30731-2-git-send-email-rpgoldman%40sift.info%3E Here is the original message containing the patch: > Content-Type: text/plain; charset="utf-8" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Subject: [O] Make the latex export preprocessor rewrite #+INDEX to \index. > Date: Thu, 28 Apr 2011 16:47:23 -0000 > From: Robert Goldman > X-Patchwork-Id: 767 > Message-Id: <1303991243-30731-2-git-send-email-rpgoldman@sift.info> > To: emacs-orgmode@gnu.org > Cc: "Robert P. Goldman" > > From: Robert P. Goldman > > --- > lisp/org-latex.el | 13 +++++++++++++ > 1 files changed, 13 insertions(+), 0 deletions(-) > > diff --git a/lisp/org-latex.el b/lisp/org-latex.el > index e7307ef..731d6e6 100644 > --- a/lisp/org-latex.el > +++ b/lisp/org-latex.el > @@ -1775,6 +1775,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." > (end-of-line 1) > (insert "\n"))))) > > + > + > (defun org-export-latex-fixed-width (opt) > "When OPT is non-nil convert fixed-width sections to LaTeX." > (goto-char (point-min)) > @@ -2322,6 +2324,17 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." > (and (looking-at "[ \t]*ORG-VERSE-END.*") > (org-replace-match-keep-properties "\\end{verse}" t t))) > > + ;; Convert #+INDEX to LaTeX \\index. > + (goto-char (point-min)) > + (while > + (and > + (let ((case-fold-search t)) > + (re-search-forward "^[ \t]*#\\+index:[ \t]*\\(.*?\\)[ \t]*$" nil t)) > + (> (match-end 1) (match-beginning 1))) > + (let ((entry (match-string 1))) > +;; (message "Found a #+INDEX match...") > + (replace-match (format "\\index{%s}" entry) t t))) > + > ;; Convert center > (goto-char (point-min)) > (while (search-forward "ORG-CENTER-START" nil t) >