Re: [O] bug: org-shiftmetaright fails to shift the last child

2014-03-24 Thread Samuel Wales
this also appears to fail to shift siblings below the link.


On 3/24/14, Samuel Wales  wrote:
> ===
> * org-shiftmetaright on the following folded header will fail to shift
> headline 3
> * bug
> *** 2
> * [[http://www.google.com][google]]
> *** 3
> ===
>
> this is in maint.
>
> thanks.
>
> samuel
>


-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  And
ANYBODY can get it.

Denmark: free Karina Hansen NOW.




[O] bug: org-shiftmetaright fails to shift the last child

2014-03-24 Thread Samuel Wales
===
* org-shiftmetaright on the following folded header will fail to shift
headline 3
* bug
*** 2
* [[http://www.google.com][google]]
*** 3
===

this is in maint.

thanks.

samuel



[O] Question: how to disable htmlize during exporting?

2014-03-24 Thread Kelvin Hu
Dears,

Org is awesome and now I use it as my blogging tool, everything is
perfect except the source code highlighting. Org uses htmlize.el to
highlight source code, it's fine, but when I use another theme or on a
different machine, the generated html(contains source code block) will
change due to Emacs theme change. As I use git to manage my generated
html files, so when publishing after a theme change, those html files
contain source code will change and thus I need to *git commit* a lot
of files without actual useful content change!

So now I want to use google prettify.js to highlight my source code,
but I cannot disable htmlize.el during exporting, I googled and
someone said removing htmlize.el will achieve this, but I don't think
it is a good idea.

Any ideas?

Thanks,
Kelvin



Re: [O] org-html5presentation

2014-03-24 Thread Rustom Mody
Marcin wrote:
> Just my 2 cents: I've just tried org-reveal and it works like a charm.

Thanks Marcin this looks promising

Rick wrote:
> There are also s5 (ox-s5) and deck.js (ox-deck) exporters in contrib ;).

s5 is what I started with.
But it looks a bit bit-rotten [we are in 2014 and its generating xhtml]

deck I have to check out.
Since Marcin has provided direct experience with reveal, I'll start
with that for the moment

Thanks both

Bastien: Ive written to Takumi Kinjo
Rusi



Re: [O] Org is awesome

2014-03-24 Thread James Harkins
On Mar 25, 2014 3:05 AM, "chandan"  wrote:
> Can you please post a link to the sources? I would most probably use
> it as a reference for generating different parts of any documents that
> I would create.

Not just yet.

As I said in the email that you quoted, I'm working on a worg page to
explain the project's implementation. That page will include a link to the
sources. I would rather not publish the link just now, because then I would
have to answer questions about it by email, and many of those questions are
likely to be answered in the worg page -- redundant effort.

So, just be patient -- it'll happen, but not until project documentation is
ready.

hjh


Re: [O] Basic vcard-to-org-contacts converter

2014-03-24 Thread Ken Mankoff

And I posted a solution a few weeks ago that parses the Apple
AddressBook to Org contacts. Wrapped in a LaunchAgent that runs the
script whenever the addressbook is updated (file timestamp changes)
and it keeps mu4e up-to-date with Apple OS X and iDevices.

  -k.

On 2014-03-24 at 20:07, Feng Shu wrote:
> Titus von der Malsburg  writes:
>
>> Hi list!
>>
>> I decided to give org-contacts a try.  Since there doesn't seem to be a
>> facility for importing contacts in vcard format, I wrote a little Python
>> script for that.  Perhaps someone on this list finds it useful.
>>
>>   https://gist.github.com/tmalsburg/9747104
>>
>> The script uses the Python package vobject for parsing vcard files.  On
>> Debian-like systems this package is available as python-vobject.  I
>> tested the script with contacts exported from Apple's iCloud service and
>> that worked well.  However, the vcard format is somewhat messy and I
>> don't know what happens with vcard files generated in other contact
>> managers.  Use at your own risk.
>
> Import from csv is a solution too, I use the below hack functions to import a
> csv file...
>
> #+begin_src
>
> (defun eh-org-contacts-parse-csv-line (line)
>   "Build a org contact from a csv line"
>   (let ((list (split-string line ",")))
> (concat "* " (nth 0 list) "\n"
> ":PROPERTIES:\n"
> ":PHONE: " (nth 1 list) "\n"
> ":EMAIL: " (let ((string (nth 2 list)))
>  (if (string-match-p "@" string) string
>(if (> (length string) 0) (concat string 
> "@qq.com" "\n"
> ":NOTE: "  (mapconcat 'identity (nthcdr 3 list) "; ") "\n"
> ":END:\n")))
>
> (defun eh-org-contacts-csv-import (&optional filename)
>   "Convert a csv file to org contacts format and insert current point"
>   (interactive)
>   (let ((file (if filename filename (read-file-name "CSV file:")))
> (buffer (current-buffer))
> (point (point))
> contacts-string)
>   (with-temp-buffer
> (insert-file-contents file)
> (goto-char (point-min))
> (while (< (point) (point-max))
>   (setq contacts-string (concat contacts-string 
> (eh-org-contacts-parse-csv-line (buffer-substring (point) (progn 
> (end-of-line) (point "\n"))
>   (forward-line 1)
>   (beginning-of-line 1)))
>   (switch-to-buffer buffer)
>   (goto-char point)
>   (insert contacts-string)))
>
> #+end_src
>
>>
>> If there's interest, I might migrate the script to a proper Github
>> repository and develop it further, i.e., merge your pull-requests ;-)
>>
>>   Titus




Re: [O] Basic vcard-to-org-contacts converter

2014-03-24 Thread Feng Shu
Titus von der Malsburg  writes:

> Hi list!
>
> I decided to give org-contacts a try.  Since there doesn't seem to be a
> facility for importing contacts in vcard format, I wrote a little Python
> script for that.  Perhaps someone on this list finds it useful.
>
>   https://gist.github.com/tmalsburg/9747104
>
> The script uses the Python package vobject for parsing vcard files.  On
> Debian-like systems this package is available as python-vobject.  I
> tested the script with contacts exported from Apple's iCloud service and
> that worked well.  However, the vcard format is somewhat messy and I
> don't know what happens with vcard files generated in other contact
> managers.  Use at your own risk.

Import from csv is a solution too, I use the below hack functions to import a
csv file...

#+begin_src

(defun eh-org-contacts-parse-csv-line (line)
  "Build a org contact from a csv line"
  (let ((list (split-string line ",")))
(concat "* " (nth 0 list) "\n"
":PROPERTIES:\n"
":PHONE: " (nth 1 list) "\n"
":EMAIL: " (let ((string (nth 2 list)))
 (if (string-match-p "@" string) string
   (if (> (length string) 0) (concat string 
"@qq.com" "\n"
":NOTE: "  (mapconcat 'identity (nthcdr 3 list) "; ") "\n"
":END:\n")))

(defun eh-org-contacts-csv-import (&optional filename)
  "Convert a csv file to org contacts format and insert current point"
  (interactive)
  (let ((file (if filename filename (read-file-name "CSV file:")))
(buffer (current-buffer))
(point (point))
contacts-string)
  (with-temp-buffer
(insert-file-contents file)
(goto-char (point-min))
(while (< (point) (point-max))
  (setq contacts-string (concat contacts-string 
(eh-org-contacts-parse-csv-line (buffer-substring (point) (progn (end-of-line) 
(point "\n"))
  (forward-line 1)
  (beginning-of-line 1)))
  (switch-to-buffer buffer)
  (goto-char point)
  (insert contacts-string)))

#+end_src

>
> If there's interest, I might migrate the script to a proper Github
> repository and develop it further, i.e., merge your pull-requests ;-)
>
>   Titus

-- 




Re: [O] org-babel R output table with plot

2014-03-24 Thread Feng Shu
John Hendy  writes:

> On Mon, Mar 24, 2014 at 10:22 AM, Feng Shu  wrote:
>> Hi everyone
>>
>> I want to R output table with plot, I use a solution below,
>> Who can tell me other solutions?
>>
>
> I sort of follow the below, but I think it would be more helpful to
> describe what you *don't* like about the output below. In other words,
> what are you trying to achieve that is not working below?
>

It just suit my need, but I want to know more simper solution, which let
me type less code.

>
> John
>
>> thanks!
>>
>> #+begin_src R  :results output raw drawer
>>   require("ascii")
>>
>>   print.org <- function (x, caption)
>>   {
>>   print(paragraph(paste("#+CAPTION: ", caption, sep="")),type="org")
>>   print(ascii(x),type="org")
>>   }
>>   plot.org  <- function (x, caption)
>>   {
>>   pngfile <- paste(caption, ".png", sep="")
>>   print(paragraph(paste("#+CAPTION: ", caption, sep="")),type="org")
>>   png(pngfile)
>>   plot(x)
>>   dev.off()
>>   print(paragraph(paste("[[./", pngfile, "]]", 
>> sep=""),new=FALSE),type="org")
>>
>>   }
>>   data <- data.frame(x=c(1,20,100,800),y=c(200,4,5,29))
>>   print.org(data, "test-table1")
>>   print.org(data, "test-table2")
>>   plot.org(data, "test-pic")
>>
>> #+end_src
>>
>> #+RESULTS:
>> :RESULTS:
>>
>> #+CAPTION: test-table1
>> |   | x  | y  |
>> |---++|
>> | 1 | 1.00   | 200.00 |
>> | 2 | 20.00  | 4.00   |
>> | 3 | 100.00 | 5.00   |
>> | 4 | 800.00 | 29.00  |
>>
>> #+CAPTION: test-table2
>> |   | x  | y  |
>> |---++|
>> | 1 | 1.00   | 200.00 |
>> | 2 | 20.00  | 4.00   |
>> | 3 | 100.00 | 5.00   |
>> | 4 | 800.00 | 29.00  |
>>
>> #+CAPTION: test-pic
>> [[./test-pic.png]]
>> :END:
>>
>>
>> --
>>

-- 




[O] [babel] How to make source blocks immutable whil editing org files in Org mode in Emacs

2014-03-24 Thread Grant Rettke
Hi,

Context:

Just logged about 60 hours doing a literate programming project with
Org and elisp. Calling org-edit-special to break out into my customized
editing
environment has worked quite well. There, Smartparens (strict mode) or
Paredit keep parentheses
balanced. Sometimes I get lazy though and want to make a change to the
source
block and invariable screw up the parentheses and break my system.

Desire:

I would like to set a flag that disallows any editing of source blocks
whilst in org mode.
Obviously one could still see the code, just not modify it. Sure,
discipline would also be an
options but most bad edits seem like easy ones, but if it were easy you
wouldn't make it in the
first place.

Research:

Read http://orgmode.org/guide/Working-With-Source-Code.html and didn't find
that kind of feature.
Googled and didn't find a fix.

Question:

How have you folks dealt with this? Is there a solution out there? Would
you like such a thing?

Regards,

-- 
Grant Rettke | ACM, AMA, COG, IEEE
g...@wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates


Re: [O] [RFC] Properly handle keyword + COMMENT keyword

2014-03-24 Thread Nicolas Goaziou
Hello,

Samuel Wales  writes:

> does this preserve todo keyword font locking

This is one goal of the patch.

> and sorting?

IIRC, TODO-based sorting refers to `org-todo-keywords-1', which doesn't
include "COMMENT", so I don't think this changes sorting (i.e., sorting
ignores COMMENT keywords).

> does archive work the same way?

I didn't touch to archive tag (but there's some work to do here to, as
a first step, `org-in-archived-heading-p' would be nice). Note that
ARCHIVE is a tag, though.

> i presume it is a coincidence that this message comes after mine which
> mentioned font locking and sorting

No it isn't. Your message recalled me this needed to be fixed.

> as the fix to that message is to not evaluate or export call lines
> that are not supposed to be exported. i would not find this change to
> be a suitable workaround for that.

I do not want to provide a workaround for what I do not consider to be
a bug. Export and Babel are two different parts of Org that happen to
have a non-empty intersection. "No Export" doesn't have to mean "No
Babel" (unless you use a COMMENT keyword, that is).

Anyway that's another topic.


Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Properly handle keyword + COMMENT keyword

2014-03-24 Thread Samuel Wales
does this preserve todo keyword font locking and sorting?  it is an
interesting change if so, and i would probably find it useful.

does archive work the same way?

i presume it is a coincidence that this message comes after mine which
mentioned font locking and sorting, as the fix to that message is to
not evaluate or export call lines that are not supposed to be
exported.  i would not find this change to be a suitable workaround
for that.

however, i like the idea of commenting out a headline not changing
sorting and font locking.

i have always called these quasi-keywords.



Re: [O] [PATCH] org-plot: Handle explicit date/time index

2014-03-24 Thread Yasushi SHOJI
Hi Bastien,

At Sun, 23 Mar 2014 19:41:45 +0100,
Bastien wrote:
> 
> Yasushi SHOJI  writes:
> 
> > * lisp/org-plot.el (org-plot-quote-tsv-field): Dump data as is when
> >   `timeind' is set.
> 
> This change produces a compiler warning:
> 
> In org-plot-quote-tsv-field:
> org-plot.el:113:22:Warning: reference to free variable `params'

Thank you for catching this.

I guess I have to re-think the whole thing. The current code by-passes
the quoting function for _all_ fields, not just for the index when
`timeind' is present.  This surely breaks for others.

I don't have much time today.  So, please give me a day or two.
Meanwhile, Bastien, would you mind to revert the commit for me?

Thanks,
-- 
 yashi



[O] [RFC] Properly handle keyword + COMMENT keyword

2014-03-24 Thread Nicolas Goaziou
Hello,

COMMENT keyword is not always clearly defined in Org. Some parts
consider it is a regular keyword as treat it as such (e.g. `org-todo')
whereas some others see it as an additional keyword (e.g.,
`org-priority').

I think the latter makes more sense, and, as a consequence, Org Syntax
(http://orgmode.org/worg/dev/org-syntax.html) defines it that way. Much
like :ARCHIVE:, COMMENT provides an additional property to the headline,
without limiting it whatsoever.

In other words, the following should be valid:

  * TODO COMMENT Headline

and, according to Org Syntax, so should this:

  * TODO [#A] COMMENT Headline

Though, COMMENT keyword must come after any other keyword and priority,
if any. So the following is /not/ valid:

  * COMMENT TODO Headline

Thus, this patch

 - properly fontifies headlines with both a regular keyword and
   a COMMENT keyword,

 - fixes `org-toggle-comment' and `org-todo' to handle both COMMENT
   keyword and another one

 - adds some consistency to functions implementing their own COMMENT
   matching (e.g., with or without case-sensitivity).


WDYT?

-- 
Nicolas Goaziou
>From 0a16a1136dbda9deec40b9a72e7dd0a5d648db71 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou 
Date: Mon, 24 Mar 2014 21:46:00 +0100
Subject: [PATCH] Fix COMMENT keyword when stacked with a regular keyword

* lisp/org.el (org-set-font-lock-defaults): Fix headline fontification
  when keywords are stacked.
(org-toggle-comment): Properly toggle COMMENT keyword when a regular
keyword is already present.
(org-todo, org-agenda-prepare-buffers): Correctly match a commented
heading.
* lisp/org-colview.el (org-columns-capture-view): Correctly match
  a commented heading.

* testing/lisp/test-org.el (test-org/toggle-comment): New test.
---
 lisp/org-colview.el  |  8 +++
 lisp/org.el  | 40 +
 testing/lisp/test-org.el | 58 
 3 files changed, 82 insertions(+), 24 deletions(-)

diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 07d140f..9ebea98 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -1201,8 +1201,6 @@ containing the title row and all other rows.  Each row is a list
 of fields."
   (save-excursion
 (let* ((title (mapcar 'cadr org-columns-current-fmt-compiled))
-	   (re-comment (format org-heading-keyword-regexp-format
-			   org-comment-string))
 	   (re-archive (concat ".*:" org-archive-tag ":"))
 	   (n (length title)) row tbl)
   (goto-char (point-min))
@@ -1214,9 +1212,9 @@ of fields."
  (/ (1+ (length (match-string 1))) 2)
 			   (length (match-string 1)
 		 (get-char-property (match-beginning 0) 'org-columns-key))
-	(when (save-excursion
-		(goto-char (point-at-bol))
-		(or (looking-at re-comment)
+	(when (or (org-in-commented-heading-p t)
+		  (save-excursion
+			(goto-char (point-at-bol))
 			(looking-at re-archive)))
 	  (org-end-of-subtree t)
 	  (throw 'next t))
diff --git a/lisp/org.el b/lisp/org.el
index ef0bc3f..94bda2a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6343,9 +6343,11 @@ needs to be inserted at a specific position in the font-lock sequence.")
 	   ;; Code
 	   '(org-activate-code (1 'org-code t))
 	   ;; COMMENT
-	   (list (format org-heading-keyword-regexp-format
-			 (concat "\\(" org-comment-string "\\)"))
-		 '(2 'org-special-keyword t))
+	   (list (format
+		  "^\\*\\(?: +%s\\)?\\(?: +\\[#[A-Z0-9]\\]\\)? +\\(?9:%s\\)\\(?: \\|$\\)"
+		  org-todo-regexp
+		  org-comment-string)
+		 '(9 'org-special-keyword t))
 	   ;; Blocks and meta lines
 	   '(org-fontify-meta-lines-and-blocks
 (setq org-font-lock-extra-keywords (delq nil org-font-lock-extra-keywords))
@@ -12176,17 +12178,17 @@ expands them."
   (interactive)
   (save-excursion
 (org-back-to-heading)
-(let (case-fold-search)
-  (cond
-   ((looking-at (format org-heading-keyword-regexp-format
-			org-comment-string))
-	(goto-char (match-end 1))
-	(looking-at (concat " +" org-comment-string))
-	(replace-match "" t t)
-	(when (eolp) (insert " ")))
-   ((looking-at org-outline-regexp)
-	(goto-char (match-end 0))
-	(insert org-comment-string " "))
+(looking-at org-complex-heading-regexp)
+(goto-char (or (match-end 3) (match-end 2) (match-end 1)))
+(skip-chars-forward " \t")
+(unless (memq (char-before) '(?\s ?\t)) (insert " "))
+(if (org-in-commented-heading-p t)
+	(delete-region (point)
+		   (progn (search-forward " " (line-end-position) 'move)
+			  (skip-chars-forward " \t")
+			  (point)))
+  (insert org-comment-string)
+  (unless (eolp) (insert " ")
 
 (defvar org-last-todo-state-is-todo nil
   "This is non-nil when the last TODO state change led to a TODO state.
@@ -12301,7 +12303,7 @@ When called through ELisp, arg is also interpreted in the following way:
   (save-excursion
 	(catch 'exit
 	  (org-back-to-heading t)
-	  (when (looking-at (concat "^\\*+ " org-comment-st

Re: [O] org mode alignment problem

2014-03-24 Thread Guido Van Hoecke
Bastien,

On 23 March 2014 22:51, Guido Van Hoecke  wrote:
> Hi Bastien,
>
> Bastien  writes:
>
>> Hi Guido,
>>
>> Guido Van Hoecke  writes:
>>
>>> The problem remains if I replace '[' and ']' with either '{' and
>>> '}' or '(' and ')'.
>>>
>>> It disappears if I replace them by e.g. '#' and '+'.
>>
>> I smell a bad interaction with some other package.
>>
>> Can you reproduce the problem with emacs -q (loading Org
>> from master, since you're using this Org version)?
>
> Nope.
>
>> If the problem disappear when you don't load your emacs.el,
>> then maybe you can bisect and see what's wrong there.
>
> I'll investigate this tomorrow and report back with the name of the
> culprit :)

Here's the culprit:
(require 'linum)
(global-linum-mode)

Turning global-linum-mode off solved the problem, as far as I can tell now.

Thanks for your help and time.

Guido



Re: [O] verbatim/code text and line breaks with auto fill mode

2014-03-24 Thread Michael Weylandt
On Mar 18, 2014, at 18:35, "Michael Weylandt"  
wrote: 
> 
> On Mar 8, 2014, at 7:12, Alan Schmitt  wrote:
>> 
>> I've continued looking into this, and it seems that what I want is use
>> `fill-nobreak-predicate'. This is what I ended up doing:
>> 
>> #+begin_src emacs-lisp
>> (add-hook 'org-mode-hook
>> (lambda ()
>>   (add-hook 'fill-nobreak-predicate 'org-in-verbatim-emphasis)))
>> #+end_src
> 
> Is there an analogue like org-in-inline-src-p? I find the auto-fill breaks 
> inline (src_python{...}) 

There doesn't appear to be a native org version, but I've used

(defun org-in-inline-src-p ()
  (org-in-regexp org-babel-inline-src-block-regexp))

(add-hook 'org-mode-hook
 (lambda () (add-hook 'fill-nobreak-predicate 'org-in-inline-src-p)))

And it seems to give a better auto-fill experience. 

Michael


Re: [O] [ANN] orgbox: Mailbox-like task scheduling in org-agenda.

2014-03-24 Thread Aaron Ecay
Hi Alan,

I installed the attached file with M-x package-install-file to avoid
getting org pulled in via (M)ELPA.  The large version number means that
new versions of org don’t look like upgrades, preventing them from
overwriting this package.  Obviously, you should edit the path to your
git checkout of org.  You’ll additionally have to add the org/lisp and
org/contrib/lisp (if desired) directories from the git checkout to
load-path in your init.el (before calling package-initialize).

(I think the copyright line was put there because package.el would
fuss if it was missing.  This code is so short I doubt it is actually
copyrightable.)



org.el
Description: application/emacs-lisp

--
Aaron Ecay


[O] Basic vcard-to-org-contacts converter

2014-03-24 Thread Titus von der Malsburg

Hi list!

I decided to give org-contacts a try.  Since there doesn't seem to be a
facility for importing contacts in vcard format, I wrote a little Python
script for that.  Perhaps someone on this list finds it useful.

  https://gist.github.com/tmalsburg/9747104

The script uses the Python package vobject for parsing vcard files.  On
Debian-like systems this package is available as python-vobject.  I
tested the script with contacts exported from Apple's iCloud service and
that worked well.  However, the vcard format is somewhat messy and I
don't know what happens with vcard files generated in other contact
managers.  Use at your own risk.

If there's interest, I might migrate the script to a proper Github
repository and develop it further, i.e., merge your pull-requests ;-)

  Titus



Re: [O] Org is awesome

2014-03-24 Thread Sam Flint
On 24 Mar 2014, chandan wrote:

> On Monday 24 Mar 2014 20:22:47 James Harkins wrote:
>> For those who wanted to see the article, a current draft is here:
>> http://ubuntuone.com/2uszkV2PDUuSgZAtnXwXzZ -- though the subject
>> (audio synthesis and real-time control) is likely to be esoteric for
>> most.
>
> Can you please post a link to the sources? I would most probably use
> it as a reference for generating different parts of any documents that
> I would create.
Yes, please release your indexing code especially!

Sam
-- 
Sam Flint
swfl...@flintfam.org
freenode: swflint
sip:swfl...@ekiga.net
XMPP: swfl...@flintfam.org
http://flintfam.org/~swflint
2048D/BAFBF3FF
(3696 0D80 EC3C D40A 0186  D0E8 C63B 96FB BAFB F3FF)


pgp73GtEa_EsK.pgp
Description: PGP signature


Re: [O] Org is awesome

2014-03-24 Thread chandan
On Monday 24 Mar 2014 20:22:47 James Harkins wrote:
> For those who wanted to see the article, a current draft is here:
> http://ubuntuone.com/2uszkV2PDUuSgZAtnXwXzZ -- though the subject (audio
> synthesis and real-time control) is likely to be esoteric for most.

Can you please post a link to the sources? I would most probably use
it as a reference for generating different parts of any documents that
I would create.

Thanks,
chandan




Re: [O] Babel should not work in the subtree marked as not exported

2014-03-24 Thread Samuel Wales
note: this is not a high priority for me, but it seems like a bug, it
can result in surprising behavior for new users, and it helps clarify
this thread, so it seemed worth posting.  the ecm is in this thread.



Re: [O] Babel should not work in the subtree marked as not exported

2014-03-24 Thread Samuel Wales
now that everybody is happy, agreeing, and singing in a circle holding
hands, i thought i'd stir the pot.  :]  i hope i don't get wicked
glares.  :]

there are a few unresolved questions.  there is also something that,
for my workflow at least, is a bug.

i set org-export-with-tasks to nil, because i want to export only
blank headers.  this is a GREAT feature.

tldr: call lines are executed when they should not be.

===

i never use export tags.  i only use comment for occasional,
temporary, truly commented out things.  i cannot use it for more
purposes because it changes sorting and highlighting of todo keywords.
 that makes it not worth using for any other purpose.

so i do:

===
* a
*** REF b
*** NEXT e
*** d
*** MAYBE c
===

which exports a and d, but not b e c.  this is perfect.  it is exactly
what i want.  i get a sense of "this is software working the way it
should" every time i export.  i REALLY like how i can intersperse
notes with exported stuff.  no tags or comments or anything fancy,
just todo keywords.

except for one thing.

underneath b i like to put babel blocks that are relevant to a.  and
above the babel blocks, i might have some call lines.  these lines are
for testing.  i do c-c c-c on them manually, to test the block.

i also export b while testing, to get all of them at once.  but most
of the time i only export a.

this is all well and good -- again, perfect -- but in maint at least,
babel actually executes those call lines upon export of a.

i don't want them exported, because they are only there for testing.
i don't want to comment out the header, because that changes font
lock, turns off the block [which i use], and changes sorting.

to me it's a bug that those call lines are executed.

i'll join the circle if you guys will agree with me on this.  :]

samuel

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  And
ANYBODY can get it.

Denmark: free Karina Hansen NOW.



Re: [O] org-babel R output table with plot

2014-03-24 Thread John Hendy
On Mon, Mar 24, 2014 at 10:22 AM, Feng Shu  wrote:
> Hi everyone
>
> I want to R output table with plot, I use a solution below,
> Who can tell me other solutions?
>

I sort of follow the below, but I think it would be more helpful to
describe what you *don't* like about the output below. In other words,
what are you trying to achieve that is not working below?


John

> thanks!
>
> #+begin_src R  :results output raw drawer
>   require("ascii")
>
>   print.org <- function (x, caption)
>   {
>   print(paragraph(paste("#+CAPTION: ", caption, sep="")),type="org")
>   print(ascii(x),type="org")
>   }
>   plot.org  <- function (x, caption)
>   {
>   pngfile <- paste(caption, ".png", sep="")
>   print(paragraph(paste("#+CAPTION: ", caption, sep="")),type="org")
>   png(pngfile)
>   plot(x)
>   dev.off()
>   print(paragraph(paste("[[./", pngfile, "]]", 
> sep=""),new=FALSE),type="org")
>
>   }
>   data <- data.frame(x=c(1,20,100,800),y=c(200,4,5,29))
>   print.org(data, "test-table1")
>   print.org(data, "test-table2")
>   plot.org(data, "test-pic")
>
> #+end_src
>
> #+RESULTS:
> :RESULTS:
>
> #+CAPTION: test-table1
> |   | x  | y  |
> |---++|
> | 1 | 1.00   | 200.00 |
> | 2 | 20.00  | 4.00   |
> | 3 | 100.00 | 5.00   |
> | 4 | 800.00 | 29.00  |
>
> #+CAPTION: test-table2
> |   | x  | y  |
> |---++|
> | 1 | 1.00   | 200.00 |
> | 2 | 20.00  | 4.00   |
> | 3 | 100.00 | 5.00   |
> | 4 | 800.00 | 29.00  |
>
> #+CAPTION: test-pic
> [[./test-pic.png]]
> :END:
>
>
> --
>



Re: [O] Babel should not work in the subtree marked as not exported

2014-03-24 Thread Eric Schulte
Bastien  writes:

> Hi Nicolas and Eric,
>
> Eric Schulte  writes:
>
>> Looks good to me, I'll leave to Bastien since it touches core Org-mode
>> functionality and not just Babel.
>
> Looks good to me, please apply,

Applied.

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D



Re: [O] Org is awesome

2014-03-24 Thread Dave Taht
On Mon, Mar 24, 2014 at 9:48 AM, Suvayu Ali  wrote:
> On Mon, Mar 24, 2014 at 03:13:24PM +0100, Bastien wrote:
>> James Harkins  writes:
>>
>> > For those who wanted to see the article, a current draft is here:
>> > http://ubuntuone.com/2uszkV2PDUuSgZAtnXwXzZ -- though the subject
>> > (audio synthesis and real-time control) is likely to be esoteric for
>> > most.
>>
>> I don't understand a thing, but I find it beautiful.  :)
>
> Same here :)

As I used to use supercollider and other audio tools like ardour back
when I merely used computers for fun, it was a very nice read in
addition to being a great example of what org-mode can do.

Thanks for posting!
>
> --
> Suvayu
>
> Open source is the future. It sets us free.
>



-- 
Dave Täht

Fixing bufferbloat with cerowrt: http://www.teklibre.com/cerowrt/subscribe.html



Re: [O] Org is awesome

2014-03-24 Thread Suvayu Ali
On Mon, Mar 24, 2014 at 03:13:24PM +0100, Bastien wrote:
> James Harkins  writes:
> 
> > For those who wanted to see the article, a current draft is here: 
> > http://ubuntuone.com/2uszkV2PDUuSgZAtnXwXzZ -- though the subject
> > (audio synthesis and real-time control) is likely to be esoteric for
> > most.
> 
> I don't understand a thing, but I find it beautiful.  :)

Same here :)

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Babel should not work in the subtree marked as not exported

2014-03-24 Thread Bastien
Hi Nicolas and Eric,

Eric Schulte  writes:

> Looks good to me, I'll leave to Bastien since it touches core Org-mode
> functionality and not just Babel.

Looks good to me, please apply,

-- 
 Bastien



Re: [O] Babel should not work in the subtree marked as not exported

2014-03-24 Thread Eric Schulte
Nicolas Goaziou  writes:

> Hello,
>
> Eric Schulte  writes:
>
>> Nicolas Goaziou  writes:
>>>
>>> As a side note, I think `org-babel-under-commented-heading-p' is useful
>>> enough (with an optional parameter to prevent inheritance, maybe) to be
>>> moved into "org.el".
>>>
>>
>> I agree.
>
> Here is the patch.
>

Looks good to me, I'll leave to Bastien since it touches core Org-mode
functionality and not just Babel.

Thanks,


-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D



[O] org-babel R output table with plot

2014-03-24 Thread Feng Shu
Hi everyone

I want to R output table with plot, I use a solution below,
Who can tell me other solutions?

thanks!

#+begin_src R  :results output raw drawer
  require("ascii")

  print.org <- function (x, caption)
  {
  print(paragraph(paste("#+CAPTION: ", caption, sep="")),type="org")
  print(ascii(x),type="org")
  }
  plot.org  <- function (x, caption)
  {
  pngfile <- paste(caption, ".png", sep="")
  print(paragraph(paste("#+CAPTION: ", caption, sep="")),type="org")
  png(pngfile)
  plot(x)
  dev.off()
  print(paragraph(paste("[[./", pngfile, "]]", 
sep=""),new=FALSE),type="org")
  
  }
  data <- data.frame(x=c(1,20,100,800),y=c(200,4,5,29))
  print.org(data, "test-table1")
  print.org(data, "test-table2")
  plot.org(data, "test-pic")
  
#+end_src

#+RESULTS:
:RESULTS:

#+CAPTION: test-table1 
|   | x  | y  |
|---++|
| 1 | 1.00   | 200.00 |
| 2 | 20.00  | 4.00   |
| 3 | 100.00 | 5.00   |
| 4 | 800.00 | 29.00  |

#+CAPTION: test-table2 
|   | x  | y  |
|---++|
| 1 | 1.00   | 200.00 |
| 2 | 20.00  | 4.00   |
| 3 | 100.00 | 5.00   |
| 4 | 800.00 | 29.00  |

#+CAPTION: test-pic 
[[./test-pic.png]] 
:END:


-- 



Re: [O] Babel should not work in the subtree marked as not exported

2014-03-24 Thread Nicolas Goaziou
Hello,

Eric Schulte  writes:

> Nicolas Goaziou  writes:
>>
>> As a side note, I think `org-babel-under-commented-heading-p' is useful
>> enough (with an optional parameter to prevent inheritance, maybe) to be
>> moved into "org.el".
>>
>
> I agree.

Here is the patch.


Regards,

-- 
Nicolas Goaziou
>From 690543c40d766802df3e30e44ef7d6f04d6c18ba Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou 
Date: Mon, 24 Mar 2014 16:12:12 +0100
Subject: [PATCH] Rename `org-babel-under-commented-heading-p'

* lisp/org.el (org-in-commented-heading-p): New function.
* lisp/ob-tangle.el (org-babel-under-commented-heading-p): Remove
  function.
(org-babel-tangle-collect-blocks): Use new function.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Use new function.

* testing/lisp/test-org.el (test-org/in-commented-heading-p): New
  test.
---
 lisp/ob-exp.el   |  2 +-
 lisp/ob-tangle.el| 18 +-
 lisp/org.el  | 16 
 testing/lisp/test-org.el | 32 
 4 files changed, 50 insertions(+), 18 deletions(-)

diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el
index 0ddb4dc..3b63422 100644
--- a/lisp/ob-exp.el
+++ b/lisp/ob-exp.el
@@ -158,7 +158,7 @@ may make them unreachable."
 			"^[ \t]*#\\+BEGIN_SRC")))
 	(goto-char (point-min))
 	(while (re-search-forward regexp nil t)
-	  (unless (save-match-data (org-babel-under-commented-heading-p))
+	  (unless (save-match-data (org-in-commented-heading-p))
 	(let* ((element (save-excursion
 			  ;; If match is inline, point is at its
 			  ;; end.  Move backward so
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index bf67410..294a6ff 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -357,22 +357,6 @@ that the appropriate major-mode is set.  SPEC has the form:
insert-comment
(org-fill-template org-babel-tangle-comment-format-end link-data)
 
-(defvar org-comment-string) ;; Defined in org.el
-(defun org-babel-under-commented-heading-p ()
-  "Non-nil if point is under a commented heading.
-This function also checks ancestors of the current headline, if
-any."
-  (cond
-   ((org-before-first-heading-p) nil)
-   ((let ((headline (nth 4 (org-heading-components
-  (and headline
-	   (let ((case-fold-search nil))
-	 (org-string-match-p (concat "^" org-comment-string "\\(?: \\|$\\)")
- headline)
-   (t (save-excursion
-	(and (org-up-heading-safe)
-	 (org-babel-under-commented-heading-p))
-
 (defun org-babel-tangle-collect-blocks (&optional language tangle-file)
   "Collect source blocks in the current Org-mode file.
 Return an association list of source-code block specifications of
@@ -396,7 +380,7 @@ can be used to limit the collected code blocks by target file."
   (let* ((info (org-babel-get-src-block-info 'light))
 	 (src-lang (nth 0 info))
 	 (src-tfile (cdr (assoc :tangle (nth 2 info)
-(unless (or (org-babel-under-commented-heading-p)
+(unless (or (org-in-commented-heading-p)
 		(string= (cdr (assoc :tangle (nth 2 info))) "no")
 		(and tangle-file (not (equal tangle-file src-tfile
   (unless (and language (not (string= language src-lang)))
diff --git a/lisp/org.el b/lisp/org.el
index 727f646..ef0bc3f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -23303,6 +23303,22 @@ This version does not only check the character property, but also
 ;; Compatibility alias with Org versions < 7.8.03
 (defalias 'org-on-heading-p 'org-at-heading-p)
 
+(defun org-in-commented-heading-p (&optional no-inheritance)
+  "Non-nil if point is under a commented heading.
+This function also checks ancestors of the current headline,
+unless optional argument NO-INHERITANCE is non-nil."
+  (cond
+   ((org-before-first-heading-p) nil)
+   ((let ((headline (nth 4 (org-heading-components
+  (and headline
+	   (let ((case-fold-search nil))
+	 (org-string-match-p (concat "^" org-comment-string "\\(?: \\|$\\)")
+ headline)
+   (no-inheritance nil)
+   (t (save-excursion
+	(and (org-up-heading-safe)
+	 (org-in-commented-heading-p t))
+
 (defun org-at-comment-p nil
   "Is cursor in a line starting with a # character?"
   (save-excursion
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 949392e..0144841 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -544,6 +544,38 @@
 
 
 
+;;; Headline
+
+(ert-deftest test-org/in-commented-heading-p ()
+  "Test `org-in-commented-heading-p' specifications."
+  ;; Commented headline.
+  (should
+   (org-test-with-temp-text "* COMMENT Headline\nBody"
+ (goto-char (point-max))
+ (org-in-commented-heading-p)))
+  ;; Commented ancestor.
+  (should
+   (org-test-with-temp-text "* COMMENT Headline\n** Level 2\nBody"
+ (goto-char (point-max))
+ (org-in-commented-heading-p)))
+  ;; Comment keyword is case-sensitive.
+  (should-not
+   (org-test-with-temp-text "* Comment Headline\nBody"
+ (goto-char (point-max))
+ 

[O] about truncate line depend context

2014-03-24 Thread Feng Shu

Now I set  truncate-lines to -1 in my org file, but the table shows
ugly, So I use below code.

Can I use a hook to do this job?

#+begin_src elisp
(defun eh-org-truncate-lines (&optional arg)
  (interactive "P")
  (cond
   ((or (and (boundp 'org-clock-overlays) org-clock-overlays)
org-occur-highlights
org-latex-fragment-image-overlays)
(and (boundp 'org-clock-overlays) (org-clock-remove-overlays))
(org-remove-occur-highlights)
(org-remove-latex-fragment-image-overlays)
(message "Temporary highlights/overlays removed from current buffer"))
   (t
(let* ((context (org-element-context)) (type (org-element-type context)))
  (case type
((table table-cell table-row item plain-list)
 (toggle-truncate-lines 1))
(t (toggle-truncate-lines -1)))

(defun eh-org-ctrl-c-ctrl-c (&optional arg)
  (interactive)
  (eh-org-truncate-lines arg)
  (org-ctrl-c-ctrl-c arg))

(org-defkey org-mode-map "\C-c\C-c" 'eh-org-ctrl-c-ctrl-c)

#+end_src

-- 



Re: [O] Radio targets with mixed capitalisation do not work in HTML export

2014-03-24 Thread Bastien
Hi Nicolas,

Nicolas Goaziou  writes:

> However, I'm not sure this is something desirable, but the apostrophe
> problem is mildly annoying.

My intuition is that midword matching will soon be used as a neat
trick, while preventing "target's" to match "<<>>" will prove
annoying.  Also, one can easily circumvent midword false positives by
using a slightly different word.

That's quite a premature and unstable intuition, but I think it's
worth trying if your intuition goes in the same direction.  Otherwise
let's just prevent apostrophes.

Thanks again,

-- 
 Bastien



Re: [O] [ANN] orgbox: Mailbox-like task scheduling in org-agenda.

2014-03-24 Thread Alan Schmitt
I installed this manually, because I don't want to use org from elpa (as
I prefer to stay up to date with the master branch).

Is there a way to install orgbox without pulling the org dependency?

Thanks,

Alan



Re: [O] [bug] cannot extract just one column of table for use in gnuplot src block

2014-03-24 Thread Bastien
Hi Achim and Eric,

Eric S Fraga  writes:

> This patch seems to work.  Thanks!

Achim, feel free to apply the patch when you have time for this,

-- 
 Bastien



Re: [O] Org is awesome

2014-03-24 Thread Bastien
James Harkins  writes:

> For those who wanted to see the article, a current draft is here: 
> http://ubuntuone.com/2uszkV2PDUuSgZAtnXwXzZ -- though the subject
> (audio synthesis and real-time control) is likely to be esoteric for
> most.

I don't understand a thing, but I find it beautiful.  :)

-- 
 Bastien



[O] bug#17055: 24.3.50; Emacs hangs in Org mode file

2014-03-24 Thread Glenn Morris

Perhaps this is fixed now, according to comments at:

http://lists.gnu.org/archive/html/emacs-orgmode/2014-03/msg01176.html

(It would be great if someone would keep an eye on these Org bugs that
get reported to Emacs and update them when appropriate.

Although it seems better to report Org bugs to the Org-mode list rather
than to Emacs.)





Re: [O] Radio targets with mixed capitalisation do not work in HTML export

2014-03-24 Thread Nicolas Goaziou
Bastien  writes:

> It looks perfect.  I tested* the HTML and LaTeX backend and they do
> exactly what's expected.  Thanks a lot for putting this together!

Applied.

-- 
Nicolas Goaziou



Re: [O] I need help extending ob-ocaml to support :results output

2014-03-24 Thread Alan Schmitt
Eric Schulte  writes:

> You can step through the execution of `org-babel-execute:ocaml' by first
> evaluating the function with a prefix argument (meaning with the cursor
> within the function body press C-u C-A-x) which will edebug [1] the
> function.
>
> You can then evaluate an OCaml code block and when execution hits the
> `org-babel-execute:ocaml' it will pause, and you can step through the
> function by continuously pressing space bar.  In this way you can see
> how the code is executed, and you can interactively look at the OCaml
> session buffer to see where output is printed.  Pay special attention to
> the `org-babel-comint-with-output' function, which is probably where
> you'll need to make changes when the following holds.
>
>   (member "output" (cdr (assoc :result-params params)))
>
> You can also look for the string "output" in other ob-*.el language
> files to see how output results are collected.
>
> Hope this helps,

It does, thanks a lot.

Alan



Re: [O] [BABEL] BUG Re: Omitting try/catch blocks from tangled R code?

2014-03-24 Thread Eric Schulte
Rainer M Krug  writes:

> Eric Schulte  writes:
>
>> Rainer M Krug  writes:
>>
>>> Eric Schulte  writes:
>>>
 Charles Berry  writes:

> John Hendy  gmail.com> writes:
>
> [deleted]
>> >
>> > I think the default behavior should be reverted, as tangling and
>> > exporting are two different things. When I tangle, I want to see the
>> > code blocks as they are in the org document (with possible variables 
>> > and
>> > expansions) but not to create files where I do not put it explicitly
>> > into a code block. These wrappers have nothing to do with the code, and
>> > are only there for the exported engine. So I would either revert to the
>> > original behavior, or, introduce a new header argument,
>> > e.g. :include-wrappers, which would, if set to t, include the export
>> > wrappers in the tangled file. This might be useful for debugging
>> > exporting of code block results, but not for general tangling.
>> 
>> Thanks for chiming in. This was my gut reaction to the default
>> behavior. I guess we're still only a sample size of 2, but
>> intuitively, I would think that tangling would be a separate beast in
>> most cases from exporting. Just to have it on the record, if I tangle,
>> it's usually to take the code I've used in something like a Beamer
>> presentation or document and combine it into a single .R file so
>> someone can run it without needing Org-mode.
>
> [deleted]
>
> Sorry to be late to add my $0.02...
>
> I never want the try/catch wrappers.
>
> But noweb is indispensable.
>
> I use noweb a lot to organize and collect blocks. In some cases, I export
> them and in others I just tangle them.
>
> I hope that the revised code will allow me to turn off try/catch wrapping
> and still be able to use noweb when tangling or exporting.
>

 In addition to noweb, there are cases where variable expansion is useful
 in tangled code.

 The simplest option is to move things like try/catch blocks out of the
 code block expansion function, and into the execution function.  Then if
 other language present similar constructs (which we want to add to
 execution by default but never want to tangle), we can think about
 abstracting this out into some new level of code block expansion.

 Thoughts?
>>>
>>> Makes perfect sense to me, and would definitely be the better place to
>>> add them.
>>>
>>> If one wants enclosing code in the tangling, there is always
>>> the :epilogue and :prologue header arguments, and the try/catch should
>>> be considered as internal to the execution.
>>>
>>
>> Great, how's this patch work?  If it looks good I'll apply it.
>
> Git still puzzles me a lot... If you tell me how I can apply this patch
> (from emacs?) I will try it out.
>

Here are some instructions from the command line.

1. write the patch out to a file on disk, say /tmp/0001-etc...patch

2. cd into the org-mode directory

3. make sure you're up to date with the latest

 git pull

4. apply the patch

 git am /tmp/0001-etc...patch

and that should do it.

Best,

>
> Thanks,
>
> Rainer
>
>>
>> Thanks,

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D



Re: [O] Context of interaction vs. literal syntactic interpretation

2014-03-24 Thread Nicolas Goaziou
Hello,

Bastien  writes:

> In the meantime, what do you think about the solution I propose?

I think it is a sensible move.


Regards,

-- 
Nicolas Goaziou



Re: [O] Bug in org-beamer-publish-to-pdf?

2014-03-24 Thread Nicolas Goaziou
Hello,

Rafael  writes:

> I think there is a bug in org-beamer-publish-to-pdf. The code of the
> function is:
>
> #+BEGIN_SRC emacs-lisp
>   (defun org-beamer-publish-to-pdf (plist filename pub-dir)
> (org-publish-attachment
>  plist
>  (org-latex-compile (org-publish-org-to 'beamer filename ".tex" plist))
>  pub-dir))
> #+END_SRC
>
> It seems to me that (org-publish-org-to 'beamer filename ".tex" plist)
> only returns filename.tex without the directory. Hence org-latex-compile
> wants to compile a .tex file in my home directory, (rather than at the base
> directory of the publishing) and fails at not finding it there. 

You're correct. This should now be fixed in maint. Thank you for
reporting it.


Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Creole-style / Support for **emphasis**__within__**a word**

2014-03-24 Thread Jambunathan K
Nicolas Goaziou  writes:

> Good luck.

Got my answer.  The rest are just details.



Re: [O] Org is awesome

2014-03-24 Thread James Harkins
On Mar 22, 2014 3:52 PM, "Bastien"  wrote:
>
> James Harkins  writes:
>
> > After 243 commits to a constellation of org files, producing 10849
> > lines of LaTeX code from the Beamer exporter, which render into 229
> > pages of beamerarticle print-ready material, including 156 captioned
> > code listings (and a handful of un-numbered ones) and 27 pages of
> > fully indexed glossary entries (whose LaTeX code comes from
> > emacs-lisp source blocks processing org tables), I think I'm in a
> > position to state with confidence:
>
> Nice use-case !
>
> > ORG IS AWESOME.
>
> Tell it to the world with a blog entry :)

I've started on a worg page to describe the project's design. That's lower
priority than some other projects, though, might take awhile.

For those who wanted to see the article, a current draft is here:
http://ubuntuone.com/2uszkV2PDUuSgZAtnXwXzZ -- though the subject (audio
synthesis and real-time control) is likely to be esoteric for most.

hjh


Re: [O] HTML export is using the wrong browser

2014-03-24 Thread Achim Gratz
James Harkins  gmail.com> writes:
> In my case, this was not successful.
> 
> http://ubuntuforums.org/showthread.php?t=2212948

The reason is most likely that sensible-browswer doesn't use alternatives,
i.e. it doesn't end up calling x-www-browser.  You may have set BROWSER in
your environment or otherwise added a configuration file that overrides the
(system-wide) alternatives to your home directory.


Regards,
Achim.





Re: [O] Radio targets with mixed capitalisation do not work in HTML export

2014-03-24 Thread Nicolas Goaziou
Hello,

Bastien  writes:

> It looks perfect.  I tested* the HTML and LaTeX backend and they do
> exactly what's expected.  Thanks a lot for putting this together!

There is still a limitation (which was already present before the
patch), though. The regexp cannot match a radio link next to an
apostrophe, since those are considered word-constituent.

An obvious solution would be to drop the separator ("\\_<", previously
"\\<") altogether. This would allow the following construct:

   <<>> some target's

This would also allow midword matching when the radio target is small
enough to be contained within a word.

  <> organization

However, I'm not sure this is something desirable, but the apostrophe
problem is mildly annoying.

WDYT?


Regards,

-- 
Nicolas Goaziou



Re: [O] [BABEL] BUG Re: Omitting try/catch blocks from tangled R code?

2014-03-24 Thread Rainer M Krug

Eric Schulte  writes:

> Rainer M Krug  writes:
>
>> Eric Schulte  writes:
>>
>>> Charles Berry  writes:
>>>
 John Hendy  gmail.com> writes:

 [deleted]
> >
> > I think the default behavior should be reverted, as tangling and
> > exporting are two different things. When I tangle, I want to see the
> > code blocks as they are in the org document (with possible variables and
> > expansions) but not to create files where I do not put it explicitly
> > into a code block. These wrappers have nothing to do with the code, and
> > are only there for the exported engine. So I would either revert to the
> > original behavior, or, introduce a new header argument,
> > e.g. :include-wrappers, which would, if set to t, include the export
> > wrappers in the tangled file. This might be useful for debugging
> > exporting of code block results, but not for general tangling.
> 
> Thanks for chiming in. This was my gut reaction to the default
> behavior. I guess we're still only a sample size of 2, but
> intuitively, I would think that tangling would be a separate beast in
> most cases from exporting. Just to have it on the record, if I tangle,
> it's usually to take the code I've used in something like a Beamer
> presentation or document and combine it into a single .R file so
> someone can run it without needing Org-mode.

 [deleted]

 Sorry to be late to add my $0.02...

 I never want the try/catch wrappers.

 But noweb is indispensable.

 I use noweb a lot to organize and collect blocks. In some cases, I export
 them and in others I just tangle them.

 I hope that the revised code will allow me to turn off try/catch wrapping
 and still be able to use noweb when tangling or exporting.

>>>
>>> In addition to noweb, there are cases where variable expansion is useful
>>> in tangled code.
>>>
>>> The simplest option is to move things like try/catch blocks out of the
>>> code block expansion function, and into the execution function.  Then if
>>> other language present similar constructs (which we want to add to
>>> execution by default but never want to tangle), we can think about
>>> abstracting this out into some new level of code block expansion.
>>>
>>> Thoughts?
>>
>> Makes perfect sense to me, and would definitely be the better place to
>> add them.
>>
>> If one wants enclosing code in the tangling, there is always
>> the :epilogue and :prologue header arguments, and the try/catch should
>> be considered as internal to the execution.
>>
>
> Great, how's this patch work?  If it looks good I'll apply it.

Git still puzzles me a lot... If you tell me how I can apply this patch
(from emacs?) I will try it out.

Thanks,

Rainer

>
> Thanks,

-- 
Rainer M. Krug
email: Rainerkrugsde
PGP: 0x0F52F982


pgp2vOWpX0Aa5.pgp
Description: PGP signature


Re: [O] HTML export is using the wrong browser

2014-03-24 Thread James Harkins
On Mon, Mar 24, 2014 at 4:40 PM, Eric S Fraga  wrote:
> Off topic, sort of, but on Debian, as root:
>
>   update-alternatives --config sensible-browser
>
> will allow you to change the default.

In my case, this was not successful.

http://ubuntuforums.org/showthread.php?t=2212948

As shown in this question, Firefox is already the default in
update-alternatives, but the alternative that it consistently chooses
is *not* the default. This makes me think that the alternatives system
is perhaps poorly designed.

Changing the default in org-file-apps to "firefox %s" for HTML -- that
definitely works, by bypassing sensible-browser altogether. Thanks,
Bastien, for the tip.

hjh



Re: [O] HTML export is using the wrong browser

2014-03-24 Thread Eric S Fraga
James Harkins  writes:

[...]

> I noticed that C-c C-e h o was running "sensible-browser," and after
> half an hour's completely wasted effort trying to understand the
> update-alternatives system, the only thing I know is that Chrome's
> priority in the system is 200 while Firefox is 40. That explains why
> sensible-browser is choosing Chrome. But I can't find any example of a
> command that will change the priority of an existing link.

Off topic, sort of, but on Debian, as root:  

  update-alternatives --config sensible-browser

will allow you to change the default.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org 
release_8.2.5h-831-gcb9172.dirty



Re: [O] HTML export is using the wrong browser

2014-03-24 Thread Achim Gratz
James Harkins writes:
> I noticed that C-c C-e h o was running "sensible-browser," and after
> half an hour's completely wasted effort trying to understand the
> update-alternatives system, the only thing I know is that Chrome's
> priority in the system is 200 while Firefox is 40. That explains why
> sensible-browser is choosing Chrome. But I can't find any example of a
> command that will change the priority of an existing link.

If you want to change this system-wide, then:

/usr/sbin/update-alternatives --display sensible-browser
/usr/sbin/update-alternatives --config sensible-browser

will let you do this.  Changing the priorities is also possible, but
since the postinstall script will likely revert it to the packaged
default on any update this is probably less useful.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs




Re: [O] Generate and display image

2014-03-24 Thread Eric S Fraga
Andrey Tykhonov  writes:

[...]

> There is text2image command line utility which takes a text and converts it
> to the image, then returns a path to the image.
>
> When I execute that block by means of `org-babel-execute-src-block' that
> block executes correctly and returns a path:
>
> #+RESULTS:
> : [[/home/demi/images/2014-03-21-024756.png]]

If the : is part of the output you get, this means that the line is not
to be processed by org and hence the exported output is meant to be as
you describe.  Maybe you need to specify the type of results you expect
from your src block?  E.g. ":results file" or some variation thereof?
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org 
release_8.2.5h-831-gcb9172.dirty



Re: [O] [bug] cannot extract just one column of table for use in gnuplot src block

2014-03-24 Thread Eric S Fraga
Achim Gratz  writes:

> Eric S Fraga writes:
>> The trace shows that the column has been extracted exactly as I
>> wish.
>
> No, the column has been extracted as a vector, not a table.

Yes, true; what I meant was that the data extracted were the data I
expected to be extracted.  The structure may be wrong.

>> However, it would appear that the function may expect a sequence
>> and not just a single element?
>
> A table line is a list or a symbol, at the point of the error only a
> list may be present.  However, due to "data" being a vector, you'll get
> a number.  That's easy enough to guard for in that function, but the bug
> is much further up the call chain, most likely in
> org-babel-gnuplot-process-vars.  Something along the line of the
> following patch might be in order:

This patch seems to work.  Thanks!
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org 
release_8.2.5h-831-gcb9172.dirty



Re: [O] Emacs freezes

2014-03-24 Thread Christopher Witte
Fantastic! All working now.

Cheers,
Chris


On 22 March 2014 09:19, Nicolas Goaziou  wrote:

> Hello,
>
> Christopher Witte  writes:
>
> > I'm getting a weird problem with orgmode and flyspell mode. Using the
> > latest version of org from git, open the attached file test.org and run
> M-x
> > flyspell-mode, emacs will lock up. It has something to do with tables.
> >
> > Alternatively, make a new (empty) org file, run flyspell-mode, and start
> > making a new table by writing |sdf|sdf|, and it will lock up emacs.
> >
> > Using an older version of org (7.9.3) this problem doesn't occur.
> >
> > I'm using Emacs 24.3.1 on Ubuntu 12.04.
> >
> > Any ideas what could be causing this?
>
> Yes, two entries with the same key in cache. Anyway it should be fixed
> now.
>
> Thank you for the detailed report, and sorry for the delay.
>
>
> Regards,
>
> --
> Nicolas Goaziou
>


[O] #+CALL cross-file with reference arguments

2014-03-24 Thread Pascal Fleury
Hi!

I am trying to do a call across files with arguments that are references:

=== file:config.org
#+NAME: setup
#+HEADER: :var model=""
#+BEGIN_SRC sh
some bash code that works locally
#+END_SRC

=== file:experiment.org
#+NAME: experiment
| experiment_name | svm_classifier |
| num_samples | 15000  |

#+NAME: failing_call
#+CALL: config.org:setup(model=experiment[0,1])

#+NAME: passing_call
#+CALL: config.org:setup(model="svm_classifier")

#+NAME: working_reference
#+BEGIN_SRC sh :var model=experiment[0,1]
echo ${model}
#+END_SRC

For the failing_call, I get the error "Reference 'experiment' not found in
this buffer". However, if I use that same reference in another code block,
it works.
Is there an issue with passing reference through #+CALL ?

btw, I am using emacs-orgmode 8.2.5h

--paf


Re: [O] [ANN] orgbox: Mailbox-like task scheduling in org-agenda.

2014-03-24 Thread Yasuhito Takamiya
Hi Alan,

> It would be great to be able to configure some of the hard-coded dates
> and time, such as:
> - later today: number of hours (currently 3)
> - start of evening: currently 18:00
> - start of day: currently 08:00
> - start of weekend: currently Saturday (you could use
>   `org-agenda-weekend-days' as you are doing for the `orgbox-weekend-p'
>   predicate)
> - start of week: currently Monday, at 08:00
> - someday: currently in 3 months

Added the following defcustoms.

- orgbox-start-time-of-day
- orgbox-start-day-of-week
- orgbox-start-time-of-weekends
- orgbox-start-day-of-weekends
- orgbox-start-time-of-evening
- orgbox-later
- orgbox-someday

https://github.com/yasuhito/orgbox

Thanks for your feedback!

Yasuhito


On Fri, Mar 21, 2014 at 4:28 PM, Alan Schmitt
 wrote:
> Hello Yasuhito,
>
> Yasuhito Takamiya  writes:
>
>> Hello all,
>>
>> For your information, to anyone interested in GTD and org-mode,
>> I am developing a tiny tool for org-mode to schedule your agenda tasks
>> easily like Mailbox iPhone app (http://www.mailboxapp.com/).
>>
>> https://github.com/yasuhito/orgbox
>> (This is already available on MELPA.)
>>
>> Usage:
>>   - Open org-agenda view.
>>   - Move your cursor to a task you want to schedule and type C-c C-s
>> (or M-x orgbox).
>>   - Select one of the scheduling method from the menu shown on the
>> minibuffer.
>>
>> - [l] Later Today
>> - [e] This Evening
>> - [t] Tomorrow
>> - [w] This Weekend
>> - [n] Next Week
>> - [i] In a Month
>> - [s] Someday
>> - [p] Pick Date
>>
>> If anyone is interested in being involved in taking this forward,
>> that'd be great.
>
> I had a quick look at your code and this looks like a nice idea. I have
> a couple comments.
>
> It would be great to be able to configure some of the hard-coded dates
> and time, such as:
> - later today: number of hours (currently 3)
> - start of evening: currently 18:00
> - start of day: currently 08:00
> - start of weekend: currently Saturday (you could use
>   `org-agenda-weekend-days' as you are doing for the `orgbox-weekend-p'
>   predicate)
> - start of week: currently Monday, at 08:00
> - someday: currently in 3 months
>
> I don't know how difficult it would be to make these user configurable.
> In any case, I find this is a very useful addition to scheduling in org
> mode.
>
> Thanks,
>
> Alan