Re: [O] evil-mode and org

2017-03-30 Thread Eric S Fraga
On Tuesday, 28 Mar 2017 at 13:23, Peter Neilson wrote:
> You will also find people asking why anyone would ever think of using
> vim.

[...]

> Why use vim if emacs is already built into your fingertips?

I don't think the OP was intending on using vim (although nothing wrong
with that in any case ;-)).  The proposal was to use evil-mode in
Emacs.  There are many reasons for doing so, given that one wishes to
continue using emacs.  Two that apply for me are avoiding RSI issues (no
keyboard chords) and I prefer modal editing (benefits in movement and
word/sentence operations).

I did start with vi (Unix v7 on PDP 11/45) but switched to emacs a few
years later (in 1984/5, BSD Unix on a Vax 11/780), using emacs almost
exclusively since then.  Evil has been a godsend for me.

YMMV of course!

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.1.1, Org release_9.0.5-391-g36c7cf


signature.asc
Description: PGP signature


[O] Table formula references

2017-03-30 Thread Manuel Schneckenreither
Hi,

I'd like to use following formula on like this:

  | t | y_t | y_{t+1} |
  |---+-+-|
  | 1 | 115 | |
  | 2 | 121 | |
  | 3 | 118 | |
  | 4 | 127 | |

  $4 = \sum_{\tau=0}^{@#-2}{0.9^{\tau} * y_{@#-2-\tau}}
  

So that's a simple sum, which just iterates over the values and uses the
index for power and to get the value of y_{4-\tau}. So @5$3 should be
0.9^0*127 + 0.9^1*118 + 0.9^2*121 + 0.9^3*115. Shouldn't be too hard I
though, but I couldn't figure it out how to implement it using
org-spreadsheets.

As I need the index I tried using subscr with no success. I can
obviously generate the list of rows used for the calculation using
@2$1..@2$#. However, as soon as I use an elsip function in the formula I
struggle with the representation of the list:

#+TBLFM: $3='(mapcar '1+ (@2$1..@2$#))

shows following debug output:

   Substitution history of formula
   Orig:   '(mapcar '1+ (@2$1..@2$3))
   $xyz->  '(mapcar '1+ (@2$1..@2$3))
   @r$c->  '(mapcar '1+ (#("1" 0 1 (fontified t line-prefix #("*** " 0 7 
(face org-indent)) wrap-prefix #("*** " 0 8 (face org-indent)) face 
org-table)) #("115" 0 3 (fontified t line-prefix #("*** " 0 7 (face 
org-indent)) wrap-prefix #("*** " 0 8 (face org-indent)) face org-table
   $1->'(mapcar '1+ (#("1" 0 1 (fontified t line-prefix #("*** " 0 7 
(face org-indent)) wrap-prefix #("*** " 0 8 (face org-indent)) face 
org-table)) #("115" 0 3 (fontified t line-prefix #("*** " 0 7 (face 
org-indent)) wrap-prefix #("*** " 0 8 (face org-indent)) face org-table
   Result: #ERROR
   Format: NONE
   Final:  #ERROR

Is there a simple way to do it? Do I need to go over elsip functions,
and if so. How can I properly use a list?

I couldn't find a way on the web.


Best regards

Manuel



[O] Table formula references

2017-03-30 Thread Manuel Schneckenreither
Hi,

