Re: [O] [OT] Requiring packages which may be missing?

2017-04-24 Thread Adam Porter
Tim Cross  writes:

> You do need to be careful when sharing your .emacs.d between machines to
> ensure you use something like gitignore to exclude things you may not
> want to share across systems (such as auto-save files, various command
> history files etc).

Yes, that's a good point.  You should either exclude/ignore them, or
just never commit them.

> With respect to packages changing, you can use the options in elpa to
> pin a package to a specific version. The use-package macro also support
> this.

Note that you can't install old versions of packages with package.el.
Once a newer version is available, the old version is deleted from
MELPA.  You'd need to use a different tool, like Quelpa.




[O] Viewing tangled source code as source code block result?

2017-04-24 Thread D Bro
I was wondering if there is any simple way of displaying the actual tangled 
code in the org-mode buffer and resulting exports.  One can #+INCLUDE the 
resulting file, seeing it in the export; one can M-x ffap the #+INCLUDE file to 
see it in a buffer; one can do a hack like shelling out and calling cat; I 
guess you could write an lisp function that hooked org-babel-tangle, grabbed 
the buffer, and formatted it as output (haven’t figured out how to do that one 
yet). One could also do a #+src_begin org block.

But what about a simple :results setting, say ‘tangle’ or ‘noweb’?  Whose 
#+RESULTS: was actually a #+src_…#end_src block with appropriate language 
tagging that could get syntax highlighted?

Am I missing something here.  Is there a non-hackish way of composing existing 
features to print the resulting source of a noweb block, in addition to 
actually executing it and displaying the value/output?

Re: [O] How to use :prologue with latex

2017-04-24 Thread Charles C. Berry

On Mon, 24 Apr 2017, Jeremie Juste wrote:




Hello,

I would like to use :prologue  and epilogue with latex output when using
R. Would it be possible to do something like the following?



[...]

#+BEGIN_SRC R :results output latex :prologue \\begin{table} :epilogue 
\\end{table} [...]


[...]


Sure. But you do not need to; see my comment at bottom.  Try this:

#+NAME: test1123
#+HEADER: :prologue cat("\\begin{table}\n")
#+HEADER: :epilogue cat("\\end{table}\n")
#+BEGIN_SRC R :results output latex  :session *R* :dir tmp :cache no
require(xtable)
print(xtable(data.frame(a=rnorm(10),b=letters[1:10])),floating.environment=FALSE)
#+END_SRC

You might be better off using the :post header arg.

Define a src block like this:

#+name: add-table-env
#+BEGIN_SRC emacs-lisp
(format "\\begin{table}\n%s\n\\end{table}\n" *this*)
#+END_SRC

Then use

#+HEADER: :post add-table-env()

in place of the two header lines above.  The advantage is that you can if 
you want do more complicated moidification of the result.




AFAIK, LaTeX has no FALSE environment.

I think what you actually wanted was *not* :prologue and :epilogue but 
this R code:


#+begin_src R
print(xtable(data.frame(a=rnorm(10),b=letters[1:10])),floating.environment="table")
#+end_src


HTH,

Chuck






Re: [O] [OT] Requiring packages which may be missing?

2017-04-24 Thread Tim Cross

You do need to be careful when sharing your .emacs.d between machines to
ensure you use something like gitignore to exclude things you may not
want to share across systems (such as auto-save files, various command
history files etc). I've found the use of use-package and init.el in a
git repo the best combination.

With respect to packages changing, you can use the options in elpa to
pin a package to a specific version. The use-package macro also support
this.

Tim

Adam Porter writes:

> I find that the best way is to store the entire ~/.emacs.d directory
> (including the /elpa subdirectory) in a git repository.  This makes it
> easy to keep your entire config in sync between machines, and it means
> you keep your init file in sync with the versions of packages.
> Otherwise you may find that when you install your init file on a new
> machine and install the same packages, you get newer versions that have
> breaking changes, and it usually happens when you don't have time to fix
> it.
>
> If for some reason you don't want to do that, the use-package macro
> makes it easy to install packages, like:
>
> (use-package org
>   :ensure t)
>
> That will install org using the package system, if it's not already installed.


-- 
---
Tim Cross



Re: [O] [OT] Requiring packages which may be missing?

2017-04-24 Thread Tim Cross

Have a look at the use-package package. I have found it makes this much
easier. There are some complications associated with using it and
org-mode, due mainly to emacs being bundled with one version and another
vesion being available in both the gnus and org-mode elpa
repos. However, once you have that bit sorted, the rest really makes
managing your packages easier.

