Re: [O] Don't ask, don't run

2011-07-11 Thread Ken Williams
Eric Schulte  gmail.com> writes:

> There is no way to customize `org-confirm-evaluate' to achieve this
> behavior, however it can be accomplished through creative use of the
> :eval header argument, by using the `org-export-current-backend'
> variable to inhibit evaluation during export.
> 
> #+begin_src emacs-lisp :eval (if org-export-current-backend "never"
>  "yes") :exports results
>   (message "launch missles")
> #+end_src

I see, thanks.  Since I'm new to this, can I confirm my understanding 
here?  It tests whether the 'org-export-current-backend' variable is
set, which means we're currently exporting, and if so, we set the 
:eval argument to "never".  Otherwise we set it to "yes", which means
evaluate it without asking.

Assuming that understanding is correct, I have a couple of followup
questions.

1) http://orgmode.org/manual/eval.html doesn't list the "yes" option, 

2) Is there a similar variable I might test to check whether it's currently
doing an explicit C-c C-c action?  If there were, I might prefer 
something like :eval (if org-export-current-backend "never" (if 
org-doing-c-c-c-c "yes" "query")), so that I cover some other
scenario besides export or C-c C-c.

3) Finally, is there a way to add this argument fanciness implicitly
to *all* the source blocks in my file?  Or will it have to go on 
all of them?

Thanks much.

 -Ken




Re: [O] calculating column averages

2011-07-22 Thread Ken Williams
Jude DaShiell  shellworld.net> writes:

> 
> In this case I don't want to tell org-mode how many rows to calculate, and 
> I put a table together with an averages line in its own footer section.  

Since you have a header & footer, one solution is to use a formula like this:

   :=vmean(@I..@II)

 -Ken




[O] LaTeX export crashes

2011-10-14 Thread Ken Williams
Hi, the following document makes a LaTeX export (C-c C-e d) crash with
"Args out of range: "", -1, 0".  After that, exporting (to any format)
dies with the same error.

--
#+TITLE: Test doc
#+AUTHOR: Ken Williams

Some stuff.

#+begin_src R
5+5
#+end_src
--

Is this a known problem?

If I either omit the R source block, or add a top-level outline
element to the document, then the export succeeds.  For now as a
workaround I guess I'll add a header.

Thanks,

 -Ken



Emacs  : GNU Emacs 23.3.1 (i386-mingw-nt6.1.7600)
 of 2011-03-10 on 3249CTO
Package: Org-mode version 7.7

current state:
==
(setq
 org-log-done 'time
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-speed-command-hook '(org-speed-command-default-hook
org-babel-speed-command-hook)
 org-babel-load-languages '((emacs-lisp) (R . t))
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-alphabetical-lists t
 org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup)
 org-export-html-style "\n
<!--/*--><![CDATA[/*><!--*/\n  .src {
background-color: #F5FFF5; position: relative; overflow: visible;
margin-right: auto; }\n  .src:before  { position: absolute;
top: -15px; background: #ff; padding: 1px; border: 1px solid
#00; font-size: small; }\n  .src-sh:before   { content: 'sh';
}\n  .src-bash:before { content: 'sh'; }\n  .src-R:before{
content: 'R'; }\n  .src-perl:before { content: 'Perl'; }\n
.src-sql:before  { content: 'SQL'; }\n  .example {
background-color: #FFF5F5; }\n/*]]>*/-->\n"
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-export-preprocess-hook '((lambda nil
   (org-set-local (quote
 org-complex-heading-regexp)
"^\\(\\*+\\)[
 ]+\\(?:\\(TODO\\|DONE\\)\\>\\)?\\(?:[  ]*\\(\\[#.\\]\\)\\)?[
 ]*\\(.*?\\)\\(?:[  ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[]*$")
   )
  )
 org-tab-first-hook '(org-hide-block-toggle-maybe
org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-cycle-hook '(org-cycle-hide-archived-subtrees
 org-cycle-hide-drawers org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-export-preprocess-before-normalizing-links-hook
'(org-remove-file-link-modifiers)
 org-mode-hook '(#[nil "\300\301\302\303\304$\207" [org-add-hook
 change-major-mode-hook org-show-block-all append local]
   5]
 #[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook
 org-babel-show-result-all append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
org-babel-execute-safely-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-export-interblocks '((lob org-babel-exp-lob-one-liners) (src
org-babel-exp-inline-src-blocks))
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-occur-hook '(org-first-headline-recenter)
 org-from-is-user-regexp nil
 org-export-babel-evaluate nil
 org-export-preprocess-before-selecting-backend-code-hook
'(org-beamer-select-beamer-code)
 org-confirm-babel-evaluate nil
 org-export-latex-final-hook '(org-beamer-amend-header
 org-beamer-fix-toc org-beamer-auto-fragile-frames
   org-beamer-place-default-actions-for-lists)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-export-blocks '((src org-babel-exp-src-block nil) (comment
 org-export-blocks-format-comment t)
 (ditaa org-export-blocks-format-ditaa nil) (dot
org-export-blocks-format-dot nil))
 )



[O] LaTeX export crashes

2011-10-14 Thread Ken Williams
Hi, the following document makes a LaTeX export (C-c C-e d) crash with "Args 
out of range: "", -1, 0".  After that,

--
#+TITLE: Test doc
#+AUTHOR: Ken Williams

Some stuff.

#+begin_src R
5+5
#+end_src
--

Is this a known problem?

If I either omit the R source block, or add a top-level outline element to the 
document, then the export succeeds.  For now as a workaround I guess I'll add a 
header.

Thanks,

 -Ken

CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] LaTeX export crashes

2011-10-17 Thread Ken Williams
On Thu, Oct 13, 2011 at 4:48 PM, Ken Williams  wrote:
> Hi, the following document makes a LaTeX export (C-c C-e d) crash with
> "Args out of range: "", -1, 0".  After that, exporting (to any format)
> dies with the same error.
> [snip]

Then Sebastien Vauban wrote:
> Works for me, with Org-mode version 7.7 (release_7.7.381.ge8629.dirty).

Here's a full stack trace, does this make it any more evident what's going on?

 -Ken

Debugger entered--Lisp error: (args-out-of-range "" -1 0)
  substring("" -1)
  (string= "\n" (substring body sub-length))
  (if (string= "\n" (substring body sub-length)) (substring body 0
sub-length) body)
  (let* ((body ...) (sub-length ...)) (if (string= "\n" ...)
(substring body 0 sub-length) body))
  (org-babel-clean-text-properties (let* (... ...) (if ... ... body)))
  (let* ((block-indentation ...) (lang ...) (lang-headers ...)
(switches ...) (body ...) (preserve-indentation ...)) (list lang
(with-temp-buffer ...) (org-babel-merge-params
org-babel-default-header-args ... ... ... ...) switches
block-indentation))
  org-babel-parse-src-block-match()
  (setq info (org-babel-parse-src-block-match))
  (save-excursion (goto-char head) (setq info
(org-babel-parse-src-block-match)) (setq indent (car ...)) (setq info
(butlast info)) (while (and ... ...) (setf ... ...)) (when (looking-at
org-babel-src-name-w-name-regexp) (setq name ...) (when ... ...)))
  (if (setq head (org-babel-where-is-src-block-head)) (save-excursion
(goto-char head) (setq info ...) (setq indent ...) (setq info ...)
(while ... ...) (when ... ... ...)) (when (save-excursion ... ...)
(setq info ...)))
  (let ((case-fold-search t) head info name indent) (if (setq head
...) (save-excursion ... ... ... ... ... ...) (when ... ...)) (when
(and info ...) (setf ... ...)) (when info (append info ...)))
  org-babel-get-src-block-info(light)
  (let* ((info ...) (lang ...) (raw-params ...) hash) (when info (when
... ... ...) (setf ... ...) (org-babel-exp-do-export info ... hash)))
  (save-excursion (goto-char (match-beginning 0)) (let* (... ... ...
hash) (when info ... ... ...)))
  org-babel-exp-src-block("" #("R" 0 1 (font-lock-fontified t fontified nil)))
  apply(org-babel-exp-src-block "" #("R" 0 1 (font-lock-fontified t
fontified nil)))
  (if (memq type org-export-blocks-witheld) "" (apply func body headers))
  (progn (if (memq type org-export-blocks-witheld) "" (apply func body
headers)))
  (unwind-protect (progn (if ... "" ...)) (set-match-data
save-match-data-internal (quote evaporate)))
  (let ((save-match-data-internal ...)) (unwind-protect (progn ...)
(set-match-data save-match-data-internal ...)))
  (save-match-data (if (memq type org-export-blocks-witheld) "" (apply
func body headers)))
  (let ((replacement ...)) (when replacement (delete-region
match-start match-end) (goto-char match-start) (insert replacement)
(unless preserve-indent ...)))
  (progn (let (...) (when replacement ... ... ... ...)))
  (if (setq func (cadr ...)) (progn (let ... ...)))
  (when (setq func (cadr ...)) (let (...) (when replacement ... ... ... ...)))
  (let* ((match-start ...) (body-start ...) (indentation ...)
(inner-re ...) (type ...) (headers ...) (balanced 1) (preserve-indent
...) match-end) (while (and ... ...) (if ... ... ...)) (when (not ...)
(error "unbalanced begin/end_%s blocks with %S" type ...)) (setq
match-end (match-end 0)) (unless preserve-indent (setq body ...))
(unless (memq type types) (setq types ...)) (save-match-data
(interblock start match-start)) (when (setq func ...) (let ... ...)))
  (while (re-search-forward beg-re nil t) (let* (... ... ... ... ...
... ... ... match-end) (while ... ...) (when ... ...) (setq match-end
...) (unless preserve-indent ...) (unless ... ...) (save-match-data
...) (when ... ...)) (setq start (point)))
  (let ((beg-re "^\\([  ]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[
\n]")) (while (re-search-forward beg-re nil t) (let* ... ... ... ...
... ... ... ...) (setq start ...)))
  (progn (fset (quote interblock) (function* ...)) (goto-char
(point-min)) (setq start (point)) (let (...) (while ... ... ...))
(interblock start (point-max)) (run-hooks (quote
org-export-blocks-postblock-hook)))
  (unwind-protect (progn (fset ... ...) (goto-char ...) (setq start
...) (let ... ...) (interblock start ...) (run-hooks ...)) (if
--cl-letf-bound-- (fset ... --cl-letf-save--) (fmakunbound ...)))
  (let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...))
