Re: [O] [Discuss] make :tangle header argument respect :dir could save info typing

2019-03-19 Thread Sean O'Halpin
Hi,

=:dir= specifies the directory for code execution, i.e. when you hit =C-c
C-c= what is the environment in which the code is run?

=:mkdirp= forces creation of the directory for tangle output, i.e. when you
=org-babel-tangle= where do you put the output source code?

They are quite separate concerns.

Regards,
Sean

On Tue, 5 Mar 2019 at 06:03, stardiviner  wrote:

>
> I realized one thing, the combination of ~:mkdir~, ~:dir~, and ~:tangle~
> does not work
> good enough. Can make ~:tangle~ respect ~:dir~ too. WDYT?
>
> Here is an example:
>
> #+begin_src clojure :mkdirp yes :dir "data/code/clj-crawler-demo" :tangle
> "src/clj_crawler_demo/core.clj"
> (ns clj-crawler-demo.core
>   (:require [clj-http.client :as http])
>   (:require [net.cgrand.enlive-html :as html]))
>
> (html/select
>  (-> (http/get "https://www.baidu.com;)
>  :body
>  html/html-snippet)
>  [:div])
> #+end_src
>
> Why need this? If ~:tangle~ respect ~:dir~, it will don't need the
> complete path to
> tangled file. And when the source block has other header argument need dir
> like
> ~:file~, this will make ~:tangle~ and other related header arguments
> shorter.
>
> If ~:tangle~ does not respect ~:dir~, user need to repeat the path:
>
> #+begin_src clojure :mkdirp yes :dir "data/code/clj-crawler-demo" :tangle
> "data/code/clj-crawler-demo/src/clj_crawler_demo/core.clj"
> (ns clj-crawler-demo.core
>   (:require [clj-http.client :as http])
>   (:require [net.cgrand.enlive-html :as html]))
>
> (html/select
>  (-> (http/get "https://www.baidu.com;)
>  :body
>  html/html-snippet)
>  [:div])
> #+end_src
>
> This is long, I know there is ~#+headers:~ for source block. But reduce
> info would
> be better. I also consider the disadvantage of this change. Some user's
> existing
> source block might be broken.
>
> Let's level this change for discussion.
>
> --
> [ stardiviner ]
>I try to make every word tell the meaning what I want to express.
>
>Blog: https://stardiviner.github.io/
>IRC(freenode): stardiviner, Matrix: stardiviner
>GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
>
>
>


Re: [O] Problem with org-mode after upgradiing to org 8

2014-07-15 Thread Sean O'Halpin
Hi,

This might be something to do with the order in which package
initialization and the loading of your init.el file happen. I use the
following alias to put my local org-mode git repo paths ahead of
anything emacs does on launch (in startup.el or site-start.el, etc.):

: alias emacs='/usr/local/bin/emacs --eval '\''(progn (add-to-list
(quote load-path) ~/.emacs.d/org-mode/lisp) (add-to-list (quote
load-path) ~/.emacs.d/org-mode/contrib/lisp))'\'''

This doesn't seem like a very elegant solution though - I too would
like to know what the 'proper' way to do this is (if there is one).

Regards,
Sean

On Mon, Jul 14, 2014 at 12:05 PM, Roland Everaert reveatw...@gmail.com wrote:
 org-mode will makes me crazy. After a deep review (well rewrite my entire
 configuration based on norang's one) org-mode is working again, but its the
 version bundled with emacs that seems to be loaded and not the one I
 downloaded from the git repository.


 My emacs configuration is structured like so:

 ~/.emacs.d/init.el
 ~/.emacs.d/site-lisp/ -- contains alot of lisp codes including the
 directory of org.


 At the top of the init.el file I put the following:

 (let ((default-directory ~/.emacs.d/site-lisp/))
   (normal-top-level-add-to-load-path '(.))
   (normal-top-level-add-subdirs-to-load-path))


 I, later, load a file containing all my org-mode configuration. That file is
 located in ~/.emacs.d/site-lisp/. I load that file in this way:

 (load-library my-org-mode-config)

  At the top of that configuration file is written:

 (add-to-list 'load-path (expand-file-name
 ~/.emacs.d/site-lisp/org-mode/lisp))
 (add-to-list 'load-path (expand-file-name
 ~/.emacs.d/site-lisp/org-mode/contrib/lisp))
 (add-to-list 'auto-mode-alist '(\\.\\(org\\|org_archive\\)$ . org-mode))

 (require 'org)


 So I don't understand why M-x org-version gives me:

 Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @
 /usr/share/emacs/24.3/lisp/org/)


 Any help welcomed,


 Roland.

 On Fri, Jul 4, 2014 at 4:21 PM, John Hendy jw.he...@gmail.com wrote:

 On Fri, Jul 4, 2014 at 5:55 AM, Roland Everaert reveatw...@gmail.com
 wrote:
  Hi,
 
  After further investigation, it is the call to the function
  (org-agenda-to-appt) inside the function bh/org-agenda-to-appt that is
  causing the error.
 
  The body of the function:
 
  ; Erase all reminders and rebuilt reminders for today from the agenda
  (defun bh/org-agenda-to-appt ()
(interactive)
(setq appt-time-msg-list nil)
   (org-agenda-to-appt)
  )

 I know approximately nothing about elisp... but my intuitive
 interpretation is that it's setting the variable appt-time-msg-list to
 the value nil. When I do M-x help RET appt-msg-[TAB], I don't get any
 completions listed. Does that variable still exist?

 When googling that variable, I find evidence of people referring to
 it, but I'm not sure it's built into emacs -- are you sure you don't
 need to add something else, such as appt.el?
 - http://www.emacswiki.org/emacs-en/appt.el


 John

 
 
  I will deactivate the call to bh/org-agenda-to-appt, so I can have a
  normal
  life again and use emacs and org-mode without any problem. I will review
  and
  clean my configuration when times permit.
 
  I am anyway curious to know why that function call generate such error.
 
  Thanks for your help,
 
 
  Roland.
 
 
 
 
  On Thu, Jul 3, 2014 at 10:10 AM, Roland Everaert reveatw...@gmail.com
  wrote:
 
  Hi John,
 
  I am using Bernt's configuration (at least a part of it) for years
  without
  problems until I switch to org 8.
 
  I hame commented most of my init.el file and uncomment bits of
  configuration lines one at a time. and I have found where is located
  the
  problem. I have know to investigate why it is a problem.
 
  The offending line is (bh/org-agenda-to-appt), this is one of the
  function
  from the configuration of Bernt, so I have now to check my version
  against
  the one on his page to see if he doesn't update it.
 
  And to answer your question, the loaded version of org-mode is
  Org-mode
  version beta_8.3 (beta_8.3-16-g16c71d6 @
  /home/reveatwork/.emacs.d/site-lisp/org-mode/lisp/)
 
  I will also perform a make clean  make of my installation of
  org-mode
  just in case some their is some garbage left from previous version.
 
 
  Thanks for your help,
 
 
  Roland.
 
 
 
 
 
  On Tue, Jul 1, 2014 at 5:55 PM, John Hendy jw.he...@gmail.com wrote:
 
  On Tue, Jul 1, 2014 at 5:04 AM, Roland Everaert reveatw...@gmail.com
  wrote:
   I have upgraded using git on a Linux fedora 20 64 bit.
  
   I perform the following commands from the directory of org-mode:
  
   make clean
   git pull
   make
 
  I usually do git pull  make clean  make, but don't know if that
  makes a difference, so that's probably fine.
 
   I have also read the following page:
   http://orgmode.org/worg/org-8.0.html
  
   And search for all variables in my configuration that start with
   org-export,
   but I have none of them.
 
  Well, I'm 

Re: [O] Colorizing 'emacs-lisp' when it is exported?

2013-12-22 Thread Sean O'Halpin
On Sun, Dec 22, 2013 at 4:03 PM, Sharon Kimble boudic...@talktalk.net wrote:
 Thanks to auntie google I've found out how to keep the formatting of
 elisp on export to html using '#+BEGIN_SRC emacs-lisp' at the beginning
 of the code block, and '#+END_SRC' at the end. Whilst its in .emacs its
 nicely colorized, but how do I colorize the output when its been
 exported please? For once, google has drawn a blank, unfortunately!

 Sharon.

Have you set this?

(setq org-src-fontify-natively t)

Regards,
Sean



Re: [O] How do I specify the language for a :results code block

2013-12-02 Thread Sean O'Halpin
Hi,

Taking a slightly different approach, you could use the :post header
argument to wrap the results in a source block.

See http://orgmode.org/org.html#post (from which the example below is derived).

For example, you could use something like this:

  #+OPTIONS: d:RESULTS

  * Example

  #+name: eg-1
  #+begin_src sh :results replace drawer :exports results :post
wrap-src(text=*this*)
  head -n 3 demo.v
  #+end_src

  Output
  #+results: eg-1

  * Utils   :noexport:
  #+name: wrap-src
  #+begin_src emacs-lisp :var text= :results raw
  (concat #+BEGIN_SRC coq\n text \n#+END_SRC)
  #+end_src

BTW I answered a question similar to this on Stack Overflow recently
(http://stackoverflow.com/questions/20194347/org-mode-with-code-example-as-html/20232922#20232922)
- must be something in the air.

Regards,
Sean

On Mon, Dec 2, 2013 at 1:04 PM, Alan Schmitt
alan.schm...@polytechnique.org wrote:
 Hi Sébastien,

 sva-n...@mygooglest.com writes:

 Exporting if the result is not in the buffer is fine. I tried adding a
 :results replace as inner header argument to the call line and to the
 fetchcoq block, but it does not change anything.

 How can I tell the call line to replace the results when exporting?

 The syntax of the call line is:

 #+call: NAME[HEADER-ARGS-FOR-BLOCK](ARGUMENTS) 
 HEADER-ARGS-FOR-CALL-LINE

 So, you should add your option either in [] after the name, or at the end of
 the line -- I'm always hesitating about where to put the right stuff (not so
 enough clear yet in my mind)...

 I tried both, and neither works. Here is an org file showing the
 problem:

 --8---cut here---start-8---
 #+name: testcall
 #+BEGIN_SRC sh :exports none :results raw
 echo #+BEGIN_SRC emacs-lisp
 echo (+ 1 2)
 echo #+END_SRC
 #+END_SRC

 Test fails:
 #+call: testcall() :results raw

 #+RESULTS:
 #+BEGIN_SRC emacs-lisp
 (+ 1 2)
 #+END_SRC

 Test fails:
 #+call: testcall[:results replace]() :results raw

 #+RESULTS:
 #+BEGIN_SRC emacs-lisp
 (+ 1 2)
 #+END_SRC

 Test fails:
 #+call: testcall() :results raw replace

 #+RESULTS:
 #+BEGIN_SRC emacs-lisp
 (+ 1 2)
 #+END_SRC

 Test succeeds (results not already in the file):
 #+call: testcall() :results raw
 --8---cut here---end---8---

 If you export this, you'll see that only the last call generates the
 expected output.

 Alan




Re: [O] Problems with org-bibtex

2013-11-21 Thread Sean O'Halpin
Hi,

I was just trying the same thing (prompted by the recent discussion).
It turned out I had to

#+begin_src emacs-lisp
  (bibtex-set-dialect)
#+end_src

first.

Regards,
Sean


On Thu, Nov 21, 2013 at 3:55 AM, Marvin Doyley marvin...@gmail.com wrote:
 Hi there,

 I have decided to give org-bibtex a try. I have loaded it in my .emacs file,
 but whenever I copy a bibtex entry and try to use org-bibtex-yank I get the
 following error

 Symbol's function definition is void: bibtex-beginning-of-entry

 Could someone tell me what this mean and how to fix it.

 Thanks
 M



Re: [O] New maintainer

2013-04-19 Thread Sean O'Halpin
Hi Bastien,

I'd like to thank you for the fabulous job you've done as maintainer.

Best wishes,
Sean

On Thu, Apr 18, 2013 at 5:53 PM, Bastien b...@gnu.org wrote:
 Dear all,

 I'm stepping down as the Org maintainer.

 Carsten accepted to step up, if the community agrees.
 Please raise your thumbs up or your concerns, if any.

 I'm glad I had this opportunity to work as Robin and
 I'm even more glad Batman may strike back!

 :)

 --
  Bastien





Re: [O] C-o now mapped to org-ctrl-o surprise

2013-04-14 Thread Sean O'Halpin
Gosh, that was quick!

Thanks,
Sean


On Sun, Apr 14, 2013 at 9:31 AM, Bastien b...@gnu.org wrote:
 Hi Sean,

 Sean O'Halpin sean.ohal...@gmail.com writes:

 I was quite surprised after pulling down master to find that C-o has
 been bound to org-ctrl-o (commit 45d6d8f8 2013-04-05 11:14:20 +0200).

 I personally don't use open-line much myself so remap this key for my own 
 use.

 Wouldn't it be better to do something like:

 (define-key org-mode-map [remap open-line] 'org-ctrl-o)

 and let the user choose which key does open-line rather than create a
 new keybinding which might override a user definition? Also, perhaps
 the function should be called org-open-line rather than org-ctrl-o.

 Indeed.  I renamed the command and used remap as you suggest.

 --
  Bastien



Re: [O] Enriched/Org is a colorful Org

2013-04-13 Thread Sean O'Halpin
In your opinion, would it be possible to reproduce the functionality
of outline-mode using text properties rather than overlays? And in the
case of org-mode, would this really make that much of a difference in
terms of performance?

Regards,
Sean

On Fri, Apr 12, 2013 at 1:36 PM, Eli Zaretskii e...@gnu.org wrote:
 From: Carsten Dominik carsten.domi...@gmail.com
 Date: Fri, 12 Apr 2013 12:56:11 +0200
 Cc: emacs-orgmode@gnu.org

 I guess outline mode does have the exact same problem in this case, in
 fact any mode with large amount of hidden text.

 Of course.  The only difference is that outline is not as popular as
 Org, and usually is used with relatively short chunks of text.  But
 the problems are exactly the same.




[O] C-o now mapped to org-ctrl-o surprise

2013-04-13 Thread Sean O'Halpin
Hi,

I was quite surprised after pulling down master to find that C-o has
been bound to org-ctrl-o (commit 45d6d8f8 2013-04-05 11:14:20 +0200).

I personally don't use open-line much myself so remap this key for my own use.

Wouldn't it be better to do something like:

(define-key org-mode-map [remap open-line] 'org-ctrl-o)

and let the user choose which key does open-line rather than create a
new keybinding which might override a user definition? Also, perhaps
the function should be called org-open-line rather than org-ctrl-o.

Regards,
Sean



Re: [O] What Happened to org-export-html-extension?

2013-03-31 Thread Sean O'Halpin
Hi,

org-html-publish-to-html is defined in ox-html.el and looks like this
(sans doc):

  (defun org-html-publish-to-html (plist filename pub-dir)
(org-publish-org-to 'html filename .html plist pub-dir))

You could define your own publishing function, e.g.

  (defun my-org-html-publish-to-html (plist filename pub-dir)
(org-publish-org-to 'html filename .yml plist pub-dir))

and refer to that in your org-publish-project-alist.

org-html-extension is used in org-html-export-to-html which calls
org-export-to-file, which is the same function org-publish-org-to
calls (so org-html-extension is bypassed).

There's also the export option :html-extension but it doesn't look
like it's used to name published files.

Regards,
Sean



Re: [O] avoid subscripting text

2013-03-27 Thread Sean O'Halpin
On Wed, Mar 27, 2013 at 12:29 PM, Luca Ferrari fluca1...@infinito.it wrote:
 Hi all,
 in my file I've got some text that I'd like to be represented as fixed
 font size, and therefore I write it as ~cap_mkdb~ surrounding with ~.
 The problem is that, when I export the document to ODF, I got the word
 following the underscore written as a subscript. Now this reminds me
 the LaTeX behavior, and when I export it happens to me that LaTeX is
 used for a preliminary conversion.
 Is there a smart way to avoid escaping any underscore?

 Thanks,
 Luca


Hi,

Use

#+OPTION: ^:{}

to leave underscores alone.

Regards,
Sean



Re: [O] [ANN] Merge of new export framework on Wednesday

2013-03-03 Thread Sean O'Halpin
On Sat, Mar 2, 2013 at 6:14 PM, Bastien b...@altern.org wrote:
 Hi Sean,

 Sean O'Halpin sean.ohal...@gmail.com writes:

 One small point: as we're going to have to change the meta directive
 #+STYLE to #+HTML_STYLE, can we change the name to reflect what it
 really does in the HTML backend, i.e. insert text verbatim into the
 head element? I suggest we rename it to #+HTML_HEAD.

 Done.  You can now use HTML_HEAD instead of HTML_STYLE.

 Some variables were also renamed, check the details here:
 http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=2752ef

 Best,

 --
  Bastien

Thanks! It will now feel less hacky to use it for other head elements :)

Also, it's just struck me - wouldn't it be more consistent if
ATTR_HTML were HTML_ATTR, ATTR_LATEX were LATEX_ATTR, etc.? But I
suppose if you go down that route of everything export backend related
being prefixed with the export type, you'd really have to change
BEGIN_HTML to HTML_BEGIN, etc. Perhaps going too far...

Regards,
Sean



Re: [O] babel :results output and format of output

2013-02-24 Thread Sean O'Halpin
On Sun, Feb 24, 2013 at 10:50 AM, D M German d...@uvic.ca wrote:

 hi everybody,


 I have been testing babel with perl and I am very puzzled by the
 following:


 Say I have the following script that outputs 10 numbers. org/babel wraps
 it as a begin_example


 #+begin_src perl :results output
 for (my $i=0;$i10;$i++) {
   print $i\n;
 }
 #+end_src

 #+RESULTS:
 #+begin_example
 0
 1
 2
 3
 4
 5
 6
 7
 8
 9
 #+end_example


 But if my script only outputs 9 lines then the format is not wrapped by
 #+begin_example, and instead is prefixed by :

 #+begin_src perl :results output
 for (my $i=0;$i9;$i++) {
   print $i\n;
 }
 #+end_src

 #+RESULTS:
 : 0
 : 1
 : 2
 : 3
 : 4
 : 5
 : 6
 : 7
 : 8

 Is this behaviour expected? Is the threshold at which it happens
 configurable?

Yes - it's controlled by =org-babel-min-lines-for-block-output= in
lisp/ob-core.el:

#+BEGIN_QUOTE
(defvar org-babel-min-lines-for-block-output 10
  The minimum number of lines for block output.
If number of lines of output is equal to or exceeds this
value, the output is placed in a #+begin_example...#+end_example
block.  Otherwise the output is marked as literal by inserting
colons at the starts of the lines.  This variable only takes
effect if the :results output option is in effect.)
#+END_QUOTE

Regards,
Sean



Re: [O] [ANN] Merge of new export framework on Wednesday

2013-02-09 Thread Sean O'Halpin
On Fri, Feb 8, 2013 at 4:45 PM, Sebastien Vauban
wxhgmqzgw...@spammotel.com wrote:

 Sean O'Halpin wrote:

 I suggest we rename it to #+HTML_HEAD.

 But I'd like to propose HTML_HEADER instead (?), to mirror what LaTeX_HEADER
 does -- at least, if that one still exists, which I'm not sure about (not
 enough played with the new exporter yet).


I'm going on the assumption that what comes after the =#+HTML_= prefix
is specific to the HTML back-end. Where LaTeX has a /conceptual/
header, HTML has a /concrete/ =head= element. There's nothing to
mirror =LaTeX_CLASS= for example because the concept of document class
does not exist in HTML.

This raises another question which is more about Org document export
headers in general: why do we have specific document headers for LaTeX
and HTML? Because we need to able to insert raw markup at specific
points in the exported document. (We also have =html-preamble= and
=html-postamble= which act on every document.) But what about other
exporter back-ends? Say we get a native org to docbook exporter. What
would be the mechanism for inserting markup into the =artheader=?
Would there be a =#+DOCBOOK_HEADER=?

Please forgive my meandering here. It's just struck me that we might
need a more general mechanism for document-level export directives
that will avoid multiplying the number of =#+HTML_= style directives
we already have. Perhaps something along the lines of:

#+BEGIN_SRC ORG
,#+EXPORT html head style .../
,#+EXPORT latex header \usepackage{xyz}
#+END_SRC

where =head= and =header= represent specific places in the exported
document that the exporter in question has defined as places you can
insert raw markup. So, Org would define the =#+EXPORT= protocol,
specific back-ends would define the names and places.

Regards,
Sean



Re: [O] [ANN] Merge of new export framework on Wednesday

2013-02-09 Thread Sean O'Halpin
On Sat, Feb 9, 2013 at 1:56 PM, Nicolas Goaziou n.goaz...@gmail.com wrote:
 Hello,

 Sean O'Halpin sean.ohal...@gmail.com writes:

 This raises another question which is more about Org document export
 headers in general: why do we have specific document headers for LaTeX
 and HTML? Because we need to able to insert raw markup at specific
 points in the exported document. (We also have =html-preamble= and
 =html-postamble= which act on every document.) But what about other
 exporter back-ends? Say we get a native org to docbook exporter. What
 would be the mechanism for inserting markup into the =artheader=?
 Would there be a =#+DOCBOOK_HEADER=?

 Please forgive my meandering here. It's just struck me that we might
 need a more general mechanism for document-level export directives
 that will avoid multiplying the number of =#+HTML_= style directives
 we already have. Perhaps something along the lines of:


 #+BEGIN_SRC ORG
 ,#+EXPORT html head style .../
 ,#+EXPORT latex header \usepackage{xyz}
 #+END_SRC


 where =head= and =header= represent specific places in the exported
 document that the exporter in question has defined as places you can
 insert raw markup. So, Org would define the =#+EXPORT= protocol,
 specific back-ends would define the names and places.

 Not every back-end has a concept of head (think about Markdown
 back-end). We don't need a general concept for something that isn't
 general.

I haven't made myself clear. I'm not suggesting a general concept of
head. What I am suggesting is that the back-ends handle these
back-end specific concepts themselves, rather than add more buffer
keywords for every new exporter. The general concept is that we want
to communicate document level information to the back-end, in this
case, bits of text to insert at specific places which are dependent on
the specific back-end in question.

 Also, completely unifying every back-end is close to impossible, unless
 the same person writes every back-end[1]. Most of the options are
 shared, that's the goal of ox.el, but in the end, each back-end decides
 how it handles the others.

This would not require unifying every back-end at all. In fact, quite
the opposite. All you would need would be for the generic exporter
framework to provide the back-end a dictionary of key value pairs,
such as ((:head script.../) ...), which the back-end would
interpret. You would avoid having to add document level keywords such
as HTML_STYLE and MAN_CLASS_OPTIONS for new exporters. It would be the
back-end's responsibility to validate and document these options. My
suggestion is really not so different from what the new exporter does
anyway. Where we now have =#+HTML_LINK_UP: ...=, I'm suggesting we
have =#+EXPORT: html link-up ...=.

Perhaps I'm just expressing a preference for fewer buffer-level
keywords - feel free to ignore the suggestion.

Regards,
Sean



Re: [O] How to pass a block of text to a code block as data?

2013-02-09 Thread Sean O'Halpin
On Sat, Feb 9, 2013 at 2:59 AM, Michael Baum maab...@gmail.com wrote:

 - What signals the end of the block of text to be used as data? I take it
 that it's important that these all be comment lines staring with a colon
 after the #+name label? Is there a way to do the same thing with a begin and
 end block construction?

 - In this line:

#+begin_src sh :stdin lines-of-text :results output

 does the flag :stdin mean that the following named block literally becomes
 the STDIN stream for the code block? If I replace your shell/grep example
 with this:

 #+begin_src perl :stdin lines-of-text :results output
 while () {
print $_;
 }
 #+end_src

 ...it doesn't work, although as far as I know that perl code snippet should
 in fact simply print out the incoming lines from stdin.

 Thanks again,

 Michael

Hi,

The :stdin option is only defined for shell and awk AFAIK. (Might be
an idea to add to other languages..)

You can pass in a variable referring to the block of text, as shown
below (example for ruby but should work for perl):

#+begin_src org

#+name: more-lines-of-text
#+begin_example
What signals the end of the block of text to be used as data? I take
it that it's important that these all be comment lines staring with a
colon after the #+name label? Is there a way to do the same thing with
a begin and end block construction?
#+end_example

#+begin_src ruby :var lines=more-lines-of-text :results output
  puts lines.reverse
#+end_src

#+RESULTS:
: ?noitcurtsnoc kcolb dne dna nigeb a
: htiw gniht emas eht od ot yaw a ereht sI ?lebal eman+# eht retfa noloc
: a htiw gnirats senil tnemmoc eb lla eseht taht tnatropmi s'ti taht ti
: ekat I ?atad sa desu eb ot txet fo kcolb eht fo dne eht slangis tahW

#+end_src

Regards,
Sean



Re: [O] [ANN] Merge of new export framework on Wednesday

2013-02-08 Thread Sean O'Halpin
Great work on the new exporter!

One small point: as we're going to have to change the meta directive
#+STYLE to #+HTML_STYLE, can we change the name to reflect what it
really does in the HTML backend, i.e. insert text verbatim into the
head element? I suggest we rename it to #+HTML_HEAD.

Regards,
Sean



Re: [O] external process modifying buffers

2012-10-13 Thread Sean O'Halpin
On Sat, Oct 13, 2012 at 5:27 PM, Ken Mankoff mank...@gmail.com wrote:

 Can you suggest how to have it as a local file variable when the
 command that generates the file over-writes it? I have modified the
 code that produces the iCal.org file so the top line now is:

 # -*- coding: utf-8; auto-revert-mode: t; -*-


 But emacs does not seem to be obeying the command.

I've found this works for me:

  # -*- coding: utf-8; eval: (auto-revert-mode 1); -*-

Regards,
Sean



Re: [O] [OT] Xiki - could something like that be done with emacs+orgmode?

2012-09-19 Thread Sean O'Halpin
On Wed, Sep 19, 2012 at 4:37 AM, Andrew Hyatt ahy...@gmail.com wrote:

 The xiki video is interesting, and I immediately thought of babel.
 However, babel sh-mode doesn't have support for execution yet.

Not sure what you mean by that. Place cursor in source block and hit C-c, e.g.

#+BEGIN_ORG
* Shell example

#+begin_src sh
date
#+end_src

#+RESULTS:
: Wed Sep 19 07:24:17 BST 2012

#+END_ORG

Regards,
Sean



Re: [O] Macro and babel

2012-09-19 Thread Sean O'Halpin
On Wed, Sep 19, 2012 at 1:54 AM, tony day zygom...@gmail.com wrote:

 I had written this:

 ,
 | #+MACRO: testdir ~/working
 | #+begin_src sh
 |   cd  {{{testdir}}}
 | #+end_src
 `

 Thinking it would do this:

 ,
 | #+begin_src sh
 |   cd ~/working
 | #+end_src
 `
 Alas, #+Macro acts on export only.

 Is there a quick way to effect general text substitution on C-c C-c?  That 
 would be an awesome feature, basically adding macro capabilities to every 
 babelable language.  Or am I missing something?


 Tony

Here's a somewhat roundabout way of achieving something similar:

#+BEGIN_ORG

#+NAME: test-dir2
#+BEGIN_SRC sh :var dir=. :results output org :exports none
echo 
,#+begin_src sh
cd $dir
,#+end_src

#+END_SRC

#+CALL: test-dir2(dir=~/org) :results value raw :exports both

#+CALL: test-dir2(dir=/var/www/) :results value raw :exports both

#+END_ORG

HTH,
Sean



[O] [PATCH][New exporter] Fix: org-e-html-special-block had not been converted from LaTeX version

2012-08-29 Thread Sean O'Halpin
* contrib/lisp/org-e-html.el (org-e-html-special-block): convert LaTeX
markup to HTML

This function had not been modified from its org-e-latex-special-block original
so with #+BEGIN_ORG for example you would get \begin{org}...\end{org}
in the output
instead of div class=org.../div.
---
 contrib/lisp/org-e-html.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/lisp/org-e-html.el b/contrib/lisp/org-e-html.el
index 1c2255b..2d3d3c4 100644
--- a/contrib/lisp/org-e-html.el
+++ b/contrib/lisp/org-e-html.el
@@ -2617,7 +2617,7 @@ holding contextual information.
   (let ((type (downcase (org-element-property :type special-block
 (org-e-html--wrap-label
  special-block
- (format \\begin{%s}\n%s\\end{%s} type contents type
+ (format div class=\%s\\n%s\n/div type contents


  Src Block
-- 
1.7.0.4



Re: [O] [BABEL] [PATCH] Make it possible to use buffer local noweb start/end patterns

2012-08-26 Thread Sean O'Halpin
On Sun, Aug 26, 2012 at 3:31 PM, Eric Schulte eric.schu...@gmx.com wrote:
 [snip]
 I just committed this to the git repo.

 Thanks for the contribution!
 (and thanks for packaging your patch so that it was easy to apply)

Great! Thanks.



[O] [BABEL] [PATCH] Make it possible to use buffer local noweb start/end patterns

2012-08-25 Thread Sean O'Halpin
* lisp/ob.el (org-babel-expand-noweb-references): Capture current
noweb start and end patterns then use to set buffer locals in
(with-temp-buffer) form.

This solves the problem that using different patterns for
org-babel-noweb-wrap-start and org-babel-noweb-wrap-end could be done
only globally.

TINYCHANGE
---
 lisp/ob.el |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lisp/ob.el b/lisp/ob.el
index 7518293..f9e9ae1 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -2270,6 +2270,8 @@ block but are passed literally to the \example-block\.
  (info (or info (org-babel-get-src-block-info)))
  (lang (nth 0 info))
  (body (nth 1 info))
+(ob-nww-start org-babel-noweb-wrap-start)
+(ob-nww-end org-babel-noweb-wrap-end)
 (comment (string= noweb (cdr (assoc :comments (nth 2 info)
 (rx-prefix (concat \\( org-babel-src-name-regexp \\|
:noweb-ref[ \t]+ \\)))
@@ -2282,6 +2284,8 @@ block but are passed literally to the \example-block\.
 (org-babel-trim (buffer-string)
 index source-name evaluate prefix blocks-in-buffer)
 (with-temp-buffer
+  (org-set-local 'org-babel-noweb-wrap-start ob-nww-start)
+  (org-set-local 'org-babel-noweb-wrap-end ob-nww-end)
   (insert body) (goto-char (point-min))
   (setq index (point))
   (while (and (re-search-forward (org-babel-noweb-wrap) nil t))
-- 
1.7.0.4



Re: [O] [BABEL] [PATCH] Make it possible to use buffer local noweb start/end patterns

2012-08-25 Thread Sean O'Halpin
On Sat, Aug 25, 2012 at 11:50 PM, Eric Schulte eric.schu...@gmx.com wrote:
 Are you familiar with file local variables?

 See (info (emacs)Specifying File Variables)


Yes. That's what I'm trying to enable. Without the patch, it seems that
the =with-temp-buffer= used in =org-babel-expand-noweb-references=
overrides any file local variables. In other words, setting
=org-babel-noweb-wrap-start= and =org-babel-noweb-wrap-end= using
file local variables doesn't work for me without this patch. Am I
missing something?

Regards,
Sean



Re: [O] babel print

2012-08-22 Thread Sean O'Halpin
On Wed, Aug 22, 2012 at 8:38 PM, skip scp0...@gmail.com wrote:
 I have an org file with several src blocks and tangle blocks.

 How can I print the file without executing any of the src or tangle
 blocks? I want to avoid disabling each block.

Use

  #+PROPERTY: eval never

at the head of the file and C-c on that line to refresh the local setup.
This disables execution for all blocks in the file. Alternatively, you can use

  #+PROPERTY: eval no-export

to disable it only for exporting.

See http://orgmode.org/org.html#eval for details.

 How can I generate the tangle files only without executing any other
 src blocks in the file? I want to avoid going to each tangle block and
 executing.

=M-x org-babel-tangle= should tangle all the blocks in the file.

See http://orgmode.org/org.html#Extracting-source-code

Regards,
Sean



Re: [O] org-link minor mode

2012-08-19 Thread Sean O'Halpin
On Sat, Aug 18, 2012 at 4:07 PM, Bastien b...@altern.org wrote:
 Hi Sean,

 I just added links to your code in worg/org-hacks.org and
 worg/org-contrib/index.org -- thanks!

Thanks!

 I see it as orthogonal to orgstruct - they could happily co-exist side by 
 side.
 I've just tested that though and it seems they don't. I'll try to fix
 that.

 Okay, let us know how it goes!

Certainly (though it might take a little longer...)

Regards,
Sean



Re: [O] org-link minor mode

2012-08-17 Thread Sean O'Halpin
On Tue, Aug 14, 2012 at 11:57 AM, Christopher J. White
orgm...@grierwhite.com wrote:
 This is pretty cool, Sean.  One issue I'm having is that it does not
 properly handle breaking the link:

Thanks for trying it out. I think I've fixed the link breaking
problem (using font-lock-unfontify-region-function). Source in github
at: https://github.com/seanohalpin/org-link-minor-mode

Regards,
Sean



Re: [O] org-link minor mode

2012-08-17 Thread Sean O'Halpin
On Tue, Aug 14, 2012 at 8:49 AM, Bastien b...@gnu.org wrote:
 Sean O'Halpin sean.ohal...@gmail.com writes:

 I've been hacking this weekend to try to create a minor mode that
 enables org-mode bracket links in modes other than org-mode.
[snip]
 Yes.  This might especially be useful in modes where people use
 orgstruct as well -- and could well end up being part of orgstruct,
 if that's not too invasive.

I see it as orthogonal to orgstruct - they could happily co-exist side by side.
I've just tested that though and it seems they don't. I'll try to fix that.

 I'm not sure how to prevent turning on org-link-minor-mode
 from an org-mode buffer

 Simply use

 (unless (derived-mode-p 'org-mode)

 on the top of your function?

Thanks - I used your suggestion as you can see here:

  
https://github.com/seanohalpin/org-link-minor-mode/blob/master/org-link-minor-mode.el

I realised the problem I had was that I can't prevent entering the minor mode
because by the time I check for org-mode, the minor mode has already been
entered so I have to turn it off again.

BTW, I've refactored the code to simplify it and added more link types.

Regards,
Sean



[O] org-link minor mode

2012-08-12 Thread Sean O'Halpin
Hi,

I've been hacking this weekend to try to create a minor mode that
enables org-mode bracket links in modes other than org-mode.

I believe this has been mooted before
(e.g. http://lists.gnu.org/archive/html/emacs-orgmode/2009-08/msg00573.html).

The following codes works for me but I'm sure it could be improved.

I'm an elisp noob so I'd very much appreciate feedback on the approach
I'm taking.  For example, I'm not sure how to prevent turning on
org-link-minor-mode from an org-mode buffer - advice would be welcome.

Regards,
Sean

#+begin_src emacs-lisp

(require 'org)

(define-minor-mode org-link-minor-mode
  Toggle display of org-mode style bracket links in non-org-mode buffers.
  :lighter  org-link
  (let ((org-link-minor-mode-keywords (list
'(org-activate-bracket-links (0 'org-link t)
(save-excursion
  (save-match-data
(goto-char (point-min))
(if org-link-minor-mode
(progn
  (font-lock-add-keywords nil org-link-minor-mode-keywords t)
  (set (make-local-variable 'org-descriptive-links)
org-descriptive-links)
  (if org-descriptive-links (add-to-invisibility-spec '(org-link)))
  (font-lock-fontify-buffer)
  )
  (progn
(font-lock-remove-keywords nil org-link-minor-mode-keywords)
(org-remove-from-invisibility-spec '(org-link))
(while (re-search-forward org-bracket-link-regexp nil t)
  ;; Remove all org-link properties
  (remove-text-properties (match-beginning 0) (match-end
0) (text-properties-at (match-beginning 0)))
  )
)
  )

(provide 'org-link-minor-mode)

#+end_src



Re: [O] Code for feature for showing progress in lisp code for creation of Gantt charts

2012-05-27 Thread Sean O'Halpin
On Fri, May 25, 2012 at 8:49 AM,  julia.jacob...@arcor.de wrote:

 Thanks for your answer. The key-combination C-c C-c unfortunately creates the 
 new additional block of code surrounded by the lines
 #+RESULTS:
 #+begin_latex
  Here's the created LaTeX code
 #+end_latex
 right after the lisp function.

 This code block has to be moved just before the line beginning with
 #+   \\draw...
 to get the order right again.

 I tried to include the results of the evaluation of the lisp function there 
 by placing
 #+RESULTS: elispgantt
 there (because there's a line saying #+source: elispgantt), but for unknown 
 reasons,
 the results of code evaluation are always placed just after the elispgantt 
 function.
 Any help to fix that is appreciated.

Use

  #+name: elispgantt

instead of

  #+source: elispgantt

I've tried it with your example and it works. AFAIR #+source was
deprecated a while ago.

Regards,
Sean



Re: [O] Patch: option to not hide brackets in org links

2012-05-12 Thread Sean O'Halpin
On Thu, May 10, 2012 at 9:56 AM, Paul Sexton psexton...@gmail.com wrote:
 Sean O'Halpin sean.ohalpin at gmail.com writes:
 Is that publicly available anywhere?

 Here you go. To use, add orgl-enable to the relevant mode-hook, eg:
 (add-hook 'python-mode-hook 'orgl-enable)

[snip code]

Thanks!



Re: [O] Patch: option to not hide brackets in org links

2012-05-10 Thread Sean O'Halpin
On Wed, May 9, 2012 at 10:07 PM, Paul Sexton psexton...@gmail.com wrote:

 I have a
 minor mode that makes org-style links fully active and fontifed in other major
 modes.

Is that publicly available anywhere?

Regards,
Sean



Re: [O] Feature request for noweb mode that strips references on export

2012-04-01 Thread Sean O'Halpin
On Sat, Mar 31, 2012 at 4:32 PM, Eric Schulte eric.schu...@gmx.com wrote:

 Thanks for bringing this problem to light.  I've just pushed up a fix.

 Cheers,

 --
 Eric Schulte
 http://cs.unm.edu/~eschulte/

Thanks! This is really useful.

Regards,
Sean



Re: [O] Feature request for noweb mode that strips references on export

2012-03-31 Thread Sean O'Halpin
On Fri, Mar 30, 2012 at 5:37 PM, Nick Dokos nicholas.do...@hp.com wrote:
 This may have nothing to do with anything (it may even be an artifact of
 mailer misbehavior) but is this supposed to be boilerplate? These
 are supposed to be ASCII chars, so if you are using some sort of extended
 charset, try changing them and see if that works.

 Nick

I've customized =org-babel-noweb-wrap-start= and
=org-babel-noweb-wrap-end= to use guillemets rather than angle
brackets. The noweb stuff is working. It's the lack of the results output
when using strip-export that is bugging me.



Re: [O] Feature request for noweb mode that strips references on export

2012-03-31 Thread Sean O'Halpin
On Fri, Mar 30, 2012 at 5:39 PM, Daimrod daim...@gmail.com wrote:
 If you don't want to export boilerplate you've to use :exports none in
 it.

 #+name: boilerplate
 #+begin_src ruby :exports none
 def hello
  Hello World
 end
 #+end_src

 Use it

 #+name: example
 #+begin_src ruby :exports both :noweb strip-export
 boilerplate

 hello
 #+end_src

Thanks but that's not my problem. When I use :exports both I get the
code but not the results output in my exported HTML.
Do you get the Hello World output? If so, it looks like I'll have to
debug my configuration.



Re: [O] Feature request for noweb mode that strips references on export

2012-03-30 Thread Sean O'Halpin
Hi,

I've tried to use the new :noweb strip-export feature but I can't work
out the magic combination of headers (working with git head, i.e.
commit 67694297fa0f9b32cf4bfe812ba8a5c5cf4a0859).

Here is a stripped down example:

START OF EXAMPLE

* Example

Define method

#+name: boilerplate
#+begin_src ruby
def hello
  Hello World
end
#+end_src

Use it

#+name: example
#+begin_src ruby :exports both :noweb strip-export
«boilerplate»

hello
#+end_src

And here is the result:

#+RESULTS: example
: Hello World

END OF EXAMPLE

On export, I expect this to display the result string Hello World
after the code hello but get nothing. If I change the :noweb
strip-export to :noweb yes, I do get the output (but also the
boilerplate of course).

Is strip-export meant to work like this? If so, could someone please
post a working example?

Thanks,
Sean



Re: [O] Export to multiple HTML files?

2012-03-03 Thread Sean O'Halpin
On Mon, Feb 27, 2012 at 5:19 PM, Avdi Grimm gro...@inbox.avdi.org wrote:
 Is there a way to export a single Org file to a bunch of HTML files,
 one for each heading of a given level? E.g. the way the Org manual is
 presented at http://orgmode.org/manual ? (yes, I realize that's Info
 not org-mode)I thought I remembered that being possible, but now I
 can't find it.

 Thanks!

 --
 Avdi Grimm
 http://avdi.org


I don't recall an export to multiple HTML files. Are you thinking of
the INFOJS[1] Javascript enhanced export option?

[1]: http://orgmode.org/manual/JavaScript-support.html



Re: [O] anyway to create link to a line number in a file

2012-02-18 Thread Sean O'Halpin
On Fri, Feb 17, 2012 at 4:54 PM, Not To Miss not.to.m...@gmail.com wrote:
 Hi all,

 I am reading a long text file and want to write down my notes with
 org-mode. I extremely would like to put the line numbers down along
 with my notes. Although there is a way to store a link for text search
 for the current line, I haven't found a way to create a link to a line
 number in the current buffer. Is there anyway to do that? Thanks

Take a look at org-capture: http://orgmode.org/manual/Capture.html



Re: [O] [Babel] [PATCH] Customize regular expression to match noweb references

2012-01-28 Thread Sean O'Halpin
On Fri, Jan 27, 2012 at 11:05 PM, Eric Schulte eric.schu...@gmx.com wrote:
 Good idea,

 I've changed your implementation to rely on two new customization
 variables `org-babel-noweb-wrap-start' and `org-babel-noweb-wrap-end' as
 this provides more flexibility to the backend implementation to place
 constraints on the properties of the noweb names.

 In you're situation you will now want to set...
 (setq org-babel-noweb-wrap-start «
      org-babel-noweb-wrap-end   »)

 Thanks for the great idea,


Seems to work fine. Thanks for implementing it so quickly and thanks
for org-babel!

Regards,
Sean



Re: [O] [BUG] org-agenda-switch-to fails with void function org-pop-to-buffer-same-window

2011-12-15 Thread Sean O'Halpin
On Thu, Dec 15, 2011 at 1:26 AM, Jeff Horn jrhorn...@gmail.com wrote:
 Recently did a fresh pull, which seems to have broken org-agenda-switch-to.

 To reproduce, open an agenda buffer, navigate to a line you want to
 inspect, press [RET]. On my machine, this calls autopair, then falls
 back to org-agenda-switch-to. Autopair doesn't seem to be causing the
 problem, since it persists even if I call =M-x org-agenda-switch-to=
 instead of pressing [RET].

 Org-mode version 7.8.02 (release_7.8.02.3.gfb8c)
 GNU Emacs 24.0.90.3 (i386-apple-darwin9.8.0, NS apple-appkit-949.54)
 of 2011-12-14 on braeburn.aquamacs.org - Aquamacs Distribution 3.xdev

 Can anyone reproduce?


I recently had a similar problem with =org-pop-to-buffer-same-window=
. It turned out that after switching to using =org-babel-load-file= to
load my init file, emacs was then using the org-mode installed in
site-lisp rather than my local git copy.

I fixed this by setting =load-path= to point to my local git copy of
org-mode before calling =org-babel-load-file=.

HTH.

Regards,
Sean



Re: [O] #+end_src interfering with :results raw

2011-05-14 Thread Sean O'Halpin
On Sat, May 14, 2011 at 7:49 AM, Mark Cox markco...@gmail.com wrote:
 Hi,

 I have an org file like this one,

 #+TITLE: An issue with #+end_src

 #+srcname: no_issue()
 #+begin_src sh :results output
 echo '#+begin_src'
 #+end_src

 #+call: no_issue() :results raw

 #+srcname: the_issue()
 #+begin_src sh :results output
 echo '#+end_src'
 #+end_src

 #+call: the_issue() :results raw

 When C-c C-c on the line containing #+call: no_issue() :results raw, the 
 following lines are inserted:
 #+results: no_issue()
 #+begin_src

 When C-c C-c on the line containing #+call: the_issue() :results raw, the 
 following unexpected lines are inserted:
 #+results: the_issue()
 nil

 I am currently running a2f29de86.

 Thanks
 Mark Cox


Looks like you've run into the same issue as me. See
http://patchwork.newartisans.com/patch/715/ for a patch.

Regards,
Sean



Re: [O] Illiterate programming question

2011-03-31 Thread Sean O'Halpin
On Wed, Mar 30, 2011 at 11:52 PM, Eric Schulte schulte.e...@gmail.com wrote:
 Babel does have a way to bring changes back from pure source code into
 code blocks in an Org-mode document.  While it isn't perfect (especially
 if you make extensive use of noweb references or variables) there are
 mechanisms to maintain such a /sync/.  To try this out, tangle out code
 with the :comments yes header argument, then change an element of the
 tangled source code, and use the `org-babel-detangle' function to bring
 the changes back into the Org-mode document.

 Improving the detangling (or illiterate) features is an area ripe for
 future Babel development.

 Cheers -- Eric


Hi,

Could anyone please give a working example of this? I tried tangling
the following:

   * A tangle example

   #+source: body
   #+begin_src ruby :comments yes :noweb yes
 puts hello
   #+end_src

   #+source: method
   #+begin_src ruby :comments yes :noweb yes
 def hello
   body
 end
   #+end_src

   #+source: main
   #+begin_src ruby :comments yes :tangle detangle.rb :noweb yes
 method
 hello
   #+end_src

and got the output:

   # [[][main]]

   def hello
 puts hello
   end
   hello

   # main ends here

which doesn't look right to me.

Regards,
Sean



Re: [O] Illiterate programming question

2011-03-31 Thread Sean O'Halpin
On Thu, Mar 31, 2011 at 9:13 PM, Nick Dokos nicholas.do...@hp.com wrote:
 Sean O'Halpin sean.ohal...@gmail.com wrote:

 On Wed, Mar 30, 2011 at 11:52 PM, Eric Schulte schulte.e...@gmail.com 
 wrote:
  Babel does have a way to bring changes back from pure source code into
  code blocks in an Org-mode document.  While it isn't perfect (especially
  if you make extensive use of noweb references or variables) there are
  mechanisms to maintain such a /sync/.  To try this out, tangle out code
  with the :comments yes header argument, then change an element of the
  tangled source code, and use the `org-babel-detangle' function to bring
  the changes back into the Org-mode document.
 
  Improving the detangling (or illiterate) features is an area ripe for
  future Babel development.
 
  Cheers -- Eric
 
 
 Hi,

 Could anyone please give a working example of this? I tried tangling
 the following:

    * A tangle example

    #+source: body
    #+begin_src ruby :comments yes :noweb yes
      puts hello
    #+end_src

    #+source: method
    #+begin_src ruby :comments yes :noweb yes
      def hello
        body
      end
    #+end_src

    #+source: main
    #+begin_src ruby :comments yes :tangle detangle.rb :noweb yes
      method
      hello
    #+end_src

 and got the output:

    # [[][main]]

    def hello
      puts hello
    end
    hello

    # main ends here

 which doesn't look right to me.


 What should it look like?

 Nick

To be honest, I don't know what it /should/ look like but I have ':comments yes'
on three sections and get only one link on output, so I can't see how this
would detangle properly.

Also,

# [[][main]]

is missing the file reference (in the first set of brackets), so it
won't work as a link.

Regards,
Sean

P.S. Apologies again for not replying to all first time.



[O] [PATCH] Avoid spurious matches to literal #+end_src inside source block

2011-03-25 Thread Sean O'Halpin
From d5a47db19a6c263b0516c454594296da9f44c428 Mon Sep 17 00:00:00 2001
From: Sean O'Halpin sean.ohal...@gmail.com
Date: Fri, 25 Mar 2011 22:16:54 +
Subject: [PATCH] * lisp/ob.el: Avoid spurious matches to literal
#+end_src inside a source block.

Added newline to org-babel-src-block-regexp.

---
 lisp/ob.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/ob.el b/lisp/ob.el
index 6b4a766..8938b3b 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -141,7 +141,7 @@ remove code block execution from the C-c C-c keybinding.
;; (4) header arguments
\\([^\n]*\\)\n
;; (5) body
-   \\([^\000]*?\n*\\)[ \t]*#\\+end_src)
+   \\([^\000]*?\n*\\)\n[ \t]*#\\+end_src)
   Regexp used to identify code blocks.)

 (defvar org-babel-inline-src-block-regexp
-- 
1.7.0.4



Re: [O] [PATCH][ANN] org-html/org-odt

2011-03-25 Thread Sean O'Halpin
Hi,

I was getting the error:

org-html-insert-toc: Wrong type argument: char-or-string-p, nil

when trying to generate an HTML file with

#+OPTIONS: toc:nil

The patch below seems to fix this.

Regards,
Sean

index bd53741..37eddf4 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -2113,7 +2113,7 @@ the alist of previous items.

 (defun org-html-end-export ()
   ;; insert the table of contents
-  (when (and org-export-with-toc (not body-only))
+  (when (and org-export-with-toc (not body-only) org-parse-table-of-contents)
 (org-html-insert-toc org-parse-table-of-contents))

   ;; remove empty paragraphs