Re: [O] patch for HTML links to GNU documents

2016-03-27 Thread Marcin Borkowski

On 2016-03-28, at 00:55, Richard Kim  wrote:

> Attached patch affects how 'info' links in org mode are converted to HTML
> links.  Today info links such as
>
> [[info:emacs#List Buffers]]
>
> are converted to this HTML link:
>
> emacs#List Buffers
>
> With the patch applied, the HTML link generated would be
>
> http://www.gnu.org/software/emacs/manual/html_mono/emacs.html#List-Buffers;>emacs#List
> Buffers
>
> The general idea is that couple of list variables describe how to map
> info file names to URLs so that those URL's would be used if available.
>
> One motivation for this patch is to make it easy for elisp package
> authors to to create links to wonderful emacs documents, because writing
> an org info-link to emacs manual in org files is trivial once you know
> the info node name.

That looks great; if it's accepted, I /immediatelly/ fetch the
bleeding-edge Org and start using it!!!

My use case is writing blog posts about Emacs using Org.

Thanks,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



Re: [O] a patch to ob-lisp.el

2016-03-27 Thread Nick Dokos
stardiviner  writes:

> I hope to merge this patch to Org-mode `ob-lisp.el`.
>

I have only looked at the surface of it, but I see some issues.

> < ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
> ---
> > ;; Copyright (C) 2009-2016 Free Software Foundation, Inc.

Why did you leave out the previous copyright statement?
Where did 2020 come from?

> < ;; Authors: stardiviner 
> < ;; Maintainer: stardiviner 
> < ;; Keywords: org babel lisp sly slime
> < ;; URL: https://github.com/stardiviner/ob-lisp
> < ;; Created: 1th March 2016
> < ;; Version: 0.0.1
> < ;; Package-Requires: ((org "8"))
> ---
>> ;; Authors: Joel Boehland
>> ;;Eric Schulte
>> ;;David T. O'Toole 
>> ;; Keywords: literate programming, reproducible research
>> ;; Homepage: http://orgmode.org

Why did you erase the previous authors?

Are you volunteering to be the maintainer of ob-lisp.el or are you
planning to keep your own repo and submit patches? Have you signed FSF
papers?

> < ;; Requires SLY (Sylvester the Cat's Common Lisp IDE) and SLIME
> < ;; See:
> < ;; - https://github.com/capitaomorte/sly
> < ;; - http://common-lisp.net/project/slime/
> ---
>> ;; Requires SLIME (Superior Lisp Interaction Mode for Emacs.)
>> ;; See http://common-lisp.net/project/slime/

Does it really require both? If so, I suggest you rework it so
either can be used, but only one is required. If not, I suggest
you fix the comment.

-- 
Nick




[O] no div/id on named example blocks in html export

2016-03-27 Thread John Kitchin

I noticed that if I make a block like this:

#+name: methane-smiles
#+BEGIN_EXAMPLE
C
#+END_EXAMPLE

There is no id="methane-smiles" assocated with the pre block in the HTML
export.

The place to add it would be in org-html-example-block I suppose. Is
there any reason not to do that?


-- 
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



[O] switch parsing in babel

2016-03-27 Thread John Kitchin
I am trying to make a new source block that looks like this:

#+BEGIN_SRC obabel -icml -osmi
[CH4]
#+END_SRC

This gets parsed to:

(src-block
 (:language "obabel" :switches "-i" :parameters "cml -osmi" :begin 190 :end 240 
:number-lines nil :preserve-indent t :retain-labels t :use-labels t :label-fmt 
nil :hiddenp nil :value "[CH4] \n" :post-blank 1 :post-affiliated 190 :parent 
nil))

Is that correct? I would have thought that 
1. The first switch should be -icml
2. -osmi would also be a switch.

If I go with -i -o, then they are both listed as switches.


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



[O] patch for HTML links to GNU documents

2016-03-27 Thread Richard Kim
Attached patch affects how 'info' links in org mode are converted to HTML
links.  Today info links such as

[[info:emacs#List Buffers]]

are converted to this HTML link:

emacs#List Buffers

With the patch applied, the HTML link generated would be

http://www.gnu.org/software/emacs/manual/html_mono/emacs.html#List-Buffers;>emacs#List
Buffers

The general idea is that couple of list variables describe how to map
info file names to URLs so that those URL's would be used if available.

One motivation for this patch is to make it easy for elisp package
authors to to create links to wonderful emacs documents, because writing
an org info-link to emacs manual in org files is trivial once you know
the info node name.
From f0a8a7d12d90d219cd4d8f4d3d9bc580e02c255a Mon Sep 17 00:00:00 2001
From: Richard Kim 
Date: Thu, 10 Mar 2016 06:29:48 -0800
Subject: [PATCH] org-info.el: generate HTML links to gnu.org

* lisp/org-info.el (org-info-export): Convert info links to HTML URL's
that point to appropriate gnu.org or other pages.  User's can customize
the behavior using `org-info-emacs-documents' and
`org-info-other-documets' new variables.

TINYCHANGE
---
 lisp/org-info.el | 35 +--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/lisp/org-info.el b/lisp/org-info.el
index 270c19f..e7ff9ed 100644
--- a/lisp/org-info.el
+++ b/lisp/org-info.el
@@ -81,6 +81,37 @@
 nodename-or-index)
 (user-error "Could not open: %s" name)))
 
+(defvar org-info-emacs-documents
+  '("ada-mode" "auth" "autotype" "bovine" "calc" "ccmode" "cl" "dbus" "dired-x"
+"ebrowse" "ede" "ediff" "edt" "efaq-w32" "efaq" "eieio" "eintr" "elisp"
+"emacs-gnutls" "emacs-mime" "emacs" "epa" "erc" "ert" "eshell" "eudc" "eww"
+"flymake" "forms" "gnus" "htmlfontify" "idlwave" "ido" "info" "mairix-el"
+"message" "mh-e" "newsticker" "nxml-mode" "octave-mode" "org" "pcl-cvs"
+"pgg" "rcirc" "reftex" "remember" "sasl" "sc" "semantic" "ses" "sieve"
+"smtpmail" "speedbar" "srecode" "todo-mode" "tramp" "url" "vip" "viper"
+"widget" "wisent" "woman")
+  "List of emacs documents available at the official URL
+")
+
+(defvar org-info-other-documents
+  '(("gcc"  . "https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gcc/index.html;)
+("libc" . "http://www.gnu.org/software/libc/manual/html_mono/libc.html;)
+("make" . "http://www.gnu.org/software/make/manual/index.html;))
+  "Alist of documents generated from texinfo source.
+
+When converting info links to html, links to any one of these manuals
+are converted to point to these links.")
+
+(defun org-info-map-html-url (filename)
+  "Given info FILENAME, either return it or convert it to URL pointing
+to the official page on internet, e.g., use gnu.org for all emacs related documents.
+See `org-info-official-gnu-document' and `org-info-other-documents' for details."
+  (if (member filename org-info-emacs-documents)
+  (format "http://www.gnu.org/software/emacs/manual/html_mono/%s.html;
+  filename)
+(let ((url (cdr (assoc filename org-info-other-documents
+  (or url (concat filename ".html")
+
 (defun org-info-export (path desc format)
   "Export an info link.
 See `org-add-link-type' for details about PATH, DESC and FORMAT."
@@ -89,8 +120,8 @@ See `org-add-link-type' for details about PATH, DESC and FORMAT."
 	(string-match "\\(.*\\)" path))
 (let ((filename (match-string 1 path))
 	  (node (or (match-string 2 path) "Top")))
-  (format "%s"
-	  filename
+  (format "%s"
+	  (org-info-map-html-url filename)
 	  (replace-regexp-in-string " " "-" node)
 	  (or desc path)
 
-- 
2.5.0



[O] a patch to ob-lisp.el

2016-03-27 Thread stardiviner

Here is my repo, and I also created an recipe on MELPA.

- http://gituhb.com/stardiviner/ob-lisp
- https://github.com/melpa/melpa/pull/3682

I hope to merge this patch to Org-mode `ob-lisp.el`.

1c1
< ;;; ob-lisp.el --- org-babel functions for common lisp evaluation with SLY or SLIME.
---
> ;;; ob-lisp.el --- org-babel functions for common lisp evaluation
3c3
< ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
---
> ;; Copyright (C) 2009-2016 Free Software Foundation, Inc.
5,11c5,9
< ;; Authors: stardiviner 
< ;; Maintainer: stardiviner 
< ;; Keywords: org babel lisp sly slime
< ;; URL: https://github.com/stardiviner/ob-lisp
< ;; Created: 1th March 2016
< ;; Version: 0.0.1
< ;; Package-Requires: ((org "8"))
---
> ;; Authors: Joel Boehland
> ;;	 Eric Schulte
> ;;	 David T. O'Toole 
> ;; Keywords: literate programming, reproducible research
> ;; Homepage: http://orgmode.org
30c28
< ;;; Support for evaluating Common Lisp code, relies on SLY or SLIME for all eval.
---
> ;;; support for evaluating common lisp code, relies on slime for all eval
34,37c32,33
< ;; Requires SLY (Sylvester the Cat's Common Lisp IDE) and SLIME
< ;; See:
< ;; - https://github.com/capitaomorte/sly
< ;; - http://common-lisp.net/project/slime/
---
> ;; Requires SLIME (Superior Lisp Interaction Mode for Emacs.)
> ;; See http://common-lisp.net/project/slime/
42,50c38
< (defcustom org-babel-lisp-eval-fn "sly-eval"
<   "The function to be called to evaluate code on the Lisp side."
<   :group 'org-babel
<   :version "24.1"
<   :options '("sly-eval" "slime-eval")
<   :type 'stringp)
< 
< 
< ;; (declare-function sly-eval "ext:sly" (sexp  package))
---
> (declare-function slime-eval "ext:slime" (sexp  package))
70,80c58,68
<  (result-params (cdr (assoc :result-params params)))
<  (print-level nil) (print-length nil)
<  (body (org-babel-trim
< (if (> (length vars) 0)
< (concat "(let ("
< (mapconcat
<  (lambda (var)
<(format "(%S (quote %S))" (car var) (cdr var)))
<  vars "\n  ")
< ")\n" body ")")
<   body
---
> 	 (result-params (cdr (assoc :result-params params)))
> 	 (print-level nil) (print-length nil)
> 	 (body (org-babel-trim
> 		(if (> (length vars) 0)
> 		(concat "(let ("
> 			(mapconcat
> 			 (lambda (var)
> 			   (format "(%S (quote %S))" (car var) (cdr var)))
> 			 vars "\n  ")
> 			")\n" body ")")
> 		  body
82,83c70,71
< (member "pp" result-params))
< (format "(pprint %s)" body)
---
> 	(member "pp" result-params))
> 	(format "(pprint %s)" body)
86d73
< ;;;###autoload
88,91c75,76
<   "Execute a block `BODY' with `PARAMS' of Common Lisp code with Babel."
<   (pcase org-babel-lisp-eval-fn
< ("slime-eval" (require 'slime))
< ("sly-eval" (require 'sly)))
---
>   "Execute a block of Common Lisp code with Babel."
>   (require 'slime)
94,108c79,92
<   (funcall (if (member "output" (cdr (assoc :result-params params)))
<#'car #'cadr)
<(with-temp-buffer
<  (insert (org-babel-expand-body:lisp body params))
<  (funcall org-babel-lisp-eval-fn
<   `(swank:eval-and-grab-output
< ,(let ((dir (if (assoc :dir params)
< (cdr (assoc :dir params))
<   default-directory)))
<(format
< (if dir (format org-babel-lisp-dir-fmt dir)
<   "(progn %s\n)")
< (buffer-substring-no-properties
<  (point-min) (point-max)
<   (cdr (assoc :package params)))
---
> 	  (funcall (if (member "output" (cdr (assoc :result-params params)))
> 		   #'car #'cadr)
> 		   (with-temp-buffer
> 		 (insert (org-babel-expand-body:lisp body params))
> 		 (slime-eval `(swank:eval-and-grab-output
>    ,(let ((dir (if (assoc :dir params)
> 		   (cdr (assoc :dir params))
> 		 default-directory)))
>   (format
>    (if dir (format org-babel-lisp-dir-fmt dir)
> 	 "(progn %s\n)")
>    (buffer-substring-no-properties
> 	(point-min) (point-max)
>  (cdr (assoc :package params)))
115c99
< (cdr (assoc :colnames params)))
---
> 			(cdr (assoc :colnames params)))
117c101
< (cdr (assoc :rownames params)
---
> 			(cdr (assoc :rownames params)


signature.asc
Description: PGP signature