(unwind-protect (progn ... ... ... ... ... ...) (if --cl-letf-bound--
... ...)))
  (letf ((... ...)) (goto-char (point-min)) (setq start (point)) (let
(...) (while ... ... ...)) (interblock start (point-max)) (run-hooks
(quote org-export-blocks-postblock-hook)))
  (letf* ((... ...)) (goto-char (point-min)) (setq start (point)) (let
(...) (while ... ... ...)) (interblock sta

Re: [O] LaTeX export crashes

2011-10-17 Thread Ken Williams
On Mon, Oct 17, 2011 at 4:52 PM, Nick Dokos  wrote:
> Ken Williams  wrote:
>
>> Here's a full stack trace, does this make it any more evident what's going 
>> on?
>>
>
> Not really: you have not mentioned what version you are using.

I did post my complete config, which this message was a direct reply to:

  http://article.gmane.org/gmane.emacs.orgmode/47841

I probably confused matters by posting first without my config, from
the wrong address, so I thought it wouldn't make it to the list.

> Chances are you are running an older version which has the problem, Seb is 
> running
> a recent 7.7 which does not exhibit the problem (I tried it too: works for
> me as well with Org-mode version 7.7 (release_7.7.392.g35d92)).
> So upgrade to latest and see if you can reproduce the problem.

Nope, I'm already running 7.7.

 -Ken



Re: [O] LaTeX export crashes

2011-10-17 Thread Ken Williams
On Mon, Oct 17, 2011 at 8:31 PM, Nick Dokos  wrote:
>
> As I pointed out in the subsequent message, that's not good enough: 7.7 came 
> out
> on July 28 and the fix (at least what I *think* is the fix) did not go in 
> until
> September 13.

Ah, I see - I was thinking 7.7 came out at the end of September, not
sure why I thought that.

Looking at commit 597e1eb it does seem on target.  I'll probably hold
off upgrading until 7.8, since I'm running in a corporate environment
& I can survive fine with workarounds.

Thanks for your help.

 -Ken



Re: [O] zotero plain, org-odt, and citations in general

2011-11-09 Thread Ken Williams
Jambunathan K  gmail.com> writes:

>  
> > Basically all that one can do in org-mode at the moment is insert &
> > update citations, and following citation links to the entry in Zotero.
> 
> Can you or someone provide me how such an Org file with citation
> definition and reference looks like?

I'd be very interested in this too.  I've just started to work with Zotero and
I'd assumed that to interface with org-mode I'd have to export as BiBTeX first,
but if I can connect them directly that would be awesome.

 -Ken




[O] Hang on incomplete input

2011-11-30 Thread Ken Williams
Apparently, org-mode Babel (or maybe Emacs, or ESS) will hang when given 
incomplete input, like the following:

#+begin_src R
ddply(x,
#+end_src

I was just tearing my hair out trying to figure out why my code was hanging, 
because of course it's much longer and I didn't notice the missing paren.

Is this replicable on other people's platforms too?  I'm using GNU Emacs on 
Windows, with org-mode 7.7 and ESS 5.14.

There are other situations where I really wish org-mode (or Emacs, or ESS) 
didn't freeze up while evaluating R code - for example if I accidentally did 
'debug()' on a function that's now being called, or even just on long-running 
calculations.  Any chance evaluation could be done in a separate thread or 
something?

Thanks.

--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com


CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] Hang on incomplete input

2011-12-01 Thread Ken Williams

Rafael wrote:

> In Ubuntu 10.10, emacs 23.2 and recent org, I get an *Org-Babel Error
> Output* buffer, saying:
>
> Error: unexpected '}' in:
> "ddply(x,
> }"
> Execution halted

I'm using:

GNU Emacs 23.3 (from http://vgoulet.act.ulaval.ca/en/emacs/windows/)
Windows 7
org-mode 7.7
ESS 5.14

What version of ESS do you have?  Maybe that's the difference?

Any suggestions for how to debug a hang like this?  Is there a signal I can 
send it, to generate a stack trace (if signals are even possible in Windows, 
I'm not even sure)?

 -Ken

CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] Hang on incomplete input

2011-12-01 Thread Ken Williams


> -Original Message-
> From: n...@dokosmarshall.org [mailto:n...@dokosmarshall.org] On Behalf
> Of Nick Dokos
> Sent: Thursday, December 01, 2011 9:21 AM
>
> Forgive my ignorance: how do I check the ESS version? And what does ESS
> have to do with R? I thought this was an R code block, but as you can
> probably tell, I'm an ignoRamus.

ESS is the mechanism by which org-mode interfaces with a running R process.

And I think I left out a crucial piece of information in my first message: I 
run R in a session buffer, my full .org file looks like this:

###
#+TITLE: Test doc
#+AUTHOR: Ken Williams
#+BABEL: :session *Rt*

* My Header

Some code:

#+begin_src R
ddply(x,
#+end_src
###

With that change, is the hang reproducible?


> If that does not bear fruit, you can M-x toggle-debug-on-quit, run the code
> block and press C-g to get a backtrace. Rinse, repeat to see whether you
> always stop at the same point. It's somewhat hit-or-miss but it can be
> effective sometimes.

I could *SWEAR* I had tried C-g to abort the running R command (and C-c C-c, 
and C-c C-g, and about a dozen other things), but couldn't get it to react.  
Now it aborts as desired.  I must have not actually tried a simple C-g.  I can 
never remember which keys abort which aspect of operation.

When I'm armed with that C-g, the hang is a much smaller issue!

 -Ken


CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] Hang on incomplete input

2011-12-01 Thread Ken Williams


> -Original Message-
> From: nicholas.dokos
> Sent: Thursday, December 01, 2011 12:19 PM
>
> Note also that #+BABEL: is obsolete for versions of org more recent than Oct.
> 20 or so. You seem to still be running 7.7 from late July or early August, so 
> you
> should still be OK, but when you next upgrade, you will need to make
> changes to your files. I had to change it to #+PROPERTIES:
> ...  for my org version.
>
> A good starting point on this change  is Eric Schulte's message entitled
>
>   "Standardized code block syntax and Property Accumulation merged into
> Master"

Thanks for the heads up, I'll make the change.  But it seems like the thread 
you referenced might only be tangentially related to a BABEL->PROPERTIES change:

  http://thread.gmane.org/gmane.emacs.orgmode/49247/focus=49309

Or if it's there, I'm not seeing it. =)

 -Ken


CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



[O] More specific LaTeX output classes

2011-12-02 Thread Ken Williams
If I export the following code to LaTeX:

--
#+begin_src R
CV.t.hat <- rowMeans(loss)[m]
CV.t.hat
#+end_src

#+results:
: [1] 1.135857
--

, then it looks like this in the *.tex file:

--
\begin{verbatim}
CV.t.hat <- rowMeans(loss)[m]
CV.t.hat
\end{verbatim}

\begin{verbatim}
 [1] 1.135857
\end{verbatim}
--

So there's no distinction between input & output, nor between various types of 
input (e.g. different programming languages).

Would it be possible for the export process to define various classes that 
default to being exactly like 'verbatim', but could be customized?  After that, 
a next step might be to provide nice defaults that do things like 
syntax-highlighting (through the 'minted' package, perhaps), or at least add a 
visual marker distinguishing between input & output.

Or of course it's possible some of this is already implemented and I've missed 
it. =)

--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com



CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



[O] Subscripts in URLs

2012-08-06 Thread Ken Williams
Hi,

