Re: [O] Calc: Multiply time (hours) with a float

2016-09-19 Thread Bernhard Pröll
Hi,

FWIW, there is a org-table-toggle-formula-debugger command.


On Mon, Sep 19 2016, Karl Voit wrote:

> * Michael Welle  wrote:
>>
>> Karl Voit  writes:
>>
 [...]
> #+TBLFM: @2$3='(* $2 (org-time-string-to-hours "$1"));L
 or converting $2 to a number before the calculation should work also,
 but is more to write ;).
>>>
>>> Hm. I still got #ERROR. I reduced my issue to calculate the float (for 
>>> hours)
>>> without multiplying it with "value":
>> strange. I use the current Org version from git and Emacs 25.1.
>>
>>> | time [h:m:s] |   value | product |
>>> |--+-+-|
>>> | 09:15:00 | 2.54321 | #ERROR  |
>>>
>>> #+TBLFM: @2$3='(org-time-string-to-hours $1)
>> That works for me. The default interpretation of $1 is used and
>> therefore the value is fed into o-t-s-t-h as string.
>
> OK, this is my current issue then.
>
> I'm using Org from git/maint version 8.3.4
> (release_8.3.4-33-gd522fc) and GNU Emacs 24.5.1 (i686-pc-mingw32
> Windows) as well as Emacs 24.4.1 on GNU/Linux.
>
> Can somebody confirm my #ERROR behavior?
>
>>> #+TBLFM: @2$3='(org-time-string-to-hours $1);L
>> That doesn't work. I'm not sure, but I guess it is because you asked for 
>> literal interpretation and it is not clear what that would mean for
>> 09:15:00.
>
> I'd say the same.
>
>>> #+TBLFM: @2$3='(org-time-string-to-hours "$1");N
>> Here you ask for interpretation as numbers. So the o-t-s-t-h function
>> sees a stringified 9 as it's parameter value. Near, but still no t-shirt ;). 
>
> I was wondering whether or not the stringification is done before or
> after the number-conversion - as a test. It's an #ERROR anyway.
>
>>> ... each of the TBLFM results in the same error.
>> Well, none of them looks like the one I wrote:
>>
>> #+TBLFM: @2$3='(* $2 (org-time-string-to-hours "$1"));L
>
> ... which I tried first, got an #ERROR and analyzed the issue.
> Narrowing down to '(org-time-string-to-hours $1) is my issue since
> I now understand the handling of $2 which is according to the
> documentation.
>
>> You said, that gives an error, too. I have no idea, why. You can use
>> (message...) and (type-of ...) to look at the types and values that you
>> feed into your functions. Maybe that gives some insight?
>
> (type-of ...) -> very helpful
>
> | time [h:m:s] |   value | product |
> |--+-+-|
> | 09:15:00 | 2.54321 | #ERROR  |
>
> #+TBLFM: @2$3='(message (type-of (org-time-string-to-hours $1)))
> #+TBLFM: @2$3='(type-of (org-time-string-to-hours $1))
>
> ... both formulas lead to #ERROR in @2$3 with no message in the
> *Message* buffer.
>
> From my understanding, the first one should have caused an output of
> the type in the *Message* buffer and the second one should have
> placed something like "integer" into @2$3. Am I correct?
>
>> The variant with converting $2 to a number is:
>> #+TBLFM: @2$3='(* (string-to-number $2) (org-time-string-to-hours $1))
>
> Since the issue is with $1, the (string-to-number $2) (which is
> working) doesn't fix the #ERROR issue of $1 :-(
>
>
> Thank you *very* much for your explanations! I (and hopefully many
> others as well) am learning a lot here.

-- 
Bernhard



Re: [O] Upper or lower case in BEGIN_SRC and other keywords

2016-06-16 Thread Bernhard Pröll

On Thu, 16. Jun 12:13, William Denton wrote:

When I use the 

For one, there is a ~org-babel-results-keyword~ variable. Also I prefer
src block keywords not to stand out as such:

