Re: [O] html-email in org-mode

2016-11-05 Thread Eric Brown
John Kitchin <jkitc...@andrew.cmu.edu> writes:

> htmlize-mail.org
>
>
> * Send org files by html email so they look like org files.
>   :PROPERTIES:
>   :MAIL_FMT: html
>   :END:
>
> We might not always want a full export of an org heading to html for sending 
> an email. Eric Brown would like to just send something that looks like what 
> he sees in org-mode. There is another way to get html from emacs: htmlize! 
> Here is an example. Eric: if this is what you mean, see my modified 
> org-mime.el at https://github.com/jkitchin/scimax/blob/master/org-mime.el. 
>
> The command to send a subtree is: elisp:org-mime-subtree-htmlize
>
>
> #+BEGIN_EXAMPLE
> My comment was motivated by other usage where I wish that I could simply
> wrap an entire simple text, whitespace-formatted email message,
> e.g. generated from org export to a plain text buffer, with a Monospace
> directive so that webmail users could appreciate what I see with Sans
> Mono.
> #+END_EXAMPLE
>
> | a | b | c |
> | 4 | 5 | 6 |
>
> An equation 
> \(e^{i\pi} + 1 = 0\)
>
>
> A figure: 
>
> #+name: fig-particle
> #+attr_org: :width 30%
> ./images/Au-icosahedron-3.png
>
>
> A code block:
> #+BEGIN_SRC python :results output org drawer
> for i in range(5):
> print(i)
> #+END_SRC
>
> ** A subtree
>
> An orgmode reference: cite:Dominik201408. A figure reference: 
> ref:fig-particle.


Thanks John. This is very helpful!



Re: [O] html-email in org-mode

2016-11-01 Thread Eric Brown
John Kitchin  writes:

> Do you mean monospace in the whole html message, e.g. something like Courier?
>
> Or just in a table? I do not think you can control the font in plain
> text emails.
>
> You can set the font in the td elements of a table like this (I used
> cursive because it was easy to see.
>
> #+BEGIN_SRC emacs-lisp
> (defun italicize-table (data backend info)
>   (with-temp-buffer
> (insert data)
> (goto-char (point-min))
> (while (re-search-forward "   (replace-match " (message"got %s" (buffer-string))
> (buffer-string)))
>
>
> (add-to-list 'org-export-filter-table-functions 'italicize-table)
> #+END_SRC
>
> After you run that, the tables in html have italicized/cursive elements
> in them. And probably all other exports to html too ;)
>

Thanks, this is extremely useful, as well.  In retrospect, I think my
question may be a bit moot, as the HTML formatting would probably allow
tables to remain aligned regardless of length of any one cell.

My comment was motivated by other usage where I wish that I could simply
wrap an entire simple text, whitespace-formatted email message,
e.g. generated from org export to a plain text buffer, with a Monospace
directive so that webmail users could appreciate what I see with Sans
Mono.



Re: [O] html-email in org-mode

2016-10-30 Thread Eric Brown
John Kitchin  writes:

> 1.1.3 Tables
>
>  Table 1: A table for you.  
>   x  y
>   1  2
>

Hi John,

I haven't (yet) found the email thread that you had alluded to, but I
think this post is awesome.  Works well for me!

One suggestion/thought:

I would like to do is force monospace font in these messages, since the
recipients I typically send to will have variable width fonts, and
tables and the like tend to get messed up.

How might this be done?

Best regards,
Eric



Re: [O] Require feedback on an idea: move to a central server all my org file and edit from there?

2016-01-31 Thread Eric Brown


Xebar Saram  writes:


Hi all

Was wondering about input regarding having all my orgmode files 
on a remote

server and editing from there?
I keep syncing (via git,unison etc) all my org files all the 
time between 4
machines and i just had enough :) im not (and probably never 
will be) disciplined
enough to properly save and close all my 100's of buffer before 
i leave each
machine each time and im always faced with conflict/merging 
hell..


I was thinking of putting all my org file in one of these cloud 
servers and access the
files directly and edit them there from any machine..is that a 
silly though?


i dont have any real privacy concerns in my files (i use another 
system for sensitive

info) so that shouldn't be a concern

I would love to hear everyone's thoughts, and if they have a 
magic git/unison

solution for idiots like me id also welcome that ;-)

thx alot in advance

Z



Hi Xebar,

I think I've tried all the options, and I have found that a 
centralized
system is best for me.  I'm really tired of the syncing--I spend 
way too
much time obssessing over the perfect system.  Others have pointed 
out

Dropbox -- this might work but is not FLOSS and costs $.

