[O] org-mode for swi-prolog and latex export ?

2014-07-20 Thread Joseph Vidal-Rosset
Hello the list,

Here is my question : is there a mean to use org-mode to export both the
prolog file (for example my-program.pl) and the documentation in .tex
(my-program.tex) ?

I see that there are solutions in swi-prolog but I have difficulties to
understand the documentation, and therefore I wonder if there is an
org-mode route.

I hope so.

In advance, many thanks

Jo.


Re: [O] org-mode for swi-prolog and latex export ?

2014-07-20 Thread Thorsten Jolitz
Joseph Vidal-Rosset joseph.vidal.ros...@gmail.com writes:

 Hello the list, 

 Here is my question : is there a mean to use org-mode to export both
 the prolog file (for example my-program.pl) and the documentation in .
 tex (my-program.tex) ? 

 I see that there are solutions in swi-prolog but I have difficulties
 to understand the documentation, and therefore I wonder if there is an
 org-mode route. 

I have not seen an ob-prolog.el yet, but maybe it does exist?  If so,
exporting both code and result of its execution would be:

,
| * My documentation
| 
| Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec
| hendrerit tempor tellus. Donec pretium posuere tellus. Proin quam
| nisl, tincidunt et, mattis eget, convallis nec, purus. Cum sociis
| natoque penatibus et magnis dis parturient montes, nascetur ridiculus
| mus. Nulla posuere. Donec vitae dolor. Nullam tristique diam non
| turpis. Cras placerat accumsan nulla. Nullam rutrum. Nam vestibulum
| accumsan nisl.
| 
| #+header: :exports both
| #+begin_src prolog
|  ( ... my-program ...)
| #+end_src
`

PS
Code and documentation text is always exported together, thats what
Org Babel is for, as long as you don't specify :exports none or so. 

-- 
cheers,
Thorsten




Re: [O] Bug: org-contacts show Non-existent agenda file ~/org/* virexit. [R]emove from list or [A]bort? when trying to find contacts with M-x org-contactsRET [8.2.7b (8.2.7b-dist @ c:/Users/Seam/A

2014-07-20 Thread Daimrod
seamw...@gmail.com writes:

 I put my captured contacts to ~/.orgmode/data/contact.org and I can
 successfully capture the contacts, however, when I eval the function
 org-contacts in org mode, it just shows the message in the title.

 if the contact file is empty, it does not show the message, but org-contacts
 show an empty match.

--
 org-contacts show Non-existent agenda file ~/org/* virexit. [R]emove
 from list or [A]bort? when trying to find contacts with M-x
 org-contactsRET [8.2.7b (8.2.7b-dist @
 c:/Users/Seam/AppData/Roaming/.emacs.d/orgmode/lisp/)]
--

It looks like you had added a file named '* virexit' to the agenda list,
but that file doesn't exist anymore.

`org-contacts' uses the agenda views to display contacts. I don't know
the internals of `org-agenda' very well but I guess that it checks for
agenda files even if the caller doesn't need them, hence the error.

I don't know (yet) if it's possible to disable this behavior, but in the
meantime you can remove the file from the agenda list.

Best,

-- 
Daimrod/Greg



[O] Bug: syntax highlighting of elisp:blahblah and shell:blablah [8.2.6 (8.2.6-67-g9e09b2-elpa @ c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140602/)]

2014-07-20 Thread Andrea Rossetti

Hi all,

  when I insert some text like elisp:sometext or shell:sometext
in an Org buffer, it becomes highlighted and clickable. On click,
a prompt asks for confirm to execute sometext.

  I get the same behaviour if I add tags to a headline, and one
of the tags is elisp or shell.

  I expected this behaviour when I create links with double square
brackets, but not in default text paragraphs, nor in the tags.
May I please ask for some feedback:

1) did I miss something, and this was expected (at least for default
   text paragraphs)?
2) is this reproducible for some of you as well?

  I attach here a small test case:

* my elisp tricks collection:elisp:andrea:tricks:

I like to write elisp:it is useful.
I seldow use shell:but it's useful as well

  Thanks in advance, kindest regards.

Andrea

Emacs  : GNU Emacs 24.3.1 (i386-mingw-nt6.1.7600) of 2013-03-17 on MARVIN
Package: Org-mode version 8.2.6 (8.2.6-67-g9e09b2-elpa @ 
c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140602/)


[O] Request to patch the =org-html-fontify-code= function in =ox-html.el=

2014-07-20 Thread Kaushal
Hi,

I have been using org for technical documentation and that involves
inserted code snippets.  The org to pdf export works great but I faced
issues when exporting to html.

After some digging around, I figured that having fci-mode enabled on a
LANG-mode-hook caused insertion of some strange unicode characters in the
html converted version.

Full details are in my reddit post here:
http://www.reddit.com/r/emacs/comments/2b5x5g/funny_characters_appended_at_new_line_to_source/

To fix this problem by adding the following code after the line (funcall
lang-mode) in the org-html-fontify-code defun in ox-html.el.

(when (require 'fill-column-indicator nil 'noerror)
(fci-mode -1))

Can this fix be integrated into ox-html.el?


Thanks.


--
Kaushal Modi


Re: [O] [BUG] in org-element (was Re: Replacing property-name hangs Emacs)

2014-07-20 Thread Nicolas Goaziou
Hello,

Thorsten Jolitz tjol...@gmail.com writes:

 Thorsten Jolitz tjol...@gmail.com writes:

 This turned out to be an Org-mode bug.

[...]

 Here is the recipe:

 1. emacs -Q

 2. M-x find-file instruments.org (content posted below)

 3. M-% resource_id RET name RET

 4. hit space quickly (- accept) until Emacs hangs (100pc CPU)

It should be fixed. Thank you for the report and the ECM.


Regards,

-- 
Nicolas Goaziou



Re: [O] [bug?, org-element] latex-environment delimiters must be at BOL

2014-07-20 Thread Nicolas Goaziou
Hello,

Rasmus ras...@gmx.us writes:

 I changed a couple of things,

A couple of things? AFAIU, it only requires to change the regexp in
`org-element-latex-environment-parser', doesn't it?

