Re: Shell SRC blocks under Windows

2022-02-08 Thread H. Dieter Wilhelm
Matt  writes:

>   On Sun, 06 Feb 2022 12:51:49 -0500 H. Dieter Wilhelm 
>  wrote 
>  > Matt  writes:
>  > 
>  > >   On Sat, 05 Feb 2022 17:22:29 -0500 Matt  wrote 
> 
>  > >
>  > >  >  > But I'm not sure if I'm halfway there with "sh"?  I need to run the
>  > >  >  > following MSYS2 command AND switch between two arguments (for 
> building
>  > >  >  > Emacs).
>  > >  >  > 
>  > >  >  >   \MSYS2\msys2_shell.cmd -mingw64
>  > >  >  > 
>  > >  >  > and
>  > >  >  > 
>  > >  >  >   \MSYS2\msys2_shell.cmd -msys.
>  > >  >  > 
>  > >  >  > How could I achieve this within a src block?
>  > >  > 
>  > >  > I'm not sure I follow you here.  Can you please describe what
>  > >  > you're trying to do and the system you're using (e.g. Windows,
>  > >  > GNU/Linux, Haiku) as well the shell used to run the Emacs instance
>  > >  > you're doing this in?
>  > >  > 
>  > > Excuse me.  Obviously you're using Windows.  :)
>  > 
>  > Yes I have to, but please don't mind, thank you for your interest. :-)
>  > 
>  
> I don't mind. I had asked about the system to help troubleshoot yet
> that info was clearly given in the thread title.  :)
>
>  You said you weren't sure if you're halfway there with "sh".  Is that
>  feeling resolved for you?

Not yet, I'm still grappling with your message
<17ecbfb46e9.e16df906236239.6523271905911672...@excalamus.com> and
ob-shell.el.  I'll come back to you when I'm through.

Thanks a lot for your interest.

   Dieter
-- 
Best wishes
H. Dieter Wilhelm
Zwingenberg, Germany



Re: Shell SRC blocks under Windows

2022-02-06 Thread H. Dieter Wilhelm
Matt  writes:

>   On Sat, 05 Feb 2022 17:22:29 -0500 Matt  wrote 
>
>  >  > But I'm not sure if I'm halfway there with "sh"?  I need to run the
>  >  > following MSYS2 command AND switch between two arguments (for building
>  >  > Emacs).
>  >  > 
>  >  >   \MSYS2\msys2_shell.cmd -mingw64
>  >  > 
>  >  > and
>  >  > 
>  >  >   \MSYS2\msys2_shell.cmd -msys.
>  >  > 
>  >  > How could I achieve this within a src block?
>  > 
>  > I'm not sure I follow you here.  Can you please describe what
>  > you're trying to do and the system you're using (e.g. Windows,
>  > GNU/Linux, Haiku) as well the shell used to run the Emacs instance
>  > you're doing this in?
>  > 
> Excuse me.  Obviously you're using Windows.  :)

Yes I have to, but please don't mind, thank you for your interest. :-)



Re: Shell SRC blocks under Windows

2022-02-05 Thread H. Dieter Wilhelm
Michael Powe  writes:

> On 2/4/2022 15:15, H. Dieter Wilhelm wrote:
>> Hello
>>
>> I installed the software distribution MSYS2 https://www.msys2.org/.  And
>> I'd like to call its various shells in org src blocks.  First I tried to
>> set explicit-shell-file-name but then my LaTeX exports don't work any
>> longer.
>>
>> Is is it possible to extend org-mode's src blocks with
>> org-babel-shell-names to use either MSYS2 or MinGW shells (instead of
>> cmd.exe)?  Unfortunately ob-shell.el doesn't guide me further and I
>> can't find examples or the respective lisp files on how to define the
>> execution functions.
>>
>> GNU Emacs 28.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30,
>> cairo version 1.15.10) of 2022-01-14
>>
>> Org mode version 9.4.6 (9.4.6-13-g4be129-elpaplus @
>> /home/dieter/.emacs.d/elpa/org-plus-contrib-20210920/)
>
> I'm not aware that I did anything special to get these results, except 
> add `(shell . t)` to `org-babel-load-languages`. I mean, it is entirely 
> possible that I did, in some other context. I think it's just a matter 
> of having bash in your path.