I see in http://lists.gnu.org/archive/html/emacs-orgmode/2010-08/msg01014.html 
that a patch was committed back in 2010 that should prevent underscores from 
introducing subscripts in links.  However, I'm using 7.8.03 (released 
2012-01-03) and when I insert a link like so:

  
[[http://www.mmm.ucar.edu/events/ISP/presentations/JNT_forecast_evaluation_concepts.pdf]]

and export to HTML, I get a link with anchor text 
http://www.mmm.ucar.edu/events/ISP/presentations/JNTforecastevaluationconcepts.pdf,
 where "forecastevaluationconcepts" is subscripted.  The link *target* is 
correct, though.

Was there a subsequent commit that changes things back, or maybe something else 
I'm missing?  I'd like for the anchor text to just appear without org-mode's 
formatting stuff.

Thanks.

--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com


CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] Subscripts in URLs

2012-08-07 Thread Ken Williams


From: Bastien Guerry [mailto:bastiengue...@googlemail.com]
>
> Ken Williams  writes:
>
> > and export to HTML, I get a link with anchor text
> >
> http://www.mmm.ucar.edu/events/ISP/presentations/JNTforecastevaluati
> on
> > concepts.pdf, where "forecastevaluationconcepts" is subscripted.  The
> > link *target* is correct, though.
>
> Maybe you have (setq org-export-with-sub-superscripts t) or ^:t in your
> buffer?

Indeed, that seems to be the case.  I do want to be able to use subscripts and 
other markup in general though, but in a URL like this it seems misplaced.

Maybe we could patch the core code to only process link markup when the author 
has explicitly given the anchor text?  Otherwise, if I'm linking to an external 
resource, I don't have control over whatever crazy stuff appears in the URL, 
and underscores are quite common.

 -Ken


CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



[O] Exporting inline code sections

2012-08-13 Thread Ken Williams
Hi,

I noticed that exporting a document to HTML when "exports" is set to "both" 
gives an error.  Here's an example document:

-
#+TITLE: Example Doc
#+PROPERTY: exports both

The result is src_R{3+4} =[1] 7=.
-

The stack trace looks like this:

-
Debugger entered--Lisp error: (void-function nil)
  nil("%flags")
  replace-regexp-in-string("%flags" nil "#+BEGIN_SRC R%flags\n3+4\n#+END_SRC" t 
t)
  org-fill-template("#+BEGIN_SRC %lang%flags\n%body\n#+END_SRC" (("lang" . "R") 
("flags") ("body" . "3+4")))
  org-babel-exp-code(("R" "3+4" ((:comments . "") (:shebang . "") (:cache . "") 
(:padline . "") (:noweb . "") (:tangle . "") (:exports . "both") (:results . 
"replace") (:session . "none"
  org-babel-exp-do-export(("R" "3+4" ((:comments . "") (:shebang . "") (:cache 
. "") (:padline . "") (:noweb . "") (:tangle . "") (:exports . "both") 
(:results . "replace") (:session . "none"))) inline)
  org-babel-exp-inline-src-blocks(1 83)
  #[(pair) "\211A@)\n
\"\207" [pair x start end] 4]((src org-babel-exp-inline-src-blocks))
  mapcar(#[(pair) "\211A@)\n
\"\207" [pair x start end] 4] ((lob org-babel-exp-lob-one-liners) (src 
org-babel-exp-inline-src-blocks)))
  interblock(1 83)
  
byte-code("\306\307\211\211\211\211\211\211\211\211\211\211+,-./0\310\311!\2111\205)
-

I'm still at version 7.8.03, apologies if this has been addressed in a later 
version already.


--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com



CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] Exporting inline code sections

2012-08-13 Thread Ken Williams


> -Original Message-
> From: Ken Williams
> Sent: Monday, August 13, 2012 3:37 PM
>
> I'm still at version 7.8.03, apologies if this has been addressed in a later
> version already.

FWIW, I just downloaded 7.8.11 and confirmed that the problem still exists 
there.

I wonder if the inline-code code could use a little love in general.  Another 
thing that would be nice to accomplish with it is to be able to control the 
markup - right now it forces =code= markers around the output, but it might be 
nice to let the result flow more naturally in whatever paragraph it's part of.  
That would be great for stuff like report writing, where statistics calculated 
dynamically could be put into the report text.

 -Ken

CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] Exporting inline code sections

2012-08-13 Thread Ken Williams


> -Original Message-
> From: Bastien Guerry [mailto:bastiengue...@googlemail.com]
> Sent: Monday, August 13, 2012 4:56 PM
>
> Now fixed in git, thanks.

Such service! =)

>
> Yes.  Patch welcome!

I'll have a shot at it.  I'm very bad at elisp though.

The other thing I just noticed was that every time I edit a table.el table with 
C-c ', two more spaces get inserted to the left of the table when it's 
reinserted into the org buffer.  I tried to find where in the code that's 
happening (probably in org-edit-src-exit?) but I couldn't quite see it.

 -Ken

CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] Exporting inline code sections

2012-08-14 Thread Ken Williams


> -Original Message-
> From: Bastien Guerry [mailto:bastiengue...@googlemail.com]
> Sent: Monday, August 13, 2012 4:56 PM
> Ken Williams  writes:
>
> > FWIW, I just downloaded 7.8.11 and confirmed that the problem still
> > exists there.
>
> Now fixed in git, thanks.
>

Just tested it, works great, thanks.

 -Ken

CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] Exporting inline code sections

2012-08-14 Thread Ken Williams


> -Original Message-
> From: nicholas.do...@hp.com [mailto:nicholas.do...@hp.com]
> Sent: Monday, August 13, 2012 6:34 PM
>
> Ken Williams  wrote:
>
> > The other thing I just noticed was that every time I edit a table.el
> > table with C-c ', two more spaces get inserted to the left of the
> > table when it's reinserted into the org buffer.  I tried to find where
> > in the code that's happening (probably in org-edit-src-exit?) but I
>
> Yes.
>
> > couldn't quite see it.
>
> C-h v org-src-preserve-indentation RET

Okay, I was stepping through org-edit-src-exit with the emacs debugger, getting 
my bearings - but now for the life of me I can't get the debugger to trigger 
when entering that function anymore.  I do `M-x debug-on-entry 
org-edit-src-exit`, then put my point in a table.el table and hit `C-c '`, then 
hit `C-c '` again to exit the editing buffer, and no debugging happens.  Can 
someone think of why that might be?

Otherwise I have to try to simulate emacs in my head to see what this code is 
doing, and that's not going to be pretty. =)

 -Ken

CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] Exporting inline code sections

2012-08-14 Thread Ken Williams


> -Original Message-
> From: nicholas.do...@hp.com [mailto:nicholas.do...@hp.com]
> Sent: Tuesday, August 14, 2012 10:20 AM
>
> You might want to try edebug instead of the standard debugger,

MUCH better, thanks!

 -Ken


CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



[O] [patch] change indentation logic for edit-src

2012-08-16 Thread Ken Williams
Following on a message from a few days ago, I've prepared a patch (attached) 
that alters the behavior of 'org-edit-src-exit' so that it no longer adds an 
extra 2 spaces of indentation each time a source block (or a table.el table) is 
edited.  Previously a workaround was to set 'org-src-preserve-indentation', but 
without that set, you'd get the undesirable behavior.

There's probably some stuff wrong with this approach - let me know.  I'm new to 
both elisp programming and the org-mode code.

I also created a little utility function 'org-prefixify', not sure whether 
that's kosher or not.  One change that would be nice to make to it is to avoid 
prefixing the final line if it's blank, but I couldn't get that to work.  Also 
- could that essentially be replaced by a call to string-insert-rectangle?

--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com



CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.
From d80b7726402a39b4c8a630a86614b0ba9d7eca6a Mon Sep 17 00:00:00 2001
From: Ken Williams 
Date: Thu, 16 Aug 2012 13:26:44 -0500
Subject: [PATCH] Change the edit-src-save code so that it either preserves
 original formatting, or imposes its new indentation, but
 not both.

