Re: [O] [bug, org] footnote-action broken with narrowed buffer

2015-04-25 Thread Rasmus
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 In any case, how about some of these alternative approaches to the issue
 of handling footnotes from a narrowed buffer.

1. Retrieve the footnote in the minibuffer.  E.g. org-footnote-action
   shows the footnote-definition if it is outside of the narrow (and
   known) in the minibuffer?  E.g. 2. when using prefix.

 I suggested it already in this thread, i.e., if the definition is
 outside the narrowed part of the buffer, offer to widen and jump to it,
 or display the definition, or do nothing.

The problem is that narrow can be time-consuming to recreate.  Consider
this narrow where I have to edit fn:1

* top
** h1
** h2
*** h3
Txtpoint[fn:1]

To recreate the narrow I have to go to *top, narrow to the subtree,
potentially collapse *h{1,2}...

 Actually, displaying the definition could be a separate binding (e.g.,
 C-u C-c C-c), since it could be useful even outside this case.

2. Show the definition in the minibuffer as editable text (read input)
   and update it if necessary.

 Then you have to deal with out of sync buffers, closed buffers,.. 

Wouldn't it only find definition in the same file?  If you use a popup
indirect buffer narrowed to the footnote-definition in question I don't
think these problems can exist.  In any case, this would seem similar to
the way ob handles code blocks.

 I'm pretty sure that in this situation, the user is able to widen the
 buffer himself and then jump to the definition in order to edit it. This
 would be a lot of trouble for a debatable benefit.

Sure, but recreating your narrow takes time.  And it's annoying when you
want to review a section, say.

—Rasmus

-- 
And I faced endless streams of vendor-approved Ikea furniture. . .




Re: [O] Source code evaluation problem

2015-04-25 Thread Eric S Fraga
On Saturday, 25 Apr 2015 at 15:47, Damian Bernardini wrote:
 I'm trying to use ledger blocks inside org with babel:

[...]

 I'm trying the noweb example from:
 http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ledger.html

 I can evaluate and get results from income and expenses blocks, but when I
 try to run C-c C-c on balance block I get:
 Symbol's function definition is void: org-id-find-id-file

What version of org are you using?  How are you loading org?

The error message you get is rather suspicious and makes me think you
might have an installation of org that is possibly a mix of old and new.
That function is in org-id.el which is required by org-attach which
itself is required by org...

What is the output of M-x find-library RET org RET?

Finally, maybe prepare a minimal example and post it to this list.  I
use ledger in org all the time and it works fine.  
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-1062-gce4e64



Re: [O] Source code evaluation problem