One of the nice things about use-package is that it includes the :ensure
keyword, which tells emacs to ensure that the package has been
installed. So you emacs init file ends up being essentially a lot of
use-package stanzas that are easy to maintain and ensure all the
packages are loaded. I keep my emacs init file on github and when I run
emacs on a different system, all I need to do is clone the repo and
start emacs. The first run will be a little slow as emacs installs all
the packages I need, but after that, it is fast - in fact, use-package
has options which can speed up emacs startup by delaying loading of
package (it sets up autoloads for you). I also find managing my
configuration much cleaner.

Yes, I am definitely a convert. There are wrinkles - it isn't magic and
you will go through some trial an error, but I've been using it for a
while now and am very happy with how much easier managing my init.el and
all my elpa packages is.

HTH

Tim

Loris Bennett writes:

> Hi,
>
> This is more of a general emacs question.
>
> I often use the same .emacs on various machines which may not have all
> the packages I normally load.  To get around this I use the Fabrice
> Niessen's 'try-require' function taken from
>
>   http://www.mygooglest.com/fni/dot-emacs.html
>
> Due to some recent  problems, I wanted to look at the  way I load things
> and wondered how others deal with missing packages.
>
> Cheers,
>
> Loris
>
> PS: I mainly use Emacs 25, but would be interested in Emacs 24
> compatibility.


-- 
---
Tim Cross



[O] How to use :prologue with latex

2017-04-24 Thread Jeremie Juste


Hello,

I would like to use :prologue  and epilogue with latex output when using
R. Would it be possible to do something like the following?


#+NAME: test1123
#+BEGIN_SRC R :results output latex :prologue \\begin{table} :epilogue 
\\end{table} :session *R* :dir tmp :cache no
print(xtable(data.frame(a=rnorm(10),b=letters[1:10])),floating.environment=FALSE)
#+END_SRC



#+RESULTS: test1123
#+BEGIN_EXPORT latex
Error: unexpected input in "\"
% latex table generated in R 3.3.1 by xtable 1.8-2 package
% Mon Apr 24 12:40:21 2017
\begin{FALSE}[ht]
\centering
\begin{tabular}{rrl}
  \hline
 & a & b \\ 
  \hline
1 & -0.79 & a \\ 
  2 & 0.71 & b \\ 
  3 & 0.82 & c \\ 
  4 & 1.04 & d \\ 
  5 & 0.46 & e \\ 
  6 & 1.02 & f \\ 
  7 & 0.89 & g \\ 
  8 & -1.12 & h \\ 
  9 & 0.77 & i \\ 
  10 & 2.08 & j \\ 
   \hline
\end{tabular}
\end{FALSE}
Error: unexpected input in "\"
#+END_EXPORT


Best wishes,

Jeremie



Re: [O] [OT] Requiring packages which may be missing?

2017-04-24 Thread Adam Porter
I find that the best way is to store the entire ~/.emacs.d directory
(including the /elpa subdirectory) in a git repository.  This makes it
easy to keep your entire config in sync between machines, and it means
you keep your init file in sync with the versions of packages.
Otherwise you may find that when you install your init file on a new
machine and install the same packages, you get newer versions that have
breaking changes, and it usually happens when you don't have time to fix
it.

If for some reason you don't want to do that, the use-package macro
makes it easy to install packages, like:

(use-package org
  :ensure t)

That will install org using the package system, if it's not already installed.




Re: [O] RFC: Extensible Dependencies 'N' Actions

2017-04-24 Thread Adam Porter
Hi Ian,

Don't have time to dig into this at the moment, but it sounds very
impressive and useful.  I look forward to giving it a try soon.  Keep up
the good work!




Re: [O] problem with bibtex-parse-buffers-stealthily

2017-04-24 Thread Adam Porter
Eric S Fraga  writes:

> On Monday, 10 Apr 2017 at 12:03, Alan Schmitt wrote:
>> Hello,
>>
>> I'm having `bibtex-parse-buffers-stealthily' fail when there is an
>> org-mode buffer with a bibtex source block. For instance, if you have
>> the following block in an org file
>
> I also get this and, although it doesn't really affect things, it is
> annoying.  Did you get anywhere with this report and/or find a solution?

