From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [BUG] Inconsistency in src block hiding Date: Thu, 19 Jan 2012 07:41:26 -0700 Message-ID: <87ehuv4la3.fsf@gmx.com> References: <8739djqfkv.fsf@gmail.com> <87fwhiwwr0.fsf@gmail.com> <87bos6pp1a.fsf@gmail.com> <8739dhnxjs.fsf@gmail.com> <87ipmcxboo.fsf@gmail.com> <87pqgjipu8.fsf@gmail.com> <87y5v6x3lv.fsf@gmail.com> <87fwh86533.fsf@gmail.com> <87ehwbdxk2.fsf@gnu.org> <874nx782wi.fsf@gmx.com> <87lip76p48.fsf@norang.ca> <87d3ai2p98.fsf@gmail.com> <8762ga6whl.fsf@norang.ca> <87pqehrnjv.fsf@gmx.com> <8739bc3ob5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:44447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnwUp-0000kH-HG for emacs-orgmode@gnu.org; Thu, 19 Jan 2012 13:14:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RnwUn-0002sH-Si for emacs-orgmode@gnu.org; Thu, 19 Jan 2012 13:13:59 -0500 Received: from mailout-us.gmx.com ([74.208.5.67]:38009 helo=mailout-us.mail.com) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RnwUn-0002qz-Jf for emacs-orgmode@gnu.org; Thu, 19 Jan 2012 13:13:57 -0500 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: Nicolas Goaziou Cc: Rick Frankel , emacs-orgmode@gnu.org Nicolas Goaziou writes: > Hello, > > Eric Schulte writes: > >> Well maybe we should roll back this change. > > Please don't. _That_ would be a regression. > >> I'll wait to see if Nicolas has a solution which is both functional and >> conforms to the Org-mode wide syntax norms. > > The problem comes from the current exporter, which isn't neutral about > drawers, by default. > > I think that a temporary fix should be to: > > 1. Change default drawer formatting function to the following > (neutral): > > #+begin_src emacs-lisp > (defun org-export-format-drawer (name contents) > "Export contents of a drawer as-is. > Property drawers are ignored." > (if (string= "PROPERTIES" name) "" contents)) > #+end_src > > 2. Handle drawers earlier in org-export-preprocess-string function, > i.e. just before footnote handling, so its contents can benefit > from further modifications. > > 3. Allow drawers in export by default (excepted PROPERTIES > drawers). That is change `org-export-with-drawers' default value to > t. > > I'm packaging this in the following quick patch, highly untested. > Thanks for taking the time to collect these changes into a patch, however I believe the changes you describe present /new/ behavior (e.g., new export semantics for drawers), rather than a bug repair. For the time being I am going to bring back results folding until an acceptable alternative can be agreed upon and implemented. Best, > > > Regards, > > -- > Nicolas Goaziou > From 0c15bf694f8051eb58fd131868059460f28f2e0d Mon Sep 17 00:00:00 2001 > From: Nicolas Goaziou > Date: Wed, 18 Jan 2012 18:34:11 +0100 > Subject: [PATCH] org-exp: Set neutral behaviour towards drawers > > * lisp/org-exp.el (org-export-with-drawers): Change default value so > all drawers are exportable as a default. > (org-export-preprocess-string): Handle drawers earlier in the > preprocess, so their contents can be modified further. > (org-export-format-drawer): Change default behaviour contents of > drawers are exported as Org code. As a special case, property > drawers are still ignored. > --- > lisp/org-exp.el | 26 ++++++++------------------ > 1 files changed, 8 insertions(+), 18 deletions(-) > > diff --git a/lisp/org-exp.el b/lisp/org-exp.el > index c7e1a94..d9b0a3e 100644 > --- a/lisp/org-exp.el > +++ b/lisp/org-exp.el > @@ -406,7 +406,7 @@ This option can also be set with the +OPTIONS line, e.g. \"tags:nil\"." > (const :tag "Not in TOC" not-in-toc) > (const :tag "On" t))) > > -(defcustom org-export-with-drawers nil > +(defcustom org-export-with-drawers t > "Non-nil means export with drawers like the property drawer. > When t, all drawers are exported. This may also be a list of > drawer names to export." > @@ -1156,6 +1156,10 @@ on this string to produce the exported version." > ;; Get rid of tasks, depending on configuration > (org-export-remove-tasks (plist-get parameters :tasks)) > > + ;; Get rid of drawers > + (org-export-remove-or-extract-drawers > + drawers (plist-get parameters :drawers)) > + > ;; Prepare footnotes for export. During that process, footnotes > ;; actually included in the exported part of the buffer go > ;; though some transformations: > @@ -1209,10 +1213,6 @@ on this string to produce the exported version." > ;; Find HTML special classes for headlines > (org-export-remember-html-container-classes) > > - ;; Get rid of drawers > - (org-export-remove-or-extract-drawers > - drawers (plist-get parameters :drawers)) > - > ;; Get the correct stuff before the first headline > (when (plist-get parameters :skip-before-1st-heading) > (goto-char (point-min)) > @@ -1500,19 +1500,9 @@ EXP-DRAWERS will be removed." > name content)) > (insert content))))))) > > -(defun org-export-format-drawer (name content) > - "Format the content of a drawer as a colon example." > - (if (string-match "[ \t]+\\'" content) > - (setq content (substring content (match-beginning 0)))) > - (while (string-match "\\`[ \t]*\n" content) > - (setq content (substring content (match-end 0)))) > - (setq content (org-remove-indentation content)) > - (setq content (concat ": " (mapconcat 'identity > - (org-split-string content "\n") > - "\n: ") > - "\n")) > - (setq content (concat " : " (upcase name) "\n" content)) > - (org-add-props content nil 'org-protected t)) > +(defun org-export-format-drawer (name contents) > + "Export contents of a drawer as-is." > + (if (string= "PROPERTIES" name) "" contents)) > > (defun org-export-handle-export-tags (select-tags exclude-tags) > "Modify the buffer, honoring SELECT-TAGS and EXCLUDE-TAGS. -- Eric Schulte http://cs.unm.edu/~eschulte/