2015-04-25 Thread Eric S Fraga
On Saturday, 25 Apr 2015 at 17:55, Damian Bernardini wrote:
 You were right.
 If I do M-x org-version it says:
 Org-mode version 8.3beta (release_8.3beta-1062-gce4e64-git @ mixed
 installation! /usr/share/emacs/24.5/lisp/org/ and
 /home/damian/git/org-mode/lisp/)

 I've downloaded org from git and loaded it with:
 (add-to-list 'load-path ~/git/org-mode/lisp)
 (add-to-list 'load-path ~/git/org-mode/contrib/lisp)

which is what I have:

  (add-to-list 'load-path ~/git/org-mode/lisp)
  (add-to-list 'load-path ~/git/org-mode/contrib/lisp/)
  (require 'org)

Maybe you have something earlier in your initialisation that brings in
the old version?  Have you done make in your ~/git/org-mode directory?

What happens if you start emacs with -Q, execute the lines above
and then visit your ledger org file?

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-1062-gce4e64



Re: [O] Source code evaluation problem

2015-04-25 Thread Damian Bernardini
After a reinstallation I forgot to do make autoloads.
Now, it's working perfectly.
It was my mistake, sorry and thank you for your help.

2015-04-25 18:26 GMT+00:00 Eric S Fraga e.fr...@ucl.ac.uk:

 On Saturday, 25 Apr 2015 at 17:55, Damian Bernardini wrote:
  You were right.
  If I do M-x org-version it says:
  Org-mode version 8.3beta (release_8.3beta-1062-gce4e64-git @ mixed
  installation! /usr/share/emacs/24.5/lisp/org/ and
  /home/damian/git/org-mode/lisp/)
 
  I've downloaded org from git and loaded it with:
  (add-to-list 'load-path ~/git/org-mode/lisp)
  (add-to-list 'load-path ~/git/org-mode/contrib/lisp)

 which is what I have:

   (add-to-list 'load-path ~/git/org-mode/lisp)
   (add-to-list 'load-path ~/git/org-mode/contrib/lisp/)
   (require 'org)

 Maybe you have something earlier in your initialisation that brings in
 the old version?  Have you done make in your ~/git/org-mode directory?

 What happens if you start emacs with -Q, execute the lines above
 and then visit your ledger org file?

 --
 : Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org
 release_8.3beta-1062-gce4e64



Re: [O] Source code evaluation problem

2015-04-25 Thread Bob Newell
On Sat, Apr 25, 2015 at 5:47 AM, Damian Bernardini
damian.bernard...@gmail.com wrote:
 I'm trying to use ledger blocks inside org with babel:
snip
 I can evaluate and get results from income and expenses blocks, but when I
 try to run C-c C-c on balance block I get:
 Symbol's function definition is void: org-id-find-id-file

I have no problem doing a balance report.

My transactions sit in a block like this:

#+name: hcfgeneralledger :noweb yes
#+begin_src ledger
... etc
... etc
#+end_src

And then I use this to get the balance report. C-c C-c on the line
hcfgeneralldeger, for instance.

#+name: balance
#+begin_src ledger :cmdline -s bal :noweb yes
hcfgeneralledger
#+end_src


-- 
Bob Newell
Honolulu, Hawai`i

Sent via Linux Mint 17.



Re: [O] Visibility cycling at end of headline

2015-04-25 Thread Nicolas Goaziou
Charles C. Berry ccbe...@ucsd.edu writes:

 Done.

Thank you.

Regards,



Re: [O] Source code evaluation problem

2015-04-25 Thread Damian Bernardini
You were right.
If I do M-x org-version it says:
Org-mode version 8.3beta (release_8.3beta-1062-gce4e64-git @ mixed
installation! /usr/share/emacs/24.5/lisp/org/ and
/home/damian/git/org-mode/lisp/)

I've downloaded org from git and loaded it with:
(add-to-list 'load-path ~/git/org-mode/lisp)
(add-to-list 'load-path ~/git/org-mode/contrib/lisp)

How can I tell emacs to not load the /usr/share/emacs/24.5/lisp/org package?

2015-04-25 17:35 GMT+00:00 Eric S Fraga e.fr...@ucl.ac.uk:

 On Saturday, 25 Apr 2015 at 15:47, Damian Bernardini wrote:
  I'm trying to use ledger blocks inside org with babel:

 [...]

  I'm trying the noweb example from:
  http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ledger.html
 
  I can evaluate and get results from income and expenses blocks, but when
 I
  try to run C-c C-c on balance block I get:
  Symbol's function definition is void: org-id-find-id-file

 What version of org are you using?  How are you loading org?

 The error message you get is rather suspicious and makes me think you
 might have an installation of org that is possibly a mix of old and new.
 That function is in org-id.el which is required by org-attach which
 itself is required by org...

 What is the output of M-x find-library RET org RET?

 Finally, maybe prepare a minimal example and post it to this list.  I
 use ledger in org all the time and it works fine.
 --
 : Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org
 release_8.3beta-1062-gce4e64



Re: [O] Visibility cycling at end of headline

2015-04-25 Thread Charles C. Berry

On Sat, 25 Apr 2015, Nicolas Goaziou wrote:


Hello,

Charles C. Berry ccbe...@ucsd.edu writes:


This change in org-cycle line 131 seems to have the desired effect:



[snip]


It should work indeed. Can you wrap it into an appropriate patch and
commit it?

Regards,

--
Nicolas Goaziou



Done.

Chuck



Re: [O] Visibility cycling at end of headline

2015-04-25 Thread Eric S Fraga
On Friday, 24 Apr 2015 at 10:37, Charles C. Berry wrote:

[...]

 This change in org-cycle line 131 seems to have the desired effect:

Looks good.  Thanks!

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-1062-gce4e64



Re: [O] Marking/highlighting text temporarily

2015-04-25 Thread Eric Abrahamsen
Eric Abrahamsen e...@ericabrahamsen.net writes:

 Vikas Rawal vikasli...@agrarianresearch.org writes:

 On 25-Apr-2015, at 6:22 am, John Kitchin jkitc...@andrew.cmu.edu
 wrote:

 Inspired by this conversation, I hacked up this functional comment
 link:

 
 http://kitchingroup.cheme.cmu.edu/blog/2015/04/24/Commenting-in-org-files/
 

 It has a custom link type that exports in html and latex, and when
 you click on it, it asks if you want to delete the comment. 

 Nice. One small issue is that when I highlight a text and add comment
 to it, and then delete the comment, one space following the last word
 is removed.

 Also, it would be good to make the comment stand out in LaTeX (and
 other) exports, preferably by pushing it to the margin (so it does not
 move everything else).

 Hang on a bit, I'm wasting my afternoon expanding this...

Okay, this is as far as I got today. I changed some behavior from John's
implementation: when following the links, it seemed like displaying the
comment text would be more useful than deleting it -- I think many of us
have delete-org-link functions lying around. I also couldn't get the
add-comment thing to work, as it complained when there was no region, so
I changed how that works.

Lastly, I spent most of my time learning how tabular list mode works,
and haven't actually tested the export. Will save that for tomorrow.
Otherwise, here's the introduction from the Commentary. Comments and
suggestions very welcome!



Provides a new link type for Org that allows you to create comments
on arbitrary chunks of text.  The link prefix is comment:.

Add comments with `org-comment-add-comment'.  Following the link
will display the text of the comment in a pop-up buffer.  The
buffer is in special-mode, hit q to dismiss it.

Call `org-comment-display-comments' to see all comments in a buffer.

See the `org-comment-[backend]-export-style' options for ways to
format comments in export.

TODO:

1. Better export customization options.
2. What does the ODT comment XML look like?
3. More functions in the display comment buffer: copy as
kill... what else?
4. More functions in the comments list buffer, to display, pop to,
delete, and edit comment text.
5. Is it possible to have multi-line filled tabular list items?
Long comments are not very useful if you can't see the whole thing.
5. Allow multiple comment list buffers attached to different Org
buffers.
6. Maybe a minor mode for ease of manipulating comments?




org-comment.el
Description: application/emacs-lisp


Re: [O] [bug, ox-latex] footnotes with math in narrowed buffer

2015-04-25 Thread Nicolas Goaziou
Rasmus ras...@gmx.us writes:

 Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 `org-html--build-mathjax-config' needs to check, in addition to parse
 tree, cdr of all associations in (plist-get
 info :footnote-definition-alist), and values of all parsed keywords.

 It seems you did not do this.  I will add this over the weekend.

Actually, it isn't a very good idea because we cannot assume all parsed
keywords and all footnote definitions will actually be used to create
the document. This can introduce false positives.

What about inserting a :with-mathjax option (default value
`org-html-with-mathjax'). If nil, no template, if t, template, if
`auto', current behaviour (i.e. template if some math snippet /in
body/)?

`auto' is a decent default value for `org-html-with-mathjax' and it can
be overridden per document with :with-mathjax.


Regards,



Re: [O] Marking/highlighting text temporarily

2015-04-25 Thread Eric S Fraga
John,

thanks for this.  Very nice.  And I can use my preferred LaTeX
annotation with it easily.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-1062-gce4e64



Re: [O] [bug, ox-latex] footnotes with math in narrowed buffer

2015-04-25 Thread Rasmus
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Rasmus ras...@gmx.us writes:

 Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 `org-html--build-mathjax-config' needs to check, in addition to parse
 tree, cdr of all associations in (plist-get
 info :footnote-definition-alist), and values of all parsed keywords.

 It seems you did not do this.  I will add this over the weekend.

 Actually, it isn't a very good idea because we cannot assume all parsed
 keywords and all footnote definitions will actually be used to create
 the document. This can introduce false positives.

OK.

 What about inserting a :with-mathjax option (default value
 `org-html-with-mathjax'). If nil, no template, if t, template, if
 `auto', current behafviour (i.e. template if some math snippet /in
 body/)?

OK.

 `auto' is a decent default value for `org-html-with-mathjax' and it can
 be overridden per document with :with-mathjax.

I guess the example I showed is a limitation that we can live with.  Also
it's pretty unlikely that you /only/ have math in footnotes.

—Rasmus

-- 
With monopolies the cake is a lie!



Re: [O] Visibility cycling at end of headline

2015-04-25 Thread Nicolas Goaziou
Hello,

Charles C. Berry ccbe...@ucsd.edu writes:

 This change in org-cycle line 131 seems to have the desired effect:

 --- 128,134  Original

  ;; At an item/headline: delegate to `org-cycle-internal-local'.
  ((and (or (and org-cycle-include-plain-lists (org-at-item-p))
 !  (save-excursion (beginning-of-line 1)
(looking-at org-outline-regexp)))
(or (bolp) (not (eq org-cycle-emulate-tab 'exc-hl-bol
   (org-cycle-internal-local))
 *** 128,134  NEW

  ;; At an item/headline: delegate to `org-cycle-internal-local'.
  ((and (or (and org-cycle-include-plain-lists (org-at-item-p))
 !  (save-excursion (move-beginning-of-line 1)
(looking-at org-outline-regexp)))
(or (bolp) (not (eq org-cycle-emulate-tab 'exc-hl-bol
   (org-cycle-internal-local))

 Caveat: I've not run this thru make test.

It should work indeed. Can you wrap it into an appropriate patch and
commit it?

Regards,

-- 
Nicolas Goaziou



Re: [O] Marking/highlighting text temporarily

2015-04-25 Thread Eric Abrahamsen
Vikas Rawal vikasli...@agrarianresearch.org writes:

 On 25-Apr-2015, at 6:22 am, John Kitchin jkitc...@andrew.cmu.edu
 wrote:

 Inspired by this conversation, I hacked up this functional comment
 link:

 http://kitchingroup.cheme.cmu.edu/blog/2015/04/24/Commenting-in-org-files/
 

 It has a custom link type that exports in html and latex, and when
 you click on it, it asks if you want to delete the comment. 

 Nice. One small issue is that when I highlight a text and add comment
 to it, and then delete the comment, one space following the last word
 is removed.

 Also, it would be good to make the comment stand out in LaTeX (and
 other) exports, preferably by pushing it to the margin (so it does not
 move everything else).

Hang on a bit, I'm wasting my afternoon expanding this...

Eric




Re: [O] [bug, org] footnote-action broken with narrowed buffer

2015-04-25 Thread Nicolas Goaziou
Rasmus ras...@gmx.us writes:

 Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Point is moved, though.  If narrow shouldn't be broken then point
 shouldn't be moved.  I.e. no move when the definition is not within the
 buffer.

Fixed in 5954f6aa25b51a3a9a8f258fb0f15ef51be31366. Thank you.

 Outside of the most trivial case (i.e., jump back and forth between the
 definition and one of its references) it sounds like it would quickly
 get in the way.

 It would only work for the most trivial case I guess.

This is why it is not worth implementing.


Regards,



Re: [O] [bug, org] footnote-action broken with narrowed buffer

2015-04-25 Thread Rasmus
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Rasmus ras...@gmx.us writes:

 Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Point is moved, though.  If narrow shouldn't be broken then point
 shouldn't be moved.  I.e. no move when the definition is not within the
 buffer.

 Fixed in 5954f6aa25b51a3a9a8f258fb0f15ef51be31366. Thank you.

 Outside of the most trivial case (i.e., jump back and forth between the
 definition and one of its references) it sounds like it would quickly
 get in the way.

 It would only work for the most trivial case I guess.

 This is why it is not worth implementing.

If it covers x%, for x large, of the realized usecases when working with a
narrowed buffer it's still worth it.

In any case, how about some of these alternative approaches to the issue
of handling footnotes from a narrowed buffer.

   1. Retrieve the footnote in the minibuffer.  E.g. org-footnote-action
  shows the footnote-definition if it is outside of the narrow (and
  known) in the minibuffer?  E.g. 2. when using prefix.
   2. Show the definition in the minibuffer as editable text (read input)
  and update it if necessary.
   3. A way to quickly get back to the previous narrow (this should
  probably be an Emacs-core feature).

—Rasmus

-- 
Enough with the bla bla!



Re: [O] [bug, org] footnote-action broken with narrowed buffer

2015-04-25 Thread Rasmus
Rasmus ras...@gmx.us writes:

1. Retrieve the footnote in the minibuffer.  E.g. org-footnote-action
   shows the footnote-definition if it is outside of the narrow (and
   known) in the minibuffer?  E.g. 2. when using prefix.
2. Show the definition in the minibuffer as editable text (read input)
   and update it if necessary.

1. and  2. should be combined and use a popup buffer a la capture since
footnotes can hold stuff like tables which probably do not go well the
minibuffer.  It would close with C-c C-c.

—Rasmus

-- 
Evidence suggests Snowden used a powerful tool called monospaced fonts



Re: [O] [bug, org] footnote-action broken with narrowed buffer

2015-04-25 Thread Nicolas Goaziou
Rasmus ras...@gmx.us writes:

 If it covers x%, for x large, of the realized usecases when working with a
 narrowed buffer it's still worth it.

Please do not mess with user's narrowing. There's no valid reason to do
this, no matter how large x is.

 In any case, how about some of these alternative approaches to the issue
 of handling footnotes from a narrowed buffer.

1. Retrieve the footnote in the minibuffer.  E.g. org-footnote-action
   shows the footnote-definition if it is outside of the narrow (and
   known) in the minibuffer?  E.g. 2. when using prefix.

I suggested it already in this thread, i.e., if the definition is
outside the narrowed part of the buffer, offer to widen and jump to it,
or display the definition, or do nothing.

Actually, displaying the definition could be a separate binding (e.g.,
C-u C-c C-c), since it could be useful even outside this case.

2. Show the definition in the minibuffer as editable text (read input)
   and update it if necessary.

Then you have to deal with out of sync buffers, closed buffers,.. 

I'm pretty sure that in this situation, the user is able to widen the
buffer himself and then jump to the definition in order to edit it. This
would be a lot of trouble for a debatable benefit.

3. A way to quickly get back to the previous narrow (this should
   probably be an Emacs-core feature).

It doesn't belong to Org to implement it anyway.


Regards,



[O] Source code evaluation problem

2015-04-25 Thread Damian Bernardini
I'm trying to use ledger blocks inside org with babel:

Babel language config:
(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)
   (emacs-lisp . t)
   (ledger . t)))

Ledger lisp path:
(autoload 'ledger-mode ledger-mode A major mode for Ledger t)
(add-to-list 'load-path
 (expand-file-name /home/damian/git/ledger/lisp/))
(add-to-list 'auto-mode-alist '(\\.ledger$ . ledger-mode))

I'm trying the noweb example from:
http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ledger.html

I can evaluate and get results from income and expenses blocks, but when I
try to run C-c C-c on balance block I get:
Symbol's function definition is void: org-id-find-id-file

Ledger mode and ledger from the command line are working.