Yes, you are right, when using 

> #+begin_src sh

It seems that I'm also running some bash shell! :-) Previously I was
using the src block in this way:

  #+begin_src shell

and here the shell seems to be com.exe.

But I'm not sure if I'm halfway there with "sh"?  I need to run the
following MSYS2 command AND switch between two arguments (for building
Emacs).

  \MSYS2\msys2_shell.cmd -mingw64

and

  \MSYS2\msys2_shell.cmd -msys.

How could I achieve this within a src block?

Thanks 



Shell SRC blocks under Windows

2022-02-04 Thread H. Dieter Wilhelm
Hello

I installed the software distribution MSYS2 https://www.msys2.org/.  And
I'd like to call its various shells in org src blocks.  First I tried to
set explicit-shell-file-name but then my LaTeX exports don't work any
longer.

Is is it possible to extend org-mode's src blocks with
org-babel-shell-names to use either MSYS2 or MinGW shells (instead of
cmd.exe)?  Unfortunately ob-shell.el doesn't guide me further and I
can't find examples or the respective lisp files on how to define the
execution functions.

GNU Emacs 28.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30,
cairo version 1.15.10) of 2022-01-14

Org mode version 9.4.6 (9.4.6-13-g4be129-elpaplus @
/home/dieter/.emacs.d/elpa/org-plus-contrib-20210920/)

Thanks a lot

   Dieter
-- 
Best wishes
H. Dieter Wilhelm
Zwingenberg, Germany




Re: Microsoft Excel spreadsheet editing directly from within emacs.

2021-01-08 Thread H. Dieter Wilhelm
Hongyi Zhao  writes:

> On Tue, Dec 29, 2020 at 5:40 PM Jean Louis  wrote:
>>
>> * Hongyi Zhao  [2020-12-29 07:55]:
>> > From this point of view, if we want to have both full-features and
>> > powerful capabilities in manipulating spreadsheet, it seems that only
>> > the python based programmatic tools/packages, say, openpyxl
>> > <https://openpyxl.readthedocs.io>, can meet the requirements
>> > currently.
>>
>> What are you requirements?
>
> I use Linux as my working environment exclusively. So, I can't access
> the native MS Office supplied for macOS/Windows. But I sometimes
> really need to manipulate and process MS Office documents, especially
> DOCX and XLSX files. Though there are some free and open source office
> suites, e.g. LibreOffice, but none of them can completely compatible
> with the MS Office.
>
> So, I want to find a way that can be used to programmatically complete
> any possible work done by MS Office word/excel.

For directly reading Excel sheets I highly recommend "readxl" from the
R package bundle "tidyverse".  

  https://r4ds.had.co.nz/

It's an investment though but it pays in the long run for serious data
science.  After processing you should be able to write data in an excel
file with the "writexl" package.  (Did not test it, never had the need
to export into Excel. :-))

By the way, I'm mostly doing data processing in org-mode R source
blocks.  And I'm also converting data into org-mode tables but mostly
small ones for latex table exports. And you can also do spreadsheet
calculations with them

  https://orgmode.org/manual/The-Spreadsheet.html

Here's a small example

   #+LATEX: \definecolor{VitescoYellow}{RGB}{242,229,0}
   #+LATEX: \rowcolors[]{1}{VitescoYellow!100}{VitescoYellow!5}
   #+caption: Required motor torque to reach src_R{N} rpm in src_R{T} s
   | *Cases*| *Torque* in  Nmm |
   |+--|
   | Best case  |  9.5 |
   | Worst case | 11.6 |
   #+TBLFM: @2$2='(org-sbe mintorque):: @3$2='(org-sbe maxtorque)

