emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Activate/deactivate export of inlinetasks with #+OPTIONS
@ 2012-08-14 12:19 Rasmus
  2012-08-14 12:49 ` Rasmus
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Rasmus @ 2012-08-14 12:19 UTC (permalink / raw)
  To: emacs-orgmode


Hi list,

When writing documents, I think in terms of LaTeX.  There, a common
option in `draft'.  In orgmode inlinetasks is a draft-thingy to me.  I
want to easily remove inlinetasks before exporting a final (that merely
means `pretty') version.

To reach an Org-ish solution I wrote the following trivial advice+extra,
which allows #+OPTIONS: inline:t or #+OPTIONS: inline:nil.  It works
only with the new exporter (which is amazing!!!).

I'm hoping someone else could make use of it (although it is truly
trivial, but not being a programmer I appreciate finding `easy'
solutions on the internets).

#+BEGIN_SRC emacs-lisp
(add-to-list 'org-export-options-alist
	     '(:with-inlinetasks nil "inline" org-export-with-inlinetasks))

(defcustom org-export-with-inlinetasks t
  "Non-nil means include INLINETASKS keywords in export.
When nil, remove all these keywords from the export."
  :group 'org-export-general
  :type 'boolean)

(defadvice org-e-latex-inlinetask (after org-e-export-inlinetask-p)
  "Return an inlinetask string if :with-inlinetasks is t otherwise
  return nothing"
  (if (not (plist-get info :with-inlinetasks))
      (setq ad-return-value "")))

(ad-activate 'org-e-latex-inlinetask)
#+END_SRC

If this is of high enough standards it could perhaps be added to the
worg. . .

–Rasmus

-- 
In theory, practice and theory are the same. In practice they are not

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Activate/deactivate export of inlinetasks with #+OPTIONS
  2012-08-14 12:19 Activate/deactivate export of inlinetasks with #+OPTIONS Rasmus
@ 2012-08-14 12:49 ` Rasmus
  2012-08-14 19:17 ` Suvayu Ali
  2012-08-14 21:48 ` Bastien
  2 siblings, 0 replies; 6+ messages in thread
From: Rasmus @ 2012-08-14 12:49 UTC (permalink / raw)
  To: emacs-orgmode

Rasmus <rasmus@gmx.us> writes:

> To reach an Org-ish solution I wrote the following trivial
> advice+extra,
> which allows #+OPTIONS: inline:t or #+OPTIONS: inline:nil.  It works
> only with the new exporter (which is amazing!!!).

This solution is better as it's backend-agnostic: 

#+BEGIN_SRC emacs-lisp
  (add-to-list 'org-export-options-alist
               '(:with-inlinetasks nil "inline" org-export-with-inlinetasks))

  (defcustom org-export-with-inlinetasks t
    "Non-nil means include INLINETASKS keywords in export.
  When nil, remove all these keywords from the export."
    :group 'org-export-general
    :type 'boolean)

  (defun org-e-inlinetask-p (inlinetask back-end info)
    "Return an inlinetask string if :with-inlinetasks is t"
    (if (plist-get info :with-inlinetasks)
        inlinetask
        ""))

  (add-to-list 'org-export-filter-inlinetask-functions 'org-e-inlinetask-p)

  ;; (defadvice org-e-latex-inlinetask (after org-e-export-inlinetask-p)
  ;;   "Return an inlinetask string if :with-inlinetasks is t otherwise
  ;;   return nothing"
  ;;   (if (not (plist-get info :with-inlinetasks))
  ;;       (setq ad-return-value "")))

  ;; (ad-activate 'org-e-latex-inlinetask)

#+END_SRC

-- 
I almost cut my hair, it was happened just the other day

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Activate/deactivate export of inlinetasks with #+OPTIONS
  2012-08-14 12:19 Activate/deactivate export of inlinetasks with #+OPTIONS Rasmus
  2012-08-14 12:49 ` Rasmus
@ 2012-08-14 19:17 ` Suvayu Ali
  2012-08-14 21:48 ` Bastien
  2 siblings, 0 replies; 6+ messages in thread
From: Suvayu Ali @ 2012-08-14 19:17 UTC (permalink / raw)
  To: emacs-orgmode

On Tue, Aug 14, 2012 at 01:19:47PM +0100, Rasmus wrote:
> 
> Hi list,
> 
> When writing documents, I think in terms of LaTeX.  There, a common
> option in `draft'.  In orgmode inlinetasks is a draft-thingy to me.  I
> want to easily remove inlinetasks before exporting a final (that merely
> means `pretty') version.
> 
> To reach an Org-ish solution I wrote the following trivial advice+extra,
> which allows #+OPTIONS: inline:t or #+OPTIONS: inline:nil.  It works
> only with the new exporter (which is amazing!!!).
> 

[...]

> 
> If this is of high enough standards it could perhaps be added to the
> worg. . .
> 

Worg is exactly for these kind of things!  Feel free to add it to an
appropriate page.  I would suggest Worg/org-hacks.org::Exporting org
files <http://orgmode.org/worg/org-hacks.html#sec-1-9>.

> –Rasmus

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Activate/deactivate export of inlinetasks with #+OPTIONS
  2012-08-14 12:19 Activate/deactivate export of inlinetasks with #+OPTIONS Rasmus
  2012-08-14 12:49 ` Rasmus
  2012-08-14 19:17 ` Suvayu Ali
@ 2012-08-14 21:48 ` Bastien
  2012-08-16 10:51   ` Nicolas Goaziou
  2 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2012-08-14 21:48 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Hi Rasmus,

Rasmus <rasmus@gmx.us> writes:

> (defcustom org-export-with-inlinetasks t
>   "Non-nil means include INLINETASKS keywords in export.
> When nil, remove all these keywords from the export."
>   :group 'org-export-general
>   :type 'boolean)

+1 for having this for the new exporter.

Thanks for the idea and the code!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Activate/deactivate export of inlinetasks with #+OPTIONS
  2012-08-14 21:48 ` Bastien
@ 2012-08-16 10:51   ` Nicolas Goaziou
  2012-08-16 11:05     ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2012-08-16 10:51 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode, Rasmus

Hello,

Bastien <bzg@gnu.org> writes:

>> (defcustom org-export-with-inlinetasks t
>>   "Non-nil means include INLINETASKS keywords in export.
>> When nil, remove all these keywords from the export."
>>   :group 'org-export-general
>>   :type 'boolean)
>
> +1 for having this for the new exporter.
>
> Thanks for the idea and the code!

I agree, this is a good idea. I've added it in org-export.el.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Activate/deactivate export of inlinetasks with #+OPTIONS
  2012-08-16 10:51   ` Nicolas Goaziou
@ 2012-08-16 11:05     ` Bastien
  0 siblings, 0 replies; 6+ messages in thread
From: Bastien @ 2012-08-16 11:05 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Rasmus

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Bastien <bzg@gnu.org> writes:
>
>>> (defcustom org-export-with-inlinetasks t
>>>   "Non-nil means include INLINETASKS keywords in export.
>>> When nil, remove all these keywords from the export."
>>>   :group 'org-export-general
>>>   :type 'boolean)
>>
>> +1 for having this for the new exporter.
>>
>> Thanks for the idea and the code!
>
> I agree, this is a good idea. I've added it in org-export.el.

Thanks!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-08-16 11:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-14 12:19 Activate/deactivate export of inlinetasks with #+OPTIONS Rasmus
2012-08-14 12:49 ` Rasmus
2012-08-14 19:17 ` Suvayu Ali
2012-08-14 21:48 ` Bastien
2012-08-16 10:51   ` Nicolas Goaziou
2012-08-16 11:05     ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).