[O] Useful interactive functions for clock logs, and workarounds for large agenda files

2016-07-12 Thread Christoph LANGE
Dear Org-mode community,

I have recently developed a few functions related to clocking and the
agenda, which are highly useful for me.  So far I haven't found the time
to add them to worg, but as I have meanwhile open-sourced my Emacs
configuration, I thought I'd point you there for now.

There is:

1. org-clock-split-current-interval
https://github.com/clange/emacs/blob/master/.emacs.d/init/org-clock.el#L18
(stable link to current revision:
https://github.com/clange/emacs/blob/f340dc1517f2a8017dd3a6f11124740c6af9367c/.emacs.d/init/org-clock.el#L18)

This function splits the CLOCK time interval in the current line in two.
 Use case: you logged time on some task but afterwards realise that part
of the time was spent on some other task.  See
https://lists.gnu.org/archive/html/emacs-orgmode/2015-03/msg01054.html
for the original description, but meanwhile I have improved the function.

2. org-clock-change-hh-mm
https://github.com/clange/emacs/blob/master/.emacs.d/init/org-clock.el#L102
(stable link to current revision:
https://github.com/clange/emacs/blob/f340dc1517f2a8017dd3a6f11124740c6af9367c/.emacs.d/init/org-clock.el#L102)

This function changes the HH:MM parts of the CLOCK time interval in the
current line.  My main use case for this: adding time logged outside of
org-mode to one's org file.  When not at my computer, I log time in an
unstructured way on my phone, e.g. like this:

Tue 12
Taskname 22:00-22:11, 23:31-23:45

(This is mainly because the VimTouch trick explained in
https://lists.gnu.org/archive/html/emacs-orgmode/2014-10/msg00089.html
no longer works for me, as on a non-rooted device one can't edit .vimrc
any more.)

I add such logs to my org file by first creating a CLOCK line for the
right day, e.g. copied from somewhere else and possibly changed to the
right day using org-shiftcontrolup, and then modifying the HH:MM parts.
This has so far been quite cumbersome to do manually, as it required me
to jump around a lot in the line.

3. a variant of org-calendar-goto-agenda that does not display an agenda
with the default timespan but always just for one day, bound to the key
"C" in the calendar.  I need this because I'm lazy and keep all my
history in one large org file (5.5 MB, grown over 6.5 years), which
slows down the agenda.
https://github.com/clange/emacs/blob/master/.emacs.d/init/org.el#L67
(stable link to current revision:
https://github.com/clange/emacs/blob/774b6d5ac33102dfd8bbc68b18a5a1227c486f75/.emacs.d/init/org.el#L67)

BTW, I have more workarounds for coping with large agenda files; see
e.g.
https://github.com/clange/emacs/blob/master/.emacs.d/init/org.el#L76
(https://github.com/clange/emacs/blob/774b6d5ac33102dfd8bbc68b18a5a1227c486f75/.emacs.d/init/org.el#L76)
for how to export the agenda of the next month to an external file.  I
also have code for extracting from an org file only those tasks on which
time was logged in a given interval, which is useful e.g. for
(re-)generating clocktables for these intervals.  Please let me know if
you are interested.  This is implemented as a Makefile plus shell and
Perl scripts and is currently hosted in the same private repository in
which I have my org files, but in principle I'm happy to open it.

Cheers,

Christoph

-- 
Dr. Christoph Lange, Enterprise Information Systems Department
Applied Computer Science @ University of Bonn; Fraunhofer IAIS
http://langec.wordpress.com/about, Skype duke4701

→ Please note: I will be on parental leave from 29 July to 28 October.
  Colleagues will stand in for me by project.



Re: [O] mobileorg agendas.org has no entries [8.3.4 (8.3.4-elpa @ c:/Users/Michael/AppData/Roaming/.emacs.d/elpa/org-20160222/)]

2016-07-12 Thread Michael Ziems

Hello Philip,

thanks for the answer, but that did not help me, i believe.
I went trough the org-mobile-push with the edebug, but i believe that i 
have to understand how another function that is in there works, maybe these:


(let ((inhibit-redisplay t)
  (org-agenda-files (mapcar 'car org-mobile-files-alist)))
  (org-mobile-create-sumo-agenda))

and i cannot start the debugger in the same way on them, as they are not 
startable via M-x.



Does anybody have a clue, what could be the reason, why my agenda is 
normally created but the agendas.org is containing all my agenda view 
but without any headline (todo) in it?



Am 06.07.2016 um 00:06 schrieb Philip Hudson:

On 5 July 2016 at 21:09, Michael Ziems  wrote:

Is there any way, that i can try to debug the "org-mobile-push"


Eval this in your scratch buffer:

(info "(elisp) Edebug")

Then use C-h f org-mobile-push -- the function help buffer contains a
link to the function's source code definition, which you can then
instrument for the debugger by typing C-u C-M-x with point anywhere in
the function definition.

HTH






smime.p7s
Description: S/MIME Cryptographic Signature


Re: [O] Can I quote/ref value in the output table?

2016-07-12 Thread John Kitchin
Do you mean something like this (I used an elisp block instead of a sql
block, but hopefully you get the idea):

#+name: src-block1
#+BEGIN_SRC emacs-lisp
'((1 2) (3 4))
#+END_SRC

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

#+BEGIN_SRC python :var data=src-block1
print data
#+END_SRC

#+RESULTS:
: [[1, 2], [3, 4]]



If so, give your sql block a name, and use it as a variable in some other
block.

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 Tue, Jul 12, 2016 at 3:59 AM, Xi Shen  wrote:

> Hi,
>
> Say I have a sql babel block which outputs a table. Is there any way
> that I can reference the values in the output table in another babel
> block?
>
>


Re: [O] how to speed up an org-mode file?

2016-07-12 Thread Eric S Fraga
My experience is that (non-trivially sized) tables really slow down org
mode, especially if there is more than one in a "section".  I am not
sure why this is, however.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.94.1, Org release_8.3.4-869-gf2c421



Re: [O] how to speed up an org-mode file?

2016-07-12 Thread Leslie Watter
IMHO if you can split the file in more than one .org file you'll get a
better experience.

I've been working on machines with less than 8Gb of ram in files that are
bigger than yours ( 1.2Mb org with lots of latex, R and other things )
and haven't got a trouble.

One thing that 've noticed is that, if I start the whole text shown,
manipulating the file is much slower than if I got only the section I'll
work on at that time. You'll probably should give it a try, e.g. opening
only the section you'll work on.

Cheers,

Leslie



On Mon, Jul 11, 2016 at 10:32 PM, Grant Rettke 
wrote:

> Try approaching this the same way that you would prepare an ECM:
>
> http://orgmode.org/worg/org-faq.html
>
> Start Emacs with a stable version of Org-Mode, without any additional
> configuration.
>
> Is the performance what you expect?
>
> FWIW: two things that sped up my rather small in comparison Org-Mode files
> were:
> - Switching from linum to nlinum
> - #+STARTUP: showeverything
>
>
> Sincerely,
>
> Grant Rettke
>
> On Sun, Jul 10, 2016 at 9:37 AM, Sharon Kimble  > wrote:
>
>>
>> I'm working on an org-mode file about cancer which is 945.1kb, is
>> converted to a tex file of 1.0mb and a pdf of 2.0mb with 505 pages. The
>> conversion is done through this code snippet '(global-set-key (kbd
>> "s-#") 'org-latex-export-to-latex)'. There is no problem with the
>> conversion to tex or conversion to pdf.
>>
>> However, the org-mode file is increasingly slowing down and becoming
>> difficult to move about within the file, and also enter new information
>> within it.
>>
>> How then can I speed it up within the org file please?
>>
>> Thanks
>> Sharon.
>> --
>> A taste of linux = http://www.sharons.org.uk
>> TGmeds = http://www.tgmeds.org.uk
>> Debian 8.4, fluxbox 1.3.7, emacs 25.0.95
>>
>
>


-- 
Leslie H. Watter


Re: [O] workflow, matlab+latex in org file

2016-07-12 Thread Uwe Brauer
>>> "Eric" == Eric S Fraga  writes:

   > On Monday, 11 Jul 2016 at 12:32, Uwe Brauer wrote:
   >> Hello
   >> 
   >> I want in a org file, to include matlab code and run it (that I know how
   >> to do)
   >> 
   >> Then I want certain results, which are symbolic variables, expressed in
   >> latex, we I achieve  using matlab's latex command.
   >> 
   >> Like
   >> 
   >> #+begin_src matlab :results output
   >> clear all
   >> syms e p R g w K K2
   >> phi=[(e + (e+p)*R^2)^((g-1)/2);((e+p)*R*sqrt(1+R^2))/(e+(e+p)*R^2)]
   >> 
   >> jac=jacobian(phi,[e,p])
   >> ltxjac=latex(jac)
   >> #+end_src

   > A bit of a kludge but, if you don't want to modify the ob-matlab code,
   > you can explicitly generate LaTeX into a file and use it directly:

   > #+begin_src octave :exports none :results output
   >   clear all
   >   pkg load symbolic
   >   syms e p R g w K K2;
   >   phi=[(e + (e+p)*R^2)^((g-1)/2);((e+p)*R*sqrt(1+R^2))/(e+(e+p)*R^2)];

   >   jac=jacobian(phi,[e,p]);
   >   ltxjac = latex(jac);
   >   fid = fopen("jacobian.tex","w");
   >   fprintf(fid, "%s\n", ltxjac);
   >   fclose(fid);
   >   ltxjac
   > #+end_src

   > \begin{equation}
   > \input{jacobian}
   > \end{equation}

Thanks, that is a solution but  a bit cumbersome because of the
additional latex file. John sent me a hack which seems a bit more
flexible.

Uwe 
   > I don't have MATLAB so have tested with octave instead...




[O] a possible solution (was: problems with alphabetic ordering in tables containing non ASCII chars)

2016-07-12 Thread Uwe Brauer
>>> "Nicolas" == Nicolas Goaziou  writes:

   > Uwe Brauer  writes:
   >> Which function could you recommend?

   > I don't know. There may be something readily available in Emacs 25.
   > Otherwise, you'll have to write you own.

It seems that the easiest solution is the following

-  run iso-unaccentuate (which runs on regions) on the table, which
   will change Álvarez to 'Alvarez,
   

-  sort. The sorting is ok

-  reconvert via iso-accentuate the table.


I don't understand much of the org-table sort code. My naive approach would be 
to
define

org-table-iso-accentuate and org-table-iso-unaccentuate and then add
that via defadvice to the original function, but that seems a bad
approach since defacvice makes it difficult to debug.

Any suggestions?

Thanks

Uwe Brauer 





[O] Can I quote/ref value in the output table?

2016-07-12 Thread Xi Shen
Hi,

Say I have a sql babel block which outputs a table. Is there any way
that I can reference the values in the output table in another babel
block?