I'd like to use following formula on like this:

  | t | y_t | y_{t+1} |
  |---+-+-|
  | 1 | 115 | |
  | 2 | 121 | |
  | 3 | 118 | |
  | 4 | 127 | |

  $4 = \sum_{\tau=0}^{@#-2}{0.9^{\tau} * y_{@#-2-\tau}}
  

So that's a simple sum, which just iterates over the values and uses the
index for power and to get the value of y_{4-\tau}. So @5$3 should be
0.9^0*127 + 0.9^1*118 + 0.9^2*121 + 0.9^3*115. Shouldn't be too hard I
though, but I couldn't figure it out how to implement it using
org-spreadsheets.

As I need the index I tried using subscr with no success. I can
obviously generate the list of rows used for the calculation using
@2$1..@2$#. However, as soon as I use an elsip function in the formula I
struggle with the representation of the list:

#+TBLFM: $3='(mapcar '1+ (@2$1..@2$#))

shows following debug output:

   Substitution history of formula
   Orig:   '(mapcar '1+ (@2$1..@2$3))
   $xyz->  '(mapcar '1+ (@2$1..@2$3))
   @r$c->  '(mapcar '1+ (#("1" 0 1 (fontified t line-prefix #("*** " 0 7 
(face org-indent)) wrap-prefix #("*** " 0 8 (face org-indent)) face 
org-table)) #("115" 0 3 (fontified t line-prefix #("*** " 0 7 (face 
org-indent)) wrap-prefix #("*** " 0 8 (face org-indent)) face org-table
   $1->'(mapcar '1+ (#("1" 0 1 (fontified t line-prefix #("*** " 0 7 
(face org-indent)) wrap-prefix #("*** " 0 8 (face org-indent)) face 
org-table)) #("115" 0 3 (fontified t line-prefix #("*** " 0 7 (face 
org-indent)) wrap-prefix #("*** " 0 8 (face org-indent)) face org-table
   Result: #ERROR
   Format: NONE
   Final:  #ERROR

Is there a simple way to do it? Do I need to go over elsip functions,
and if so. How can I properly use a list?

I couldn't find a way on the web.


Best regards

Manuel



Re: [O] Allow #+SETUPFILE to point to an URL for the org file

2017-03-30 Thread Nicolas Goaziou
Hello,

Kaushal Modi  writes:

> Here is my implementation.. it is still not baked into org.el, etc and
> provided as a complete patch; I have some questions..

Thank you.