---
 lisp/org-src.el |   22 +++---
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/lisp/org-src.el b/lisp/org-src.el
index c110f32..61b800f 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -601,11 +601,9 @@ the language, a switch telling if the content should be in 
a single line."
 (buffer (current-buffer))
 (single (org-bound-and-true-p org-edit-src-force-single-line))
 (macro (eq single 'macro-definition))
-(total-nindent (+ (or org-edit-src-block-indentation 0)
-  org-edit-src-content-indentation))
 (preserve-indentation org-src-preserve-indentation)
 (allow-write-back-p (org-bound-and-true-p 
org-edit-src-allow-write-back-p))
-(delta 0) code line col indent)
+(delta 0) code line col indent total-nindent)
 (when allow-write-back-p
   (unless preserve-indentation (untabify (point-min) (point-max)))
   (if org-src-strip-leading-and-trailing-blank-lines
@@ -640,14 +638,10 @@ the language, a switch telling if the content should be 
in a single line."
   (when (org-bound-and-true-p org-edit-src-picture)
(setq preserve-indentation nil)
(untabify (point-min) (point-max))
-   (goto-char (point-min))
-   (while (re-search-forward "^" nil t)
- (replace-match ": ")))
-  (unless (or single preserve-indentation (= total-nindent 0))
-   (setq indent (make-string total-nindent ?\ ))
-   (goto-char (point-min))
-   (while (re-search-forward "^" nil t)
- (replace-match indent)))
+   (org-prefixify ": "))
+  (setq total-nindent (if preserve-indentation (or 
org-edit-src-block-indentation 0)
+   org-edit-src-content-indentation ))
+  (org-prefixify (make-string total-nindent ?\ ))
   (if (org-bound-and-true-p org-edit-src-picture)
  (setq total-nindent (+ total-nindent 2)))
   (setq code (buffer-string))
@@ -692,6 +686,12 @@ the language, a switch telling if the content should be in 
a single line."
  (message (or msg ""
 (def-edebug-spec org-src-in-org-buffer (body))
 
+(defun org-prefixify (s)
+  (unless (string= "" s)
+(goto-char (point-min))
+(while (re-search-forward "^" nil t)
+  (replace-match s
+
 (defun org-edit-src-save ()
   "Save parent buffer with current state source-code buffer."
   (interactive)
-- 
1.7.9



Re: [O] [patch] change indentation logic for edit-src

2012-08-17 Thread Ken Williams
Hi,

I know Bastien's out of touch for a few days, but could someone say whether a 
patch to the mailing list is the right place to put it, or should I put it on 
GitHub or somewhere else?  Thanks.

 -Ken

> From: Ken Williams
> Sent: Thursday, August 16, 2012 2:30 PM
> To: emacs-orgmode@gnu.org
> Subject: [patch] change indentation logic for edit-src
>
> Following on a message from a few days ago, I've prepared a patch (attached) 
> that alters the behavior of 'org-edit-src-exit' ...

CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



[O] Testing the git latest

2012-08-17 Thread Ken Williams
I recently made some local changes to the latest git HEAD, and I wanted to run 
regression tests.  It didn't work, though - here's the error I got:

% /cygdrive/c/Program\ Files\ \(x86\)/GNU\ Emacs\ 24.1/bin/emacs -Q --batch \
-L lisp/ -L testing/ -L testing/lisp -l lisp/org.el \
-l lisp/org-id.el -l testing/org-test.el \
--eval "(progn (org-reload) (setq org-confirm-babel-evaluate nil))" \
-f org-test-run-batch-tests
Searching for program: no such file or directory, /bin/zsh

I'm on Cygwin, is that not a supported testing configuration maybe?


--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com



CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] [patch] change indentation logic for edit-src

2012-08-22 Thread Ken Williams


> -Original Message-
> From: Bastien Guerry [mailto:bastiengue...@gmail.com]
> Sent: Tuesday, August 21, 2012 6:14 PM
>
> Mh... for me there is no change.  There are always 2 spaces added before
> table.el tables.

The prior behavior I've been seeing is that there are 2 spaces added *every 
time the table.el table is edited*.  No matter what settings the user has, that 
seems like unhelpful behavior.

 -Ken


CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.


[O] Breadcrumbs?

2012-09-24 Thread Ken Williams
Has anyone ever tried implementing a "breadcrumbs"-type feature in org-mode?  
By that I mean something that would quickly tell you the headings up the whole 
path to the root, to quickly orient yourself when you're deep within a 
document.  I was originally thinking of something always-present shown at the 
top of the frame, but maybe it would be better as something shown on demand in 
the minibuffer, possibly making it taller while shown.

--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com



CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.


Re: [O] Breadcrumbs?

2012-09-25 Thread Ken Williams
Very nice, thanks.  I like to see the top-level heading too, so I removed the 
(rest ...) call near the beginning.

  -Ken

From: Anthony Lander [mailto:anth...@landerfamily.ca]
Sent: Monday, September 24, 2012 7:45 PM
To: Ken Williams
Cc: emacs-orgmode@gnu.org
Subject: Re: [O] Breadcrumbs?

Hi Ken,

You can bind this to a speed command. It will show you the path to the current 
headline (less the first heading) in the echo area, and will also copy it to 
the kill ring. This is the functionality I need, but it would be easy to modify 
to do what you want.

(defun org-copy-outline-path-less-root-to-kill-ring (&optional a b)
  "Copy the current outline path, less the first node, to the
kill ring, and echo to the echo area."
  (interactive "P")
  (let* ((bfn (buffer-file-name (buffer-base-buffer)))
 (case-fold-search nil)
 (path (rest (org-get-outline-path
(setq path (append path
   (save-excursion
 (org-back-to-heading t)
 (if (looking-at org-complex-heading-regexp)
 (list (match-string 4))
(let ((formatted-path (org-format-outline-path
   path
   (1- (frame-width)
  (kill-new formatted-path)
  (message "%s" formatted-path

Hope this helps,

 -Anthony



CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.


[O] Base64 embedded images?

2012-10-27 Thread Ken Williams
Has anyone ever tried embedding images directly in the HTML when exporting an 
org-mode file, similar to what the "SingleFile" Chrome extension does 
(https://github.com/gildas-lormeau/SingleFile)?  This would be extremely handy, 
allowing me to periodically archive the page in Git, including changes to 
images.  It also makes sharing a document dead-simple.

I've seen a few similar things, e.g.:
  http://thread.gmane.org/gmane.emacs.orgmode/55155
  http://thread.gmane.org/gmane.emacs.orgmode/11180

But what I'm hoping for is to create the image in the usual way, with a 
[[file:foo.png]] tag (usually this is the result of plotting something in R), 
and the Base64 encoding happens to all images during *export*.   The above 
approaches create the Base64-encoded  tag right in the org-mode buffer, 
which limits the other types of exports one can do (e.g. normal HTML, LaTeX, 
etc.).

--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com



CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.


[O] Outline export styles

2012-11-09 Thread Ken Williams
Hi,

Does org-mode support different outline export styles (to HTML)?  For instance, 
if I want something like this in the export:

   1 Empirical probability distributions

   a. Create a vector of 1,000 uniformly-sampled random integers

instead of the default:

   1 Empirical probability distributions

   1.1 Create a vector of 1,000 uniformly-sampled random integers

is there a configuration somewhere for that?  Thanks.

--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com


CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] Outline export styles

2012-11-09 Thread Ken Williams
I found the 'section-number-format' variable, which customizes nicely to do 
what I asked about.

But on second thought, I guess that's not what I really want.  Because my 
"Create a vector..." stuff is actually a paragraph or so, and doesn't fit 
nicely on one line as a headline.  So it looks like I want to customize the 
plain-list output formats, and I'm not sure how to tie those together without 
specifying each one manually.

 -Ken

> Hi,
>
> Does org-mode support different outline export styles (to HTML)?  For
> instance, if I want something like this in the export:
>
>1 Empirical probability distributions
>
>a. Create a vector of 1,000 uniformly-sampled random integers
>
> instead of the default:
>
>1 Empirical probability distributions
>
>1.1 Create a vector of 1,000 uniformly-sampled random integers
>
> is there a configuration somewhere for that?  Thanks.

CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



[O] Can't get 'sh' blocks working

2013-01-02 Thread Ken Williams
I'm having some trouble getting 'sh' babel blocks to work.  Here's a minimal 
test case, with the output after pressing C-c C-c:

#+begin_src sh
  echo foo
#+end_src

#+RESULTS:
: Error: unexpected symbol in "echo foo"

In my .emacs file, I have the following:

(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
   (sh . t)
   (R . t)))



I tried to create a stack trace for this error, but I hit a snag when I did 
"C-u M-x org-reload RET": "Cannot open load file: 
/usr/local/share/emacs/24.1/lisp/org/org-agenda.el" .  I'm not sure where 
that's coming from, I don't have any mention of agenda stuff in my .emacs.

Any pointers for the 'sh' error or for getting a stack trace?  Thanks.

--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com



CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.


Re: [O] Can't get 'sh' blocks working

2013-01-02 Thread Ken Williams
Sorry I forgot to include my version information:

Emacs  : GNU Emacs 24.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.10.4)
of 2012-07-13 on x.windlogics.local
Package: Org-mode version 7.8.11

current state:
==
(setq
org-export-babel-evaluate nil
org-export-preprocess-before-selecting-backend-code-hook 
'(org-beamer-select-beamer-code)
org-tab-first-hook '(org-hide-block-toggle-maybe 
org-src-native-tab-command-maybe
  org-babel-hide-result-toggle-maybe)
org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
org-occur-hook '(org-first-headline-recenter)
org-export-html-preamble-format '(("en"
"Author: mailto:%e\";>%a\nDate: %d\n")
   )
org-metaup-hook '(org-babel-load-in-session-maybe)
org-export-preprocess-before-normalizing-links-hook 
'(org-remove-file-link-modifiers)
org-confirm-shell-link-function 'yes-or-no-p
org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc
   org-beamer-auto-fragile-frames
   org-beamer-place-default-actions-for-lists)
org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
org-after-todo-state-change-hook '(org-clock-out-if-current)
org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
org-agenda-before-write-hook '(org-agenda-add-entry-text)
org-babel-pre-tangle-hook '(save-buffer)
org-export-html-postamble nil
org-mode-hook '(#[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook org-show-block-all 
append local] 5]
 #[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook 
org-babel-show-result-all append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe)
org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines 
org-optimize-window-after-visibility-change)
org-export-latex-format-toc-function 'org-export-latex-format-toc-default
org-export-blocks '((src org-babel-exp-src-block nil)
 (export-comment org-export-blocks-format-comment t)
 (ditaa org-export-blocks-format-ditaa nil)
 (dot org-export-blocks-format-dot nil))
org-export-first-hook '(org-beamer-initialize-open-trackers)
org-export-interblocks '((src org-babel-exp-non-block-elements))
org-confirm-elisp-link-function 'yes-or-no-p
org-metadown-hook '(org-babel-pop-to-session-maybe)
org-export-html-postamble-format '(("en"
 "Author: %a 
(%e)\nDate: %d\nGenerated by 
%c\n")
    )
org-babel-load-languages '((emacs-lisp . t) (sh . t) (R . t))
org-alphabetical-lists t
org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
org-confirm-babel-evaluate nil
)

From: Ken Williams
Sent: Wednesday, January 02, 2013 1:03 PM
To: emacs-orgmode@gnu.org
Subject: Can't get 'sh' blocks working

I'm having some trouble getting 'sh' babel blocks to work.  Here's a minimal 
test case, with the output after pressing C-c C-c:

#+begin_src sh
  echo foo
#+end_src

#+RESULTS:
: Error: unexpected symbol in "echo foo"

In my .emacs file, I have the following:

(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
   (sh . t)
   (R . t)))



I tried to create a stack trace for this error, but I hit a snag when I did 
"C-u M-x org-reload RET": "Cannot open load file: 
/usr/local/share/emacs/24.1/lisp/org/org-agenda.el" .  I'm not sure where 
that's coming from, I don't have any mention of agenda stuff in my .emacs.

Any pointers for the 'sh' error or for getting a stack trace?  Thanks.

--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com



CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.


[O] Problem exporting code

2013-01-20 Thread Ken Williams
I'm giving a talk tomorrow on org-mode and R, and I'm having an exporting
problem that's tripping me up.

Usually when I export code/output sections to HTML, they get CSS classes
like "src-R" for R code, "src-perl" for perl code, "example" for output.
 But now they're all "example".  Has anyone seen this?

Having different classes lets me do stuff like this:
http://article.gmane.org/gmane.emacs.orgmode/46301

Maybe it's the new exporter?  I'm using org-mode 7.9.3d.

I can try downgrading, is there a location for older versions of orgmode?

 -Ken


Re: [O] Problem exporting code

2013-01-20 Thread Ken Williams
Unfortunately, downgrading to 7.8.11 didn't change the behavior - all code
sections are still exported to HTML as class "example".

I also see that on one machine, using 7.9.2, I get the desired  tag for R code export.  I can't figure out what's making
the difference though.


On Sun, Jan 20, 2013 at 5:44 PM, Ken Williams  wrote:

> I'm giving a talk tomorrow on org-mode and R, and I'm having an exporting
> problem that's tripping me up.
>
> Usually when I export code/output sections to HTML, they get CSS classes
> like "src-R" for R code, "src-perl" for perl code, "example" for output.
>  But now they're all "example".  Has anyone seen this?
>
> Having different classes lets me do stuff like this:
> http://article.gmane.org/gmane.emacs.orgmode/46301
>
> Maybe it's the new exporter?  I'm using org-mode 7.9.3d.
>
> I can try downgrading, is there a location for older versions of orgmode?
>
>  -Ken
>


Re: [O] Problem exporting code

2013-01-20 Thread Ken Williams
On Sun, Jan 20, 2013 at 9:15 PM, Eric S Fraga  wrote:

> Ken Williams  writes:
>
>  Unfortunately, downgrading to 7.8.11 didn't change the behavior - all
>> code sections are still exported to HTML as class "example".
>> I also see that on one machine, using 7.9.2, I get the desired > class="src src-R"> tag for R code export.  I can't figure out what's making
>> the difference though.
>>
>
> I'm grasping at straws here, having seldom exported to HTML, but have you
> loaded the languages for babel?
>

Yes, I believe that's set up properly, because I can do "C-c C-c" and it
knows how to run my R sections and return the correct values.  Also, when I
"describe org-babel-load-languages", I see:

org-babel-load-languages is a variable defined in `org.el'.
Its value is ((emacs-lisp . t)
 (sh . t)
 (R . t)
 (perl . t))

I'm grasping at straws too, not knowing my way around the elisp code very
well. =)

 -Ken


Re: [O] Problem exporting code

2013-01-20 Thread Ken Williams
On Sun, Jan 20, 2013 at 10:57 PM, Ken Williams  wrote:

>
> I'm grasping at straws too, not knowing my way around the elisp code very
> well. =)
>

It looks like the function controlling this behavior is
`org-export-format-source-code-or-example`, in org-exp.el:

(if (string-match "]*\\)>\n*" rtn)
(setq rtn
  (concat
   (if caption
   (concat
""
(format
 "%s"
 caption))
 "")
   (replace-match
(format "\n" lang)
t t rtn)
   (if caption "" "")

So the  tag gets inserted first, then later gets replaced by  ?


Re: [O] Problem exporting code

2013-01-20 Thread Ken Williams
Thanks John.  Here's a small org file:

>>>>>>>>>>>>>>>>>>>>>
#+TITLE: Sample Doc
#+AUTHOR:Ken Williams
#+EMAIL: kena...@gmail.com
#+DATE:  2013-01-21
#+PROPERTY: results output
#+PROPERTY: exports both
#+LATEX_HEADER: \usepackage{amsmath}


#+begin_src R
5+5
#+end_src

#+RESULTS:
: [1] 10
<<<<<<<<<<<<<<<<<<<<<

The code gets exported to:

>>>>>>>>>>>>>>>>>>>>>

5+5



[1] 10

<<<<<<<<<<<<<<<<<<<<<

And here's my config:

>>>>>>>>>>>>>>>>>>>>>
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(current-language-environment "UTF-8")
 '(global-font-lock-mode t nil (font-lock))
 '(inhibit-splash-screen t)
 '(org-alphabetical-lists t)
 '(org-export-html-postamble nil)
 '(org-export-html-preamble-format (quote (("en" "Author: mailto:%e\";>%a
Date: %d
"
 '(org-src-preserve-indentation t)
 '(show-paren-mode t)
 '(tool-bar-mode nil)
 '(transient-mark-mode t)
 '(user-mail-address "kena...@gmail.com"))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(diff-added-face ((t (:foreground "green"
 '(diff-changed-face ((t (:foreground "blue" :slant italic :weight bold
 '(diff-removed-face ((t (:foreground "red"
 )

(setq
   backup-by-copying t  ; don't clobber symlinks
   backup-directory-alist
'(("." . "/tmp/")))

(add-to-list 'load-path "~/share/emacs/site-lisp/org" load-path)
(require 'org-install)
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))

(global-set-key (kbd "M--") 'ess-smart-underscore)

(org-babel-do-load-languages
 'org-babel-load-languages
 '((emacs-lisp . t)
   (sh . t)
   (R . t)
   (perl . t)))

(setq org-export-html-style
"
<!--/*--><![CDATA[/*><!--*/
  .src { background-color: #F5FFF5; position: relative;
overflow: visible; margin-right: auto; }
  .src:before  { position: absolute; top: -15px; background:
#ff; padding: 1px; border: 1px solid #00; font-size: small; }
  .src-sh:before   { content: 'sh'; }
  .src-bash:before { content: 'sh'; }
  .src-R:before{ content: 'R'; }
  .src-perl:before { content: 'Perl'; }
  .src-java:before { content: 'Java'; }
  .src-sql:before  { content: 'SQL'; }
  .example { background-color: #FFF5F5; }
/*]]>*/-->
")

(setq org-export-babel-evaluate nil)
(setq org-confirm-babel-evaluate nil)
<<<<<<<<<<<<<<<<<<<<<

 -Ken


On Sun, Jan 20, 2013 at 11:36 PM, John Hendy  wrote:

> On Sun, Jan 20, 2013 at 10:57 PM, Ken Williams  wrote:
> >
> > On Sun, Jan 20, 2013 at 9:15 PM, Eric S Fraga  wrote:
> >>
> >> Ken Williams  writes:
> >>
> >>> Unfortunately, downgrading to 7.8.11 didn't change the behavior - all
> >>> code sections are still exported to HTML as class "example".
> >>> I also see that on one machine, using 7.9.2, I get the desired  >>> class="src src-R"> tag for R code export.  I can't figure out what's
> making
> >>> the difference though.
> >>
> >>
> >> I'm grasping at straws here, having seldom exported to HTML, but have
> you
> >> loaded the languages for babel?
> >
> >
> > Yes, I believe that's set up properly, because I can do "C-c C-c" and it
> > knows how to run my R sections and return the correct values.  Also,
> when I
> > "describe org-babel-load-languages", I see:
> >
> > org-babel-load-languages is a variable defined in `org.el'.
> > Its value is ((emacs-lisp . t)
> >  (sh . t)
> >  (R . t)
> >  (perl . t))
> >
> > I'm grasping at straws too, not knowing my way around the elisp code very
> > well. =)
>
> Just tried myself on a file lying around with embedded R code, and I
> get "" for my src blocks.
>
> Can we back up a bit and have you post a minimal config and sample
> file? Perhaps the output of =M-x org-version= as well, just to be sure
> on where emacs is pulling org code from? You might have done this; my
> apologies if so. Been following the thread from a distance as I didn't
> have much experience with html/src code export. Just thought I'd chime
> in on things I've been asked to do that usually do help the situation.
>
> With a minimal config (like your load directories and the babel
> language definitions above), we can try to replicate a bit better.
> Emacs configs get long, so it's really hard to know from user to user
> what else might be going on.
>
>
> Thanks!
> John
>
> >
> >  -Ken
>


Re: [O] Problem exporting code

2013-01-20 Thread Ken Williams
Argh, forgot my platform details - I'm using:

Either org-mode 7.9.3d or 7.8.11 (same results)
Aquamacs 2.4 (but I saw the same result using Emacs on a Linux box)
Aquamacs is based on GNU Emacs 23.3.50.1.

 -Ken


On Sun, Jan 20, 2013 at 11:36 PM, John Hendy  wrote:

> On Sun, Jan 20, 2013 at 10:57 PM, Ken Williams  wrote:
> >
> > On Sun, Jan 20, 2013 at 9:15 PM, Eric S Fraga  wrote:
> >>
> >> Ken Williams  writes:
> >>
> >>> Unfortunately, downgrading to 7.8.11 didn't change the behavior - all
> >>> code sections are still exported to HTML as class "example".
> >>> I also see that on one machine, using 7.9.2, I get the desired  >>> class="src src-R"> tag for R code export.  I can't figure out what's
> making
> >>> the difference though.
> >>
> >>
> >> I'm grasping at straws here, having seldom exported to HTML, but have
> you
> >> loaded the languages for babel?
> >
> >
> > Yes, I believe that's set up properly, because I can do "C-c C-c" and it
> > knows how to run my R sections and return the correct values.  Also,
> when I
> > "describe org-babel-load-languages", I see:
> >
> > org-babel-load-languages is a variable defined in `org.el'.
> > Its value is ((emacs-lisp . t)
> >  (sh . t)
> >  (R . t)
> >  (perl . t))
> >
> > I'm grasping at straws too, not knowing my way around the elisp code very
> > well. =)
>
> Just tried myself on a file lying around with embedded R code, and I
> get "" for my src blocks.
>
> Can we back up a bit and have you post a minimal config and sample
> file? Perhaps the output of =M-x org-version= as well, just to be sure
> on where emacs is pulling org code from? You might have done this; my
> apologies if so. Been following the thread from a distance as I didn't
> have much experience with html/src code export. Just thought I'd chime
> in on things I've been asked to do that usually do help the situation.
>
> With a minimal config (like your load directories and the babel
> language definitions above), we can try to replicate a bit better.
> Emacs configs get long, so it's really hard to know from user to user
> what else might be going on.
>
>
> Thanks!
> John
>
> >
> >  -Ken
>


Re: [O] Problem exporting code

2013-01-21 Thread Ken Williams
I believe I've figured it out.  I must have an old version of 'htmlize'
installed somewhere, I 'edebug' traced through the code and fell through to
this part:

  (when lang
(if (featurep 'xemacs)
(require 'htmlize)
  (require 'htmlize nil t))
(when (not (fboundp 'htmlize-region-for-paste))
  ;; we do not have htmlize.el, or an old version of it
  (setq lang nil)
  (message
   "htmlize.el 1.34 or later is needed for source code formatting")))

I couldn't manage to set up my load-path to load htmlize 'properly' (is
htmlize not able to be loaded via 'load-path' and 'require'?), but after
downloading htmlize 1.43 and adding the following to my .emacs, I seem to
be in business again:

(load-file "~/share/emacs/site-lisp/htmlize/htmlize.el")

Thanks everyone.



On Mon, Jan 21, 2013 at 1:39 AM, Eric S Fraga  wrote:

> Ken Williams  writes:
>
> > Thanks John.  Here's a small org file:
>
> Data point: this works just fine for me with both old and new
> exporters.  And I don't even have R installed on this particular system
> (hadn't realised until now ;-).
>
> --
> : Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
> : in Emacs 24.3.50.1 and Org release_7.9.3d-826-gbe0d87
>
>


Re: [O] Problem exporting code

2013-01-21 Thread Ken Williams
On Mon, Jan 21, 2013 at 10:48 AM, John Hendy  wrote:

>
> Awesome that you got it going. Do you still have =(require
> 'org-install)= in your .emacs? ETA: just checked and you do. I checked
> as I had an issue with emacs not using the git version of org because
> I stupidly had =(require 'org-install)= before my load paths!
>

I do have =(require 'org)= in my .emacs.  I never really know whether I'm
supposed to do 'org or 'org-install, but this seems to get the ball rolling!


>
> The only thing that stuck out to me was this: =(add-to-list 'load-path
> "~/share/emacs/site-lisp/org" load-path)=
>

D'oh!  I changed that from a ham-fisted (setq ...) to an (add-to-list ...)
call, and I forgot to take out the final argument.  Thanks for spotting it.

 -Ken


Re: [O] Problem exporting code

2013-01-21 Thread Ken Williams
On Mon, Jan 21, 2013 at 4:16 PM, John Hendy  wrote:

> On Mon, Jan 21, 2013 at 11:45 AM, Ken Williams  wrote:
> >
> > On Mon, Jan 21, 2013 at 10:48 AM, John Hendy  wrote:
> >>
> >>
> >> Awesome that you got it going. Do you still have =(require
> >> 'org-install)= in your .emacs? ETA: just checked and you do. I checked
> >> as I had an issue with emacs not using the git version of org because
> >> I stupidly had =(require 'org-install)= before my load paths!
> >
> >
> > I do have =(require 'org)= in my .emacs.  I never really know whether I'm
> > supposed to do 'org or 'org-install, but this seems to get the ball
> rolling!
>
> I don't think this is needed anymore, and in this thread I thought it
> might even cause potential problems, but I could be wrong!
> - http://lists.gnu.org/archive/html/emacs-orgmode/2012-10/msg00030.html
>
> >
> >>
> >>
> >> The only thing that stuck out to me was this: =(add-to-list 'load-path
> >> "~/share/emacs/site-lisp/org" load-path)=
> >
> > D'oh!  I changed that from a ham-fisted (setq ...) to an (add-to-list
> ...)
> > call, and I forgot to take out the final argument.  Thanks for spotting
> it.
> >
>
> It'd be interesting to know how htmlize didn't get updated. Is that
> provided via org or your emacs variant?


In my case, version 1.23a was provided by Aquamacs:

/Applications/Writing/Aquamacs.app/Contents/Resources/lisp/aquamacs/htmlize.el

It's been a while since I've used this machine, so I'd updated to the
latest Aquamacs, but it looks like Aquamacs itself hasn't seen a release in
over a year.  That's probably part of the problem.  I wonder if there's
something else filling the niche these days?

 -Ken


Re: [O] Problem exporting code

2013-01-21 Thread Ken Williams
On Mon, Jan 21, 2013 at 5:02 PM, John Hendy  wrote:

>
> On Jan 21, 2013 4:51 PM, "Ken Williams"  wrote:
> >
> > It's been a while since I've used this machine, so I'd updated to the
> latest Aquamacs, but it looks like Aquamacs itself hasn't seen a release in
> over a year.  That's probably part of the problem.  I wonder if there's
> something else filling the niche these days?
>
> I've been using this:
> - http://vgoulet.act.ulaval.ca/en/emacs/mac/
>

Ah!  I've been using his Emacs for Windows at work, I didn't notice there
was a Mac one too.  Thanks for the pointer.

 -Ken


Re: [O] Problem exporting code

2013-01-22 Thread Ken Williams
On Tue, Jan 22, 2013 at 1:49 AM, Bastien  wrote:

> Hi Thomas and all,
>
> t...@tsdye.com (Thomas S. Dye) writes:
>
> > Ken Williams  writes:
> >
> >>> I've been using this:
> >>> - http://vgoulet.act.ulaval.ca/en/emacs/mac/
>
> Thanks for the pointer, I was not aware of this distribution.
>
> > Interesting, this Emacs distribution removed Org a few days ago.
>
> This is a wrong move.  Also, the NEWS entry in
> http://vgoulet.act.ulaval.ca/pub/emacs/NEWS-mac suggests that Org's
> maintainers are recommending to install Org as an external package,
> which is a false statement too.
>
> I just wrote to Vincent asking for more details and offering to help
> to ease his life as a maintainer for this Emacs distribution.
>

I also wrote to him and suggested he remove the (require 'org-install)
statement from his default.el, because it was causing warnings for people
who upgrade org. Perhaps it would be better to change it to a conditional
on the version number?

-Ken


[O] More decoration for babel output

2013-01-23 Thread Ken Williams
Hi all,

When exporting to HTML I always add some extra CSS to my org-mode config, for 
the purpose of identifying which chunks are input vs. output, and for 
identifying the language of the code in code chunks.  Language is identified by 
a little label on the box, and input/output is identified by green/red.

Would this be helpful to include by default?  Patch attached.

--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com




CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.
From 37ba52c7911b88c6879179311571654ded0273dd Mon Sep 17 00:00:00 2001
From: Ken Williams 
Date: Wed, 23 Jan 2013 10:14:50 -0600
Subject: [PATCH 1/1] Add background color and language-label to CSS for babel
 blocks.

---
 lisp/org-html.el |   24 
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/lisp/org-html.el b/lisp/org-html.el
index 224a103..5e34385 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -170,6 +170,30 @@ for the JavaScript code in this tag.
 font-size: 90%;
 overflow:auto;
   }
+
+  /* Some decoration for source code blocks and their output. */
+  pre.src {
+background-color: #F5FFF5;
+position: relative;
+overflow: visible;
+margin-right: auto;
+  }
+  pre.src:before {
+position: absolute;
+top: -15px;
+background: #ff;
+padding: 1px;
+border: 1px solid #00;
+font-size: small;
+  }
+  pre.src-sh:before   { content: 'sh'; }
+  pre.src-bash:before { content: 'sh'; }
+  pre.src-R:before{ content: 'R'; }
+  pre.src-perl:before { content: 'Perl'; }
+  pre.src-java:before { content: 'Java'; }
+  pre.src-sql:before  { content: 'SQL'; }
+  pre.example { background-color: #FFF5F5; }
+
   table { border-collapse: collapse; }
   td, th { vertical-align: top;  }
   th.right  { text-align:center;  }
-- 
1.7.9



[O] No pictures when exporting narrowed/subtree

2012-01-04 Thread Ken Williams
Hi,

If I export the following document to HTML, I see the 'testout.png' plot as 
desired.

However, if I put my cursor near "Some more text" and choose 'switch 
buffer/subtree export' when exporting, or if I narrow (C-x n d) to that subtree 
and then export, the 'testout.png' plot doesn't show up.

I'm still using orgmode 7.7, but I didn't see anything pertaining to this in 
the Changes file for 7.8, is it still an issue there?

 -Ken

Emacs  : GNU Emacs 23.3.1 (i386-mingw-nt6.1.7600)
 of 2011-03-10 on 3249CTO
Package: Org-mode version 7.7


=======
#+TITLE: A Document
#+AUTHOR: Ken Williams
#+BABEL: :session *Rt* :results output :exports both

* Section 1

Some text.

* Section 2

Some more text.

#+begin_src R :results graphics :file testout.png
plot(1:10, (1:10)^2)
#+end_src

#+results:
[[file:testout.png]]

Where's the plot?
===

--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com


CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] org-jira.el updated

2012-01-06 Thread Ken Williams
Bao Haojun  gmail.com> writes:
> I have updated the org-jira.el as suggested by Bastien and Richard
> Riley:

Amazing.  Just 120 seconds ago I got out of a meeting where we talked about
using Jira more widely in our company, and I worried that I'd duplicate too much
between my org-mode journals and the Jira tracker.

Then I go look at the org-mode list and this is the first message I see.  =)

I'm going to need to upgrade to org-mode 7.8 and try this out.

 -Ken




Re: [O] No pictures when exporting narrowed/subtree

2012-01-13 Thread Ken Williams
> -Original Message-
> ... if I put my cursor near "Some more text" and choose 'switch
> buffer/subtree export' when exporting, or if I narrow (C-x n d) to that
> subtree and then export, the 'testout.png' plot doesn't show up.

Ping - anyone able to replicate or not replicate this?

 -Ken

CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



[O] SO question on dynamic arguments

2012-02-09 Thread Ken Williams
I asked this question on Stack Overflow today, I wonder if someone might know 
the answer here:

  
http://stackoverflow.com/questions/9215216/computing-argument-values-dynamically

It's about computing arguments to a "#+begin_src R" block based on previous R 
results.

Thanks.

--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com



CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.


[O] I'm tripping over #+BABEL: vs. #+PROPERTY:

2012-03-14 Thread Ken Williams
1) I see from http://orgmode.org/Changes.html, section "Incompatible changes", 
that I have to change my #+BABEL: lines to something else, in order to upgrade 
from 7.7 to 7.8.03.  But I can't figure out to what.

I previously had:

#+BABEL: :session *R* :results output :exports both

#+begin_src R :exports none :results silent
setwd('c:/Users/ken/wdir')
source("src/main/R/mylib.R")
#+end_src

What does that translate to, using #+PROPERTY: syntax?  I tried the following, 
but then when I execute a "#+begin_src R" block, it doesn't evaluate in a 
session called *R*, it just evaluates in-process.  No *R* buffer is created.

#+PROPERTY: session *R*
#+PROPERTY: results output
#+PROPERTY: exports both

A pointer to some transition doc would also be great, if such a thing exists.

2) In the same list of "Incompatible changes", it says "code blocks are named 
with - results are named with code block may still be labeled with named with 
#+tblname: will be considered to be named results".  What on earth does that 
mean??  I would offer a doc patch but I can't figure it out. =)


--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com


CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] I'm tripping over #+BABEL: vs. #+PROPERTY:

2012-03-14 Thread Ken Williams
Aha!  That was the trick, thanks.

How about a translation of the text for question 2)?

 -Ken

> -Original Message-
> From: Eric Schulte [mailto:eric.schu...@gmx.com]
> Sent: Wednesday, March 14, 2012 1:29 PM
> To: Ken Williams
> Cc: emacs-orgmode@gnu.org
> Subject: Re: [O] I'm tripping over #+BABEL: vs. #+PROPERTY:
>
> Hi Ken,
>
> Did you press C-c C-c on each property line after it was written?
> Property lines only take effect either with C-c C-c, or when the file is first
> opened.
> [...]
>
> > 2) In the same list of "Incompatible changes", it says "code blocks
> > are named with - results are named with code block may still be
> > labeled with named with #+tblname: will be considered to be named
> > results".  What on earth does that mean??  I would offer a doc patch
> > but I can't figure it out. =)

CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] I'm tripping over #+BABEL: vs. #+PROPERTY:

2012-03-14 Thread Ken Williams


> -Original Message-
> From: Eric Schulte [mailto:eric.schu...@gmx.com]
> Sent: Wednesday, March 14, 2012 1:40 PM
> To: Ken Williams
> Cc: emacs-orgmode@gnu.org
> Subject: Re: [O] I'm tripping over #+BABEL: vs. #+PROPERTY:
>
> > How about a translation of the text for question 2)?
> [...]
>
> Hope that clarifies. Cheers,

Thanks.  I think I see what happened - the following text (in the commit 
message for 7e93b90f8816346a16ad49cee22870b17c05b211) :

- call lines are specified with #+call:
- code blocks are named with #+name:
- results are named with #+name:, however results generated by a code
  block may still be labeled with #+results:, and tables named with
  #+tblname: will be considered to be named results

got mangled by the HTML builder into this:

call lines are specified with #+call:
code blocks are named with - results are named with code block may still be 
labeled with named with #+tblname: will be considered to be named results

So some '#' characters probably need to be escaped.

 -Ken


CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



[O] Bug: Tabbing error with asterisks [7.8.03]

2012-03-23 Thread Ken Williams
I have the following document:

--
#+TITLE: Test Doc
#+AUTHOR: Ken Williams

* Top header

Top paragraph.

#+begin_src R
library(testthat)

test_that("failures", {
  expect_that(6, equals(9))
  expect_that(6, equals(9))
  expect_that(6, equals(9))
  expect_that(6, equals(9))
  expect_that(6, equals(9))
})
#+end_src

#+results:
#+begin_example
 Error: Test failure in 'failures'
* 6 not equal to 9
Mean relative difference: 0.333
* 6 not equal to 9
Mean relative difference: 0.333
* 6 not equal to 9
Mean relative difference: 0.333
* 6 not equal to 9
Mean relative difference: 0.333
* 6 not equal to 9
Mean relative difference: 0.333
#+end_example
--


When I put the point on the top headline and hit , it doesn't fold the 
complete section, it only folds up to the line "* 6 not equal to 9".  So 
something thinks that line is a header, even though it's within a 
"#+begin_example" section.

By contrast, the syntax coloring looks correct - the lines starting with '#' 
are red, and the lines inside the "#+begin_src" and "#+begin_example" sections 
are gray, as expected.


Emacs  : GNU Emacs 23.3.1 (i386-mingw-nt6.1.7600)
 of 2011-03-10 on 3249CTO
Package: Org-mode version 7.8.03

--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com


CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] Bug: Tabbing error with asterisks [7.8.03]

2012-03-27 Thread Ken Williams
Bastien  gnu.org> writes:

> Hit C-c ' twice and you'll have commas inserted before the lines
> starting with an asterisk.
> 

That works as a workaround, as long as I remember to do it.  Is there a reason
not to automatically do this to the return value of doing "C-c C-c" on all
"#begin_src R" blocks?

Also, what if I need real commas in my literal stuff?  Any way to escape those?
 Just add one more comma, maybe?

 -Ken




[O] Auto-fill-mode with code sections

2012-05-01 Thread Ken Williams
Hi,

I use org-mode extensively with R code sections, as a scientific notebook.  One 
annoyance I have is that when I have auto-fill-mode turned on (which is 
convenient for the main body parts of the document), it extends to the code 
section and starts auto-filling my code.

Can anyone recommend a configuration that will get me folding in the body 
sections, but not in the code sections?  It could use another mechanism besides 
auto-fill-mode if that's what's preferred these days, but auto-fill-mode is the 
one I'm familiar with.

Thanks.

--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com



CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.


Re: [O] Auto-fill-mode with code sections

2012-05-04 Thread Ken Williams
Ping - I'm still interested in this, if anyone has any recommendations.  Thanks.

 -Ken

> From: Ken Williams
> Sent: Tuesday, May 01, 2012 8:51 AM
> To: emacs-orgmode@gnu.org
> Subject: Auto-fill-mode with code sections
>
> Hi,
>
> I use org-mode extensively with R code sections, as a scientific notebook.
> One annoyance I have is that when I have auto-fill-mode turned on (which
> is convenient for the main body parts of the document), it extends to the
> code section and starts auto-filling my code.
>
> Can anyone recommend a configuration that will get me folding in the body
> sections, but not in the code sections?  It could use another mechanism
> besides auto-fill-mode if that's what's preferred these days, but 
> auto-fill-mode
> is the one I'm familiar with.


CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



[O] Export width for generated SVG image?

2013-03-26 Thread Ken Williams
I'm using a 'dot' section to create an SVG image, then exporting my document to 
HTML:

#+BEGIN_SRC dot :exports results :file process-diag.svg
digraph {
  "foo.rds" -> "foo.csv";
  ...
}
#+END_SRC

My diagram ends up pretty huge though, and I want to shrink it down.  ":width 
1000" doesn't seem to have any effect, nor does wrapping like so:

#+BEGIN_HTML

#+END_HTML

... dot diagram here ...

#+BEGIN_HTML

#+END_HTML

... because the interior SVG just overrides the width of its parent.

Any suggestions?

I'm using version 7.9.2-dist .  Thanks.

--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com




CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.


Re: [O] Export width for generated SVG image?

2013-03-26 Thread Ken Williams


> -Original Message-
> From: John Hendy [mailto:jw.he...@gmail.com]
> Sent: Tuesday, March 26, 2013 3:49 PM
>
> Are you using the new exporter or old? I believe the old syntax would have
> been:
>
> #+attr_html width="100%"
> [[image.svg]]

Beautiful, thanks.

 -Ken




CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.


[O] attr_html for table.el tables?

2013-03-27 Thread Ken Williams
Hi,

I have a table that has multi-line cells (just because some of the cells have 
some long-ish sentences in them, and I want them to break rather than careening 
off the right-hand side of the page), so I'm using table.el to manage it.  When 
I export, I wanted to get all borders shown, because without borders the 
structure isn't very clear.

It looks like `#+attr_html` doesn't have any effect on table.el tables, 
correct?  Is there another mechanism to specify export options when org-mode 
renders table.el tables to HTML?

--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com




CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.


[O] Bug: Export of table.el to LaTeX fails [7.9.4 (7.9.4-dist @ c:/Users/kwilliams/share/emacs/site-lisp/org/)]

2013-03-28 Thread Ken Williams
My email client seems to be eating the formatting in the bug report, so I'm 
attaching it as a text file.  Hope that's okay.

 -Ken




CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.
To: emacs-orgmode@gnu.org
Subject: Bug: Export of table.el to LaTeX fails [7.9.4 (7.9.4-dist @ 
c:/Users/kwilliams/share/emacs/site-lisp/org/)]
From: ken.willi...@windlogics.com
--text follows this line--

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.


When I try to export the following example document to LaTeX, I get a
failure "Invalid search bound (wrong side of point)".  The key piece
seems to be the '...' string in the 4th cell.

=====
#+TITLE: Example Doc
#+AUTHOR: Ken Williams


* Failing table

Example:

+--+---+
|Name  |Examples   |
+--+---+
|foo   |x ... y|
+--+---+

=


Here's a stack trace:

Debugger entered--Lisp error: (error "Invalid search bound (wrong side of 
point)")
  re-search-forward("\\s *\\'" 53 t)
  table--buffer-substring-and-trim(54 53)
  #[514 
"\307\310\302@B!\310\302@B!\"\311\312!r\211q\210\313\314\315\316\317\320!\321\"\322\323%DC\216c\210eb\210\324\325\326\327#\203_\330\224\203E\212\330\224b\210\331c\210)\202,\322\224\203S\332\333\327\211#\210\202,\332\334\335\336!\334Q!\210\202,ed{\262*\210r\300q\210\306@\204\200`Sf\337=\203{\340\202|\341\342\261\210\305@\330V\203\234\343\344\305@\306@\203\224\345\202\225\340$c\210\202\237\211c\210)\306\326\240\210\305\330\240\210\303\304@\3018\240\207"
 [# (1 12) (5) (12) (2) (1) (nil) 
table--buffer-substring-and-trim table--goto-coordinate generate-new-buffer " 
*temp*" funcall make-byte-code 0 "\301\300!\205  \302\300!\207" vconcat vector 
[buffer-name kill-buffer] 2 "\n\n(fn)" re-search-forward 
"\\([#$~_^%{}]\\)\\|\\(\\)\\|\\([<>|]\\)" nil t 1 "\\" replace-match 
"$\\backslash$" "$" match-string 3 32 "" " " "& " format 
"\\multicolumn{%d}{%sl|}{%s}" "|"] 11 "\n\n(fn FROM TO)"](12 11)
  table--generate-source-scan-lines(# latex (43 . 
53) (101 . 111) (1 12) (5 7))
  table-generate-source(latex "*org-export-table*" "caption")
  org-export-latex-convert-table\.el-table()
  org-export-latex-tables(t)
  
org-export-latex-content(#("\n\nExample:\n\n+--+---+\n|Name 
 |Examples   |\n+--+---+\n|foo   |x ... y   
 |\n+--+---+\n\n\n" 0 12 (fontified t) 12 24 (fontified t) 
24 40 (fontified t) 40 41 (fontified t) 41 69 (fontified t org-caption nil 
org-caption-shortn nil org-attributes nil org-label nil) 69 70 (fontified t) 70 
82 (fontified t) 82 98 (fontified t) 98 99 (fontified t) 99 127 (fontified t 
org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 127 
128 (fontified t) 128 140 (fontified t) 140 156 (fontified t) 156 159 
(fontified t)))
  org-export-latex-subcontent(((pos . 2) (level . 1) (occur . 1) (heading . #(" 
Failing table " 1 2 (target "sec-1" fontified t) 2 14 (target "sec-1" fontified 
t))) (content . #("\n\nExample:\n\n+--+---+\n|Name  
|Examples   |\n+--+---+\n|foo   |x ... y
|\n+--+---+\n\n\n" 0 12 (fontified t) 12 24 (fontified t) 
24 40 (fontified t) 40 41 (fontified t) 41 69 (fontified t org-caption nil 
org-caption-shortn nil org-attributes nil org-label nil) 69 70 (fontified t) 70 
82 (fontified t) 82 98 (fontified t) 98 99 (fontified t) 99 127 (fontified t 
org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 127 
128 (fontified t) 128 140 (fontified t) 140 156 (fontified t) 156 159 
(fontified t))) (subcontent)) t)
  #[(x) "\302  \"\207" [x num org-export-latex-subcontent] 3](((pos . 2) 
(level . 1) (occur . 1) (heading . #(" Failing table " 1 2 (target "sec-1" 
fontified t) 2 14 (target "sec-1" fontified t))) (content . 
#("\n\nExample:\n\n+--+---+\n|Name  |Examples   
|\n+--+---+\n

Re: [O] Bug: Export of table.el to LaTeX fails [7.9.4 (7.9.4-dist @ c:/Users/kwilliams/share/emacs/site-lisp/org/)]

2013-03-28 Thread Ken Williams
(org-clock-remove-empty-clock-drawer)
 org-export-html-postamble nil
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-mode-hook '(#[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook org-show-block-all 
append local] 5]
 #[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook 
org-babel-show-result-all append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-src-preserve-indentation t
 org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc 
org-beamer-auto-fragile-frames
   org-beamer-place-default-actions-for-lists)
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-export-html-postamble-format '(("en"
 "Author: %a 
(%e)\nDate: %d\nGenerated by 
%c\n")
)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-babel-tangle-lang-exts '(("perl" . "pl") ("emacs-lisp" . "el"))
 org-babel-load-languages '((emacs-lisp . t) (sh . t) (plantuml . t) (R . t) 
