Re: [O] [babel] Working dir incorrect

2017-03-13 Thread John Hendy
On Mon, Mar 13, 2017 at 9:32 AM, Loris Bennett
 wrote:
> Hi,
>
> In a file that used to work, when I now try to run some R code which
> generates an image, I get the error:
>
>   cannot open file './usage_users_historical_facet.pdf'
>
> If I check the working directory for the R session I see
>
>   getwd()
>   [1] "/usr/share/emacs/site-lisp/ess"
>
> instead of the directory in which my org file is located.
>
> I am now running Org 9.0.5 on Emacs 25.1.1.  The last time things worked
> I was definitely using an older version of Org and possibly Emacs 24.
>
> Any thoughts?

I agree with Nick on an ECM. Just to start the ball rolling:

M-x org-version
Org mode version 9.0.5 (release_9.0.5-288-g4caad0 @
/home/jwhendy/.elisp/org/lisp/)

$ emacs --version
GNU Emacs 25.1.1

#+begin_src min-config

;; set load paths
(add-to-list 'load-path "~/.elisp/org.git/lisp/")
(add-to-list 'load-path "~/.elisp/org.git/contrib/lisp/")
(add-to-list 'load-path "~/.elisp/ess/lisp/")

(require 'ess-site)

;; setup babel languages
(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)))

#+end_src

method:
- emacs -Q
- M-x load-file /path/to/min-config
- C-c C-c on both of these blocks and get the results as shown

 file: ~/Desktop/test.org ;

* heading

#+begin_src R

getwd()

#+end_src

#+RESULTS:
: /home/jwhendy/Desktop

#+begin_src R :session r

getwd()

#+end_src

#+RESULTS:
: /home/jwhendy/Desktop

;


How does this go for you?
John

>
> Cheers,
>
> Loris
>
> --
> This signature is currently under construction.
>
>



[O] export menu

2017-03-13 Thread Seb
Hello,

Scanning the manual I don't see a hint on how to narrow the export menu
shown by C-c C-e (`org-export-dispatch').  I'm using ox-pandoc, which
has a lengthy export menu, which cannot display fully and gets cut off
the screen.  Ideally, it should be possible to sequentially narrow the
options, so that for instance only the LaTeX export options are shown
after hitting "l", but of course any tip allowing submenus to be fully
displayed will do!

Thanks,
-- 
Seb




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

2017-03-13 Thread Vicente Vera
OK that's a nice trick. Very useful for CSV files. Thanks!

2017-03-12 16:52 GMT+00:00 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] New markup for revising manuscripts

2017-03-13 Thread Doyley, Marvin M.
Hi John and Eric,

I decided to adopt your approaches, thanks for the suggestions.  So I can use 
either the response: or ++ to highlight changes in our manuscripts.

Cheers,
M

#+BEGIN_SRC emacs-lisp
(org-link-set-parameters
 "response"
 :export (lambda (keyword desc format)
   (cond
((eq 'latex format)
 (format "\\textcolor{red}{%s}" keyword
 :face '(:foreground "red"))
#+END_SRC


#+begin_src emacs-lisp
(setq org-emphasis-alist
  (cons '("+" '(:foreground "red"))
(delete* "+" org-emphasis-alist :key 'car :test 'equal)))

(custom-set-variables
  '(org-latex-text-markup-alist '((bold . "\\textbf{%s}")
 (code . verb)
 (italic . "\\emph{%s}")
 (strike-through . 
"\\textcolor{red}{%s}")
 (underline . "\\uline{%s}")
 (verbatim . protectedtexttt

#+end_src


> On Mar 10, 2017, at 4:47 PM, John Kitchin  wrote:
> 
> You can  wait for it... make a colored link ;): 
> http://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/#org1bc1061
>  
> 
> 
> 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: 
> http://kitchingroup.cheme.cmu.edu/blog/2016/11/10/Persistent-highlighting-in-Emacs/
>  
> 
> 
> 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: 
> https://github.com/jkitchin/scimax/blob/master/ov-highlighter.el 
> 
> 
> Towards the bottom of 
> https://github.com/jkitchin/scimax/blob/master/cm-mods.el 
> 
>  I was working on some ways to use the criticmarkup  in conjunction with git 
> diffs to automatically make these kinds of diffs.
> 
> I can't say I am fully satisified by any of these solutions (that is why 
> there are so many of them ;)
> 
> John
> 
> ---
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu 
> 
> 
> 
> On Fri, Mar 10, 2017 at 3:56 PM, Kaushal Modi  > wrote:
> I use this macro to highlight text in html/latex(pdf):
> 
> #+MACRO: COLOR @@html:$2latex:\textcolor{$1}{$2}@@
> 
> This is from https://github.com/fniessen/org-macros/blob/master/README.org 
> 
> 
> Example use:
> {{{COLOR(red, This information is important.)}}}
> 
> It doesn't though highlight the text in red in org-mode.
> 
> On Fri, Mar 10, 2017 at 3:49 PM Doyley, Marvin M.  > wrote:
> Hi there,
> 
> When revising manuscripts, I usually 

Re: [O] Babel R source blocks problem

2017-03-13 Thread Thomas S. Dye
Aloha Chuck,

Charles C. Berry writes:

> On Fri, 10 Feb 2017, Thomas S. Dye wrote:
>
>> Aloha Chuck,
>>
>> Charles C. Berry writes:
>>>
>>> A look at the `slidify-example.org' file in the `org-9-plus' branch of my
>>> (chasberry) `orgmode-accessories' github repo might be a good start with
>>> .Rmd exports even if you do not want to use `slidify'.
>>
>> Your ox-ravel exporter is a pleasure to use.  I'm farther along than I
>> thought I'd be at this point.
>>
>
> Thanks. I am glad to hear this.
>
>
>> I'm new to much of the R ecosystem, including slidify, so forgive some
>> noob ignorance in the following three questions:
>>
>> 1) I've specified the properties EXPORT_TITLE and EXPORT_AUTHOR, but
>> they don't show up in the .Rmd file.  Is this a limitation of ox-ravel,
>> or do I need to learn how to insert them in the Org mode source?
>>
>
> Both, I guess.
>
> Arguably, it is a limitation in the markdown backends available that
> there isn't one that will create the yaml header from the export
> options in the org buffer.  I think the long term fix is to create a
> backend derived from 'md, but this is far down my todo list.  For now,
> either hand tool a yaml header like that in
>
> : slidify-example.org::#tds-headline
>
> (If you are viewing that on my github repo, be sure to click 'raw' or the
> yaml header will not be visible!)
>
> or create a src block that will pull the title, author, et cetera and wrap
> them as a yaml header in an md export block and put it at the top of the
> output. If you want to do the src block, I can provide a skeleton version.
>
>
>> 2) How do I instruct ox-ravel to include the graphics output of a source
>> code block?  I tried :ravel fig=TRUE as a header to the source code
>> block, but no dice.  Most of my experience is with ox-latex, so that
>> colors my expectations here; i.e. I'm expecting a [[file:myfile.pdf]]
>> link to produce a graphic in the output.
>
> Often it `just works', but it depends on the vignette engine. `fig=TRUE'
> is correct for Sweave. See
>
> : demos.org::#36234656-157D-4F1D-B441-E727DFCC0251
>
> for an example of that. For knitr, you usually do not need to include
> anything if there is just one plot produced, but there are loads of
> options. See
>
>   https://yihui.name/knitr/options/#plots
>
>
> I find myself using ~:ravel fig.cap=my_caption~ (where `my_caption' is
> an R string from an earlier src block) a lot. See
>
> : demos.org::#C341969B-90F3-4C27-AA7F-5352A9669506
>
> for an example of a lengthy caption done in latex.
>
> There is a src block that produces a plot in the slidify-example.org file.
> No special header was needed for ~slidify()~ to render it.  But I cannot
> be sure whether the yaml block does something special for the graphics.
>
>>
>> 3) I've been knitting the .Rmd output using RStudio, which is also new
>> to me.  I don't mind doing this (it is what the session organizer is
>> going to do with the .Rmd file I send next week), but I'm wondering
>> if you have an emacs-only solution?
>>
>
> I don't know RStudio, but here is a start:
>
> #+BEGIN_SRC R :exports none :results silent
> require(rmarkdown)
> render("my-file.Rmd")
> #+END_SRC
>
> If you look at the =demos.org= file, you will see examples and the src
> blocks used to run ~knitr::knit2pdf()~.  If you export some of the
> examples to *.Rmd files and run the equivalent ~render(...)~ on the .Rmd
> files, you will get html by default.
>
> ---
>
> Let me know how it works out!

Just a short note to let you know that ox-ravel was a terrific tool for
my project of producing a workable R Markdown file for an upcoming
conference.  I was dreading the requirement to provide .Rmd source for a
handout, but ox-ravel made it one of the easiest steps.

Thanks for your contribution to Org mode and your support when I was
flailing around last month.

All the best,
Tom

--
Thomas S. Dye
http://www.tsdye.com



Re: [O] org-publish issue

2017-03-13 Thread Bob Newell
Okay, solved, but it does point to a problem. I had misspellings in the
project names. So this happens:

("generalweb" :components ("generalimages" "generalother" "generalorg"))

"generalimages" is processed. "generalother" isn't found because of a
misspelling. But there is no error message and processing stops
silently, with "generalorg" being skipped.

Perhaps there should at least be an error or warning here?

-- 
Bob Newell
Honolulu, Hawai`i
* Via Gnus/BBDB/Org/Emacs/Linux *



[O] org-publish issue

2017-03-13 Thread Bob Newell
Aloha,

Running 9.0.5. I have a strange problem with org-publish. Only the first
entry of my :components gets processed. I've tried tracing code and fail
to find the problem. Can anyone give a suggestion? I'm appending my
project alist. Mahalo!

(setq org-publish-project-alist
(quote (
  ("35yearsorg"
   :base-directory "~/organize/publish/35years/"
   :publishing-directory 
"/ftp:chipscha...@www.bobnewell.net:~/publish/35years"
   :recursive t
   :table-of-contents t
   :auto-sitemap t
   :sitemap-title "35 Years of EMACS"
   :sitemap-filename "index.html"
   :sitemap-style "tree"
   :makeindex t
   :base-extension "org"
   :publishing-function org-html-publish-to-html
   :style-include-default nil
   :section-numbers t
   :table-of-contents t 
   :author-info "Bob Newell"
   :creator-info nil)
  ("35yearstother"
   :base-directory "~/organize/publish/35years/other/"
   :base-extension "css\\|pdf\\|sh"
   :publishing-directory 
"/ftp:chipscha...@www.bobnewell.net:~/publish/35years/other"
   :publishing-function org-publish-attachment
   :recursive t
  )
  ("35yearsimages"
   :base-directory "~/organize/publish/35years/images"
   :base-extension "png\\|jpg\\|gif"
   :publishing-directory 
"/ftp:chipscha...@www.bobnewell.net:~/publish/35years/images"
   :publishing-function org-publish-attachment
   :recursive t
   )
  ("35yearsweb" :components ("35yearsimages" "35yearsother" 
"35yearsorg"))
  ("generalorg"
   :base-directory "~/organize/publish/general/"
   :publishing-directory 
"/ftp:chipscha...@www.bobnewell.net:~/publish/general"
   :recursive t
   :table-of-contents t
   :auto-sitemap t
   :sitemap-title "General Web Pages"
   :sitemap-filename "index.html"
   :sitemap-style "tree"
   :makeindex t
   :base-extension "org"
   :publishing-function org-html-publish-to-html
   :style-include-default nil
   :section-numbers t
   :table-of-contents t
   :author-info "Bob Newell"
   :creator-info nil)
  ("generaltother"
   :base-directory "~/organize/publish/general/other/"
   :base-extension "css\\|pdf\\|sh"
   :publishing-directory 
"/ftp:chipscha...@www.bobnewell.net:~/publish/general/other"
   :publishing-function org-publish-attachment
   :recursive t
   )
  ("generalimages"
   :base-directory "~/organize/publish/general/images/"
   :base-extension "png\\|jpg\\|gif"
   :publishing-directory 
"/ftp:chipscha...@www.bobnewell.net:~/publish/general/images"
   :publishing-function org-publish-attachment
   :recursive t
  )
  ("generalweb" :components ("generalimages" "generalother" 
"generalorg"))
)))


-- 
Bob Newell
Honolulu, Hawai`i
* Via Gnus/BBDB/Org/Emacs/Linux *



Re: [O] ox-epub

2017-03-13 Thread Mark Meyer
Sorry, the code lives here: https://github.com/ofosos/ox-epub

Also available on MELPA.

Cheers, Mark

-- 
  Mark Meyer
  m...@ofosos.org



Re: [O] Modified remote file name syntax

2017-03-13 Thread Nick Dokos

Heads-up: if you are using remote directories, you'll want to read this.

Michael Albinus  writes:

> Hi,
>
> today I've committed a patch, which changes the remote file name syntax
> in Emacs. The "method" part, optional until now, becomes
> mandatory. Valid remote file names are now
>
> /method:host:/path/to/file
> /method:user@host:/path/to/file
>
> A new method, "-", has been added which is a marker for the default
> method as known so far.
>
> The reason is, that all the time there have been problems in Tramp due
> to syntactic ambiguities. A remote file name "/foo:" has not been
> distinct; "foo" could be either a method or a host name. This has
> resulted in permanent problems during file name completion.
>
> The changes will be visible with the next releases of Tramp 2.3.2 and
> Emacs 26.1.
>
> Best regards, Michael.

-- 
Nick




[O] ox-epub

2017-03-13 Thread Mark Meyer
Hi list,
I'm the author of ox-epub, which is a very recent extension to org-mode
to author EPUB files directly via the org export layer.

Pank (Rasmus) asked on Github, whether this could be part of org-mode.
I'm all for it. I gather this would be added to the lisp/contrib directory?

Are there any technical barriers to continuing development on ox-epub to
me? The legal stuff is not an issue to me.

Do you find the addition worthwile?

Speak your mind.

Cheers, Mark
-- 
  Mark Meyer
  m...@ofosos.org



Re: [O] How do you store web pages for reference?

2017-03-13 Thread Peter Salazar
By the way, you can definitely save a PDF with links if you prefer that. I
use DevonThink, and I use this snippet to save a PDF of a webpage, complete
with links.

javascript:window.location='x-devonthink://createPDF?title='+encodeURIComponent(document.title)+'='+encodeURIComponent(window.location)+'='+encodeURIComponent(document.referrer)+'=No='+window.innerWidth;

On Mon, Jan 16, 2017 at 3:48 AM, Alan Schmitt <
alan.schm...@polytechnique.org> wrote:

> Hello,
>
> I'm looking for a workflow that allows me to save a web page for
> reference, ideally from Firefox. I know of org-protocol-capture-html
> (https://github.com/alphapapa/org-protocol-capture-html), which is
> perfect for pure-text pages, but I'm also looking for a solution for
> images-heavy pages. I've tried to simply save the page to PDF, but it
> does not preserve the links.
>
> Do you have suggestions?
>
> Thanks,
>
> Alan
>
> --
> OpenPGP Key ID : 040D0A3B4ED2E5C7
> Monthly Athmospheric CO₂, Mauna Loa Obs. 2016-12: 404.48, 2015-12: 401.85
>


Re: [O] Allow #+SETUPFILE to point to an URL for the org file

2017-03-13 Thread Kaushal Modi
On Thu, Dec 8, 2016 at 5:40 PM Nicolas Goaziou 
wrote:

> Kaushal Modi  writes:
>
> You can use something like `url-insert' and `url-retrieve' or
> `url-retrieve-synchronously'.
>

Thanks. I am using url-retrieve-synchronously.

>
> Sure, but SETUPFILE still accepts local file names. So I was pointing
> out that you need to check if the URL is a local file name before
> proceeding. In particular, this check needs to happen when using "C-c '"
> (which may display URL contents in a read-only buffer, BTW).
>

Understood. I might need some help when baking this into org.el,
org-macros.el, etc.


>
> Is it necessary? File contents could be stored in, e.g., a hash table,
> url being the key. The file is downloaded only if the entry doesn't
> exist in the table and the user didn't force download.-
>

Correct. Thanks for the idea. I am now using hash table for this.

Here is my implementation.. it is still not baked into org.el, etc and
provided as a complete patch; I have some questions..

=
(defvar org-setupfile-ht (make-hash-table :test 'equal)
  "Hash table to store the org SETUPFILE.
This acts as a cache of setup files read using
`org-insert-setupfile-contents'.")

(defun org-setupfile-clear-cache ()
  "Clear the SETUPFILE cache stored in `org-setupfile-ht'."
  (interactive)
  (clrhash org-setupfile-ht))

(defun org-insert-setupfile-contents (setupfile  nocache noerror)
  "Insert the contents of SETUPFILE.
SETUPFILE can be a file path or URL.

If SETUPFILE is a file path, use `org-file-contents' to get the file
contents.
If it is a URL instead, download the contents. If the URL contents are
already
cached in the `org-setupfile-ht' hash table, the download step is skipped.

If NOCACHE is non-nil, do a fresh fetch of SETUPFILE even if cached version
is
available. This option applies only if SETUPFILE is a URL.

If NOERROR is non-nil, ignore the error when unable to read the SETUPFILE
from
file or URL."
  (require 'ffap)   ;for `ffap-url-regexp'
  (let* ((is-url (string-match-p ffap-url-regexp setupfile))
 (cache (when (and is-url (not nocache))
  (gethash setupfile org-setupfile-ht)))
 (contents (when (and is-url cache) cache)))
(if is-url
(unless cache
  (let (url-retrieve-header)
(with-current-buffer (url-retrieve-synchronously setupfile)
  (goto-char (point-min))
  ;; Take point to after the url-retrieve header
  (re-search-forward "\n\n") ; 2 consecutive new-line chars
  (setq url-retrieve-header (buffer-substring-no-properties
 (point-min) (point)))
  (message url-retrieve-header) ;Dump the URL retrieve header
to *Messages*
  (if (string-match-p "HTTP.*\\s-+200\\s-OK"
url-retrieve-header) ;URL retrieved correctly
  (progn
(setq contents (buffer-substring-no-properties (point)
(point-max)))
;; Update the cache `org-setupfile-ht'
(puthash setupfile contents org-setupfile-ht))
(funcall (if noerror 'message 'error)
 "Unable to fetch SETUPFILE from `%s'"
setupfile)
  (setq contents (org-file-contents setupfile noerror)))
(when contents
  (save-excursion
(insert contents)
=

Question:

- All the places where the content of SETUPFILE is inserted in a temp
buffer, it is assumed that the file is retrieved from disk and not from URL.

Example in ox.el:

 ((equal key "SETUPFILE")
  (let ((file
 (expand-file-name
  (org-unbracket-string "\"" "\"" (org-trim val)
;; Avoid circular dependencies.
(unless (member file files)
  (with-temp-buffer
(setq default-directory
  (file-name-directory file))
(insert (org-file-contents file 'noerror))
(let ((org-inhibit-startup t)) (org-mode))
(funcall get-options (cons file files))


Note the use of expand-file-name, (member file files), default-directory,
(funcall get-options (cons file files)).

How do we deal with those parts of the code when the 'file' is a URL.

Using my implementation above,

(org-insert-setupfile-contents "/file/path/or/url" nil :noerror)

works the same way as

(insert (org-file-contents "/file/path" 'noerror))

So org-insert-setupfile-contents can replace (insert (org-file-contents
..)) easily. The unknown is how to deal with the surrounding code that
deals with

> expand-file-name, (member file files), default-directory, (funcall
get-options (cons file files)).

Here's a similar code snippet around setupfile insertion in ox.el again, in
org-export--list-bound-variables:

=
;; Enter setup file.
(let ((file (expand-file-name
 (org-unbracket-string "\"" "\"" val
  (unless (member file files)
(with-temp-buffer
  (setq default-directory
(file-name-directory file))
  (let ((org-inhibit-startup t)) (org-mode))
  (insert 

Re: [O] Default silent results

2017-03-13 Thread Nick Dokos
Jarmo Hurri  writes:

> Jérémie Juste  writes:
>
> Greetings.
>
>> you can tweek the default behaviour using
>> org-babel-default-header-args:org variable
>>
>> My default configuration for org is the following. I did not modify
>> it.
>>
>> org-babel-default-header-args:org is a variable defined in ‘ob-org.el’.
>> Its value is ((:results . "raw silent") (:exports . "code"))
>
> So the default value is really language dependent, not always "replace"
> as the manual suggested. Ok, that explains it. Thanks!
>

I wonder if that's intended behavior though: what's the reason for org
blocks to have non-default behavior?

Most languages set org-babel-default-header-args: to '(),
although some do non-trivial stuff (abc, asymptote, ditaa, dot,
gnuplot, mscgen, plantuml all set :results to file e.g.), but it's not
clear to me why org sets it to "raw silent".

--
Nick




[O] Reproducing a table

2017-03-13 Thread Jarmo Hurri

Greetings (again).

What is the smartest way to reproduce a table without defining the table
as an Org source block (constraint explained below).

I can do the following, but it doesn't seem very sane (need to use elisp
or some other language just to funnel the table).

# -
* define table
  #+name: my-table
  | row 1 | 1 | 2 |
  | row 2 | 3 | 4 |
  |---+---+---|
  |   | col 1 | col 2 |
* reproduce entire table
  I need to be able to reproduce the entire table in my document
  #+BEGIN_SRC elisp :var data=my-table :hlines yes
  (print data)
  #+END_SRC

  #+RESULTS:
  | row 1 | 1 | 2 |
  | row 2 | 3 | 4 |
  |---+---+---|
  |   | col 1 | col 2 |
* reproduce only data
  I also need to be able to pass only the data to functions
  #+BEGIN_SRC elisp :var data=my-table[0:1,1:2]
  (print data)
  #+END_SRC

  #+RESULTS:
  | 1 | 2 |
  | 3 | 4 |
# -

The reason I can _not_ define the table as an Org source block is the
second example. I need to pass parts of the table as data to functions,
and constructs like my-table()[0:1,1:2] don't work. (At least I have not
been able to get them to work.)

Jarmo




Re: [O] New markup for revising manuscripts

2017-03-13 Thread Doyley, Marvin M.
Hi Eric,

I really appreciate this. I will try it out too.

Cheers,
M
On Friday, 10 Mar 2017 at 20:33, Doyley, Marvin M. wrote:
> Hi there,
>
> When revising manuscripts, I usually highlight the changes (response
> to reviewer) in red. I use typically do this as follows:
> (1) #+latex_header: \newcommand{\response}[1]{\textcolor{red}{#1}}
> (2) \response{changes)
>
> Is there a more elegant way to do this ?

I don't know about elegant but my approach is to subvert the +...+
emphasis markers.  These usually indicate strike-through, something I
never use.  Instead, I have +some text+ be highlighted and exported to
LaTeX and HTML as such.

To achieve this, I customise a number org variables.  It took me some
time to find how I actually did this as it's been part of my org setup
for years, so much so that I almost thought it was default behaviour!
In any case, the following is an elided extract from my customised
variables:

#+begin_src emacs-lisp
  (custom-set-variables
   '(org-emphasis-alist
 (quote
  (("*" bold)
   ("/" italic)
   ("_" underline)
   ("=" org-verbatim verbatim)
   ("~" org-code verbatim)
   ("+" highlight
   '(org-html-text-markup-alist
 (quote
  ((bold . "%s")
   (code . "%s")
   (italic . "%s")
   (strike-through . "%s")
   (underline . "%s")
   (verbatim . "%s"
   '(org-latex-text-markup-alist
 (quote
  ((bold . "\\textbf{%s}")
   (code . protectedtexttt)
   (italic . "\\emph{%s}")
   (strike-through . "\\hl{%s}")
   (underline . "\\uline{%s}")
   (verbatim . protectedtexttt)
#+end_src

There are basically copies of the defaults with the strike-through
element changed.

Now I can write +highlighted text+ which appears as you wish in both
HTML and LaTeX exports as well as on the screen (customise the highlight
face to get what you want on screen).  For LaTeX, you also have to

  (add-to-list 'org-latex-packages-alist '("" "soul"))



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [O] Default silent results

2017-03-13 Thread Jarmo Hurri
Jérémie Juste  writes:

Greetings.

> you can tweek the default behaviour using
> org-babel-default-header-args:org variable
>
> My default configuration for org is the following. I did not modify
> it.
>
> org-babel-default-header-args:org is a variable defined in ‘ob-org.el’.
> Its value is ((:results . "raw silent") (:exports . "code"))

So the default value is really language dependent, not always "replace"
as the manual suggested. Ok, that explains it. Thanks!

Jarmo




Re: [O] [babel] Working dir incorrect

2017-03-13 Thread Nick Dokos
"Loris Bennett"  writes:

> Hi,
>
> In a file that used to work, when I now try to run some R code which
> generates an image, I get the error:
>
>   cannot open file './usage_users_historical_facet.pdf'
>
> If I check the working directory for the R session I see
>
>   getwd()
>   [1] "/usr/share/emacs/site-lisp/ess"
>
> instead of the directory in which my org file is located.
>
> I am now running Org 9.0.5 on Emacs 25.1.1.  The last time things worked
> I was definitely using an older version of Org and possibly Emacs 24.
>
> Any thoughts?
>

Can I make a plea for an ECM? If you provide one, I can spend five
minutes testing it, but without it I'll have to do real work to get an
example together and that's much more unlikely to happen.

-- 
Nick




Re: [O] Default silent results

2017-03-13 Thread Jérémie Juste
Hello

you can tweek the default behaviour  using
org-babel-default-header-args:org variable

My default configuration for org is the following. I did not modify it.

org-babel-default-header-args:org is a variable defined in ‘ob-org.el’.
Its value is ((:results . "raw silent") (:exports . "code"))


Best regards

Jeremie

On Mon, Mar 13, 2017 at 4:30 PM, Jarmo Hurri  wrote:

>
> Greetings.
>
> An old org-code of mine stopped working, and while trying to fix it I
> bumped into the following. What am I missing here?
>
> Jarmo
>
> * test
>   A simple code block.
>   #+name: org-block
>   #+BEGIN_SRC org
>   | foo | bar |
>   |-+-|
>   |   1 |   2 |
>   #+END_SRC
>
>   A silent call produces no results as expected.
>   #+call: org-block() :results silent
>
>   This produces results as expected.
>   #+call: org-block() :results replace
>
>   #+RESULTS:
>   | foo | bar |
>   |-+-|
>   |   1 |   2 |
>
>   But this also behaves like silent, while the manual says that the
>   default is "replace."
>   #+call: org-block()
>
>
>


-- 
Jérémie Juste


[O] Default silent results

2017-03-13 Thread Jarmo Hurri

Greetings.

An old org-code of mine stopped working, and while trying to fix it I
bumped into the following. What am I missing here?

Jarmo

* test
  A simple code block.
  #+name: org-block
  #+BEGIN_SRC org
  | foo | bar |
  |-+-|
  |   1 |   2 |
  #+END_SRC

  A silent call produces no results as expected.
  #+call: org-block() :results silent

  This produces results as expected.
  #+call: org-block() :results replace

  #+RESULTS:
  | foo | bar |
  |-+-|
  |   1 |   2 |

  But this also behaves like silent, while the manual says that the
  default is "replace."
  #+call: org-block()




[O] [babel] Working dir incorrect

2017-03-13 Thread Loris Bennett
Hi,

In a file that used to work, when I now try to run some R code which
generates an image, I get the error:

  cannot open file './usage_users_historical_facet.pdf'

If I check the working directory for the R session I see

  getwd()
  [1] "/usr/share/emacs/site-lisp/ess"

instead of the directory in which my org file is located.

I am now running Org 9.0.5 on Emacs 25.1.1.  The last time things worked
I was definitely using an older version of Org and possibly Emacs 24.

Any thoughts?

Cheers,

Loris

-- 
This signature is currently under construction.




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

2017-03-13 Thread Michael Welle
Hello,

oops, I think the double space after full stop rule applies here, too.
Sorry for the noise.


Michael Welle  writes:
[...]
>> Could you provide an ORG-NEWS entry for the feature?
>
>
*** More specific anniversary descriptions

Anniversary descriptions (used in the agenda view, for instance)
include the point in time, when the anniversary appears.  This is,
in its most general form, just the date of the anniversary.  Or
more specific terms, like "today", "tomorrow" or "in n days" are
used to describe the time span.

This feature allows to automatically change the description of an
anniversary, depending on if it occurs in the next few days or
far away in the future.


Regards
hmw



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

2017-03-13 Thread Michael Welle
Hello,

Nicolas Goaziou wrote:
> 
> 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.
thank you. I think that makes at least three people, including me,
happy ;).


> 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?


*** More specific anniversary descriptions

Anniversary descriptions (used in the agenda view, for instance)
include the point in time, when the anniversary appears. This is,
in its most general form, just the date of the anniversary. Or
more specific terms, like "today", "tomorrow" or "in n days" are
used to describe the time span.

This feature allows to automatically change the description of an
anniversary, depending on if it occurs in the next few days or
far away in the future.


Regards
hmw



[O] [PATCH] Fix custom timestamps during export (ox-groff)

2017-03-13 Thread Robert Klein
Hi,

this patch updates ox-groff.el in contrig to use the
org-timestamp-translate function instead of the non-existing
org-translate-time.

Best regards
Robert

From 632764856ecbc0f6a733d3d919f4904c6465605c Mon Sep 17 00:00:00 2001
From: Robert Klein 
Date: Mon, 13 Mar 2017 07:29:27 +0100
Subject: [PATCH] Fix custom timestamps during export (ox-groff)

* contrib/lisp/ox-groff.el (org-groff-clock, org-groff-planning): Use
  org-translate-time'.

(propagate changes introduced to other export backends in commit
e1adb17ba509a43e9a03a5b367a98b8bc8de8b02.)
---
 contrib/lisp/ox-groff.el | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/contrib/lisp/ox-groff.el b/contrib/lisp/ox-groff.el
index a9478b9..555a89d 100644
--- a/contrib/lisp/ox-groff.el
+++ b/contrib/lisp/ox-groff.el
@@ -823,9 +823,7 @@ information."
   (concat
(format "\\fB%s\\fP " org-clock-string)
(format org-groff-inactive-timestamp-format
-   (concat (org-translate-time
-		(org-element-property :raw-value
-	  (org-element-property :value clock)))
+   (concat (org-timestamp-translate (org-element-property :value clock))
(let ((time (org-element-property :duration clock)))
  (and time (format " (%s)" time)))
 
@@ -1409,22 +1407,19 @@ information."
(concat
 (format "\\fR %s \\fP" org-closed-string)
 (format org-groff-inactive-timestamp-format
-(org-translate-time
-			 (org-element-property :raw-value closed))
+(org-timestamp-translate closed)
(let ((deadline (org-element-property :deadline planning)))
  (when deadline
(concat
 (format "\\fB %s \\fP" org-deadline-string)
 (format org-groff-active-timestamp-format
-(org-translate-time
-			 (org-element-property :raw-value deadline))
+(org-timestamp-translate deadline)
(let ((scheduled (org-element-property :scheduled planning)))
  (when scheduled
(concat
 (format "\\fR %s \\fP" org-scheduled-string)
 (format org-groff-active-timestamp-format
-(org-translate-time
-			 (org-element-property :raw-value scheduled
+(org-timestamp-translate scheduled)))
 "")
""))
 
-- 
2.6.6