Re: [O] Let Org-mode babel file result support relative link type by using org-link-file-path-type

2017-03-12 Thread numbch...@gmail.com
* Does Org-mode `:output-dir` header-argument? Or is `:dir`?

* An example

I can make it (`:results file :file "FILENAME"`) work in `ob-python` like
this:

```org
#+BEGIN_SRC python :var fname="QR_I_Love_YOU.png" :dir "data/images"
:results file
import qrcode

img = qrcode.make("I Love YOU")
img.save(fname)
return fname
#+END_SRC

#+RESULTS:
[[file:/home/stardiviner/Org/Wiki/Computer
Technology/Programming/Programming
Languages/Python/Data/Packages/data/images/QR_I_Love_YOU.png]]
```

* More specific suggestion:

Make use of org-mode variable `org-link-file-path-type`.
When user generate a result with link (like:

```org
#+RESULTS:
[[file:/home/stardiviner/Org/Wiki/Computer
Technology/Programming/Programming
Languages/Python/Data/Packages/data/images/QR_I_Love_YOU.png]]
```

Org-mode babel always use relative file path for link, instead of absolute
file path like upper example.
For example, if current path is `/home/stardiviner/Org/Wiki/Computer
Technology/Programming/Programming Languages/Python/Data/Packages/`, then
the relative file path link should be:

```org
#+RESULTS:
[[file:data/images/QR_I_Love_YOU.png]]
```

* About what one preceduce over the other problem

The header argument `:dir "data/images"` is used to specify my generated
image's destination directory.
My suggestion is want a the result link use `org-link-file-path-type`. So
the header argument `:dir` is not about the result link. Just it will be
used. Like upper example.


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sun, Mar 12, 2017 at 9:14 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> "numbch...@gmail.com"  writes:
>
> > Let Org-mode babel file result support relative (adaptive) link type by
> > using `org-link-file-path-type`.
> >
> > This also can solve static site generator extensions (like `ob-blog.el`
> > etc) image link path issue.
> >
> > Also better if user changed parent directory name, those links will have
> to
> > updated too. But if `adaptive` `org-link-file-path-type` will solve this
> > problem.
> >
> > So please let Org-mode babel header arguments `:results file :file
> > "filename.png"` use `org-link-file-path-type` variable.
>
> It sounds interesting. Could you be more specific about the
> specifications of your suggestion.
>
> For example, what happens when :output-dir is set, or when :file already
> provides some directory part? What part takes precedence over the other?
>
> Better, could you show some examples, or some tests?
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] %( in capture template

2017-03-12 Thread Samuel Wales
===
* ecm
capture literally inserts.  i was told this is not normal,
but a bug.

recent maint

to reproduce, evaluate the following code, select the lines
in the scratch buffer, and run m-x org-capture RET p.

set the notes file to whatever works for you.

*** code
  (require 'org-capture)
  (setq org-default-notes-file (substitute-in-file-name
"$dorg/alpha-org-testcase.org"))
  ;; (find-file org-default-notes-file)
  (defun alpha-org-testcase--create-capture-bug ()
(add-to-list 'org-capture-templates
 `("p" "Protocol p" entry
   (file+headline ,org-default-notes-file "xyzzy-remember")
   "%(alpha-org-protocol-string \"%:link\"
\"%:description\" \"%i\")"
   :prepend t :immediate-finish t :jump-to-captured t))
(defun alpha-org-protocol-string (link description region)
  (format "* debug org-capture
   - link %s
   - description %s
   - region %s \
   "
  link description region)))
*** the bug is below
* debug org-capture
 - link
 - description
 - region ;; This buffer is for notes you don't want to
save, and for Lisp evaluation.
  %(alpha-org-protocol-string "" "" ";; If you want to create a file,
visit that file with C-x C-f,
  %(alpha-org-protocol-string "" "" ";; then enter the text in that
file's own buffer.
  %(alpha-org-protocol-string "" "" "
  %(alpha-org-protocol-string "" "" "
===

On 1/10/17, Nicolas Goaziou  wrote:
> Hello,
>
> Samuel Wales  writes:
>
>> i have "%(my-function \"%:link\" \"%:description\" \"%i\")" in a
>> capture template, which now does not run the function but treats it as
>> text.
>
> It should. Do you have an ECM?
>
> Regards,
>
> --
> Nicolas Goaziou
>


-- 
The Kafka Pandemic: 

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

The NIH, FDA, and CDC are not there for you.  Not without activism.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
.



Re: [O] New markup for revising manuscripts

2017-03-12 Thread Eric S Fraga
On Saturday, 11 Mar 2017 at 18:22, John Kitchin wrote:
> This is probably not feasible with links. that is also a challenge with
> Eric's markup approach. One way is to use visual wrapping so whole
> paragraphs are actually one line.

Yes, multiline highlighting is a challenge.

I finally (a few years ago now) bit the bullet and moved from my old
skool 72 char filled/wrapped lines (I started programming in F66 on
punch cards back in the stone age ;-)) to single line paragraphs with
visual-line-mode and org-indent.  Highlighting (and other markers) now
work as I would like although obviously limited to a single paragraph.

The only negative is the presentation of wide tables where I have to
switch back to non-visual line mode and then back again when I move away
from the table but I have a keybinding to toggle this so not too
painful...  More positively, revision control is cleaner as there is no
reformatting of paragraphs.

-- 
Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D)


signature.asc
Description: PGP signature


[O] WARNING: No org-loaddefs.el file could be found from where org.el is loaded

2017-03-12 Thread Yannick Lagrange
I'd like to update my org-mode to the latest stable version and I am running 
into an issue which worries me enough to want to fix it; but I can't.


I'm using ubuntu 14.04 LTS, Emacs 24.3.1 which comes with org 7.9.3; for 
reasons unrelated to this question I'd like to update to the current version of 
org.


I tried to do this using the emacs packaging system. I fired up emacs with the 
-q option, then typed M-x package-install RET org, and org seemed to install 
fine, although a warning flashed up: "No org-loaddefs.el file could be found 
from where org.el is loaded". I ended up with a directory 
~/.emacs.d/elpa/org-20170210/, which looked good, and when I fired up emacs 
again and typed M-x org-version I now got


Org mode version 9.0.5 (9.0.5-elpa @ /home/me/.emacs.d/elpa/org-20170210/)


so things looked fine. However when I tried to use org I got a warning in the 
emacs *Messages* buffer:


WARNING: No org-loaddefs.el file could be found from where org.el is loaded
You need to run "make" or "make autoloads" from the Org lisp directory

Of course I've googled for this, but the responses typically either say "you 
need to do what it says" or are too lisp-savvy for me to understand (I know 0 
lisp).

The directory /home/me/.emacs.d/elpa/org-20170210/ does have an org-loaddefs.el 
file, and running make in that directory is as far as I can see pointless 
anyway because it's come from ELPA so there's no makefile or what have you. So 
it seems to me the warning is perhaps referring to 
/usr/share/emacs/24.3/lisp/org , but this is precisely where I don't want org 
to be looking (and I'm not sure I'm right about this because there is also an 
org-loaddefs.el file in that directory).

My .emacs is here:

***

(require 'package)
(package-initialize);; Initialize & Install Package
;;
(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.
 '(inhibit-startup-screen t)
 '(org-agenda-custom-commands nil)
 '(org-agenda-files (quote ("~/Encfs/org/")))
 '(org-agenda-start-on-weekday nil)
 '(org-agenda-time-grid (quote ((require-timed) "" (800 1000 
1200 1400 1600 1800 2000
 '(org-agenda-use-time-grid nil)
 '(org-startup-truncated nil))
(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.
 )
;; -*- mode: elisp -*-

;; Disable the splash screen (to enable it agin, replace the t with 0)
(setq inhibit-splash-screen t)

;; Enable transient mark mode
(transient-mark-mode 1)

;; 2015 suggested org activation commands
 (global-set-key "\C-cl" 'org-store-link)
 (global-set-key "\C-cc" 'org-capture)
 (global-set-key "\C-ca" 'org-agenda)
 (global-set-key "\C-cb" 'org-iswitchb)

;; YL setting up org capture mode (replaces remember)
 (setq org-directory "/home/me/Encfs/org")
 (setq org-default-notes-file (concat org-directory "/notes.org"))
 (define-key global-map "\C-cc" 'org-capture)
 (setq org-capture-templates
  '(
  ("h" "Home" entry (file+headline "~/Encfs/org/projects.org"
 "Home tasks") "* TODO %?\n" :clock-in t :clock-resume t)
  ("w" "Work" entry (file+headline "~/Encfs/org/projects.org"
 "Work tasks") "* TODO %?\n" :clock-in t :clock-resume t)
  ("t" "Tech" entry (file+headline "~/Encfs/org/projects.org"
 "Tech tasks") "* TODO %?\n" :clock-in t :clock-resume t)
  ("g" "General" entry (file+headline "~/Encfs/org/projects.org"
 "Tasks") "* TODO %?\n" :clock-in t :clock-resume t)
  ("r" "Reference" entry (file "~/Encfs/org/reference.org"
 "Tasks") "* %?\n" :clock-in t :clock-resume t)
  ))

***

and I have no ~/.emacs.el or ~/.emacs.d/init.el .

How do I go about debugging what is going on?

Many thanks,

YL



Re: [O] New markup for revising manuscripts

2017-03-12 Thread John Kitchin
probably no lisp required. See the post I referenced. It is all done in
the org-file there.

Doyley, Marvin M. writes:

> Hi John,
>
> I like the idea of special block that definitely solve the multi-line 
> problem. But I would need to write an latex exporter for the block, how 
> challenging would that be ? I am still learning lisp :)
>
> Cheers,
> M
>> On Mar 11, 2017, at 1:22 PM, John Kitchin  wrote:
>>
>> This is probably not feasible with links. that is also a challenge with
>> Eric's markup approach. One way is to use visual wrapping so whole
>> paragraphs are actually one line. Another is to use some kind of custom 
>> block.
>> It has been a while since I tried this: 
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__kitchingroup.cheme.cmu.edu_blog_2013_11_30_Custom-2Ddirectives_=DwIBAg=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU=s3_3riAscdqtNAzgOuwYB9g0dZVGcp8BNCy_RylYdxU=HR848Kl27487mBHnj6hZWqJ4zVzwnz8yn_CYsmstLLc=CgaellrR4m7Y4Quba00w0ekyLA_np6lkrXxoWv4awZQ=
>>
>> Multiline mostly works with criticmarks using multiline fontlock. The
>> nice thing about this is that it is still plain text markup, but relies
>> on font-lock which can be slow, and or unreliable in my experience.
>>
>> This was one reason I started looking at the overlay approach in
>> ov-highlighter. It nicely manages multiline comments, but is not part of
>> org markup though. A downside is you have to store the overlays in the
>> document to get persistence, and it is easily breakable if others edit
>> the document without using the package.
>>
>> Doyley, Marvin M. writes:
>>
>>> Thanks John,
>>>
>>> Works like a charm. Any idea how to write comments that spans multiple 
>>> lines ?
>>>
>>> cheers,
>>> M
 On Mar 11, 2017, at 7:55 AM, John Kitchin  wrote:

 it looks like you forgot to include format in the (eq ..) sexp.

 (org-link-set-parameters
 "response"
 :export (lambda (keyword desc format)
  (cond
   ((eq 'latex format)
(format "\\textcolor{red}{%s}" keyword
 :face '(:foreground "red"))
 Doyley, Marvin M. writes:

> Hi John,
>
> I make a colored link [[response: comments]], that makes the text 
> following the response keyword red. The only snag is that when I export 
> to latex I get [[response:comment]] rather than \textcolor{red}{comment}. 
> Any thoughts on what I am doing wrong ?
>
> Cheers,
> M
>
> PS.  Enclose is the code that I wrote based on your blog
>
>
> (org-link-set-parameters
> "response"
> :export (lambda (keyword desc format)
>  (cond
>   ((eq 'latex)
>(format "\\textcolor{red}{%s}" keyword
> :face '(:foreground "red"))
>
>
>> On Mar 10, 2017, at 4:47 PM, John Kitchin  
>> wrote:
>>
>> You can  wait for it... make a colored link ;): 
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__kitchingroup.cheme.cmu.edu_blog_2016_11_04_New-2Dlink-2Dfeatures-2Din-2Dorg-2D9_-23org1bc1061=DwIBAg=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU=s3_3riAscdqtNAzgOuwYB9g0dZVGcp8BNCy_RylYdxU=K82CvGdcCIiUxLK-NulYuwGBzRdPZnZ9zByz2od0v9s=SVZmNbDCL0B9rvGIDHrFia_f1-mL_I_EmCUR_vcWkxg=
>>   
>> 
>>
>> The example there has an html export defined, but you could as easily 
>> define a latex exporter. It has some limitations, like it might not 
>> reliably work on multiple lines, and you would not want to "highlight" 
>> across elements (or the latex will get ugly and probably not work).
>>
>> I have been working on some ways to get persistent highlighting using 
>> overlays for a similar purpose: 
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__kitchingroup.cheme.cmu.edu_blog_2016_11_10_Persistent-2Dhighlighting-2Din-2DEmacs_=DwIBAg=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU=s3_3riAscdqtNAzgOuwYB9g0dZVGcp8BNCy_RylYdxU=K82CvGdcCIiUxLK-NulYuwGBzRdPZnZ9zByz2od0v9s=11D132bMNfLVhS6-xXWo1p7tZ8EBpeZMgUvYmtcCD9I=
>>   
>> 
>>
>> so far I only can get reliable output to html. Latex seems possible, 
>> again if you don't highlight across too many elements. It is a work in 
>> progress here: 
>> 

Re: [O] Complex conversion of text to org table

2017-03-12 Thread Scott Randby
On 03/12/2017 11:35 AM, Xebar Saram wrote:
> Thx Vicente!
>  
> Thats a decent idea. can this be all wrapped in a function (i have zero
> coding skills :)) ? i have hundreds of these tables to convert :)
> 
> best!
> 
> Z

OR

3/4, cup, milk
2, tablespoons, white vinegar
1, cup, all-purpose flour
2, tablespoons, white sugar
1, teaspoon, baking powder
1/2, teaspoon, baking soda
1/2, teaspoon, salt
1,, egg
2, tablespoons, butter melted
,, cooking spray

| 3/4 | cup | milk  |
|   2 | tablespoons | white vinegar |
|   1 | cup | all-purpose flour |
|   2 | tablespoons | white sugar   |
|   1 | teaspoon| baking powder |
| 1/2 | teaspoon| baking soda   |
| 1/2 | teaspoon| salt  |
|   1 | | egg   |
|   2 | tablespoons | butter melted |
| | | cooking spray |

Scott

> 
> On Sun, Mar 12, 2017 at 5:26 PM, Vicente Vera  > wrote:
> 
> Hello. In this case Org splits into columns everytime it sees a
> space, so "baking soda" ends up in two columns. A brute force
> solution: replace the spaces between words that shouldn't be put
> into separated columns with an underscore:
> 
> 1_cup all-purpose_flour
> 
> Convert it to an Org table and then do a quick M-x replace-string to
> replace '_' with ' '.
> 
> 2017-03-12 15:14 GMT+00:00 Xebar Saram  >:
> 
> Hi list
> 
> so im trying to use orgmode to collect food recepies. i have one
> issue which is to convert text based ingridents list into org
> tables.
> 
> for example take this list
> 
> 3/4 cup milk
> 2 tablespoons white vinegar
> 1 cup all-purpose flour
> 2 tablespoons white sugar
> 1 teaspoon baking powder
> 1/2 teaspoon baking soda
> 1/2 teaspoon salt
> 1 egg
> 2 tablespoons butter, melted
> cooking spray
> 
> if i mark this as a region and issue
> `org-table-create-or-convert-from-region` this is the result
> 
> | 3/4 | cup | milk| |  |  
>  | |   | |
> |   2 | tablespoons | white   | vinegar | (%or | better
> | yet | lemon | juice%) |
> |   1 | cup | all-purpose | flour   |  |  
>  | |   | |
> |   2 | tablespoons | white   | sugar   |  |  
>  | |   | |
> |   1 | teaspoon| baking  | powder  |  |  
>  | |   | |
> | 1/2 | teaspoon| baking  | soda|  |  
>  | |   | |
> | 1/2 | teaspoon| salt| |  |  
>  | |   | |
> |   1 | egg | | |  |  
>  | |   | |
> |   2 | tablespoons | butter, | melted  |  |  
>  | |   | |
> | cooking | spray   | | |  |  
>  | |   | |
> 
> 
> as you can see it got the amount (1/2) and the unit (cup) right
> yet the actual ingredients is cut into several columns
> 
> i dont really know how to deal with this. is there a more
> intelligent way of auto directing the conversion to split it the
> correct way?
> 
> if not any suggestions on how to convert it in a better way?
> perhaps a command to quick delete the separator (|) across all
> the column?
> 
> thx alot in advance
> 
> Z
> 
> 
> 



Re: [O] Complex conversion of text to org table

2017-03-12 Thread Thierry Banel
Use a regex replacement. Basically you replace the 1st space with a
vertical pipe:

M-x query-replace-regexp
^\([^ ]+\)
|\1|
answer yes repeatedly,
then type TAB to align the table.


Le 12/03/2017 16:14, Xebar Saram a écrit :
> Hi list
>
> so im trying to use orgmode to collect food recepies. i have one issue
> which is to convert text based ingridents list into org tables.
>
> for example take this list
>
> 3/4 cup milk
> 2 tablespoons white vinegar
> 1 cup all-purpose flour
> 2 tablespoons white sugar
> 1 teaspoon baking powder
> 1/2 teaspoon baking soda
> 1/2 teaspoon salt
> 1 egg
> 2 tablespoons butter, melted
> cooking spray
>
> if i mark this as a region and issue
> `org-table-create-or-convert-from-region` this is the result
>
> | 3/4 | cup | milk| |  ||
> |   | |
> |   2 | tablespoons | white   | vinegar | (%or | better | yet
> | lemon | juice%) |
> |   1 | cup | all-purpose | flour   |  ||
> |   | |
> |   2 | tablespoons | white   | sugar   |  ||
> |   | |
> |   1 | teaspoon| baking  | powder  |  ||
> |   | |
> | 1/2 | teaspoon| baking  | soda|  ||
> |   | |
> | 1/2 | teaspoon| salt| |  ||
> |   | |
> |   1 | egg | | |  ||
> |   | |
> |   2 | tablespoons | butter, | melted  |  ||
> |   | |
> | cooking | spray   | | |  ||
> |   | |
>
>
> as you can see it got the amount (1/2) and the unit (cup) right yet
> the actual ingredients is cut into several columns
>
> i dont really know how to deal with this. is there a more intelligent
> way of auto directing the conversion to split it the correct way?
>
> if not any suggestions on how to convert it in a better way? perhaps a
> command to quick delete the separator (|) across all the column?
>
> thx alot in advance
>
> Z




Re: [O] Complex conversion of text to org table

2017-03-12 Thread Scott Randby
On 03/12/2017 11:35 AM, Xebar Saram wrote:
> Thx Vicente!
>  
> Thats a decent idea. can this be all wrapped in a function (i have zero
> coding skills :)) ? i have hundreds of these tables to convert :)
> 
> best!
> 
> Z

You can try using commas to separate items.

List with commas inserted:

3/4 cup, milk
2 tablespoons, white vinegar
1 cup, all-purpose flour
2 tablespoons, white sugar
1 teaspoon, baking powder
1/2 teaspoon, baking soda
1/2 teaspoon, salt
1, egg
2 tablespoons, butter melted
, cooking spray

(Notice that I eliminated the comma in "butter, melted")

Resulting table:

| 3/4 cup   | milk  |
| 2 tablespoons | white vinegar |
| 1 cup | all-purpose flour |
| 2 tablespoons | white sugar   |
| 1 teaspoon| baking powder |
| 1/2 teaspoon  | baking soda   |
| 1/2 teaspoon  | salt  |
| 1 | egg   |
| 2 tablespoons | butter melted |
|   | cooking spray |

Scott Randby

> 
> On Sun, Mar 12, 2017 at 5:26 PM, Vicente Vera  > wrote:
> 
> Hello. In this case Org splits into columns everytime it sees a
> space, so "baking soda" ends up in two columns. A brute force
> solution: replace the spaces between words that shouldn't be put
> into separated columns with an underscore:
> 
> 1_cup all-purpose_flour
> 
> Convert it to an Org table and then do a quick M-x replace-string to
> replace '_' with ' '.
> 
> 2017-03-12 15:14 GMT+00:00 Xebar Saram  >:
> 
> Hi list
> 
> so im trying to use orgmode to collect food recepies. i have one
> issue which is to convert text based ingridents list into org
> tables.
> 
> for example take this list
> 
> 3/4 cup milk
> 2 tablespoons white vinegar
> 1 cup all-purpose flour
> 2 tablespoons white sugar
> 1 teaspoon baking powder
> 1/2 teaspoon baking soda
> 1/2 teaspoon salt
> 1 egg
> 2 tablespoons butter, melted
> cooking spray
> 
> if i mark this as a region and issue
> `org-table-create-or-convert-from-region` this is the result
> 
> | 3/4 | cup | milk| |  |  
>  | |   | |
> |   2 | tablespoons | white   | vinegar | (%or | better
> | yet | lemon | juice%) |
> |   1 | cup | all-purpose | flour   |  |  
>  | |   | |
> |   2 | tablespoons | white   | sugar   |  |  
>  | |   | |
> |   1 | teaspoon| baking  | powder  |  |  
>  | |   | |
> | 1/2 | teaspoon| baking  | soda|  |  
>  | |   | |
> | 1/2 | teaspoon| salt| |  |  
>  | |   | |
> |   1 | egg | | |  |  
>  | |   | |
> |   2 | tablespoons | butter, | melted  |  |  
>  | |   | |
> | cooking | spray   | | |  |  
>  | |   | |
> 
> 
> as you can see it got the amount (1/2) and the unit (cup) right
> yet the actual ingredients is cut into several columns
> 
> i dont really know how to deal with this. is there a more
> intelligent way of auto directing the conversion to split it the
> correct way?
> 
> if not any suggestions on how to convert it in a better way?
> perhaps a command to quick delete the separator (|) across all
> the column?
> 
> thx alot in advance
> 
> Z
> 
> 
> 



Re: [O] Complex conversion of text to org table

2017-03-12 Thread Xebar Saram
Thx Vicente!

Thats a decent idea. can this be all wrapped in a function (i have zero
coding skills :)) ? i have hundreds of these tables to convert :)

best!

Z

On Sun, Mar 12, 2017 at 5:26 PM, Vicente Vera  wrote:

> Hello. In this case Org splits into columns everytime it sees a space, so
> "baking soda" ends up in two columns. A brute force solution: replace the
> spaces between words that shouldn't be put into separated columns with an
> underscore:
>
> 1_cup all-purpose_flour
>
> Convert it to an Org table and then do a quick M-x replace-string to
> replace '_' with ' '.
>
> 2017-03-12 15:14 GMT+00:00 Xebar Saram :
>
>> Hi list
>>
>> so im trying to use orgmode to collect food recepies. i have one issue
>> which is to convert text based ingridents list into org tables.
>>
>> for example take this list
>>
>> 3/4 cup milk
>> 2 tablespoons white vinegar
>> 1 cup all-purpose flour
>> 2 tablespoons white sugar
>> 1 teaspoon baking powder
>> 1/2 teaspoon baking soda
>> 1/2 teaspoon salt
>> 1 egg
>> 2 tablespoons butter, melted
>> cooking spray
>>
>> if i mark this as a region and issue 
>> `org-table-create-or-convert-from-region`
>> this is the result
>>
>> | 3/4 | cup | milk| |  || |
>> | |
>> |   2 | tablespoons | white   | vinegar | (%or | better | yet |
>> lemon | juice%) |
>> |   1 | cup | all-purpose | flour   |  || |
>> | |
>> |   2 | tablespoons | white   | sugar   |  || |
>> | |
>> |   1 | teaspoon| baking  | powder  |  || |
>> | |
>> | 1/2 | teaspoon| baking  | soda|  || |
>> | |
>> | 1/2 | teaspoon| salt| |  || |
>> | |
>> |   1 | egg | | |  || |
>> | |
>> |   2 | tablespoons | butter, | melted  |  || |
>> | |
>> | cooking | spray   | | |  || |
>> | |
>>
>>
>> as you can see it got the amount (1/2) and the unit (cup) right yet the
>> actual ingredients is cut into several columns
>>
>> i dont really know how to deal with this. is there a more intelligent
>> way of auto directing the conversion to split it the correct way?
>>
>> if not any suggestions on how to convert it in a better way? perhaps a
>> command to quick delete the separator (|) across all the column?
>>
>> thx alot in advance
>>
>> Z
>>
>
>


Re: [O] Complex conversion of text to org table

2017-03-12 Thread Vicente Vera
Hello. In this case Org splits into columns everytime it sees a space, so
"baking soda" ends up in two columns. A brute force solution: replace the
spaces between words that shouldn't be put into separated columns with an
underscore:

1_cup all-purpose_flour

Convert it to an Org table and then do a quick M-x replace-string to
replace '_' with ' '.

2017-03-12 15:14 GMT+00:00 Xebar Saram :

> Hi list
>
> so im trying to use orgmode to collect food recepies. i have one issue
> which is to convert text based ingridents list into org tables.
>
> for example take this list
>
> 3/4 cup milk
> 2 tablespoons white vinegar
> 1 cup all-purpose flour
> 2 tablespoons white sugar
> 1 teaspoon baking powder
> 1/2 teaspoon baking soda
> 1/2 teaspoon salt
> 1 egg
> 2 tablespoons butter, melted
> cooking spray
>
> if i mark this as a region and issue `org-table-create-or-convert-from-region`
> this is the result
>
> | 3/4 | cup | milk| |  || |
> | |
> |   2 | tablespoons | white   | vinegar | (%or | better | yet |
> lemon | juice%) |
> |   1 | cup | all-purpose | flour   |  || |
> | |
> |   2 | tablespoons | white   | sugar   |  || |
> | |
> |   1 | teaspoon| baking  | powder  |  || |
> | |
> | 1/2 | teaspoon| baking  | soda|  || |
> | |
> | 1/2 | teaspoon| salt| |  || |
> | |
> |   1 | egg | | |  || |
> | |
> |   2 | tablespoons | butter, | melted  |  || |
> | |
> | cooking | spray   | | |  || |
> | |
>
>
> as you can see it got the amount (1/2) and the unit (cup) right yet the
> actual ingredients is cut into several columns
>
> i dont really know how to deal with this. is there a more intelligent way
> of auto directing the conversion to split it the correct way?
>
> if not any suggestions on how to convert it in a better way? perhaps a
> command to quick delete the separator (|) across all the column?
>
> thx alot in advance
>
> Z
>


[O] matlab-shell-run-command (was: workflow, matlab+latex in org file)

2017-03-12 Thread Uwe Brauer
>>> "John" == John Kitchin  writes:

   > You can put them into an elisp src block to try it out. They have to go in
   > an init file to be permanent. I just made a symlink to the matlab
   > executable on my path.

   > The ipython functions are defined in ob-ipython,
   > https://github.com/gregsexton/ob-ipython I think.

I just found out that it will not work for me since the matlab-kernel will
need the python support of matlab, which requires version 2016 o later.

And indeed the most annoying issue of  executing matlab in an
org buffer using the babel interface was the fact that it was slow since
every time matlab needs to be restarted. Now that matlab-kernel thing
seems to resolve the issue. However it needs a very recent version of
matlab.

Therefore my proposal:

there exists already a matlab-shell written in
lisp written by Eric Ludlam and others which does not require a restart
of matlab for every call.

Couldn't your code (defun org-babel-execute:matlab (body params) trying
to use matlab-shell-run-command or matlab-shell-run-region?

I don't understand enough of either function to try to modify it.


Regards

Uwe 




[O] Complex conversion of text to org table

2017-03-12 Thread Xebar Saram
Hi list

so im trying to use orgmode to collect food recepies. i have one issue
which is to convert text based ingridents list into org tables.

for example take this list

3/4 cup milk
2 tablespoons white vinegar
1 cup all-purpose flour
2 tablespoons white sugar
1 teaspoon baking powder
1/2 teaspoon baking soda
1/2 teaspoon salt
1 egg
2 tablespoons butter, melted
cooking spray

if i mark this as a region and issue
`org-table-create-or-convert-from-region` this is the result

| 3/4 | cup | milk| |  || |
  | |
|   2 | tablespoons | white   | vinegar | (%or | better | yet |
lemon | juice%) |
|   1 | cup | all-purpose | flour   |  || |
  | |
|   2 | tablespoons | white   | sugar   |  || |
  | |
|   1 | teaspoon| baking  | powder  |  || |
  | |
| 1/2 | teaspoon| baking  | soda|  || |
  | |
| 1/2 | teaspoon| salt| |  || |
  | |
|   1 | egg | | |  || |
  | |
|   2 | tablespoons | butter, | melted  |  || |
  | |
| cooking | spray   | | |  || |
  | |


as you can see it got the amount (1/2) and the unit (cup) right yet the
actual ingredients is cut into several columns

i dont really know how to deal with this. is there a more intelligent way
of auto directing the conversion to split it the correct way?

if not any suggestions on how to convert it in a better way? perhaps a
command to quick delete the separator (|) across all the column?

thx alot in advance

Z


Re: [O] New markup for revising manuscripts

2017-03-12 Thread Eric S Fraga
On Saturday, 11 Mar 2017 at 23:26, Doyley, Marvin M. wrote:
> Hi John,
>
> I like the idea of special block that definitely solve the multi-line
> problem. But I would need to write an latex exporter for the block,
> how challenging would that be ? I am still learning lisp :)

You could use the mdframed LaTeX package, as in the attached
example.  Of course, this does not highlight the paragraphs in the org
file but only in the output.

Org will export any #+begin_XXX ... #+end_XXX to \begin{XXX}...\end{XXX}
in LaTeX export.

-- 
Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D)


t.pdf
Description: Adobe PDF document
% Created 2017-03-12 Sun 14:09
% Intended LaTeX compiler: pdflatex
\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{soul}
\usepackage{listings}
\usepackage[version=3]{mhchem}
\usepackage{doi}
\usepackage{amsmath}
\usepackage[british, english]{babel}
\usepackage[backgroundcolor=yellow!20!white]{mdframed}
\author{Eric S Fraga}
\date{\today}
\title{}
\hypersetup{
 pdfauthor={Eric S Fraga},
 pdftitle={},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 26.0.50.1 (Org mode 9.0.4)}, 
 pdflang={English}}
\begin{document}

\section{highlighting text}
\label{sec:org4ba738a}
This is \hl{some text} that should be highlighted.

\begin{mdframed}
Here are two paragraphs that should be highlighted.

This is the second of them.
\end{mdframed}

And we continue with normal text.
\end{document}
#+options: toc:nil
#+latex_header: \usepackage[backgroundcolor=yellow!20!white]{mdframed}
* highlighting text
This is +some text+ that should be highlighted.

#+begin_mdframed
Here are two paragraphs that should be highlighted.

This is the second of them.
#+end_mdframed

And we continue with normal text.


signature.asc
Description: PGP signature


Re: [O] Let Org-mode babel file result support relative link type by using org-link-file-path-type

2017-03-12 Thread Nicolas Goaziou
Hello,

"numbch...@gmail.com"  writes:

> Let Org-mode babel file result support relative (adaptive) link type by
> using `org-link-file-path-type`.
>
> This also can solve static site generator extensions (like `ob-blog.el`
> etc) image link path issue.
>
> Also better if user changed parent directory name, those links will have to
> updated too. But if `adaptive` `org-link-file-path-type` will solve this
> problem.
>
> So please let Org-mode babel header arguments `:results file :file
> "filename.png"` use `org-link-file-path-type` variable.

It sounds interesting. Could you be more specific about the
specifications of your suggestion.

For example, what happens when :output-dir is set, or when :file already
provides some directory part? What part takes precedence over the other?

Better, could you show some examples, or some tests?

Regards,

-- 
Nicolas Goaziou



Re: [O] org-bbdb-anniversaries-future

2017-03-12 Thread Nicolas Goaziou
Hello,

Michael Welle  writes:

> thank you for the valuable comments. I think I've incorporated them all.
> Furthermore I reworded some of the comments and I introduced a defvar,
> so that the point in time, when to switch to the more general
> descriptive text isn't hardcoded anymore, but customisable.

I applied your patch. Thank you.

I added :version, :package-version and :safe keywords in the defcustom.
I sligthly reworded the docstring so as to avoid documenting recursively
the variable.

Could you provide an ORG-NEWS entry for the feature?

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Missing footnotes when exporting to org file [9.0.5 (9.0.5-elpa @ ~/.emacs.d/elpa/org-20170210/)]

2017-03-12 Thread Nicolas Goaziou
Hello,

WY H  writes:

> One issue's been annoying me recently though, when exporting org files
> with footnotes to org format, all the footnotes are missing in the result
> org file. This may not look like a common use case but when ox-pandoc
> comes to picture it is one, as ox-pandoc use org as an intermediate
> format for any conversion.

FWIW, I cannot reproduce it. Could you demonstrate the issue with an ECM?

Regards,

-- 
Nicolas Goaziou



[O] Bug: Missing footnotes when exporting to org file [9.0.5 (9.0.5-elpa @ ~/.emacs.d/elpa/org-20170210/)]

2017-03-12 Thread WY H
Hi,

Thanks for the cool job done with Org mode and I'm happily living with
it everyday now :)

One issue's been annoying me recently though, when exporting org files
with footnotes to org format, all the footnotes are missing in the result
org file. This may not look like a common use case but when ox-pandoc
comes to picture it is one, as ox-pandoc use org as an intermediate
format for any conversion.

I suspect it's an org mode bug because I got the same result even after I 
removed ox-pandoc
and use the original Org Export Dispatcher.

Org mode + ox-pandoc is such a sweet combination that I really would like to
get help on this issue.

Emacs  : GNU Emacs 25.2.1 (x86_64-apple-darwin16.1.0, Carbon Version 157 AppKit 
1504.6)
 of 2017-02-14
Package: Org mode version 9.0.5 (9.0.5-elpa @ ~/.emacs.d/elpa/org-20170210/)

current state:
==
(setq
 org-id-locations-file "~/.emacs.d/.cache/.org-id-locations"
 org-footnote-auto-adjust t
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-latex-classes '(("beamer"
  "\\documentclass{beamer}\n   
\\usepackage[fntef,nofonts,fancyhdr]{ctex}" org-beamer-sectioning)
 ("ctexbook"
  
"\\documentclass[fancyhdr,fntef,UTF8,a4paper,cs4size]{ctexbook}"
  ("\\part{%s}" . "\\part*{%s}")
  ("\\chapter{%s}" . "\\chapter*{%s}")
  ("\\section{%s}" . "\\section*{%s}")
  ("\\subsection{%s}" . "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
 ("ctexrep"
  
"\\documentclass[fancyhdr,fntef,UTF8,a4paper,cs4size]{ctexrep}"
  ("\\part{%s}" . "\\part*{%s}")
  ("\\chapter{%s}" . "\\chapter*{%s}")
  ("\\section{%s}" . "\\section*{%s}")
  ("\\subsection{%s}" . "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
 ("ctexart"
  
"\\documentclass[fancyhdr,fntef,UTF8,a4paper,cs4size]{ctexart}"
  ("\\section{%s}" . "\\section*{%s}")
  ("\\subsection{%s}" . "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
  ("\\paragraph{%s}" . "\\paragraph*{%s}")
  ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
 )
 org-clock-persist-file "~/.emacs.d/.cache/org-clock-save.el"
 org-speed-command-hook '(org-speed-command-default-hook
  org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-imenu-depth 8
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-html-format-drawer-function '(closure
   (htmlize-buffer-places
org-html-format-table-no-css
htmlize-css-name-prefix htmlize-output-type
htmlize-output-type htmlize-css-name-prefix 
t)
   (_name contents) contents)
 org-log-done 'time
 org-latex-format-inlinetask-function 
'org-latex-format-inlinetask-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-image-actual-width nil
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-link-translation-function 'toc-org-unhrefify
 org-present-mode-hook '(spacemacs//org-present-start)
 org-agenda-restore-windows-after-quit t
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-default-notes-file "notes.org"
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-latex-format-drawer-function '(closure (t) (_ contents) contents)
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 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-mode-hook '(#[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-show-block-all append
local]
   5 "\n\n(fn)"]
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-babel-show-result-all
append local]
   5 "\n\n(fn)"]
 org-babel-result-hide-spec org-babel-hide-all-hashes
 fcitx--org-mode-hook spacemacs/load-yasnippet toc-org-enable
 (lambda nil
  (set
   (make-local-variable
(quote pangu-spacing-real-insert-separtor))
   t)
  )
 org-download-enable org-bullets-mode