#+begin_src emacs-lisp
(setcar org-structure-template-alist '("s" "#+begin_src ?\n\n#+end_src" ""))
#+end_src

For me, it's just a matter of taste.

Regards,
Bernhard



Re: [O] scheme SRC blocks

2016-03-22 Thread Bernhard Pröll

On Mon, 21. Mar 23:55, Arun Isaac wrote:



In addition to requiring 'geiser-install you have to set the
geiser-active-implementations variable, e.g.:


Customizing the geiser-active-implementations variable works for
me. Thank you.


alternatively there is a :scheme header argument for src blocks:

#begin_src scheme :scheme guile


Unfortunately, this doesn't work for me. Is this header argument
documented somewhere in the manual?

This approach seems more self-contained to the org file, and it'll be
good to have this, in case I want to send my org file to someone else,
or if I decide to try out more scheme implementations.


Hi,

the org-babel-execute:scheme function looks for a :scheme header argument 
(otherwise uses the geiser-default-implementation). This may depend on your org 
version, mine is 8.3beta. The argument is listed in the org babel reference 
card:

http://org-babel.readthedocs.org/en/latest/extra-header-args/

Regards
Bernhard



Re: [O] scheme SRC blocks

2016-03-21 Thread Bernhard Pröll

On Mon, 21. Mar 08:22, Robert Klein wrote:

Hi,
Arun Isaac  wrote:



I have an org file with scheme SRC blocks like so.

#+BEGIN_SRC scheme
  (some-code-here)
#+END_SRC

Every time, I open the org file, I get prompted for the "Scheme
implementation" and I need to choose an implementation (guile, in my
case) before continuing. Similarly, I am also prompted for the same
when publishing the org file, or opening up the SRC block using
org-edit-special (C-c ') for editing. This happens because of the
behaviour of the command "scheme-mode" which prompts for the required
scheme implementation.

Manually choosing the scheme implementation every time is tedious and
annoying. Is there some way to circumvent this issue?


In addition to requiring 'geiser-install you have to set the
geiser-active-implementations variable, e.g.:

#+begin_src emacs-lisp
 (require 'geiser-install)
 (setq geiser-active-implementations '(guile))
#+end_src

See also http://www.nongnu.org/geiser/geiser_3.html#choosing_002dimpl
in the Geiser manual.

Best regards
Robert



Hi,

alternatively there is a :scheme header argument for src blocks:

#begin_src scheme :scheme guile

Regards
Bernhard



Re: [O] insert automatically row number in tables.

2016-03-07 Thread Bernhard Pröll

Hi,

the following formula will do this for me:

| row | data |
|-+--|
|   2 | 0303 |
|   3 | 5123 |
|   4 |   41 |
|   5 | 4234 |
|   6 |   34 |
#+TBLFM: $1=@#

Regards,

Bernhard Pröll

On Mon, 07. Mar 11:24, Uwe Brauer wrote:

Hi

I would like to insert row in a table, and then hitting C-c C-c, the
leftmost column gets filled by the row number.

Such as in


| row | data |
|-+--|
| | 0303 |
| | 5123 |
| |   41 |
| | 4234 |
#+TBLFM: magic command

C-c C-c

gives


| row | data |
|-+--|
| 2   | 0303 |
| 3   | 5123 |
| 4   | 41   |
| 5   | 4234 |
#+TBLFM: magic command

Then
| row | data |
|-+--|
|   2 | 0303 |
|   3 | 5123 |
|   4 |   41 |
|   5 | 4234 |
| |   17 |
#+TBLFM: magic command

C-c C-c

gives

| row | data |
|-+--|
|   2 | 0303 |
|   3 | 5123 |
|   4 |   41 |
|   5 | 4234 |
|   6 |   17 |
#+TBLFM: magic command


I googled around and found solutions such as:

https://stackoverflow.com/questions/9267050/how-to-achieve-a-row-index-column-in-emacs-org-mode-using-a-calc-column-rule

Or
https://lists.gnu.org/archive/html/emacs-orgmode/2008-08/msg00054.html

But none of them worked for me the way I described it.

Any comments or help?

thanks

Uwe Brauer





Re: [O] Insert org-id Link at Point via Outline Path Completion

2015-08-02 Thread Bernhard Pröll

Hi again,

my guess into the blue: You haven't set the directory as described in
the readme (it defaults to nil).

Since I don't use helm, I haven't considered it.

The purpose of this backend is avoiding the `find-file-noselect' as used
in `org-refile' and the `helm-org-agenda-headings' suggested by John.
It's somewhat in-between using `org-refile' and an indexing with
external tools (recoll for example as recently debated on this list).

Regards,
Bernhard Pröll

On Sat, 01. Aug 16:20, Xebar Saram wrote:

Thx so much Bernhard

this looks really promising. i never had luck with either company or
auto-complete t o get it to work reliably (it often stops working even though
its still in the mod bar).
anyway i tried it and added this to my config (after cloning from git):

(add-to-list 'load-path /home/zeltak/.emacs.g/company-org-headings)
(add-hook 'org-mode-hook
 (lambda () (set (make-local-variable 'company-backends)
    '((company-org-headings)

i dont see it completes on org heading, is there any keys i need to press or
anything else in need to config? does this work only when you try to insert a
link?

best and thx so much, this look awesome

P.S have you considered Helm for this as well?

best

Z



On Sat, Aug 1, 2015 at 12:07 PM, Bernhard Pröll bmutbuer...@gmail.com wrote:

   Hi Saram,

   I've been in the same boat and decided to write a company-backend for
   this purpose. So if you're already using company-mode, this may be worth
   looking into:

   https://github.com/mutbuerger/company-org-headings

   Keep in mind that I'm in the process of learning Elisp and
   there has been little to no testing done on the package. Furthermore it
   uses org-store-link instead of org-id-store-link.

   Regards,
   Bernhard Pröll


   On Fri, 31. Jul 09:43, Xebar Saram wrote:

   i also have a similar workflow and would love to hear Dominic if you
   found a
   solution for this or if anyone on the list has other suggestions?

   best

   Z

   On Tue, May 12, 2015 at 10:57 PM, Dominic Surano sk8ing...@gmail.com
   wrote:

      Hello,

      I use org-mode a lot like a wiki so links to other org-mode headings
   are
      very common. Currently, I navigate to the heading or pull it up in
   an
      agenda view, store the link with C-l, going back to where I want to
      insert the link, then insert the link with C-c C-l RET. This is a
   bit
      time consuming.

      Instead, I would prefer to map a key that allows me to insert a link
   at
      the current point using tab completion similar to org-refile (C-c
   C-w).
      Looking through org-id.el, it seems like
   org-id-get-with-outline-path
      completion was designed for this purpose. I tried:

      (global-set-key \C-ci (lambda () (interactive) (org-id-get-with
      outline-path-completion)))

      but it didn't work as intended. Anyone have any ideas?

      Thanks!
      -D

      For reference, I have the following set in my configuration:

      ;; Use global IDs
      (require 'org-id)
      (setq org-id-link-to-org-use-id t)

      ;; Update ID file .org-id-locations on startup
      (org-id-update-id-locations)

      ;; Targets include this file and any file contributing to the agenda
   -
      up to 9 levels deep
      (setq org-refile-targets (quote ((nil :maxlevel . 9)
                                       (org-agenda-files :maxlevel . 9
      (setq org-refile-use-outline-path 'file)
      (setq org-outline-path-complete-in-steps t)
      (setq org-refile-allow-creating-parent-nodes t)










Re: [O] Insert org-id Link at Point via Outline Path Completion

2015-08-01 Thread Bernhard Pröll

Hi Saram,

I've been in the same boat and decided to write a company-backend for
this purpose. So if you're already using company-mode, this may be worth
looking into:

https://github.com/mutbuerger/company-org-headings

Keep in mind that I'm in the process of learning Elisp and
there has been little to no testing done on the package. Furthermore it
uses org-store-link instead of org-id-store-link.

Regards,
Bernhard Pröll

On Fri, 31. Jul 09:43, Xebar Saram wrote:

i also have a similar workflow and would love to hear Dominic if you found a
solution for this or if anyone on the list has other suggestions?

best

Z

On Tue, May 12, 2015 at 10:57 PM, Dominic Surano sk8ing...@gmail.com wrote:

   Hello,

   I use org-mode a lot like a wiki so links to other org-mode headings are
   very common. Currently, I navigate to the heading or pull it up in an
   agenda view, store the link with C-l, going back to where I want to
   insert the link, then insert the link with C-c C-l RET. This is a bit
   time consuming.

   Instead, I would prefer to map a key that allows me to insert a link at
   the current point using tab completion similar to org-refile (C-c C-w).
   Looking through org-id.el, it seems like org-id-get-with-outline-path
   completion was designed for this purpose. I tried:

   (global-set-key \C-ci (lambda () (interactive) (org-id-get-with
   outline-path-completion)))

   but it didn't work as intended. Anyone have any ideas?

   Thanks!
   -D

   For reference, I have the following set in my configuration:

   ;; Use global IDs
   (require 'org-id)
   (setq org-id-link-to-org-use-id t)

   ;; Update ID file .org-id-locations on startup
   (org-id-update-id-locations)

   ;; Targets include this file and any file contributing to the agenda -
   up to 9 levels deep
   (setq org-refile-targets (quote ((nil :maxlevel . 9)
                                    (org-agenda-files :maxlevel . 9
   (setq org-refile-use-outline-path 'file)
   (setq org-outline-path-complete-in-steps t)
   (setq org-refile-allow-creating-parent-nodes t)








Re: [O] Org-Mode and ditaa

2015-07-27 Thread Bernhard Pröll

Hi Pascal,

alternatively you could have installed ditaa and point ob-ditaa to it:

#+BEGIN_SRC elisp
(setq org-ditaa-jar-path /usr/bin/ditaa)
#+END_SRC

Not an answer to your actual question, though.

Regards,

Bernhard Pröll

On Sat, 18. Jul 12:34, Pascal Lorenz wrote:

Hi!

When I tried to render an org-mode document containing a ditaa block, an error: 
Could not find ditaa.jar at 
/Users/username/.emacs.d/elpa/contrib/scripts/ditaa.jar. In fact the whole contrib 
folder was missing, and ditaa.jar wasn't anywhere on my disk.

After a long search for problems with my configuration, I solved the problem by 
downloading the sources and copying the contrib folder manually, but shouldn't 
it be included in the org-plus-contrib package or at least be available as a 
separate one?


Best regards,

Pascal Lorenz




Re: [O] [feature request] org-capture-window-setup to stop capture window taking up whole frame

2015-06-09 Thread Bernhard Pröll

With a lot of windows open the annoying part of =org-capture= is
=switch-to-buffer-other-window= for me. My approach is using the current
window for the capture buffer:

#+BEGIN_SRC elisp
(defadvice org-capture (around bp/org-capture--around)
  (flet ((switch-to-buffer-other-window (buf) (switch-to-buffer buf)))
ad-do-it))
(ad-activate 'org-capture)
#+END_SRC



Re: [O] Org-Timer has nice popups; how can I use them elsewhere?

2015-03-24 Thread Bernhard Pröll

This blogpost demonstrates the usage of org-agenda-to-appt:

http://emacs-fu.blogspot.co.at/2009/11/showing-pop-ups.html

Instead of a sound I call notify-send for example.

Tory S. Anderson torys.ander...@gmail.com schrieb am Mon, 23. Mar 15:36:

So, orgmode timers have a nice popup when they run out; on my KDE, it's gentle 
GUI-box (not emacs) that nicely rises and falls. I would love to have this as 
how my appt reminders work, instead of the ugly minibuffer screeching; but 
looking through the org-timer code didn't give me any ideas. How can I achieve 
this?





Re: [O] How do you structure your org-drill file?

2015-02-08 Thread Bernhard Pröll

Dear Marcin,

with org-drill-hide-item-headings-p set to t the heading text is
irrelevant to me. I use this capture template:

(v Vocabulary Item entry
(file ~/path/to/vocabulary.org)
* Drill :drill:\n:PROPERTIES:\n:DRILL_CARD_TYPE: twosided\n:END:\n** 
Item\n%^{New Item}\n** Explanation\n%^{Explanation})

Notice that I use the twosided cardtype.

Marcin Borkowski mb...@wmi.amu.edu.pl schrieb am Sat, 07. Feb 18:06:

Hi there,

as a long-time user of one of the spaced repetition systems, I decided
to (finally) give org-drill a try.  I want to enhance my English
vocabulary with it.  Do you have any suggestions as far as (1) the
structuring of the drill file and (2) speeding up the entering words in the
database process?

Re (1): I started with this:

* Random words
**:drill:
determined not to change your mind or to be persuaded about something
***
adamant

with a space after `***' so that it is recognized as a heading.  Empty
headings look strange, though; are there any good ideas about what
I could put in them?

Re (2): I could come up with a YASnippet or maybe an org-capture
template; does anyone have a ready-made solution for that so that
I don't reinvent the wheel?

TIA,

--
Marcin Borkowski   This email was proudly sent
http://mbork.plfrom my Emacs.





Re: [O] Org and ledger

2014-11-09 Thread Bernhard Pröll

I have been curious too and found this file:

https://bitbucket.org/blais/beancount/src/tip/examples/tutorial/example.beancount

Eric S Fraga e.fr...@ucl.ac.uk schrieb am Sun, 09. Nov 13:29:

On Sunday,  9 Nov 2014 at 11:34, Daniel Clemente wrote:

[...]


  I prefer beancount (very similar to ledger but stricter): beancount
supports org out of the box! My beancount file is an org file (with
structure, tasks, priorities, agenda, etc. except :CLOCK:) and it
parses correctly as a ledger.


Interesting.  Could you post an example file?  The documentation you
linked to on Google docs does not mention org anywhere that I could see.

thanks.
--
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-475-g25d50e



--

mit freundlichen Grüßen

Bernhard Pröll



Re: [O] how to 'add capture item' in agenda view

2014-05-20 Thread Bernhard Pröll

There is an org-capture-use-agenda-date variable that seems to do what you're 
looking for.

bernhard

David Belohrad da...@belohrad.ch schrieb am Tue, 20. May 08:09:

Dear All,

when I run org-agenda with 'a' (agenda for current week or day), my
agenda is displayed. Now if I'm on a specific day, I'd like to quickly
enter a note using org-capture such, that it will automatically enter
into the captured template a time, which corresponds to the time/date
i'm currently pointing by cursor in org-agenda.

is there any way how to accomplish this? typical use is e.g., you make a
schedule for a doctor, who gives you 5 different dates to
schedule. Currenly I run first org-agenda and look on a specific date
(if i'm available), then org-capture and I have to rewrite the chosen
time/date into my capture template again (even if i'm pointing to it in
org-agenda).

many thanks
.d.





Re: [O] Exporting Code Blocks to PDF

2014-04-23 Thread Bernhard Pröll

Instead of switching fontsizes regularly, you might want to set the monofont 
size or scale:

#+LATEX_HEADER: \setmonofont[Scale=0.8]{Source Code Pro}


Bernhard

John Hendy jw.he...@gmail.com schrieb am Tue, 22. Apr 19:43:

On Tue, Apr 22, 2014 at 6:28 PM, Elasady, Summer s...@stowers.org wrote:

Hello Emacs World-

I’m using LaTex to export documents to PDF, but the code blocks are not
fitting to the page properly and the code is being cutoff. Is there a way to
turn on word-wrapping for export to PDF, or to resize code blocks?



I don't know if there's a way to wrap, but in my one formal
programming class, the convention was only to write 80 characters or
less -- are you exceeding that? If not, and it's just a font size
thing, you can always use LaTeX to reduce the font. I frequently do
this, especially using code in Beamer presentations:

#+latex: \scriptsize
#+begin_src R blah blah

code here

#+end_src
#+latex: \normalsize

This way, the block is downsized, and then resumes to regular font
size for the rest of the document. You can use any size command you
want; I frequently use \footnotesize, \scriptsize, and \tiny. I hardly
notice a difference with \small, though you can try that, too.


Also, does anyone have a good system for dealing with exporting large
tables? Right now I’m just linking to a file, but I’m curious if anyone else
is doing anything clever.



For tables that are /close/ in size already, I do the same thing as
above, at least if we're talking about fitting to width. You can also
flip sideways and extend over multiple pages to handle both wide and
long:

#+latex: \begin{landscape}
#+attr_latex: :environment longtable
| *alpha* | *beta* | *gamma* | *delta* |
|-++-+-|
|   1 |  1 |   1 |   1 |
|   2 |  2 |   2 |   2 |
|   3 |  3 |   3 |   3 |
|   4 |  4 |   4 |   4 |
#+latex: \end{landscape}

You can use them independently, too. Initially I tried the Org syntax
for sidewaystable, but it didn't seem to work with longtable:
- http://orgmode.org/manual/LaTeX-specific-attributes.html

As in, technically it would seem you could do:

#+attr_latex: :environment longtable :float sidewaystable

But perhaps that's more of a LaTex issue:
- 
http://tex.stackexchange.com/questions/63585/sidewaystable-together-with-longtable

Anyway, the above works, and that covers any handles I've ever used
(font, rotate, extend over multiple pages). Other than trying to
wordsmith my column names where the title exceeds the contents...
that's all the tricks up my sleeve!


John



Thanks in advance!

Summer
s...@stowers.org