From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: [PATCH] Unwanted #+ATTR_Backend and #+Backend stuff Date: Wed, 30 Jun 2010 12:32:30 +0200 Message-ID: <87tyokhku9.wl%n.goaziou@gmail.com> References: <87ljaa997e.wl%n.goaziou@gmail.com> <87tyosqzfv.wl%dmaus@ictsoc.de> <87ocf0ck7z.fsf@gmx.de> <87631280by.fsf@gmx.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="Multipart_Wed_Jun_30_12:32:29_2010-1" Return-path: Received: from [140.186.70.92] (port=34414 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTuau-00025b-Fc for emacs-orgmode@gnu.org; Wed, 30 Jun 2010 06:32:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OTuat-00046z-8D for emacs-orgmode@gnu.org; Wed, 30 Jun 2010 06:32:40 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:58369) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OTuat-00046l-1y for emacs-orgmode@gnu.org; Wed, 30 Jun 2010 06:32:39 -0400 Received: by wyb39 with SMTP id 39so765166wyb.0 for ; Wed, 30 Jun 2010 03:32:37 -0700 (PDT) In-Reply-To: <87631280by.fsf@gmx.de> 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: Sebastian Rose Cc: Org Mode List --Multipart_Wed_Jun_30_12:32:29_2010-1 Content-Type: text/plain; charset=US-ASCII Hello, >>>>> Sebastian Rose writes: > What's the status of this? What about the following patch ? I think it should fix it. -- Nicolas --Multipart_Wed_Jun_30_12:32:29_2010-1 Content-Type: text/plain; type=patch; charset=US-ASCII Content-Disposition: attachment; filename="0001-Remove-unwanted-ATTR_Backend-and-Backend-during-expo.patch" Content-Transfer-Encoding: 7bit >From 115a7e9d04fd5463913e1086ad3ff807ae579e16 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 30 Jun 2010 12:28:32 +0200 Subject: [PATCH] Remove unwanted #+ATTR_Backend and #+Backend during export. * lisp/org-exp.el: (org-export-select-backend-specific-text) Properly get rid of #+Backend and #+ATTR_Backend specifics to backends not matching the one we're exporting to. --- lisp/org-exp.el | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 54afdac..578e0cf 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1526,15 +1526,27 @@ from the buffer." (while formatters (setq fmt (pop formatters)) - (when (eq (car fmt) backend) - ;; This is selected code, put it into the file for real - (goto-char (point-min)) - (while (re-search-forward (concat "^\\([ \t]*\\)#\\+" (cadr fmt) - ":[ \t]*\\(.*\\)") nil t) + ;; Handle #+Backend: stuff + (goto-char (point-min)) + (while (re-search-forward (concat "^\\([ \t]*\\)#\\+" (cadr fmt) + ":[ \t]*\\(.*\\)") nil t) + (if (not (eq (car fmt) backend)) + (delete-region (point-at-bol) (min (1+ (point-at-eol)) (point-max))) + (replace-match "\\1\\2" t) + (add-text-properties + (point-at-bol) (min (1+ (point-at-eol)) (point-max)) + '(org-protected t)))) + ;; Handle #+attr_Backend: stuff + (goto-char (point-min)) + (while (re-search-forward (concat "^\\([ \t]*\\)#\\+attr_" (cadr fmt) + ":[ \t]*\\(.*\\)") nil t) + (if (not (eq (car fmt) backend)) + (delete-region (point-at-bol) (min (1+ (point-at-eol)) (point-max))) (replace-match "\\1\\2" t) (add-text-properties (point-at-bol) (min (1+ (point-at-eol)) (point-max)) '(org-protected t)))) + ;; Handle #+begin_Backend and #+end_Backend stuff (goto-char (point-min)) (while (re-search-forward (concat "^[ \t]*#\\+" (caddr fmt) "\\>.*\n?") nil t) -- 1.7.1 --Multipart_Wed_Jun_30_12:32:29_2010-1 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --Multipart_Wed_Jun_30_12:32:29_2010-1--