[...]

2. Load my modified org-element.el file and rerun tests.
   The only new fail is this one, that is to be expected to fail.

   (should-not
(eq 'latex-environment
(org-test-with-temp-text \\begin{env}{arg} 
 something\nvalue\n\\end{env}
  (org-element-type (org-element-at-point)

OK.

 Hence, my question is: Can I now assume that my modification are now
 somewhat safe wrt. the current Org syntax?

You should also add tests specifics to the new behaviour.

 I have a case that I worry a bit about, namely broken LaTeX code with
 mismatching no. of begin/end tags:

 Consider:

 #+begin_src org 
   \begin{equation} x^2_3
   \begin{equation} x^2_3 \end{equation}
 #+end_src

 With my patch, this will produce (*):

 #+begin_src latex
 \begin{equation} x^2_3
 \begin{equation} x^2_3 \end{equation}
 #+end_src latex

This looks correct.  It is a valid latex-environment element even
though it is not valid LaTeX syntax.

 I will write some tests and review the two documents you mention and
 submit a patch ASAP.

OK. Thank you for that.


Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: syntax highlighting of elisp:blahblah and shell:blablah [8.2.6 (8.2.6-67-g9e09b2-elpa @ c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140602/)]

2014-07-20 Thread Nick Dokos
Andrea Rossetti andrea.rosse...@gmail.com writes:

   when I insert some text like elisp:sometext or shell:sometext
 in an Org buffer, it becomes highlighted and clickable. On click,
 a prompt asks for confirm to execute sometext.

   I get the same behaviour if I add tags to a headline, and one
 of the tags is elisp or shell.

   I expected this behaviour when I create links with double square
 brackets, but not in default text paragraphs, nor in the tags.
 May I please ask for some feedback:

 1) did I miss something, and this was expected (at least for default
text paragraphs)?

I don't know whether it's expected (one of these years I really have
to sit down and learn the syntax).

 2) is this reproducible for some of you as well?


Yes.

   I attach here a small test case:

 * my elisp tricks collection:elisp:andrea:tricks:

 I like to write elisp:it is useful.
 I seldow use shell:but it's useful as well



Workarounds:

- in text, leave a space after the colon - that's standard practice
  anyway.

- in tags, put the `link' tag at the end:

  :andrea:tricks:elisp:

The latter doesn't help if you have two `link'-type tags, but it should cover
the majority of problematic cases.

-- 
Nick




Re: [O] Request to patch the =org-html-fontify-code= function in =ox-html.el=

2014-07-20 Thread Nick Dokos
Kaushal kaushal.m...@gmail.com writes:

 Full details are in my reddit post here:
 http://www.reddit.com/r/emacs/comments/2b5x5g/funny_characters_appended_at_new_line_to_source/



 To fix this problem by adding the following code after the
 line (funcall lang-mode) in the org-html-fontify-code defun
 in ox-html.el.

 (when (require 'fill-column-indicator nil 'noerror)
 (fci-mode -1))

 Can this fix be integrated into ox-html.el? 


Not really: the above would cause an error if fci-mode is
undefined. You'll have to add a bit more checking before
calling it - check out the doc for fboundp:

C-h f fboundp RET

-- 
Nick




[O] [PATCH] New user option for org-agenda-show-and-scroll-up

2014-07-20 Thread Trevor Murphy

Hi, all.

The current behavior of `org-agenda-show-and-scroll-up' (SPC from the
Agenda) reveals drawers and logbooks unless the user passes a prefix
argument.  This doesn't work for my flow - I prefer the drawers stay
hidden all the time, unless I prefix the command.

My workflow may be unique to me.  Thus far I've been patching the code
locally.  For fun I'm sharing my patch with the list, in case somebody
else finds it worthwhile.

I've added a defcustom `org-agenda-show-and-scroll-up-show-drawers'.
It defaults to t, and this gives the current behavior.  Customizing it
to nil gives the alternate behavior I prefer.

My not-so-secret hope is that this patch is suitable for applying to
master.  Please let me know if that's the case, or if there are some
changes I can make that would get it there.  I'm fine signing
copyright assignment papers.

Thanks for taking a look!

-- 
Trevor Murphy
GnuPG Key: 0x83881C0A



[O] [PATCH] org-agenda: Customize agenda-show's drawer hide/show behavior.

2014-07-20 Thread Trevor Murphy
* lisp/org-agenda.el (org-agenda-show-and-scroll-up-show-drawers): New
  user option.  Controls whether `org-agenda-show-and-scroll-up' hides
  or shows drawers without a prefix arg.  Pre-patch behavior
  corresponds to setting this to t (the default).
* lisp/org-agenda.el (org-agenda-show-and-scroll-up): Compute
  hide/show behavior based on user option and prefix arg.
---
 lisp/org-agenda.el | 18 +++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index f24e1f6..e556a4a 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -135,6 +135,14 @@ addresses the separator between the current and the 
previous block.
  (character)
  (string)))
 
+(defcustom org-agenda-show-and-scroll-up-show-drawers t
+  Non-nil means show drawers by default when displaying the item at point.
+Set this to nil to reverse the behavior of
+`org-agenda-show-and-scroll-up' with respect to a
+\\[universal-argument] prefix.
+  :group 'org-agenda
+  :type 'boolean)
+
 (defgroup org-agenda-export nil
   Options concerning exporting agenda views in Org-mode.
   :tag Org Agenda Export
@@ -8603,16 +8611,20 @@ if it was hidden in the outline.
 When called repeatedly, scroll the window that is displaying the buffer.
 With a \\[universal-argument] prefix, use `org-show-entry' instead of
 `show-subtree' to display the item, so that drawers and logbooks stay
-folded.
+folded.  Reverse this behavior with user option
+`org-agenda-show-and-scroll-up-show-drawers'.
   (interactive P)
-  (let ((win (selected-window)))
+  (let ((win (selected-window))
+(fold (if org-agenda-show-and-scroll-up-show-drawers
+  arg
+(not arg
 (if (and (window-live-p org-agenda-show-window)
 (eq this-command last-command))
(progn
  (select-window org-agenda-show-window)
  (ignore-errors (scroll-up)))
   (org-agenda-goto t)
-  (if arg (org-show-entry) (show-subtree))
+  (if fold (org-show-entry) (show-subtree))
   (setq org-agenda-show-window (selected-window)))
 (select-window win)))
 
-- 
2.0.1




Re: [O] org-mode for swi-prolog and latex export ?

2014-07-20 Thread Joseph Vidal-Rosset
2014-07-20 10:05 GMT+02:00 Thorsten Jolitz tjol...@gmail.com:

 I have not seen an ob-prolog.el yet, but maybe it does exist?  If so,
 exporting both code and result of its execution would be:

 ,
 | * My documentation
 |
 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec
 | hendrerit tempor tellus. Donec pretium posuere tellus. Proin quam
 | nisl, tincidunt et, mattis eget, convallis nec, purus. Cum sociis
 | natoque penatibus et magnis dis parturient montes, nascetur ridiculus
 | mus. Nulla posuere. Donec vitae dolor. Nullam tristique diam non
 | turpis. Cras placerat accumsan nulla. Nullam rutrum. Nam vestibulum
 | accumsan nisl.
 |
 | #+header: :exports both
 | #+begin_src prolog
 |  ( ... my-program ...)
 | #+end_src
 `

 PS
 Code and documentation text is always exported together, thats what
 Org Babel is for, as long as you don't specify :exports none or so.


Thanks for this reply. Unfortunately, I don't see option to export into
the prolog .pl format. If someone can explain to me how export any code
(python , prolog, ocaml, etc.)  if it is possible with org-mode, I will be
thankfull.

Best regards,

Jo.


Re: [O] org-mode for swi-prolog and latex export ?

2014-07-20 Thread Thomas S. Dye
Aloha Jo,

Joseph Vidal-Rosset joseph.vidal.ros...@gmail.com writes:

 2014-07-20 10:05 GMT+02:00 Thorsten Jolitz tjol...@gmail.com:

 I have not seen an ob-prolog.el yet, but maybe it does exist?  If so,
 exporting both code and result of its execution would be:

 Thanks for this reply. Unfortunately, I don't see option to export into
 the prolog .pl format. If someone can explain to me how export any code
 (python , prolog, ocaml, etc.)  if it is possible with org-mode, I will be
 thankfull.

I don't see Prolog on the list of supported languages:

http://orgmode.org/worg/org-contrib/babel/languages.html

There are instructions for developing support for other languages:

http://orgmode.org/worg/org-contrib/babel/languages.html#develop

You'll want to tangle the .pl source code file and export the
documentation. 

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] org-mode for swi-prolog and latex export ?

2014-07-20 Thread Nick Dokos
t...@tsdye.com (Thomas S. Dye) writes:

 Aloha Jo,

 Joseph Vidal-Rosset joseph.vidal.ros...@gmail.com writes:

 2014-07-20 10:05 GMT+02:00 Thorsten Jolitz tjol...@gmail.com:

 I have not seen an ob-prolog.el yet, but maybe it does exist?  If so,
 exporting both code and result of its execution would be:

 Thanks for this reply. Unfortunately, I don't see option to export into
 the prolog .pl format. If someone can explain to me how export any code
 (python , prolog, ocaml, etc.)  if it is possible with org-mode, I will be
 thankfull.

 I don't see Prolog on the list of supported languages:

 http://orgmode.org/worg/org-contrib/babel/languages.html

 There are instructions for developing support for other languages:

 http://orgmode.org/worg/org-contrib/babel/languages.html#develop

 You'll want to tangle the .pl source code file and export the
 documentation. 


The first sentence of the doc that Tom pointed to is:

,
| The core Babel functions (viewing, export, tangling, etc…) are language
| agnostic and will work even for languages that are not explicitly
| supported. Explicit language-specific support is required only for
| evaluation of code blocks in a language.
`

So maybe nothing more is needed for just exporting and tangling
(completely untested).
-- 
Nick