If you put it in the cloud, it costs $ and you lose control.  See
Richard Stallman's missives on the topic. A cloud system large 
enough to

hold all your digital assets could be very very expensive.

Personally, I have settled on one laptop, and a quick pluggable
monitor/keyboard for places that I do a lot of computing, 
e.g. home and

work.  I also carry an ergonomic keyboard in my backpack.

My desktop machine stays home, of course, and every "3 months" or 
so I
transfer old projects off.  The machine is always available over 
cable
modem, with a service like DynDNS running so that I can ssh back 
in at

my leisure.  (I don't need these 8 TB with me at all times.)

Eric



[O] Commenting out #+

2016-01-18 Thread Eric Brown
Dear List,

I would like to comment out directives like:

#+STARTUP

but I would like to keep them around for future use, e.g.

##+STARTUP

Is this sort of thing possible with org 8.3.3+ ?

Thanks,
Eric




Re: [O] Error Embedding SQL Source from code block into R Source of Another (noweb)

2014-09-30 Thread Eric Brown
Thanks Rainer and Grant for your suggestions.  A couple of things:

1) My current code does what I want, the second time. Its advantage is
that everything is kept inside of one .org file.  Also, I am wondering
if it is an R/ESS issue.

2) Grant, I tried your code, but there seem to be some missing headers.
Do you have a complete minimal example that exhibits the behavior that
you have demonstrated?



Re: [O] Error Embedding SQL Source from code block into R Source of Another (noweb)

2014-09-30 Thread Eric Brown
Charles Berry ccbe...@ucsd.edu writes:

 Hmmm. Maybe the bug that was fixed by commit

  0fd29a5ee7d14c3695b22998196373b9a3637413

 about two weeks back? Make sure ob-R.el is up to date and compiled (or
 that ob-R.elc is deleted).


 Anyway, your code works as expected for me - first time.

 ---

 FWIW, I prefer to use :var headers to import strings, but it takes some
 setup:



 #+BEGIN_SRC emacs-lisp
   (defun grab-src (name)
 (save-excursion
   (org-babel-goto-named-src-block name)
   (nth 1 (org-babel-get-src-block-info 'light
 #+END_SRC

 #+BEGIN_SRC R :var y=(grab-src sqlsource) :results output :exports both
   y
 #+END_SRC

 #+RESULTS:
 : [1] select \n  * \nfrom \n  t \nlimit \n  10


In fact M-x R before evaluation did fix things.  I will try to get the
org source going, which contains the fix.  Otherwise, I might be content
to wait for the fix to make its way into org ELPA.  (I'm on .emacs
complexity overload)

Great idea about the grab-src function! Worked like a charm.

Thanks again,
Eric



[O] Error Embedding SQL Source from code block into R Source of Another (noweb)

2014-09-29 Thread Eric Brown
Dear List:

It is possible to embed SQL code as a string to be evaluated in R. I am
interested in formatting the SQL code in its own source code block, with
its own syntax highlighting and editing mode (C-c ').

The first time I run the code, I am prompted for R starting directory,
but I get an error:

---
load ESSR: + + + Error: unexpected string constant in:
source('~/.emacs.d/elpa/ess-20140913.1153/etc/ESSR/R/.load.R',
local=TRUE) #define load.ESSR
load.ESSR('
---

and the console locks.  I can C-g to get out of it, and then
re-evaluate, and the code prints what I expect -- the text of the SQL
command.

Is this the right way to go about this?  Have I discovered a bug, or
perhaps accidentally a wrong way to get the right answer?

Is this an ESS problem, and not an orgmode problem, per se?  My ESS
normally starts up fine, so I thought I would ask on this list first.

A minimal example (first failing, second evaluation giving expected
output) follows.

Best regards,

Eric

Debian GNU/Linux (jessie)
Emacs 24.3.93
Org current from org repo
ESS from MELPA (ca. 14.09)
R 3.1.1 compiled from source



- SESSION -
#+TITLE: Test SQL Code
#+AUTHOR: Eric Brown  
#+EMAIL: br...@fastmail.fm
#+PROPERTY: session *R*   
#+PROPERTY: cache no

#+name: sqlsource
#+begin_src sql :engine postgresql :eval yes :noweb-ref sqlsrc :exports code 
:results none
  select 
* 
  from 
t 
  limit 
10
#+end_src

#+name: rsource
#+begin_src R :noweb yes :results output :exports both
  input - '
  sqlsrc
  '
  cat(input)
  # dbGetQuery(connectionHandle, input)
#+end_src

#+RESULTS: rsource
: 
: select 
:   * 
: from 
:   t 
: limit 
:   10
-