(dot . t) (perl . t))
 org-confirm-shell-link-function 'yes-or-no-p
 )

> -Original Message-
> From: Ken Williams
> Sent: Thursday, March 28, 2013 9:34 AM
> To: emacs-orgmode@gnu.org
> Subject: Bug: Export of table.el to LaTeX fails [7.9.4 (7.9.4-dist @
> c:/Users/kwilliams/share/emacs/site-lisp/org/)]
>
> My email client seems to be eating the formatting in the bug report, so I'm
> attaching it as a text file.  Hope that's okay.
>
>  -Ken




CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] Bug: Export of table.el to LaTeX fails [7.9.4 (7.9.4-dist @ c:/Users/kwilliams/share/emacs/site-lisp/org/)]

2013-03-28 Thread Ken Williams


> -Original Message-
> From: Nicolas Goaziou [mailto:n.goaz...@gmail.com]
> Sent: Thursday, March 28, 2013 10:49 AM
> To: Ken Williams
>
> Ken Williams  writes:
>
> > Something apparently even ate part of the attachment - there are some
> > Null bytes in there I guess.  Here's a paste of the rest of the
> > attachment, as viewed in `less` to zap the non-ASCIIs.
>
> FWIW, I cannot reproduce the problem on Org-mode version 8.0-pre
> (release_8.0-pre-199-g2746c7)