Chiming in to say I'm having the same issue, except I have no bibtex
source blocks.  The same bibtex-parse-buffers-stealthily timer is giving
the error, but I don't even have any bibtex-related packages loaded.  It
happens about 10 seconds after I change window focus to a non-Emacs
window, every time I do so.  Thankfully I discovered helm-timers, which
makes it easy to kill any timers that are running, so I only have to do
this once per Emacs session.  But I haven't been able to figure out why
that timer is even running.




[O] [OT] Requiring packages which may be missing?

2017-04-24 Thread Loris Bennett
Hi,

This is more of a general emacs question.

I often use the same .emacs on various machines which may not have all
the packages I normally load.  To get around this I use the Fabrice
Niessen's 'try-require' function taken from

  http://www.mygooglest.com/fni/dot-emacs.html

Due to some recent  problems, I wanted to look at the  way I load things
and wondered how others deal with missing packages.

Cheers,

Loris

PS: I mainly use Emacs 25, but would be interested in Emacs 24
compatibility.

-- 
Dr. Loris Bennett (Mr.)
ZEDAT, Freie Universität Berlin Email loris.benn...@fu-berlin.de




Re: [O] Export in Foswiki format?

2017-04-24 Thread Loris Bennett
Nick Dokos  writes:

> "Loris Bennett"  writes:
>
>> "Loris Bennett"  writes:
>>
>>> "Loris Bennett"  writes:
>>>
 Hi,

 I'm interested in exporting from Org to Foswiki format.  Is
 org-export-generic.el still the way to go or has this been
 superseded by something else?
>>>
>>> Nevermind, I found this:
>>>
>>>   https://github.com/dfeich/org8-wikiexporters
>>>
>>> also available via MELPA.
>>
>> The following
>>
>>   M-x org-twiki-export-as-twiki
>>
>> worked on a file yesterday.  Today, with the same file, I get
>>
>>   org-export-barf-if-invalid-backend: Unknown "nil" back-end:
>>   Aborting export
>>
>> Any ideas of what I might have accidentally tweaked to make things
>> break?
>>
>
> Restarted your emacs and forgot to load ox-twiki.el?

No and yes.

'No' in the sense that I use (and have used for at least a couple of
years) Fabrice Niessen's 'try-require' function
(http://www.mygooglest.com/fni/dot-emacs.html) for loading things in my
.emacs.  If the thing to be loaded is missing the error is caught and
logged to *Messages*.  Loading in this way fails in a subtle way, since
the funtion 'org-twiki-export-as-twiki' is known, but broken.

'Yes' in the sense that if I just open the file 'ox-twiki.el' and
evaluate the buffer, exporting works fine.

I'll open a new thread on the topic of how to require packages which may
be missing. 

Cheers,

Loris

--
This signature is currently under construction.




Re: [O] ANN: org-sticky-header

2017-04-24 Thread Eric S Fraga
On Wednesday, 19 Apr 2017 at 21:33, Adam Porter wrote:
> Inline tasks are now skipped.  Thanks!

Excellent.  Thanks!

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50, Org release_9.0.5-444-g998576


signature.asc
Description: PGP signature


Re: [O] problem with bibtex-parse-buffers-stealthily

2017-04-24 Thread Eric S Fraga
On Monday, 10 Apr 2017 at 12:03, Alan Schmitt wrote:
> Hello,
>
> I'm having `bibtex-parse-buffers-stealthily' fail when there is an
> org-mode buffer with a bibtex source block. For instance, if you have
> the following block in an org file

I also get this and, although it doesn't really affect things, it is
annoying.  Did you get anywhere with this report and/or find a solution?

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50, Org release_9.0.5-444-g998576


signature.asc
Description: PGP signature


[O] [PATCH] ob-C.el: Fix command to perform on remote host

2017-04-24 Thread Иван Трусков
* lisp/ob-C.el (org-babel-C-execute): Made sure name of compiled
program is converted to local representation before sending it to the
shell on remote host.

The problem was when one would try to evaluate C source code block in
the file on remote host. Compilation would go normally, then
evaluation will fail with error like "/bin/sh: unable to find file
prevents that.

TINYCHANGE
---
 lisp/ob-C.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index 795bcb2..e54e174 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -161,7 +161,7 @@ or `org-babel-execute:C++' or `org-babel-execute:D'."
   (org-babel-eval
(pcase org-babel-c-variant
  ((or `c `cpp)
-  (concat tmp-bin-file cmdline))
+  (concat (org-babel-process-file-name tmp-bin-file) cmdline))
  (`d
   (format "%s %s %s %s"
   org-babel-D-compiler