(Above org table is reading results from named org source blocks.)

If you really, really need to return data in MS formats you might have
to run a virtual machine with Windows, not that I recommend that but
live is ...

Hope that is interesting

 Dieter


-- 
Best wishes
H. Dieter Wilhelm
Zwingenberg, Germany



Re: [O] mailto link for the #+email keyword: Suppressing backslash and braces "escaping" for latex exports

2018-02-25 Thread H. Dieter Wilhelm
John Kitchin <jkitc...@andrew.cmu.edu> writes:

> I posted this on your stack exchange question:
>
> #+latex_class: report
> #+options: author:nil email:nil
> #+latex_header: \author{Some user 
> \thanks{\href{mailto:b...@comp.org}{b...@comp.org}}}

Perfect, thanks a lot John!

Hmm, I'm asking now myself how can I get a mailto link for an html
export as well? ;-)

   Dieter
[...]

l
-- 
Best wishes
H. Dieter Wilhelm
Kelkheim, Germany




[O] mailto link for the #+email keyword: Suppressing backslash and braces "escaping" for latex exports

2018-02-25 Thread H. Dieter Wilhelm
Dear orgers,

I'd like to have a clickable mailto link in a latex pdf export (of a
report) for the #+email:-keyword's content.

I assume this is not achievable with latex commands, for example

   #+email: \href{mailto:a...@b.com}{a...@b.com}

because org escapes here backslashes and the braces:

  $\backslash$href\{mailto:a...@b.com\}\{a...@b.com\}

Is it possible to suppress this escaping or what mechanism to achieve a
clickable mailto link would you suggest?

Thank you very much

Dieter

PS: Already asked this on stackexchange:
https://emacs.stackexchange.com/q/39058/8979

-- 
Best wishes
H. Dieter Wilhelm
Kelkheim, Germany




[O] Bug: error when (require 'org-drill) in init.el [9.0.3 (9.0.3-elpa @ /home/dieter/.emacs.d/elpa/org-20161224/)]

2017-01-15 Thread H. Dieter Wilhelm
'(org-babel-load-in-session-maybe)
 org-agenda-start-on-weekday nil
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-log-done 'time
 org-latex-format-inlinetask-function 
'org-latex-format-inlinetask-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-html-metadata-timestamp-format "%Y-%m-%d"
 org-file-apps '(("pdf" . "evince %s") (auto-mode . emacs) ("\\.mm\\'" . 
default)
 ("\\.x?html?\\'" . default) ("\\.pdf\\'" . default))
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-todo-keyword-faces '(("NEU" quote (:foreground "green"))
  ("ALT" quote (:foreground "red"))
  ("TODO" quote (:foreground "orange")))
 org-capture-templates '(("r" "inserting a two-sided org-drill card entry" entry
  (file+headline "~/org/blog/dddlll.org" "Vocabulary")
  "\n* %^{Enter subject (German phrase or word)}
   :drill:\n  :PROPERTIES:\n  :DRILL_CARD_TYPE: 
twosided\n  :END:\n** F\n   %^{Enter French phrase or word}\n** 
E\n   %^{Enter English phrase or word}\n   " :prepend t)
 )
 org-agenda-include-diary t
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-from-is-user-regexp "\\<H\\. Dieter Wilhelm\\>"
 org-html-postamble t
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-html-allow-name-attribute-in-anchors t
 org-font-lock-set-keywords-hook '(org-drill-add-cloze-fontification)
 org-mode-hook '(#[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-show-block-all append 
local] 5]
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-babel-show-result-all 
append
local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes 
org-eldoc-load)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-use-speed-commands t
 org-ascii-format-drawer-function #[771 ".\207" [] 4 "\n\n(fn NAME CONTENTS 