I can't upgrade to 8.0 here, is there anyone that could try on a 7.x platform 
to confirm?

Are all those Null bytes & line noise in the stack trace normal, or do they 
look like some kind of buffer overflow or something?

 -Ken



CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] Can't get dvipng to work

2013-09-18 Thread Ken Williams
Rasmus  gmx.us> writes:
> 
> So in short I think the easiest course of action is upgrading to the
> newest release, e.g. using ELPA (M-x list-packages).

I agree - I'm trying to update now.  I hadn't used ELPA before, so I tried 
that route and I'm getting a ton of 'ox-*' related errors like this:

--
Compiling file c:/Users/kwilliams/.emacs.d/elpa/org-20130916/ox-ascii.el at 
Wed Sep 18 11:30:24 2013
ox-ascii.el:41:1:Error: Symbol's value as variable is void: org-list-allow-
alphabetical

Compiling file c:/Users/kwilliams/.emacs.d/elpa/org-20130916/ox-beamer.el at 
Wed Sep 18 11:30:24 2013
ox-beamer.el:117:1:Error: Symbol's value as variable is void: org-list-
allow-alphabetical

Compiling file c:/Users/kwilliams/.emacs.d/elpa/org-20130916/ox-html.el at 
Wed Sep 18 11:30:24 2013
ox-html.el:37:1:Error: Symbol's value as variable is void: org-list-allow-
alphabetical
...
--