> (defvar org-setupfile-ht (make-hash-table :test 'equal)

org-setupfile-ht -> org--setupfile-cache

if it is meant to be inserted in "org.el" proper, or
`org-setupfile--cache' if you want to create a new "org-setupfile.el"
library.

Nitpick : 'equal -> #'equal

>   "Hash table to store the org SETUPFILE.

Hash table to store SETUPFILE contents.

> This acts as a cache of setup files read using
> `org-insert-setupfile-contents'.")
>
> (defun org-setupfile-clear-cache ()

`org--setupfile-clear-cache' or `org-setupfile--clear-cache' depending
on the location of the function.

>   "Clear the SETUPFILE cache stored in `org-setupfile-ht'."
>   (interactive)
>   (clrhash org-setupfile-ht))
>
> (defun org-insert-setupfile-contents (setupfile &optional nocache noerror)
>   "Insert the contents of SETUPFILE.
> SETUPFILE can be a file path or URL.

file path -> file name

> If SETUPFILE is a file path, use `org-file-contents' to get the file
> contents.

Then, we might want to generalize `org-file-contents' instead (i.e., let
`org-file-contents' handle remote locations). WDYT?

> If it is a URL instead, download the contents. If the URL contents are
> already
> cached in the `org-setupfile-ht' hash table, the download step is
> skipped.

Mind the double spaces at the end of sentences.

> If NOCACHE is non-nil, do a fresh fetch of SETUPFILE even if cached version
> is
> available. This option applies only if SETUPFILE is a URL.
>
> If NOERROR is non-nil, ignore the error when unable to read the SETUPFILE
> from
> file or URL."
>   (require 'ffap)   ;for `ffap-url-regexp'
>   (let* ((is-url (string-match-p ffap-url-regexp setupfile))

They are not equivalent, but could `org-file-remote-p', or
`file-remote-p' be used instead?

>  (cache (when (and is-url (not nocache))
>   (gethash setupfile org-setupfile-ht)))

  (cache (and is-url (not nocache) (gethash setupfile org-setupfile-ht)))

>  (contents (when (and is-url cache) cache)))
> (if is-url
> (unless cache
>   (let (url-retrieve-header)
> (with-current-buffer (url-retrieve-synchronously setupfile)
>   (goto-char (point-min))
>   ;; Take point to after the url-retrieve header
>   (re-search-forward "\n\n") ; 2 consecutive new-line chars

`re-search-forward' -> `search-forward'

>   (setq url-retrieve-header (buffer-substring-no-properties
>  (point-min) (point)))
>   (message url-retrieve-header) ;Dump the URL retrieve header
> to *Messages*
>   (if (string-match-p "HTTP.*\\s-+200\\s-OK"
> url-retrieve-header) ;URL retrieved correctly
>   (progn
> (setq contents (buffer-substring-no-properties (point)
> (point-max)))
> ;; Update the cache `org-setupfile-ht'
> (puthash setupfile contents org-setupfile-ht))
> (funcall (if noerror 'message 'error)

  (if noerror #'message #'error)

>  "Unable to fetch SETUPFILE from `%s'"

  `%s' -> %S

> setupfile)
>   (setq contents (org-file-contents setupfile noerror)))

I think it is clearer if wrapped like this:

  (contents
   (cond (cache)
 (is-url
  (let (url-retrieve-header)
...))
 (t (org-file-contents setupfile noerror

> (when contents
>   (save-excursion
> (insert contents)

This may not be necessary at this point if we merge `org-file-contents'
with the above.

> Question:
>
> - All the places where the content of SETUPFILE is inserted in a temp
> buffer, it is assumed that the file is retrieved from disk and not from URL.
>
> Example in ox.el:
>
>  ((equal key "SETUPFILE")
>   (let ((file
>  (expand-file-name
>   (org-unbracket-string "\"" "\"" (org-trim val)
> ;; Avoid circular dependencies.
> (unless (member file files)
>   (with-temp-buffer
> (setq default-directory
>   (file-name-directory file))
> (insert (org-file-contents file 'noerror))
> (let ((org-inhibit-startup t)) (org-mode))
> (funcall get-options (cons file files))
>
>
> Note the use of expand-file-name, (member file files), default-directory,
> (funcall get-options (cons file files)).

(member file files), (cons file files) and `expand-file-name' are used
to avoid reading over and over the same setup file. In particular, they
prevent circular dependencies.

You can ignore `expand-file-name' and replace `file' with `uri', i.e.,
it is straightforward to extend the code to remote file names.

`default-directory' is slightly more tricky, as it is used to properly
read recursively setup files with relative file names. I think our best
bet is to to check if current file name is local or remote, and

Re: [O] Have SRC_BLOCK :padline accept numbers

2017-03-30 Thread Nicolas Goaziou
Hello,

Daniel P Gomez  writes:

> I've amended the commit including the changes you've mentioned.

Thank you.

> I did not change the following, though:
>
> (numberp (string-to-int padlines)) -> (string-match-p "\\`[0-9]+\\'" padlines)
>
> because that changed the behaviour of org-babel-tangle. Having a
> string-match-p as a
> match condition broke the default of adding no padlines in the
> first tangled SRC block (when passed with no arguments).

I don't understand this. `string-to-int' and `string-match-p' both have
the same requirements about parameters type, don't they?

> I also noticed that adding this functionality to ob-tangle breaks eldoc
> for me. I guess all org babel header arguments have to be strings?

Probably.


Regards,

-- 
Nicolas Goaziou



Re: [O] evil-mode and org

2017-03-30 Thread Eric S Fraga
On Tuesday, 28 Mar 2017 at 12:57, Matt Price wrote:
> I've never used Vim but I see a lot of people online raving about evil
> mode and how much they love it. I'm considering giving it a whirl
> after the semester ends & I get some free time. I just wondered
> whether any heavy org users here on the list use evil, and if so,
> whether you see pain points within org-mode -- my setup is pretty
> heavily customized, for instance, and I wonder whether that means it
> will be quite painful to use evil.

I use evil and org all day long.  Basically, there is very little clash
between them so they co-exist very nicely.  One of the best things about
evil is that it is almost orthogonal to emacs and you can continue using
most C-x and C-c keymap bindings.

In my case, I did add a number of bindings to evil's normal and motion
keymaps to avoid typing C-c etc. as my motivation in using evil is to
avoid exacerbating my RSI.  Almost all my commands are non-chorded key
sequences.  I barely use the control, shift and meta keys in normal
use.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.1.1, Org release_9.0.5-391-g36c7cf


signature.asc
Description: PGP signature


Re: [O] evil-mode and org

2017-03-30 Thread Guido Van Hoecke
Eric,

Care to share your org-evil mappings?

One 'conflict' which bites me every time is this:

I hit /blabla to locate a heading directly under which I want to insert a
text line.

I then hit enter to acknowledge the find.

The display shows the heading line followed by its body lines (which all
start with a hyphen)

I then hit o to insert a line directly under the heading and before the
first existing detail line.

The result is however that the heading body closes, and that a line is
added before the next header line, so under all existing detail lines of
this header line.

This undesired behavior only happens if the heading was closed at the time
of the find. If the find locates an open heading, hitting enter and than o
behaves as expected.

Any suggestions on how this can be fixed would be most welcome :)

TIA,

Guido

On 29 March 2017 at 17:11, Eric S Fraga  wrote:

> On Tuesday, 28 Mar 2017 at 12:57, Matt Price wrote:
> > I've never used Vim but I see a lot of people online raving about evil
> > mode and how much they love it. I'm considering giving it a whirl
> > after the semester ends & I get some free time. I just wondered
> > whether any heavy org users here on the list use evil, and if so,
> > whether you see pain points within org-mode -- my setup is pretty
> > heavily customized, for instance, and I wonder whether that means it
> > will be quite painful to use evil.
>
> I use evil and org all day long.  Basically, there is very little clash
> between them so they co-exist very nicely.  One of the best things about
> evil is that it is almost orthogonal to emacs and you can continue using
> most C-x and C-c keymap bindings.
>
> In my case, I did add a number of bindings to evil's normal and motion
> keymaps to avoid typing C-c etc. as my motivation in using evil is to
> avoid exacerbating my RSI.  Almost all my commands are non-chorded key
> sequences.  I barely use the control, shift and meta keys in normal
> use.
>
> --
> : Eric S Fraga (0xFFFCF67D), Emacs 25.1.1, Org release_9.0.5-391-g36c7cf
>


Re: [O] [PATCH] ob-sql: Add vertica engine

2017-03-30 Thread Nicolas Goaziou
Hello,

Andreas Gerler  writes:

> * lisp/ob-sql.el (org-babel-sql-dbstring-vertica): New function.
> (org-babel-execute:sql): Add `vertica' engine.

Thank you.

If you haven't signed FSF papers yet, could you add TINYCHANGE at the
end of the commit message?

Also, would you mind providing an entry in ORG-NEWS file?

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: startup latexpreview [9.0.5 (9.0.5-elpa @ /gnu/store/...-emacs-org-20170210/share/emacs/site-lisp/guix.d/org-20170210/)]

2017-03-30 Thread Nicolas Goaziou
Hello,

Diego Nicola Barbato
 writes:

> Hello,
>
> When opening an org-file in emacs which contains the in-buffer setting
>
> "#+STARTUP: latexpreview"
>
> the minibuffer displays
>
> "Creating images for section...done"
>
> instead of
>
> "Creating images for buffer...done"
>
> and the LaTeX fragments in the buffer are not converted to
> images.

Fixed. Thank you for the report and the analysis.

Regards,

-- 
Nicolas Goaziou



Re: [O] [BUG] org-link-search fails if search string contains new lines

2017-03-30 Thread Nicolas Goaziou
Hello,

Skip Collins  writes:

> Test test-org/fuzzy-links backtrace:
>   (if (unwind-protect (setq value-10839 (let ((file (make-temp-file "o
>   (let (form-description-10840) (if (unwind-protect (setq value-10839
>   (let ((value-10839 (cl-gensym "ert-form-evaluation-aborted-"))) (let
>   (lambda nil (let ((value-10802 (cl-gensym "ert-form-evaluation-abort
>   ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struc
>   ert-run-test([cl-struct-ert-test test-org/fuzzy-links "Test fuzzy li
>   ert-run-or-rerun-test([cl-struct-ert--stats "\\(org\\|ob\\)" [[cl-st
>   ert-run-tests("\\(org\\|ob\\)" #[385 "\306\307\"\203G\211\211G\310
>   ert-run-tests-batch("\\(org\\|ob\\)")
>   ert-run-tests-batch-and-exit("\\(org\\|ob\\)")
>   (let ((org-id-track-globally t) (org-test-selector (if org-test-sele
>   org-test-run-batch-tests("\\(org\\|ob\\)")
>   eval((org-test-run-batch-tests org-test-select-re))
>   command-line-1(("--eval" "(setq vc-handled-backends nil org-startup-
>   command-line()
>   normal-top-level()
> Test test-org/fuzzy-links condition:
> (ert-test-failed
>  ((should
>(org-test-with-temp-text-in-file "Paragraph
>
> line1
> line2
>
> "
> (let ... ... ... ... ... ...)))
>   :form
>   (let
>  ((file ...)
>   (kill-buffer-query-functions nil)
>   (inside-text ...)
>   G10838)
> (with-temp-file file
>  (insert inside-text))
> (find-file file)
> (org-mode)
> (setq G10838
>  (progn ...))
> (save-buffer)
> (kill-buffer
> (current-buffer))
> (delete-file file)
> G10838)
>   :value nil))
>FAILED  656/718  test-org/fuzzy-links

Thank you. Unfortunately, there is not much to do with this. Could you
do some debugging when running the faulty test? It may come from
something in your configuration.

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] ob-sql: Add vertica engine

2017-03-30 Thread Andreas Gerler
Hi Nicolas,

actually I send my request to FSF after sending the patch. So I guess it's 
easier to ignore the patch until I finished signing the papers. I have another 
change sitting currently in my config.

So long 

Andy

> On 30. Mar 2017, at 12:44 PM, Nicolas Goaziou  wrote:
> 
> Hello,
> 
> Andreas Gerler  writes:
> 
>> * lisp/ob-sql.el (org-babel-sql-dbstring-vertica): New function.
>> (org-babel-execute:sql): Add `vertica' engine.
> 
> Thank you.
> 
> If you haven't signed FSF papers yet, could you add TINYCHANGE at the
> end of the commit message?
> 
> Also, would you mind providing an entry in ORG-NEWS file?
> 
> Regards,
> 
> -- 
> Nicolas Goaziou
> 




Re: [O] evil-mode and org

2017-03-30 Thread Guido Van Hoecke
Eric,

You already mentioned your mappings in
http://lists.gnu.org/archive/html/emacs-orgmode/2012-05/msg00153.html
Thanks!

Finally got myself to write a little lisp to solve my problem and mapped it
to go

For what it's worth, here it is (but it solves a very specific problem):

  (defun guivho-insert-topic-under-heading()
"Expand heading and insert hyphen and inactive timestamp.
  Cursor is expected to be in an org header line"
(interactive)
(let ((sp " ")
  (hyphen "-"))
  (org-end-of-line)
  (evil-append 1)
  (org-return)
  (insert hyphen sp)
  (org-time-stamp nil t)
  (insert sp)
  (evil-force-normal-state)
  (evil-append 0)))

This now always inserts a 'dash space timestamp space' line immediately
under the current org header, whether it was collapsed or not.

Hey, it's not beautiful, but it solves my problem :)

And, to whom it may concern, org and evil make a nice combo :)

Guido


On 30 March 2017 at 12:14, Guido Van Hoecke  wrote:

>
>
> Eric,
>
> Care to share your org-evil mappings?
>
> One 'conflict' which bites me every time is this:
>
> I hit /blabla to locate a heading directly under which I want to insert a
> text line.
>
> I then hit enter to acknowledge the find.
>
> The display shows the heading line followed by its body lines (which all
> start with a hyphen)
>
> I then hit o to insert a line directly under the heading and before the
> first existing detail line.
>
> The result is however that the heading body closes, and that a line is
> added before the next header line, so under all existing detail lines of
> this header line.
>
> This undesired behavior only happens if the heading was closed at the time
> of the find. If the find locates an open heading, hitting enter and than o
> behaves as expected.
>
> Any suggestions on how this can be fixed would be most welcome :)
>
> TIA,
>
> Guido
>
> On 29 March 2017 at 17:11, Eric S Fraga  wrote:
>
>> On Tuesday, 28 Mar 2017 at 12:57, Matt Price wrote:
>> > I've never used Vim but I see a lot of people online raving about evil
>> > mode and how much they love it. I'm considering giving it a whirl
>> > after the semester ends & I get some free time. I just wondered
>> > whether any heavy org users here on the list use evil, and if so,
>> > whether you see pain points within org-mode -- my setup is pretty
>> > heavily customized, for instance, and I wonder whether that means it
>> > will be quite painful to use evil.
>>
>> I use evil and org all day long.  Basically, there is very little clash
>> between them so they co-exist very nicely.  One of the best things about
>> evil is that it is almost orthogonal to emacs and you can continue using
>> most C-x and C-c keymap bindings.
>>
>> In my case, I did add a number of bindings to evil's normal and motion
>> keymaps to avoid typing C-c etc. as my motivation in using evil is to
>> avoid exacerbating my RSI.  Almost all my commands are non-chorded key
>> sequences.  I barely use the control, shift and meta keys in normal
>> use.
>>
>> --
>> : Eric S Fraga (0xFFFCF67D), Emacs 25.1.1, Org release_9.0.5-391-g36c7cf
>>
>
>


[O] Using org-export-get-reference for strings

2017-03-30 Thread Mark Meyer
Hi list,
In ox-epub I'm using several references to external stylesheets,
starting with the external name in the user filesystem I transform
these into a kind-of unique id that lives in the EPUB zip file.

Currently I'm doing this using a counter, generating zip entries in the
form of style-1.css. Can I use `org-export-get-reference' to generate
these ids? I would likely pass a simple string as the object to get a
reference to (the path the external stylesheet lives at).

>From what I understand this would generate different references for
`foobar.css' and `../foobar.css' even when these are identical
documents. This should be fixed by passing `(expand-file-name style)' to
`org-export-get-reference'.

I'm not quite sure I understand `org-export-get-reference' correctly,
can you elucidate this?

Cheers, Mark
-- 
   Mark Meyer
   m...@ofosos.org



[O] Bug: org-indent-mode with visual-line-mode breaks C-a and C-e

2017-03-30 Thread Thibault Polge

* Summary

With visual-line-mode and org-indent-mode activated, C-a and C-e
misbehaves on indented text blocks.  C-a and C-e sometimes start jumping
over lines (ie, go backwards or forward one extra line) and sometimes
even reverses direction (C-e goes backward). I can reproduce this from
emacs -Q with builtin Org 8.2.10. The issue can also be reproduced
without enabling org-indent-mode, although it is much less severe
without it.

* Steps to reproduce

>From emacs -Q:

 1. Open the attached document, or create a new org-mode file with an
heading and a (preferably long) paragraph or text under it.
 2. Enable visual-line-mode and org-indent-mode
 3. Reduce Emacs frame width.
 4. With text-scale-mode or (set-frame-parameter), seriously increase
the font size (if it can't display more than two or three words per
line, that's perfect).
 5. Go to the last character of the huge paragraph.
 6. Start playing with C-a and C-e.  The cursor will wander erratically
within the paragraph, often in the wrong direction.

Notice: setting the frame width, the font size and going to the end of
the document is not strictly required, as the bug will appear sooner or
later, but in my tests it made it appear much faster, in a matter of
seconds.]

I'm using Emacs 25.2rc2 with org 9.0.5 from ELPA, but have been
experiencing this since Emacs 24.5 and the built-in Org (8.x I believe).
I can reproduce under the same conditions with the built-in org of Emacs
25.2rc2 as well.

Thanks a lot for your help,
Thibault

* This will break

On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains.


Re: [O] Table formula references

2017-03-30 Thread Eric S Fraga
I thought the following would work but org seems to reorder the vector:

  | t | y_t |  0.9^t | y_{t+1} |
  |---+-++-|
  | 1 | 115 |0.9 | 0.9 |
  | 2 | 121 |   0.81 |2.52 |
  | 3 | 118 |  0.729 |   4.707 |
  | 4 | 127 | 0.6561 |  7.3314 |
  #+TBLFM: $3=0.9^$1::$4=(@2$3..@0$3)*(@0$1..@2$1)

but maybe this will point you somewhere useful...

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.1.1, Org release_9.0.5-391-g36c7cf


signature.asc
Description: PGP signature


Re: [O] How can footnotes be exported at the end of an artile in latex?

2017-03-30 Thread Eric S Fraga
On Wednesday, 29 Mar 2017 at 15:16, Nick Dokos wrote:
> mgcyung  writes:

[...]

> They are then called "endnotes". You might want to google for that.
> And it might be as simple as
>
> #+LATEX_HEADER: \usepackage{endnotes}

You'll need to add

#+latex_header: \let\footnote\endnote

somewhere and also

#+latex: \theendnotes

at the place you want the end notes to appear.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.1.1, Org release_9.0.5-391-g36c7cf


signature.asc
Description: PGP signature


Re: [O] Bug: org-goto not work with ido completion [9.0.5 (9.0.5-elpa @ /Users/lluvio/.emacs.d/elpa/org-20170210/)]

2017-03-30 Thread Marco Wahl
Mr Lluvio  writes:

> Remember to cover the basics, that is, what you expected to happen and
> what in fact did happen.  You don't know how to make a good report?  See
>
>  http://orgmode.org/manual/Feedback.html#Feedback
>
> Your bug report will be posted to the Org mailing list.
> 
>
> org-goto with ido work on 8.2.10
>
>   (ido-mode 1)
>   (setq ido-enable-flex-matching t)
>   (setq ido-everywhere t)
>
>   (setq org-outline-path-complete-in-steps nil 
> org-goto-interface 'outline-path-completion
>
>
>
> Emacs  : GNU Emacs 25.1.1 (x86_64-apple-darwin16.4.0, NS appkit-1504.81 
> Version 10.12.3 (Build 16D32))
> of 2017-03-01
> Package: Org mode version 9.0.5 (9.0.5-elpa @ 
> /Users/lluvio/.emacs.d/elpa/org-20170210/)

When I evaluate

(ido-mode 1)
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
(setq org-outline-path-complete-in-steps nil 
  org-goto-interface 'outline-path-completion)

and do

M-x org-goto 

in an org buffer `org-goto' does its job AFAICT.

I noticed that package 'hyperbole' changes the effect of org-goto
considerably.  See the hooks of `with-output-to-temp-buffer'.


HTH
   Marco




[O] Reporting org-babel bug for java

2017-03-30 Thread santorini lysias
Hello,

I've never used a mailing list before, so bear with me if I'm not "doing
this right."

I found behavior that I think is a bug and not a feature. This is for
org-babel Java.

The content below the equals signs, below, comprise an org-mode file that I
will refer to in order to report the behavior that is the topic of this
post. Two Java jars are referenced in the classpaths and are needed in
order to run the code. They can be obtained from the Junit download page.

This code basically runs a Junit test. The concern I have is with this line:

#+begin_src java :classname ParameterizedTest :cmpflag "-cp
~/Linux/rep/junit-4.12.jar:~/Linux/rep/hamcrest-core-1.3.jar:." :cmdline
"-cp ~/Linux/rep/junit-4.12.jar:~/Linux/rep/hamcrest-core-1.3.jar:."

If I press C-c C-c on this block of code, it runs fine. However, if the
string after :cmpflag is written as "-cp
.:~/Linux/rep/junit-4.12.jar:~/Linux/rep/hamcrest-core-1.3.jar" the
compilation of this Java class will fail because the Junit jar cannot be
located!

This only happens because I change the order of the jars as they appear in
the classpath. This is not a Java problem, since the order of items in the
classpath should not change Java behavior. I have to conclude there is
something happening in the org-babel code that is causing this.


Org-mode file below
=
* calculator
#+begin_src java :classname Calculator :cmpflag "-cp ." :cmdline "-cp ."
public class Calculator{
  public double add(double number1, double number2){
return number1+number2;
  }
}
#+end_src
* parameterized test
#+begin_src java :classname ParameterizedTest :cmpflag "-cp
~/Linux/rep/junit-4.12.jar:~/Linux/rep/hamcrest-core-1.3.jar:." :cmdline
"-cp ~/Linux/rep/junit-4.12.jar:~/Linux/rep/hamcrest-core-1.3.jar:."
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import java.util.Arrays;
import java.util.Collection;

@RunWith(value=Parameterized.class)
public class ParameterizedTest{
  private double expected;
  private double valueOne;
  private double valueTwo;

  @Parameters
  public static Collection getTestParameters(){
return Arrays.asList(new Integer[][]{
{2, 1, 1},
{3, 2, 1},
{4, 3, 1},
  });
  }

  public ParameterizedTest(double expected, double valueOne, double
valueTwo){
this.expected = expected;
this.valueOne = valueOne;
this.valueTwo = valueTwo;
  }

  @Test
  public void sum(){
Calculator calc = new Calculator();
assertEquals(expected, calc.add(valueOne, valueTwo), 0);
  }
}
#+end_src
* run test
#+begin_src sh :results verbatim
java -cp
.:/home/ahan/Linux/rep/junit-4.12.jar:/home/ahan/Linux/rep/hamcrest-core-1.3.jar:
org.junit.runner.JUnitCore ParameterizedTest
#+end_src

#+RESULTS:
: JUnit version 4.12
: ...
: Time: 0.007
:
: OK (3 tests)
:


Re: [O] evil-mode and org

2017-03-30 Thread Eric S Fraga
On Thursday, 30 Mar 2017 at 10:14, Guido Van Hoecke wrote:
> Eric,
>
> Care to share your org-evil mappings?

sure:

#+begin_src emacs-lisp
  (defun esf/evil-key-bindings-for-org ()
;;(message "Defining evil key bindings for org")
(when (fboundp 'evil-declare-key)
  ;; normal, motion and visual commands
  (mapcar (lambda (state)
(evil-declare-key state org-mode-map
  "  " 'evil-scroll-down
  " e" 'org-edit-special
  " g" 'org-babel-goto-named-src-block
  " j" 'org-babel-next-src-block
  " k" 'org-babel-previous-src-block
  " l" 'org-next-link
  " n" 'org-babel-next-src-block
  " p" 'org-babel-previous-src-block
  " u" 'outline-up-heading
  "gh" 'outline-up-heading
  "gj" 'org-forward-heading-same-level
  "gk" 'org-backward-heading-same-level
  "gl" 'outline-next-visible-heading
  "t" 'org-todo ; mark a TODO item as DONE
  ",e" 'org-export-dispatch
  ",i" 'org-inlinetask-insert-task
  ",l" 'org-insert-link
  ",L" 'org-store-link
  ",n" 'outline-next-visible-heading
  ",oa" #'org-annotate-add-note
  ",od" #'org-annotate-display-notes
  ",p" 'outline-previous-visible-heading
  ",r" 'org-ref-insert-cite-link
  ;; ",t" 'org-set-tags-command
  ",u" 'outline-up-heading
  "$" 'org-end-of-line ; smarter behaviour on headlines etc.
  "^" 'org-beginning-of-line ; ditto
  "-" 'org-ctrl-c-minus ; change bullet style
  "<" 'org-metaleft ; out-dent
  ">" 'org-metaright ; indent
  (kbd "M-l") 'org-metaright
  (kbd "M-h") 'org-metaleft
  (kbd "M-k") 'org-metaup
  (kbd "M-j") 'org-metadown
  (kbd "M-L") 'org-shiftmetaright
  (kbd "M-H") 'org-shiftmetaleft
  (kbd "M-K") 'org-shiftmetaup
  (kbd "M-J") 'org-shiftmetadown))
  '(normal motion visual))
  ;; and these are only for motion and visual so that . does not repeat them
  (mapcar (lambda (state)
(evil-declare-key state org-mode-map
  "H" 'org-beginning-of-line ; smarter behaviour on headlines 
etc.
  ;; "L" 'end-of-line ; do not want "smarter" behaviour on 
headlines etc.
  "L" 'org-end-of-line ; do not want "smarter" behaviour on 
headlines etc.
  ))
  '(motion visual))
  (evil-declare-key 'insert org-mode-map
(kbd "") 'hungry-delete-backward  
(kbd "M-l") 'org-metaright
(kbd "M-h") 'org-metaleft
(kbd "M-k") 'org-metaup
(kbd "M-j") 'org-metadown
(kbd "M-L") 'org-shiftmetaright
(kbd "M-H") 'org-shiftmetaleft
(kbd "M-K") 'org-shiftmetaup
(kbd "M-J") 'org-shiftmetadown)
  (when (not esf/pandora-p)
(evil-declare-key 'insert org-mode-map
  (kbd "") 'hungry-delete-backward
#+end_src

> One 'conflict' which bites me every time is this:

I cannot help with this unfortunately other than to maybe trying to
advise the search function...

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.1.1, Org release_9.0.5-391-g36c7cf


signature.asc
Description: PGP signature


Re: [O] [PATCH] ob-sql: Add vertica engine

2017-03-30 Thread Nicolas Goaziou
Hello,

Andreas Gerler  writes:

> actually I send my request to FSF after sending the patch.

Great.

> So I guess it's easier to ignore the patch until I finished signing
> the papers.

It's up to you. I can also apply the patch with the TINYCHANGE cookie
(and the ORG-NEWS entry).

> I have another change sitting currently in my config.

OK.

Thank you.

Regards,

-- 
Nicolas Goaziou0x80A93738