WIDTH)"]
 org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
 org-enforce-todo-dependencies t
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines 
org-optimize-window-after-visibility-change)
 org-html-postamble-format '(("de"
  "Letzte Ă„nderung: %C \nErzeugt von %c \n")
 ("en"
  "Author: %a (%e)\nModification date: %C \nGenerated by %c 
\n")
 ("fr"
  "Auteur: %a (%e)\nDate de la modification: %C \nProduit 
par %c \n")
 )
 org-link-abbrev-alist '(("att" . org-attach-expand))
 org-koma-letter-default-class "my-letter"
 org-agenda-span 'month
 org-latex-packages-alist '(("AUTO" "babel" t))
 org-deadline-warning-days 3
 org-export-allow-bind-keywords t
 org-babel-tangle-lang-exts '(("maxima" . "max") ("latex" . "tex") ("python" . 
"py")
  ("emacs-lisp" . "el") ("elisp" . "el"))
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-html-format-headline-function 'org-html-format-headline-default-function
 org-link-parameters '(("id" :follow org-id-open)
   ("rmail" :follow org-rmail-open :store 
org-rmail-store-link)
   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
   ("irc" :follow org-irc-visit :store org-irc-store-link)
   ("info" :follow org-info-open :export org-info-export 
:store
org-info-store-link)
   ("gnus" :follow org-gnus-open :store org-gnus-store-link)
   ("docview" :follow org-docview-open :export 
org-docview-expor

Re: [O] How to export casual letter without from and to address?

2016-03-06 Thread H. Dieter Wilhelm
York Zhao <gtdplatf...@gmail.com> writes:

>> Yeah, this works really convenient and near automatic, I'm also using org for
>> corporate meeting minutes, reports and statistics to the tax authority
>> (besides Koma letters of course ;-)
>
> Same here, using org-mode for everything. But have you ever needed to print 
> out
> a letter without "from address" and "to address"? In my case, I just needed to
> print a note, sign it, and pass it to somebody on a regular basis! It doesn't
> make sense having to always print my home address and her address at the
> beginning because it's just a casual note.

When it's *not* a real letter you shouldn't use scrlttr2 as the document
class!

I suggest to have a look at the KOMA scrpage2 documentation, with this
style you have more control of the content and can create your own
*high-class* notes style.

Hope that helps

 Dieter


> Thanks,
>
> York
>
> On Sat, Mar 5, 2016 at 6:22 AM, H. Dieter Wilhelm
> <die...@duenenhof-wilhelm.de> wrote:
>> Eric S Fraga <e.fr...@ucl.ac.uk> writes:
>>
>>> On Friday,  4 Mar 2016 at 22:36, York Zhao wrote:
>>>> Please share how you write notes (casual letter without "from address" and 
>>>> "to
>>>> address") in Emacs org-mode, print out and give to somebody.
>>>
>>> If you don't have the usual elements of a letter, it is not really a
>>> letter so simply write it as a normal org document and export it to pdf
>>> or odt or whatever you wish to send.  org itself doesn't care!  In other
>>> words, why use a letter exporter (koma?) if you don't want something
>>> that looks like a letter?
>>
>> Yeah, this works really convenient and near automatic, I'm also using
>> org for corporate meeting minutes, reports and statistics to the tax
>> authority (besides Koma letters of course ;-).
>>
>> --
>> Best wishes
>> H. Dieter Wilhelm
>> Kelkheim, Germany
>>
>>
>
>

-- 
Best wishes
H. Dieter Wilhelm
Kelkheim, Germany




Re: [O] How to export casual letter without from and to address?

2016-03-05 Thread H. Dieter Wilhelm
Eric S Fraga <e.fr...@ucl.ac.uk> writes:

> On Friday,  4 Mar 2016 at 22:36, York Zhao wrote:
>> Please share how you write notes (casual letter without "from address" and 
>> "to
>> address") in Emacs org-mode, print out and give to somebody.
>
> If you don't have the usual elements of a letter, it is not really a
> letter so simply write it as a normal org document and export it to pdf
> or odt or whatever you wish to send.  org itself doesn't care!  In other
> words, why use a letter exporter (koma?) if you don't want something
> that looks like a letter?

Yeah, this works really convenient and near automatic, I'm also using
org for corporate meeting minutes, reports and statistics to the tax
authority (besides Koma letters of course ;-).

-- 
Best wishes
H. Dieter Wilhelm
Kelkheim, Germany




Re: [O] org table with auto-incrementing numbers in a column

2016-02-15 Thread H. Dieter Wilhelm
>
> Try this
>
>   | N |   |
>   |---+---|
>   |   |   |
>   |   |   |
>   |   |   |
>   |   |   |
>   #+TBLFM: $1..>$1= -1 + 1:: 2$1=1
>

I don't know exactly why  "N" is *not* erased but the following is
working for me (org 8.2.10).

| N |
|---|
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
#+TBLFM: $1=@#-1

> Placing point on the TBLFM line and doing C-c C-c should recalculate the
> whole table.

and C-u C-c C-* does it anywhere in the table.

Dieter
-- 
Best wishes
H. Dieter Wilhelm
Kelkheim, Germany




Re: [O] Evaluating simple inline expressions in org-mode

2016-02-07 Thread H. Dieter Wilhelm

>>> works as well.  I'm not sure how you define variables in calc however...
>>
>> You could write something like src_calc[:var x=3.41]{2*x} :-)
>
> Yes but can you save a variable for use in a later expression?

Well, at the moment I don't know another way as defining the calc
variables on the lisp level:

#+BEGIN_SRC emacs-lisp
(setq var-foo 9.81
  var-x 3.14
  var-bar ...)
#+END_SRC

Note: `var-' is a special prefix for the calc variables `foo', `x',
...

And then something like

  src_calc{2*x}

is working.

-- 
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany




Re: [O] Evaluating simple inline expressions in org-mode

2016-02-03 Thread H. Dieter Wilhelm
Eric S Fraga <e.fr...@ucl.ac.uk> writes:

> On Wednesday,  3 Feb 2016 at 08:45, Gary Oberbrunner wrote:
>
> [...]
>
>> Of course I made up that {{{}}} syntax, that's not a real thing. I've seen
>> org-mode tables with calc, but I'm hoping for something simpler, just
>> inline math expression eval. (I'm fine with elisp, calc, whatever.)
>
> As Ken has shown¸ you can use babel for inline evaluation.  Note that
> Emacs calc is one of the languages supported by babel so src_calc(2*pi)

It must be src_calc{2*pi} though.

> works as well.  I'm not sure how you define variables in calc however...

You could write something like src_calc[:var x=3.41]{2*x} :-)

Dieter
-- 
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany




Re: [O] Radio target appears as a link in html export (in Emacs stable)

2016-02-01 Thread H. Dieter Wilhelm
Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

>> I would expect an invisible html entity or just the apperance of the
>> text "orgradiotarget1".
>
> The latter is indeed expected. 

Thanks for the confirmation

> Assuming the variable above is non-nil, which would explain your output,
> we could consider to ignore it altogether for radio targets. Again, I'm

  org-html-allow-name-attribute-in-anchors is a variable defined in 
`ox-html.el'.
  Its value is t

Thanks, didn't know about this config. variable and it's working, the
anchor is then exported without a name...  But still appears as a link
in *my* html page :-(.  I conclude the problem is within the css file
I'm using for this particular site. (Please see the following comment)

> not much into HTML so I don't know if that's a good idea (e.g., is there
> any use for an anchor with both an id and a name attribute in the
> context of radio targets?).

I don't think so, with a simple org test file I'm getting the behaviour
you would expect - despite a named anchor - the target doesn't appear as
link, just a regular text.  Thank you very much, I have now a path to
look for.

  Dieter

-- 
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany




Re: [O] Radio target appears as a link in html export (in Emacs stable)

2016-01-31 Thread H. Dieter Wilhelm
Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Hello,
>
> die...@duenenhof-wilhelm.de (H. Dieter Wilhelm) writes:
>
>> But then I would have to turn all my radio links into proper links,
>> which I see no method - except with radio targets - to do this
>> automatically.
>
> Instead of 
>
>   <<>> ... radio
>
> you would have to type
>
>   <>   ... [[radio]]
>
> which, IMO, is almost equally simple.

Hmmm, that is true.  In the worst case I've to get used to it...

>> The radio links are turned correctly into links. :-)
>>
>> But the targets (anchors) appear *also* as links (in HTML).  Which is
>> confusing and redundant because there are not linked to anything.
>
> I'm confused, mainly because I'm not well versed in HTML. Let's consider
> the following document:
>
>   <<>> :target link: radio
>
> When exporting it to HTML, I get the following:
>
>   radio :target link:  href="#orgradiotarget1">radio


I'm getting  instead,
which *appears* in my html page as a link (which is wrong IMHO, Org-mode
version 8.2.10, Emacs stable).

> What would you expect instead?

I would expect an invisible html entity or just the apperance of the
text "orgradiotarget1".

Thanks
   Dieter

-- 

Best wishes
H. Dieter Wilhelm
Darmstadt, Germany




Re: [O] Radio target appears as a link in html export (in Emacs stable)

2016-01-27 Thread H. Dieter Wilhelm
Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:
> die...@duenenhof-wilhelm.de (H. Dieter Wilhelm) writes:
>
>> when exporting radio targets to PDF they appear as normal text.
>> Sometimes I wish I could make them invisible but this is a behaviour I
>> can live with.
>
> You should use regular targets, then.

But then I would have to turn all my radio links into proper links,
which I see no method - except with radio targets - to do this
automatically.

>> Anyway, when exporting to html the radio targets appear like a regular
>> link (technically I think they are a named anchor, something like > id="bla" name="bla">bla).  The apperance is not helpful, only
>> confusing.  I guess I could change this behaviour with some css trickery
>> but it might become complicated, at least for my little html knowledge.
>
> There are radio targets (e.g., <<>>) and radio links and (e.g.,
> radio). The former are turned into anchors and the latter into links.
> Don't you get the same?

The radio links are turned correctly into links. :-)

But the targets (anchors) appear *also* as links (in HTML).  Which is
confusing and redundant because there are not linked to anything.

Here's an example:
http://duenenhof-wilhelm.de/dancing/date.html

E. g. _EDanceFever_ are links to their anchor below.

Maybe the following would be a good idea for org in general: A radio
target with an optional address argument like babel src blocks
<<>>[http://targetaddresse.com] and upgrading the anchor to a
real, working link.

Thank you Nicolas

-- 
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany




[O] Radio target appears as a link in html export (in Emacs stable)

2016-01-25 Thread H. Dieter Wilhelm
Hello (),

when exporting radio targets to PDF they appear as normal text.
Sometimes I wish I could make them invisible but this is a behaviour I
can live with.

Anyway, when exporting to html the radio targets appear like a regular
link (technically I think they are a named anchor, something like bla).  The apperance is not helpful, only
confusing.  I guess I could change this behaviour with some css trickery
but it might become complicated, at least for my little html knowledge.

Is it possible in org to change the appearance of radio targets in html
exports without loosing their behaviour?

Thanks a lot, Org-mode version 8.2.10 (release_8.2.10 @
/usr/local/src/emacs-24.5/lisp/org/) from Emacs stable

 Dieter
-- 
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany




Re: [O] Babel evaluation of Calc block not working, bug in Calc?

2014-10-07 Thread H. Dieter Wilhelm
Andrea Rossetti andrea.rosse...@gmail.com writes:
 PS: Are you using Calc regularly?
 Compact answer: no :(
 Detailed answer: I do like Calc and Org+Babel+Calc,
 but my daily job doesn't involve any maths.

Then it's understandable, the UI of Calc is very fast but also very,
very abstract.

My hope is that with the Babel interface Calc can get a push.  There is
some potential, although it remains a lot to improve to have a workable
computer algebra system (CAS) in the line of Maxima, Maple, Mathematica
et al. :-|

 The Org functions I use most frequently are:
 - org-clock-in, org-clock-out, agenda view
 - org-columns
 - simple exports of TODOs or clocktable in HTML
   or PDF format

That is the strength of Org-mode: The combination of code and beautiful
documentation. :-D

   Dieter
-- 
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany




Re: [O] Babel evaluation of Calc block not working, bug in Calc?

2014-10-04 Thread H. Dieter Wilhelm
Hello Andrea 8-)

Andrea Rossetti andrea.rosse...@gmail.com writes:
 Andrea Rossetti andrea.rosse...@gmail.com writes:
 3) temporary workaround: try to change :var v=3 into :var var-v=3,
 it works for me, does it work for you too?
 The suggested workaround/test is: replace

 #+BEGIN_SRC calc :var v=3
  v + 4
 #+END_SRC

 with

 #+BEGIN_SRC calc :var var-v=3
  v + 4
 #+END_SRC

This is working for me as well, I think this will help me to understand
what is going on...

Thank you for you help
 Dieter

PS: Are you using Calc regularly?
-- 
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany




[O] Download of constants.el not working

2014-09-23 Thread H. Dieter Wilhelm
Hello (),

I can't download constants.el from

https://staff.fnwi.uva.nl/c.dominik/Tools/constants/index.html

would you mind to post a copy or another link?

Thanks
Dieter
-- 
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany




[O] Babel evaluation of Calc block not working, bug in Calc?

2014-09-22 Thread H. Dieter Wilhelm
Hello Orgers,

please consider: Emacs -Q and evaluate the following

#+BEGIN_SRC emacs-lisp
(org-babel-do-load-languages
 'org-babel-load-languages
 '((calc . t)
   (emacs-lisp . t)
   ))
#+END_SRC

#+RESULTS:
| (calc . t) | (emacs-lisp . t) |

The following works as expected

#+BEGIN_SRC calc :var V=3
V + 4
#+END_SRC

But now we are getting: byte-code: Symbol's function definition is void:
v!

#+BEGIN_SRC calc :var v=3
v + 4
#+END_SRC

Calc thinks that the variable v contains a function even though nothing
should be undefined for v and when trying debug-on-entry for
calc-var-value the expression (boundp v) returns t!?  I'm stuck at this
point, could you please have a look, I've no idea how to debug this
further.

GNU Emacs 24.3.93.3 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.24) of
2014-09-17 on vsl28t2g With the latest org-mode from git 

Thanks
Dieter
-- 
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany




Re: [O] Unit conversions and symbolic mathematics with Babel

2014-09-04 Thread H. Dieter Wilhelm
die...@duenenhof-wilhelm.de (H. Dieter Wilhelm) writes:

 Hello Org,

 for some engineering most often I need estimations with unit
 conversions, Emacs Calc is perfect for this.

 When it comes to reporting and documentation I'd like to do it with
 org-mode, of course.  For numerical stuff and visualisation purposes I'm
 using already R and TikZ. But for unit conversions and symbolic maths
 I'm in a bind when trying to do this with free programs.

 - R :: Do you have experience with a units packages under the R-project?
   What I've seen so far is not so reassuring...

 - Maxima :: I think there is a nice and intuitive units package for
   maxima.  But this would mean learning an additional tool and mentally
   switching between both within one document.

 - Calc :: I'd prefer to do it with Calc but the Babel interface is
   (yet?) restricted

   For example, I can define functions and do some unit conversions:

 #+BEGIN_SRC emacs-lisp
 (defmath cvun(a b)
 (math-convert-units a b))
 #+END_SRC

 #+RESULTS:
 : calcFunc-cvun

 #+BEGIN_SRC calc :var L1 = 5 mm 
 cvun( L1, m)
 #+END_SRC

 #+RESULTS:
 : 5e-3 m

   But what is missing is to assign variables within a source block
   
 #+BEGIN_SRC calc :var L1 = 5 mm 
 L2 := cvun( L1, m)
 #+END_SRC
   
   Unfortunately this is not working.  Do you have an idea how to
   implement this?



For your information: Jay Belanger found a workaround

#+BEGIN_SRC emacs-lisp
(defmath sett(a b) ; or any other name not identical to the applied lisp 
functions
  (set (nth 2 a) b))
#+END_SRC

#+RESULTS:
: calcFunc-sett

#+BEGIN_SRC calc :var L1 = 3
sett( L2, 3.14)
L2 - L1
#+END_SRC

#+RESULTS:
: 0.14

-- 
   Dieter   



 - Are you using (better) alternatives?

 Thanks for your insights

Dieter

-- 
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany




[O] Unit conversions and symbolic mathematics with Babel

2014-09-03 Thread H. Dieter Wilhelm
Hello Org,

for some engineering most often I need estimations with unit
conversions, Emacs Calc is perfect for this.

When it comes to reporting and documentation I'd like to do it with
org-mode, of course.  For numerical stuff and visualisation purposes I'm
using already R and TikZ. But for unit conversions and symbolic maths
I'm in a bind when trying to do this with free programs.

- R :: Do you have experience with a units packages under the R-project?
  What I've seen so far is not so reassuring...

- Maxima :: I think there is a nice and intuitive units package for
  maxima.  But this would mean learning an additional tool and mentally
  switching between both within one document.

- Calc :: I'd prefer to do it with Calc but the Babel interface is
  (yet?) restricted

  For example, I can define functions and do some unit conversions:

#+BEGIN_SRC emacs-lisp
(defmath cvun(a b)
  (math-convert-units a b))
#+END_SRC

#+RESULTS:
: calcFunc-cvun

#+BEGIN_SRC calc :var L1 = 5 mm 
cvun( L1, m)
#+END_SRC

#+RESULTS:
: 5e-3 m

  But what is missing is to assign variables within a source block
  
#+BEGIN_SRC calc :var L1 = 5 mm 
L2 := cvun( L1, m)
#+END_SRC
  
  Unfortunately this is not working.  Do you have an idea how to
  implement this?

- Are you using (better) alternatives?

Thanks for your insights

   Dieter
-- 
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany




Re: [O] About range references in the spreadsheet

2013-01-27 Thread H. Dieter Wilhelm
Eric S Fraga e.fr...@ucl.ac.uk writes:
 Bastien b...@altern.org writes:

 Hi Xue,

 Xue Fuqiao xfq.f...@gmail.com writes:

 In (info (org) References), there is an example explaining the range
 references:

  @-1$-2..@-1   3 numbers from the column to the left, 2 up to
 current row

 What does `2 up to current row' mean?  I don't understand.  IIRC `@'
 represents row, it should be `1 up to current row'.

 No.  The whole sentence expands to this: 

   This range takes 3 numbers: the first one from the column to the
   left (and the row above), the 2 others up to current row.

 I agree this might not be obvious but I don't have a better proposal.
 Maybe a native english speaker can help here.

 Best,


 I think the current description is wrong and that rows and columns have
 been interchanged?  The entries defined by this range are all in the row
 above (@-1) the current row.  The columns chosen are two to the left of
 the current column up to the current column.

Right. The formulation above would only be logical with:

  This range takes 3 numbers: the first one from TWO columns to the
  left (and the row above), the 2 others up to current row.

But still not easy to understand.

 If you wish to re-word, maybe:

 This range expands to three elements, all on the row above the current
 row, starting with the column two to the left of the current column.

Would be much better, I think.

More precisely: The manual speaks about `field references' and `column'-
and `row' specifications.  So I would write:

  The three SPECIFICATIONS expand to a field range from the row above
  the current row, starting with two columns to the left up to the
  current column.

(I would avoid the ambiguous expression column two since it is a
relative specification) alternatively

  The TWO REFERENCES expand to a field range from the row above the
  current row, starting with two columns to the left up to the current
  column.

  Dieter

-- 
Best wishes

H. Dieter Wilhelm
Darmstadt
Germany