I can try installing manually but it would be great if I could get ELPA 
working.

 -Ken





Re: [O] Can't get dvipng to work

2013-09-18 Thread Ken Williams
Ken Williams  gmail.com> writes:

> I can try installing manually but it would be great if I could get ELPA 
> working.

So I installed org-8.1.2 manually and now it does seem to be *trying* to 
process the images through LaTeX.  But it's not succeeding.  In the *Messages* 
buffer, I see this:


Creating LaTeX Image...
Failed to create dvi file from 
c:/Users/KWILLI~1/AppData/Local/Temp/orgtex6488Qq2.tex


I pasted the contents of ~/AppData/Local/Temp/orgtex6488Qq2.log here, but I 
don't see anything strange in it:

https://gist.github.com/kenahoo/6613374

 -Ken




Re: [O] Can't get dvipng to work

2013-09-19 Thread Ken Williams
Nick Dokos  gmail.com> writes:

> 
> Ken Williams  gmail.com> writes:
> 
> > I pasted the contents of ~/AppData/Local/Temp/orgtex6488Qq2.log here, but 
I 
> > don't see anything strange in it:
> >
> > https://gist.github.com/kenahoo/6613374
> >
> 
> What happens if you run latex on the tex file by hand?
> 

It succeeds: 

 % latex orgtex6488Qq2.tex
 ...
 Output written on orgtex6488Qq2.dvi (1 page, 1304 bytes).
 Transcript written on orgtex6488Qq2.log.

Additionally, if I run pdflatex manually on the tex file, the output is 
sensible.

I don't know how to verify that the tex/latex Emacs is running is the same as 
the one I get at the command line - nor whether the failure is during 
tex/latex or during dvipng.






Re: [O] Can't get dvipng to work

2013-09-20 Thread Ken Williams
Rasmus  gmx.us> writes:
> 
> Then try to run dvipng FILE.dvi or perhaps just dvipng FILE.  Does
> this work?

Yes, it produces a proper output PNG that looks good, but note that the base 
filename has a '1' appended:

% dvipng orgtex6488Qq2.dvi
This is dvipng 1.14 Copyright 2002-2010 Jan-Ake Larsson
[1]

% ls -ltr orgtex6488Qq2*
-rwx--+ 1 Administrators  1317 Sep 18 13:21 orgtex6488Qq2.tex*
-rw-r--r--+ 1 kwilliams  75721 Sep 19 16:17 orgtex6488Qq2.pdf
-rw-r--r--+ 1 kwilliams  8 Sep 19 16:20 orgtex6488Qq2.aux
-rw-r--r--+ 1 kwilliams   1304 Sep 19 16:20 orgtex6488Qq2.dvi
-rwx--+ 1 Administrators 17216 Sep 19 16:22 orgtex6488Qq2.log*
-rw-r--r--+ 1 kwilliams   3883 Sep 20 09:51 orgtex6488Qq21.png


This would probably be a lot easier to debug if the emacs logs included the 
command line strings that are being run.

 -Ken