Re: [O] Setup Org-mode to write diary.

2014-07-30 Thread numbch...@gmail.com
This org-capture looks a way, I want to try it.
But need a more advanced way, because a single file for write diary is
really not a good idea. I will be slow. (I think)
Maybe add a logic in the org-capture template.

I'm trying this way.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://nagatopain-blog.logdown.com/


On Mon, Jul 28, 2014 at 4:53 PM, Charles Philip Chan 
wrote:

> stardiviner  writes:
>
> > I want to know how to configure Org-mode to write diary with a easy way.
> > I hope someone can provide his way.
> >
> > Here is what I think what Org-mode write diary should have.
> >
> > - [ ] *open/create* a buffer to write current day's diary quickly.
>
> Set up a capture template using a date tree. For example, this is taken
> directly from section 9.1.3 of the org-mode manual:
>
> ,
> | ("j" "Journal" entry (file+datetree "~/org/journal.org")
> |  "* %?\nEntered on %U\n  %i\n  %a")
> `
>
> > - [ ] *navigate* diary entry like viewing day entries in Calendar.
>
> Use the imenu menu or just fold and unfold the outline.
>
> > - [ ] *manage* diary files with some kind of style like (date, folder,
> > etc).  - [ ] *search* diary content.
>
> Add the file to the variable "org-agenda-text-search-extra-files" and/or
> set up a custom agenda view to search the file.
>
> Charles
>
> --
> "...Deep Hack Mode--that mysterious and frightening state of
> consciousness where Mortal Users fear to tread."
> (By Matt Welsh)
>


Re: [O] make slim auto-complete work in Org-mode (delete some ac-source in Org-mode).

2014-08-07 Thread numbch...@gmail.com
I test those ac-source one by one manually.
And also I have extension org-ac. Then they are more heavy.
And I open many big org files usually. So I found they are heavy.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://nagatopain-blog.logdown.com/


On Tue, Aug 5, 2014 at 8:54 PM, Sebastien Vauban 
wrote:

> stardiviner wrote:
> > I setup default =ac-sources= for auto-complete like this:
> >
> > #+BEGIN_SRC emacs-lisp
> > (setq-default ac-sources
> >   '(ac-source-yasnippet
> > ac-source-abbrev
> > ac-source-filename
> > ac-source-files-in-current-dir
> > ac-source-dictionary
> > ac-source-words-in-same-mode-buffers
> > ))
> > #+END_SRC
> >
> > And I found =ac-source-dictionary= and
> =ac-source-words-in-same-mode-buffers= is
> > heavy for Org-mode, So I try to remove them only in Org-mode.
>
> Do you have some evidence of this?  Profiling with/without?  It'd be
> interesting.
>
> Other point: I'm surprised you don't have the source
> `ac-source-words-in-buffer' (maybe instead of
> `ac-source-words-in-same-mode-buffers')...
>
> Best regards,
>   Seb
>
> --
> Sebastien Vauban
>
>
>


[O] How to let [C-u C-c C-o] to open file link in other window by setting variable org-link-frame-setup.

2013-07-15 Thread numbch...@gmail.com
  I setup variable `org-link-frame-setup' like this:
  I want to let [C-c C-o] to open file link in current window.

  (setq org-link-frame-setup
  '((vm . vm-visit-folder-other-frame)
(vm-imap . vm-visit-imap-folder-other-frame)
(gnus . org-gnus-no-new-news)
(file . find-file)
(wl . wl-other-frame)))

   And I want to let [C-u C-c C-o] to open file link in *other* window.
   But upper setting can not do that.
   I do not know how to change this variable behavior to archive  this.

   Does anyone knows how to solve this problem ?


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): Evanescence Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
http://stardiviner.dyndns-blog.com/author.html


[O] Port ob-lisp.el to use SLY as an option to evaluate.

2016-01-19 Thread numbch...@gmail.com
I found ob-lisp.el use SLIME by default to evaluate lisp code. I want to
use SLY to evaluate lisp code. How to change it? I found the file ob-lisp.el
is short. I tried to change slime to sly.

But it is not customizable. I hope to define a defcustom for it. So that
user can customize it. But I don't know how to apply this into code. For
example, I define a custom like this:

```

(defcustom org-babel-lisp-default-implement "slime")
((defcustom org-babel-lisp-implements
   '("slime" "sly")
   "A list of Lisp implements."
   :group 'org-babel
   :version "24.1"
   ;; FIXME: reference code example.
   :type listp))
```


Then in file ob-lisp.el. Has some places use slime. I want to make
them adapt to upper defcustom value. like concate string from value or
something else.

```
(declare-function slime-eval "ext:slime" (sexp &optional package))
(defun org-babel-execute:lisp (body params)
  "Execute a block of Common Lisp code with Babel."
  (require 'slime)
  (org-babel-reassemble-table
   (let ((result
  (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
```



[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] ob-lisp.el patch to choose to use SLIME or SLY

2016-03-26 Thread numbch...@gmail.com
I original created an package ob-lisp on here:
https://github.com/stardiviner/ob-lisp
and add it to MELPA recipe.
https://github.com/melpa/melpa/pull/3682

The author suggest me to merge this change to Org-mode.

I attached patch in attachment file.
Hope someone can merge this patch.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/
diff --git a/ob-lisp.el b/ob-lisp.el
index d2cac3d..04df7fb 100644
--- a/ob-lisp.el
+++ b/ob-lisp.el
@@ -1,14 +1,12 @@
-;;; ob-lisp.el --- org-babel functions for common lisp evaluation with SLY or SLIME.
+;;; ob-lisp.el --- org-babel functions for common lisp evaluation
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2016 Free Software Foundation, Inc.
 
-;; 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
 
 ;; This file is part of GNU Emacs.
 
@@ -27,27 +25,17 @@
 
 ;;; Commentary:
 
-;;; 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
 
 ;;; Requirements:
 
-;; 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/
 
 ;;; Code:
 (require 'ob)
 
-(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 &optional package))
+(declare-function slime-eval "ext:slime" (sexp &optional package))
 
 (defvar org-babel-tangle-lang-exts)
 (add-to-list 'org-babel-tangle-lang-exts '("lisp" . "lisp"))
@@ -67,54 +55,50 @@ current directory string."
 (defun org-babel-expand-body:lisp (body params)
   "Expand BODY according to PARAMS, return the expanded body."
   (let* ((vars (mapcar #'cdr (org-babel-get-header params :var)))
- (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
 (if (or (member "code" result-params)
-(member "pp" result-params))
-(format "(pprint %s)" body)
+	(member "pp" result-params))
+	(format "(pprint %s)" body)
   body)))
 
-;;;###autoload
 (defun org-babel-execute:lisp (body params)
-  "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)
   (org-babel-reassemble-table
(let ((result
-  (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 (

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

2016-03-30 Thread numbch...@gmail.com
I updated all comments which you point out.
I wandering how to sign the FSF papers? Sorry about this, this is my first
time to contribute code in open source.



[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Mar 28, 2016 at 12:01 PM, Nick Dokos  wrote:

> 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
>
>
>


ediff-output
Description: Binary data


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

2016-04-05 Thread numbch...@gmail.com
My think my patch modifies less than 15 lines. Do I have to assign the
copyright of FSF?
I have sent one. But no response for some days. I hope Org-mode maintainer
can merge this patch.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Mar 31, 2016 at 12:52 AM, Thomas S. Dye  wrote:

> Aloha stardiviner,
>
> For instructions about the FSF papers, see
> http://orgmode.org/worg/org-contribute.html.
>
> All the best,
> Tom
>
> numbch...@gmail.com writes:
>
> > I updated all comments which you point out.
> > I wandering how to sign the FSF papers? Sorry about this, this is my
> first time
> > to contribute code in open source.
> >
> >
> >
> > [stardiviner]  GPG key ID: 47C32433
> > IRC(freeenode): stardiviner  Twitter: @numbchild
> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433
> > Blog: http://stardiviner.github.io/
> >
> > On Mon, Mar 28, 2016 at 12:01 PM, Nick Dokos  wrote:
> >
> > 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
>
>
> --
> Thomas S. Dye
> http://www.tsdye.com
>


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

2016-04-05 Thread numbch...@gmail.com
Ask a beside question. I cloned org-mode git repo, should I contribute my
patch with git way? (I mean create a git branch on my own public clone,
then paste it here to let maintainer merge it?)

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Apr 6, 2016 at 1:54 PM, numbch...@gmail.com 
wrote:

> My think my patch modifies less than 15 lines. Do I have to assign the
> copyright of FSF?
> I have sent one. But no response for some days. I hope Org-mode maintainer
> can merge this patch.
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
> On Thu, Mar 31, 2016 at 12:52 AM, Thomas S. Dye  wrote:
>
>> Aloha stardiviner,
>>
>> For instructions about the FSF papers, see
>> http://orgmode.org/worg/org-contribute.html.
>>
>> All the best,
>> Tom
>>
>> numbch...@gmail.com writes:
>>
>> > I updated all comments which you point out.
>> > I wandering how to sign the FSF papers? Sorry about this, this is my
>> first time
>> > to contribute code in open source.
>> >
>> >
>> >
>> > [stardiviner]  GPG key ID: 47C32433
>> > IRC(freeenode): stardiviner  Twitter: @numbchild
>> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433
>> > Blog: http://stardiviner.github.io/
>> >
>> > On Mon, Mar 28, 2016 at 12:01 PM, Nick Dokos  wrote:
>> >
>> > 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
>>
>>
>> --
>> Thomas S. Dye
>> http://www.tsdye.com
>>
>
>


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

2016-04-06 Thread numbch...@gmail.com
Hi, Nicolas, the another email which you commented many places is outdated.
That patch is modified from the version of MELPA package `org-plus-conrtib`.

I cloned org-mode git repo, and created public repo branch at here:
https://github.com/stardiviner/org-mode/tree/sly-support-for-ob-lisp

I checked this branch's diff with your mentioned places. All checked.
I followed org-mode contrib guide to create this commit.
Please let me know if there is any place need to modify.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Apr 6, 2016 at 5:26 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> "numbch...@gmail.com"  writes:
>
> > Ask a beside question. I cloned org-mode git repo, should I contribute my
> > patch with git way? (I mean create a git branch on my own public clone,
> > then paste it here to let maintainer merge it?)
>
> Please look at the document suggested by Thomas. In particular, please
> read section "For Org contributors: preferred way of submitting
> patches".
>
> Following advices there tremendeously helps maintainers.
>
> Thank you.
>
> Regards,
>
> --
> Nicolas Goaziou
>


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

2016-04-06 Thread numbch...@gmail.com
Oh, right. I should attach it.

```diff
>From 30eec5a63e4f720fa3880b9aef06aedd84072078 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Sat, 2 Apr 2016 00:46:36 +0800
Subject: [PATCH] add SLY support in ob-lisp

* ob-lisp.el (org-babel-execute:lisp): Support using SLY to evaluate
  lisp src block.

SLY has some advantages over SLIME, let user can evaluate Lisp src block
with SLY.

modified from a patch proposal by stardiviner.

TINYCHANGE
---
 etc/ORG-NEWS|  2 ++
 lisp/ob-lisp.el | 51 ---
 2 files changed, 34 insertions(+), 19 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 3ddc3f9..bb8a00d 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -819,6 +819,8 @@ See the docstring of ~org-latex-classes~ and

 *** `org-insert-heading' can be forced to insert top-level headline

+*** let ob-lisp supporting use SLY to evaluate
+
 ** Removed functions

 *** Removed function ~org-translate-time~
diff --git a/lisp/ob-lisp.el b/lisp/ob-lisp.el
index 64b032d..68ea5e2 100644
--- a/lisp/ob-lisp.el
+++ b/lisp/ob-lisp.el
@@ -25,16 +25,26 @@

 ;;; Commentary:

-;;; support for evaluating common lisp code, relies on slime for all eval
+;;; Support for evaluating Common Lisp code, relies on SLY or SLIME for
all eval.

 ;;; Requirements:

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

 ;;; Code:
 (require 'ob)

+(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 &optional package))
 (declare-function slime-eval "ext:slime" (sexp &optional package))

 (defvar org-babel-tangle-lang-exts)
@@ -72,24 +82,27 @@ current directory string."
   body)))

 (defun org-babel-execute:lisp (body params)
-  "Execute a block of Common Lisp code with Babel."
-  (require 'slime)
+  "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)))
   (org-babel-reassemble-table
(let ((result
-  (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)))
+  (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)))
  (org-babel-result-cond (cdr (assoc :result-params params))
result
(condition-case nil
-- 
2.8.0
```

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Apr 6, 2016 at 8:49 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> "numbch...@gmail.com"  writes:
>
> > Hi, Nicolas, the another email which you commented many places is
> outdated.
> > That patch is modified from the version of MELPA package
> `org-plus-conrtib`.
> >
> > I cloned org-mode git repo, and created public repo branch at here:
> > https://github.com/stardiviner/org-mode/tree/sly-support-for-ob-lisp
> >
> > I checked this branch's diff with your mentioned p

[O] Ruby babel src block does not run some code

2016-04-10 Thread numbch...@gmail.com
For example, I have a ruby src block like this:

```
#+BEGIN_SRC ruby
  module A
CREF = "*** CREF in module A"
  end

  module A
module B
  puts CREF
end
  end
#+END_SRC
```

And press `[C-c C-c]` to execute, get this error:
```
#+BEGIN_EXAMPLE
-:3: module definition in method body
-:4: dynamic constant assignment
  CREF = "*** CREF in module A"
^
-:7: module definition in method body
-:8: module definition in method body
#+END_EXAMPLE
```

My emacs version: 24.5.1
My org-mode version: 8.3.4 (installed from MELPA)

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] make ox-publish generate result figure image link path to relative instead of absolute full path

2016-04-24 Thread numbch...@gmail.com
I want babel can generate a figure image which path is relative to current
directory instead of full path.

Here is the org-mode buffer example which use `:dir "data/images"` as
default directory for executing code:


```
#+BEGIN_SRC gnuplot :session none :results graphics :dir "data/images"
:file "org-babel-plot-test.png"
set term png
set output 'org-babel-plot-test.png'

set grid

plot sin(x)
#+END_SRC

#+RESULTS:
[[file:/home/stardiviner/Org/Blog/org-publish/Blog/data/images/org-babel-plot-test.png]]
```

And here is another example which use current directory for save figure
image:

```
#+BEGIN_SRC gnuplot :session none :results graphics :file
"org-babel-plot-test.png"
set term png
set output 'org-babel-plot-test.png'

set grid

plot sin(x)
#+END_SRC

#+RESULTS:
[[file:org-babel-plot-test.png]]
```

What I want:
- result figure image can display as inline image.
- result figure image also can work in remote server. (like the first
example, `ox-publish` exported HTML link is local resource link like
`file:///home/USER/png`)

Is there a way to change babel generate figure image result path to be like
option `org-link-file-path-type` can set to `adaptive`.

- I think org-mode should improve on this.
- If somebody can provide an adivce, that is good too for a solution to use
for now.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] Is there an easy way converting html -> orgmode?

2016-04-24 Thread numbch...@gmail.com
​Is there relative project which can convert and save current web page from
browser to Org-mode type file?​

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sun, Apr 24, 2016 at 6:38 PM, Eric S Fraga  wrote:

> On Sunday, 24 Apr 2016 at 09:10, Martin Weigele wrote:
> > Hi, the subject line says it all, is there an easy way converting html to
> > orgmode (not the other way round).
>
> Not sure but have a look at pandoc: http://pandoc.org/
> --
> : Eric S Fraga (0xFFFCF67D), Emacs 25.0.92.1, Org release_8.3.4-739-g789412
>
>


Re: [O] Is there an easy way converting html -> orgmode?

2016-04-25 Thread numbch...@gmail.com
thanks, that's what I need. great.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sun, Apr 24, 2016 at 9:52 PM, Georgiy Tugai 
wrote:

> On 24 Apr, numbch...@gmail.com wrote:
> > ​Is there relative project which can convert and save current web page
> from
> > browser to Org-mode type file?​
> >
> > [stardiviner] GPG key ID: 47C32433
> > IRC(freeenode): stardiviner Twitter:  @numbchild
> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> > Blog: http://stardiviner.github.io/
> >
> > On Sun, Apr 24, 2016 at 6:38 PM, Eric S Fraga  wrote:
> >
> > > On Sunday, 24 Apr 2016 at 09:10, Martin Weigele wrote:
> > > > Hi, the subject line says it all, is there an easy way converting
> html to
> > > > orgmode (not the other way round).
> > >
> > > Not sure but have a look at pandoc: http://pandoc.org/
> > > --
> > > : Eric S Fraga (0xFFFCF67D), Emacs 25.0.92.1, Org
> release_8.3.4-739-g789412
> > >
> > >
>
> I believe that the following project may be what you're looking for.
> Imports whole pages, selections or "the article content" (as defined by
> `python-readability') into an `org-capture' buffer, converted to Org
> format via `pandoc'.
>
> https://github.com/alphapapa/org-protocol-capture-html
>


[O] add some babel supports (PHP, Lua, Redis)

2016-05-10 Thread numbch...@gmail.com
I created three branches on my personal public org-mode repo on GitHub.

- ob-lua
- ob-php
- ob-redis

https://github.com/stardiviner/org-mode

Hope maintainer can merge those branches.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] add some babel supports (PHP, Lua, Redis)

2016-05-10 Thread numbch...@gmail.com
I tried to sign the FSF copyright assignment before, but it is very
difficult for me. So I give up. Is there other ways to merge this patches
without signing the assignment? (I can give up this right)

Second: I updated branch commit messages in the ChangeLog format.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, May 10, 2016 at 5:42 PM, Rasmus  wrote:

> Hi,
>
> Thanks for your patches.
>
> Some comments follow.
>
> "numbch...@gmail.com"  writes:
>
> > - ob-lua
> > - ob-php
> > - ob-redis
> >
> > https://github.com/stardiviner/org-mode
> >
> > Hope maintainer can merge those branches.
>
> First, do you have copyright assignment to the FSF or would you be willing
> to?  This is necessary to merge the patches.  Please refer to,
>
>   http://orgmode.org/worg/org-contribute.html
>
> Second, could you send your work as patches?  I.e. use git format-patch.
> Note the format of the commit message should be in the ChangeLog format
> (refer to the link above).
>
> Thanks,
> Rasmus
>
> --
> History is what should never happen again
>
>
>
From 2589d4e7d28016fb515d2131cbd9ff52797e50eb Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Tue, 10 May 2016 16:03:32 +0800
Subject: [PATCH] ob-lua.el: add Lua src block executing support

* contrib/lisp/ob-lua.el (org-babel-execute:lua): support executing Lua src block.
---
 contrib/lisp/ob-lua.el | 45 +
 1 file changed, 45 insertions(+)
 create mode 100644 contrib/lisp/ob-lua.el

diff --git a/contrib/lisp/ob-lua.el b/contrib/lisp/ob-lua.el
new file mode 100644
index 000..f33090e
--- /dev/null
+++ b/contrib/lisp/ob-lua.el
@@ -0,0 +1,45 @@
+;;; ob-lua.el --- Execute Lua code within org-mode blocks.
+;; Copyright 2016 stardiviner
+
+;; Author: stardiviner 
+;; Maintainer: stardiviner 
+;; Keywords: org babel lua
+;; URL: https://github.com/stardiviner/ob-lua
+;; Created: 12th April 2016
+;; Version: 0.0.1
+;; Package-Requires: ((org "8"))
+
+;;; Commentary:
+;;
+;; Execute Lua code within org-mode blocks.
+
+;;; Code:
+(require 'org)
+(require 'ob)
+
+(defgroup ob-lua nil
+  "org-mode blocks for Lua."
+  :group 'org)
+
+(defcustom ob-lua:default-session "*lua*"
+  "Default Lua session.
+
+It is lua inferior process from `run-lua'."
+  :group 'ob-lua
+  :type 'string)
+
+;;;###autoload
+(defun org-babel-execute:lua (body params)
+  "org-babel lua hook."
+  (let* ((session (or (cdr (assoc :session params))
+  ob-lua:default-session))
+ (cmd (mapconcat 'identity (list "lua -") " ")))
+(org-babel-eval cmd body)))
+
+;;;###autoload
+(eval-after-load "org"
+  '(add-to-list 'org-src-lang-modes '("lua" . lua)))
+
+(provide 'ob-lua)
+
+;;; ob-lua.el ends here
-- 
2.8.2

From d2e7202930fcf24e7c90826e69bb768094463a0c Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Tue, 10 May 2016 16:05:38 +0800
Subject: [PATCH] ob-php.el: Add PHP src block executing support

* contrib/lisp/ob-php.el (org-babel-execute:php): support executing PHP
  src block.
---
 contrib/lisp/ob-php.el | 44 
 1 file changed, 44 insertions(+)
 create mode 100644 contrib/lisp/ob-php.el

diff --git a/contrib/lisp/ob-php.el b/contrib/lisp/ob-php.el
new file mode 100644
index 000..31960a5
--- /dev/null
+++ b/contrib/lisp/ob-php.el
@@ -0,0 +1,44 @@
+;;; ob-php.el --- Execute PHP within org-mode blocks.
+;; Copyright 2016 stardiviner
+
+;; Author: stardiviner 
+;; Maintainer: stardiviner 
+;; Keywords: org babel php
+;; URL: https://github.com/stardiviner/ob-php
+;; Created: 04th May 2016
+;; Version: 0.0.1
+;; Package-Requires: ((org "8"))
+
+;;; Commentary:
+;;
+;; Execute PHP within org-mode blocks.
+
+;;; Code:
+(require 'org)
+(require 'ob)
+
+(defgroup ob-php nil
+  "org-mode blocks for PHP."
+  :group 'org)
+
+;; todo
+(defcustom ob-php:inf-php-buffer "*php*"
+  "Default PHP inferior buffer."
+  :group 'ob-php
+  :type 'string)
+
+;;;###autoload
+(defun org-babel-execute:php (body params)
+  "org-babel PHP hook."
+  ;; todo
+  (let* ((cmd (mapconcat 'identity (list "php") " -r ")))
+(org-babel-eval cmd body)
+))
+
+;;;###autoload
+(eval-after-load "org"
+  '(add-to-list 'org-src-lang-modes '("php" . php)))
+
+(provide 'ob-php)
+
+;;; ob-php.el ends here
-- 
2.8.2

From eb3c0cb1467416d141a633c49e1c9050311d92ab Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Tue, 10 May 2016 16:06:19 +0800

Re: [O] add some babel supports (PHP, Lua, Redis)

2016-05-10 Thread numbch...@gmail.com
I moved files to contrib/lisp/. I live in China, hope FSF can assign the
copyright assignment digitally.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, May 10, 2016 at 11:44 PM, Rasmus  wrote:

> "numbch...@gmail.com"  writes:
>
> > I tried to sign the FSF copyright assignment before, but it is very
> > difficult for me. So I give up. Is there other ways to merge this patches
> > without signing the assignment? (I can give up this right)
>
> Normally you "only" need to sign a piece of paper and send it by snail
> mail to the FSF office in the US of A.  But you may be referring to the
> terms of the assignment.
>
> Depending on the issues you faced, it might be best to discuss them with
> ass...@gnu.org, who will have the legal knowledge to give you proper
> advice.
>
> Meanwhile, your files could be added to contrib, which does not require
> you to do the paperwork.  Contrib files are not part of Emacs and would
> not come as part of the default Org package.  To me, Contrib is more
> convenient than MELPA, but I’m not sure everyone would agree.
>
> > Second: I updated branch commit messages in the ChangeLog format.
>
> Thanks.
>
> Rasmus
> --
> However beautiful the theory, one should occasionally look at the evidence
>


Re: [O] [PATCH] New feature: Use dvisvgm to preview latex formular

2016-05-14 Thread numbch...@gmail.com
This is great!

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

2016-05-14 14:30 GMT+08:00 Feng Shu :

>
> --
>


[O] Hope to tag a new relase in Org-mode ELPA repo

2016-05-15 Thread numbch...@gmail.com
I'm waiting for new fix in org-mode.
But org-mode is still in version 8.3.4.
I use org-mode elpa repo. (latest version)
and my ob-lisp.el SLY support is newer than the latest tag and is in new
version (9.0)
Or is there some reasons that I don't know which makes the new release late?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] ask for an advice for org-display-inline-images

2016-05-16 Thread numbch...@gmail.com
I hope somebody can provide an advice for `org-display-inline-images` to
set image background color.

Here is an link on StackExchange.Emacs:

http://emacs.stackexchange.com/questions/20574/default-inline-image-background-in-org-mode/20598?noredirect=1#comment32482_20598

I don't know how to write this advice.

I try the following code, but not work. (I'm not good at elisp)

```lisp
(defun create-image-with-background (file width background-color)
  (create-image file
(and width 'imagemagick)
nil
:width width
:background background-color))

(advice-add 'org-display-inline-images :filter-return
(lambda (r)
  (create-image-with-background r)))
```

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] add some babel supports (PHP, Lua, Redis)

2016-05-22 Thread numbch...@gmail.com
I modified most part of my files.

- There are some places I can't improve because I'm not good at elisp.
(maybe other  people can improve it later) Like ob-redis.el implement
ob-sql style configuration. and ob-lua.el make use of lua-mode's running
process.

- I guess ob-php.el is the only one branch can be merged.
- Anyway, check out my updates, if no one can be merged, I will still keep
my github repositories.

Thanks for your detail reviews.


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, May 23, 2016 at 1:20 AM, Rasmus  wrote:

> Hi,
>
> Thanks for your patches.  Sorry about the delay.  I was hoping that
> someone with more ob knowledge would step in.
>
> Please find some comments below.  I think some more work is needed before
> your libraries are
>
> "numbch...@gmail.com"  writes:
>
> > From 2589d4e7d28016fb515d2131cbd9ff52797e50eb Mon Sep 17 00:00:00 2001
> > From: stardiviner 
> > Date: Tue, 10 May 2016 16:03:32 +0800
> > Subject: [PATCH] ob-lua.el: add Lua src block executing support
> >
> > * contrib/lisp/ob-lua.el (org-babel-execute:lua): support executing Lua
> > src block.
>
> Please capitalize after the colon.
>
> > ---
> > +;;; ob-lua.el --- Execute Lua code within org-mode blocks.
> > +;; Copyright 2016 stardiviner
>
> > +;; Author: stardiviner 
> > +;; Maintainer: stardiviner 
>
>
>
> > +;; Keywords: org babel lua
>
> For whatever reason this seems to be
>
> ;; Keywords: literate programming, reproducible research
>
> In most ob files.
>
> > +;; URL: https://github.com/stardiviner/ob-lua
>
>
> > +;; Created: 12th April 2016
>
> This header is unnecessary, but if you like it, it’s fine.
>
> > +;; Version: 0.0.1
> > +;; Package-Requires: ((org "8"))
>
> > +;;; Commentary:
> > +;;
> > +;; Execute Lua code within org-mode blocks.
>
>
> Maybe,
>
> The file provides Org-Babel support for evaluating Lua code.
>
>
>
> > +;;; Code:
> > +(require 'org)
>
> This is unnecessary.  Ob implies Org.
>
> > +(require 'ob)
> > +
> > +(defgroup ob-lua nil
> > +  "org-mode blocks for Lua."
> > +  :group 'org)
>
> It seems that ob languages do not typically define new groups.
>
> Also, ob is the filename.  Variables are org-babel.
>
> > +(defcustom ob-lua:default-session "*lua*"
> > +  "Default Lua session.
> > +
> > +It is lua inferior process from `run-lua'."
> > +  :group 'ob-lua
> > +  :type 'string)
>
> I don’t think this is necessary to have as a defcustom.  There’s already
> :session.  Also, you are missing :type.  Per above, group is org-babel.
>
> > +;;;###autoload
> This is normally not autoloaded.  Babel languages are loaded via
> org-babel-do-load-languages.
>
> > +(defun org-babel-execute:lua (body params)
> > +  "org-babel lua hook."
>
> Please capitalize sentences.
>
> > +  (let* ((session (or (cdr (assoc :session params))
> > +  ob-lua:default-session))
> > + (cmd (mapconcat 'identity (list "lua -") " ")))
>
> Is something missing here?  AFAIK cmd → "lua -" always.
>
> Also, what if my lua is not in my PATH?  I got a felling that you might
> make a more robust mode by hooking into lua-mode
>
>  https://immerrr.github.io/lua-mode/
>
> > +(org-babel-eval cmd body)))
>
> How are various return values handled?  E.g. will a table be correctly
> interpreted as such?  (It’s a while since I coded in lua).
>
> > +;;;###Autoload
> > +(eval-after-load "org"
> > +  '(add-to-list 'org-src-lang-modes '("lua" . lua)))
>
>
> This should be unnecessary as the lua-mode is presumably lua-mode.  Also,
> I think your code depends on lua-mode in order to be able to edit it.  You
> need to declare that as a dependency.
>
> > +(provide 'ob-lua)
> > +
> > +;;; ob-lua.el ends here
> > --
> > 2.8.2
> >
> >
> > From d2e7202930fcf24e7c90826e69bb768094463a0c Mon Sep 17 00:00:00 2001
> > From: stardiviner 
> > Date: Tue, 10 May 2016 16:05:38 +0800
> > Subject: [PATCH] ob-php.el: Add PHP src block executing support
> >
> > * contrib/lisp/ob-php.el (org-babel-execute:php): support executing PHP
> >   src block.
>
> Capitalize.
>
> > ---
>

Re: [O] add some babel supports (PHP, Lua, Redis)

2016-05-27 Thread numbch...@gmail.com
I see, I will check out them, and merge them if possible.
I will PR after they are good enough.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, May 28, 2016 at 12:52 AM, Rasmus  wrote:

> Hi,
>
>
> "numbch...@gmail.com"  writes:
>
> > I modified most part of my files.
>
> Thanks.
>
> > - There are some places I can't improve because I'm not good at elisp.
> > (maybe other  people can improve it later) Like ob-redis.el implement
> > ob-sql style configuration. and ob-lua.el make use of lua-mode's running
> > process.
>
> OK.
>
> > - I guess ob-php.el is the only one branch can be merged.
>
> Maybe we should wait until it is a bit less bare-bone or there’s a
> copyright assignment in place.
>
> BTW there’s also this ob-php,
>
>   https://github.com/steckerhalter/ob-php
>
> > - Anyway, check out my updates, if no one can be merged, I will still
> keep
> > my github repositories.
>
> Note that there was already one ob-lua.el that was never commiteed for
> some reason...
>
>
> https://lists.gnu.org/archive/html/emacs-orgmode/2014-05/msg01149.html
>
> Rasmus
>
> --
> Slowly unravels in a ball of yarn and the devil collects it
>
>
>


[O] ob-C doesn't support load libraries

2016-06-10 Thread numbch...@gmail.com
I have a code example like this:

#+BEGIN_SRC C
#include 
#include 

/* define complex struct */
struct complex_struct {
  double x, y;
};

/* some helper functions on complex struct */
double real_part(struct complex_struct z) {
  return z.x;
}
double img_part(struct complex_struct z) {
  return z.y;
}
double magnitude(struct complex_struct z) {
  return sqrt(z.x * z.x + z.y * z.y);
}
double angle(struct complex_struct z) {
  return atan2(z.y, z.x);
}

/* helper functions to construct complex variable */
struct complex_struct make_from_real_img(double x, double y) {
  struct complex_struct z;
  z.x = x;
  z.y = y;
  return z;
}

struct complex_struct make_from_mag_ang(double r, double A) {
  struct complex_struct z;
  z.x = r * cos(A);
  z.y = r * sin(A);
  return z;
}

/* implement complex arithemtic */
struct complex_struct add_complex(struct complex_struct z1, struct
complex_struct z2) {
  return make_from_real_img(real_part(z1) + real_part(z2), img_part(z1) +
img_part(z2));
}

int main(int argc, char *argv[]) {
  struct complex_struct z1, z2 = {1.1, 2.4};

  struct complex_struct z;
  z = add_complex(z1, z2);

  printf("%f", z);
  return 0;
}
#+END_SRC

But evaluate it got error:

```
/tmp/cckFlXlJ.o: In function `magnitude':
C-src-18467gDZ.c:(.text+0xa8): undefined reference to `sqrt'
/tmp/cckFlXlJ.o: In function `angle':
C-src-18467gDZ.c:(.text+0xfe): undefined reference to `atan2'
/tmp/cckFlXlJ.o: In function `make_from_mag_ang':
C-src-18467gDZ.c:(.text+0x174): undefined reference to `cos'
C-src-18467gDZ.c:(.text+0x190): undefined reference to `sin'
collect2: error: ld returned 1 exit status
zsh:1: no such file or directory: /tmp/babel-18467-Yn/C-bin-18467tNf
```

So I think `ob-C.el` doesn't support to load included header files.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] ob-C doesn't support load libraries

2016-06-12 Thread numbch...@gmail.com
Thanks.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, Jun 11, 2016 at 12:44 AM, Thierry Banel 
wrote:

> Change the first line to
>
>   #+BEGIN_SRC C *:libs -lm*
>
> This instructs the C++ compiler to link with the "m" library (mathematical
> functions).
>
> You need a pretty new version of ob-C.el, as the :libs parameter was
> introduced recently.
>
>
>
> Le 10/06/2016 14:01, numbch...@gmail.com a écrit :
>
> I have a code example like this:
>
> #+BEGIN_SRC C
> #include 
> #include 
>
> /* define complex struct */
> struct complex_struct {
>   double x, y;
> };
>
> /* some helper functions on complex struct */
> double real_part(struct complex_struct z) {
>   return z.x;
> }
> double img_part(struct complex_struct z) {
>   return z.y;
> }
> double magnitude(struct complex_struct z) {
>   return sqrt(z.x * z.x + z.y * z.y);
> }
> double angle(struct complex_struct z) {
>   return atan2(z.y, z.x);
> }
>
> /* helper functions to construct complex variable */
> struct complex_struct make_from_real_img(double x, double y) {
>   struct complex_struct z;
>   z.x = x;
>   z.y = y;
>   return z;
> }
>
> struct complex_struct make_from_mag_ang(double r, double A) {
>   struct complex_struct z;
>   z.x = r * cos(A);
>   z.y = r * sin(A);
>   return z;
> }
>
> /* implement complex arithemtic */
> struct complex_struct add_complex(struct complex_struct z1, struct
> complex_struct z2) {
>   return make_from_real_img(real_part(z1) + real_part(z2), img_part(z1) +
> img_part(z2));
> }
>
> int main(int argc, char *argv[]) {
>   struct complex_struct z1, z2 = {1.1, 2.4};
>
>   struct complex_struct z;
>   z = add_complex(z1, z2);
>
>   printf("%f", z);
>   return 0;
> }
> #+END_SRC
>
> But evaluate it got error:
>
> ```
> /tmp/cckFlXlJ.o: In function `magnitude':
> C-src-18467gDZ.c:(.text+0xa8): undefined reference to `sqrt'
> /tmp/cckFlXlJ.o: In function `angle':
> C-src-18467gDZ.c:(.text+0xfe): undefined reference to `atan2'
> /tmp/cckFlXlJ.o: In function `make_from_mag_ang':
> C-src-18467gDZ.c:(.text+0x174): undefined reference to `cos'
> C-src-18467gDZ.c:(.text+0x190): undefined reference to `sin'
> collect2: error: ld returned 1 exit status
> zsh:1: no such file or directory: /tmp/babel-18467-Yn/C-bin-18467tNf
> ```
>
> So I think `ob-C.el` doesn't support to load included header files.
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
>
>


[O] How to only show org-timer indicator on active mode-line not all mode-lines?

2016-08-17 Thread numbch...@gmail.com
I setup org-timer indicator in mode-line with this.

(setq-default
 mode-line-format
 (quote
  (
   ;; org-timer
   (:eval
(unless (not org-timer-countdown-timer)
  (propertize (let* ((rtime (decode-time
 (time-subtract
  (timer--time org-timer-countdown-timer)
  (current-time
 (rmins (nth 1 rtime))
 (rsecs (nth 0 rtime)))
(format "🕔 %d:%d" rmins rsecs))
  'face '(:foreground "cyan" :weight bold)
  'help-echo "org-timer")))

   )))


I hope this org-time indicator only show in active mode-line instead of all
mode-lines.

I hope to find a general way which can add any extra indicator not just
org-timer. I can just put my upper code without too much modification into
that general way.

I also posted a post on Emacs.SE
https://emacs.stackexchange.com/questions/26222/how-to-only-show-thing-in-active-mode-line-instead-of-all-mode-lines

How to do it?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] ob-clojure.el does not evaluate org-mode clojure src block

2017-02-20 Thread numbch...@gmail.com
```
  #+BEGIN_SRC clojure :session
  (def kk "stardiviner")
  #+END_SRC
```

Press =[C-c C-c]= to evaluate this. Then check out =kk= in CIDER REPL
buffer.

That's why my problem happens:

https://emacs.stackexchange.com/questions/30849/how-to-generate-inline-plot-result-for-ob-clojure

Also I did some simple edebug on ob-clojure.el:

=ob-clojure.el::org-babel-execute:clojure=

```
  #+BEGIN_SRC emacs-lisp
  (nrepl-dict-get
   (nrepl-sync-request:eval "(print \"hello, world!\")"
(cider-current-connection) (cider-current-session))
   ;; key: "output", "status"
   "output")
  #+END_SRC
```

```
   #+RESULTS:
   #+BEGIN_EXAMPLE
   (dict "status"
 ("namespace-not-found" "done" "error" "done" "state" "state")
 "id" "8" "session" "7dcda490-01d9-4411-a05b-804a4f8663b6"
"changed-namespaces"
 (dict)
 "repl-type" "cljclj")
   #+END_EXAMPLE
```

You can see the request evaluate result is error.


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] ob-clojure.el does not evaluate org-mode clojure src block

2017-02-20 Thread numbch...@gmail.com
Seems have someone meet same problem with me:
https://emacs.stackexchange.com/questions/30857/clojure-code-evaluation-in-org-mode-produces-no-output

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Feb 20, 2017 at 8:41 PM, numbch...@gmail.com 
wrote:

> ```
>   #+BEGIN_SRC clojure :session
>   (def kk "stardiviner")
>   #+END_SRC
> ```
>
> Press =[C-c C-c]= to evaluate this. Then check out =kk= in CIDER REPL
> buffer.
>
> That's why my problem happens:
>
> https://emacs.stackexchange.com/questions/30849/how-to-
> generate-inline-plot-result-for-ob-clojure
>
> Also I did some simple edebug on ob-clojure.el:
>
> =ob-clojure.el::org-babel-execute:clojure=
>
> ```
>   #+BEGIN_SRC emacs-lisp
>   (nrepl-dict-get
>(nrepl-sync-request:eval "(print \"hello, world!\")"
> (cider-current-connection) (cider-current-session))
>;; key: "output", "status"
>"output")
>   #+END_SRC
> ```
>
> ```
>#+RESULTS:
>#+BEGIN_EXAMPLE
>(dict "status"
>  ("namespace-not-found" "done" "error" "done" "state" "state")
>  "id" "8" "session" "7dcda490-01d9-4411-a05b-804a4f8663b6"
> "changed-namespaces"
>  (dict)
>  "repl-type" "cljclj")
>#+END_EXAMPLE
> ```
>
> You can see the request evaluate result is error.
>
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>


Re: [O] ob-clojure broken

2017-03-04 Thread numbch...@gmail.com
I already applied the patch at here:
https://emacs.stackexchange.com/questions/30857/clojure-code-evaluation-in-org-mode-produces-no-output


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Mar 2, 2017 at 7:01 AM, Tim Cross  wrote:

> With current 9.0.5 org-plus-contrib package, ob-clojure is broken and
> trying to evaluate clojure source blocks just gives a code block produces
> no output message.
>
> The problem is in the org-babel-execute:clojure function. This function
> has the following bit of code
>
> (setq result
>(nrepl-dict-get
> (nrepl-sync-request:eval
>  expanded (cider-current-connection) (cider-current-session))
> (if (or (member "output" result-params)
> (member "pp" result-params))
> "out"
>   "value")))
>
> The problem is in the call to nrepl-sync-request:eval. The documentation
> states for this function
>
> (nrepl-sync-request:eval INPUT CONNECTION &optional NS)
>
> Send the INPUT to the nREPL server synchronously. The request is
> dispatched via CONNECTION. If NS is non-nil, include it in the request.
> Note the last optional argument NS. This is supposed to be a clojure
> namespace. However, the org-babel-execute:clojure function is calling this
> function with the output from cider-current-session, which returns a unique
> ID representing the current session. As a result, the call is returning a
> data structure with an error and no output (perhaps some error handling is
> required). The returned result is
>
> (dict status (namespace-not-found done error done state state) id 17
> session 43e9fd6c-82ed-49fe-9624-0cfc6f56f8b1 changed-namespaces (dict)
> repl-type cljclj)
>
> Note the namespace-not-found
>
> Either the argument should be a call to (cider-current-ns) or perhaps it
> should just be left out as I don't see how you can pass the namespace as
> part of the block evaluation.
>
>
> --
> regards,
>
> Tim
>
> --
> Tim Cross
>
>


[O] Let Org-mode babel file result support relative link type by using org-link-file-path-type

2017-03-11 Thread numbch...@gmail.com
Let Org-mode babel file result support relative (adaptive) link type by
using `org-link-file-path-type`.

This also can solve static site generator extensions (like `ob-blog.el`
etc) image link path issue.

Also better if user changed parent directory name, those links will have to
updated too. But if `adaptive` `org-link-file-path-type` will solve this
problem.

So please let Org-mode babel header arguments `:results file :file
"filename.png"` use `org-link-file-path-type` variable.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] Let Org-mode babel file result support relative link type by using org-link-file-path-type

2017-03-12 Thread numbch...@gmail.com
* Does Org-mode `:output-dir` header-argument? Or is `:dir`?

* An example

I can make it (`:results file :file "FILENAME"`) work in `ob-python` like
this:

```org
#+BEGIN_SRC python :var fname="QR_I_Love_YOU.png" :dir "data/images"
:results file
import qrcode

img = qrcode.make("I Love YOU")
img.save(fname)
return fname
#+END_SRC

#+RESULTS:
[[file:/home/stardiviner/Org/Wiki/Computer
Technology/Programming/Programming
Languages/Python/Data/Packages/data/images/QR_I_Love_YOU.png]]
```

* More specific suggestion:

Make use of org-mode variable `org-link-file-path-type`.
When user generate a result with link (like:

```org
#+RESULTS:
[[file:/home/stardiviner/Org/Wiki/Computer
Technology/Programming/Programming
Languages/Python/Data/Packages/data/images/QR_I_Love_YOU.png]]
```

Org-mode babel always use relative file path for link, instead of absolute
file path like upper example.
For example, if current path is `/home/stardiviner/Org/Wiki/Computer
Technology/Programming/Programming Languages/Python/Data/Packages/`, then
the relative file path link should be:

```org
#+RESULTS:
[[file:data/images/QR_I_Love_YOU.png]]
```

* About what one preceduce over the other problem

The header argument `:dir "data/images"` is used to specify my generated
image's destination directory.
My suggestion is want a the result link use `org-link-file-path-type`. So
the header argument `:dir` is not about the result link. Just it will be
used. Like upper example.


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sun, Mar 12, 2017 at 9:14 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> "numbch...@gmail.com"  writes:
>
> > Let Org-mode babel file result support relative (adaptive) link type by
> > using `org-link-file-path-type`.
> >
> > This also can solve static site generator extensions (like `ob-blog.el`
> > etc) image link path issue.
> >
> > Also better if user changed parent directory name, those links will have
> to
> > updated too. But if `adaptive` `org-link-file-path-type` will solve this
> > problem.
> >
> > So please let Org-mode babel header arguments `:results file :file
> > "filename.png"` use `org-link-file-path-type` variable.
>
> It sounds interesting. Could you be more specific about the
> specifications of your suggestion.
>
> For example, what happens when :output-dir is set, or when :file already
> provides some directory part? What part takes precedence over the other?
>
> Better, could you show some examples, or some tests?
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] [babel] Working dir incorrect

2017-03-14 Thread numbch...@gmail.com
Yes, it seems like this, I have a similar question at here:
https://lists.gnu.org/archive/html/emacs-orgmode/2017-03/msg00283.html

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, Mar 14, 2017 at 3:28 PM, Eric S Fraga  wrote:

> On Monday, 13 Mar 2017 at 15:42, Nick Dokos wrote:
>
> [...]
>
> > Can I make a plea for an ECM? If you provide one, I can spend five
> > minutes testing it, but without it I'll have to do real work to get an
> > example together and that's much more unlikely to happen.
>
> I've found that babel languages that start specific buffers that
> persist (e.g. octave, gnuplot) will be started in a particular
> directory based on a given org file.  If subsequently another org file,
> in a different directory, is visited, babel won't change the directory
> for existing babel buffers (and probably cannot easily do so in some
> cases?).
>
> --
> : Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.4-242-g2c27b8
>


Re: [O] displaying thumbnails in heading or subheadings

2017-04-25 Thread numbch...@gmail.com
Does this `insert-image` function insert image with overlay which is not
literately inserting?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, Apr 25, 2017 at 10:56 PM, cédric ody 
wrote:

> Hi everyone,
>
> I'd like to be able to display thumbnails of images in headlines.
>
> Assume I define a ICON property with the path to a thumbnail. For instance
>
> * Emacs heading
>   :PROPERTIES:
>   :ICON:  /tmp/emacs.png
>   :END:
>
> I have been able to get some results with the following code
>
> #+BEGIN_SRC elisp
> (defun my-function ()
>   "comment"
>   (interactive)
>   (save-excursion
> (org-with-limited-levels (org-map-tree 'my_subfunction)))
>   (org-fix-position-after-promote))
> (defun my_subfunction ()
> "comment"
>   (org-with-wide-buffer
>(org-back-to-heading t)
>(let ((e (org-element-at-point)))
>(looking-at org-outline-regexp) (goto-char (1- (match-end 0)))
> (insert-image (create-image (org-element-property :ICON e))
> #+END_SRC
>
> There are two issues I'd like to solve:
>
> - when the document is saved and re-opened, a blank space has
> substituted the thumbnail.
> - is it possible to control the appearance or not of thel thumbnails
> of all headlinesin one command?
>
> Thanks,
>
> cedric
>
>


[O] A small patch for org.el to fix error in clojure babel src block code ref

2017-05-08 Thread numbch...@gmail.com
Here is the original discussion we disscusses.
https://github.com/jkitchin/org-ref/issues/433

And Here is the patch:

#+BEGIN_SRC diff
modified   lisp/org.el
@@ -9730,7 +9730,7 @@ active region."
  (setq sfuns
(delq
 nil (mapcar (lambda (f)
-  (let (fs) (if (funcall f) (push f fs
+  (let (fs) (if (and (stringp f) (funcall f)) (push f fs
  (org-store-link-functions)))
sfunsn (mapcar (lambda (fu) (symbol-name (car fu))) sfuns))
  (or (and (cdr sfuns)
#+END_SRC

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] A small patch for org.el to fix error in clojure babel src block code ref

2017-05-09 Thread numbch...@gmail.com
​Is there any other possible potential functions will have relation with
this issue?​

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, May 9, 2017 at 2:41 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> "numbch...@gmail.com"  writes:
>
> > Here is the original discussion we disscusses.
> > https://github.com/jkitchin/org-ref/issues/433
> >
> > And Here is the patch:
> >
> > #+BEGIN_SRC diff
> > modified   lisp/org.el
> > @@ -9730,7 +9730,7 @@ active region."
> >   (setq sfuns
> > (delq
> >  nil (mapcar (lambda (f)
> > -  (let (fs) (if (funcall f) (push f fs
> > +  (let (fs) (if (and (stringp f) (funcall f)) (push f fs
> >   (org-store-link-functions)))
>
> The change above doesn't make sense, does it?
>
> If F is a string, it cannot be funcall'ed. Since
> `org-store-link-functions' only contains functions, this patch is
> basically skipping the whole variable.
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] A small patch for org.el to fix error in clojure babel src block code ref

2017-05-09 Thread numbch...@gmail.com
Weird, but this patch does fixed my issue. When I `org-store-link` in
opened clojure babel src block will has this issue. But not in other
languages babel src blocks like Python, Ruby, C etc.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, May 9, 2017 at 2:41 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> "numbch...@gmail.com"  writes:
>
> > Here is the original discussion we disscusses.
> > https://github.com/jkitchin/org-ref/issues/433
> >
> > And Here is the patch:
> >
> > #+BEGIN_SRC diff
> > modified   lisp/org.el
> > @@ -9730,7 +9730,7 @@ active region."
> >   (setq sfuns
> > (delq
> >  nil (mapcar (lambda (f)
> > -  (let (fs) (if (funcall f) (push f fs
> > +  (let (fs) (if (and (stringp f) (funcall f)) (push f fs
> >   (org-store-link-functions)))
>
> The change above doesn't make sense, does it?
>
> If F is a string, it cannot be funcall'ed. Since
> `org-store-link-functions' only contains functions, this patch is
> basically skipping the whole variable.
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] A small patch for org.el to fix error in clojure babel src block code ref

2017-05-09 Thread numbch...@gmail.com
Thanks for fixing, John.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, May 9, 2017 at 7:14 PM, John Kitchin 
wrote:

> I think I have just fixed it. The offending command was trying to get an
> org-element in the special edit buffer which wasn't in org-mode. Its not
> clear why it worked in some codes and not others though!
>
> John
>
> ---
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803 <(412)%20268-7803>
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
> On Tue, May 9, 2017 at 7:01 AM, John Kitchin 
> wrote:
>
>>
>> On Tue, May 9, 2017 at 6:51 AM, Nicolas Goaziou 
>> wrote:
>>
>>> org-store-link-functions
>>
>>
>> That is a function in org-ref. I will check it out this morning.  Thanks
>> for the pointer to the root of the issue!
>>
>>
>> John
>>
>> ---
>> Professor John Kitchin
>> Doherty Hall A207F
>> Department of Chemical Engineering
>> Carnegie Mellon University
>> Pittsburgh, PA 15213
>> 412-268-7803 <(412)%20268-7803>
>> @johnkitchin
>> http://kitchingroup.cheme.cmu.edu
>>
>>
>


Re: [O] A possibly useful thing

2017-05-27 Thread numbch...@gmail.com
You can make it a minor-mode and publish on MELPA. I found it on Emacs
Planet some days ago. I use it.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Fri, May 26, 2017 at 9:08 PM, Tom Hinton  wrote:

> Hi,
>
> I made a thing, visible here:
>
>   https://github.com/larkery/emacs/blob/master/site-lisp/
> org-numbers-overlay.el
>
> Which adds overlays to headings in org-mode to display section numbering
> in the buffer, and keeps it up to date as you edit. This helps me when
> relating exported PDF output (or people's comments on it) back to the
> original org file.
>
> Anyway it turns out it was helpful to some other people too, and one of
> them suggested that I contribute it directly and that to do so I should
> email this address, and now here we are.
>
> Let me know if this fits into the org development master plan.
>
> Thanks,
>
> Tom Hinton
>
>


[O] Org-mode link returned path is truncated when contains space

2017-05-31 Thread numbch...@gmail.com
I have a link in org-moe file like this:

 #+BEGIN_SRC org
 [[file:Data/images/logos/Full color Git logo for light backgrounds.png]]
 #+END_SRC

 *The file did exist.*

 I have elisp code like this to fontify link when the file does not exist:

 #+BEGIN_SRC emacs-lisp
 (org-link-set-parameters
  "file"
  ;; TODO: fix path contains space case.
  :face (lambda (path) (if (file-exists-p path) 'org-link 'org-warning)))
 #+END_SRC

 But it is fontied as red. I tried to debug info by print of ~path~ in
upper `org-link-set-parameters` lambda function.

 It return for path:

 #+BEGIN_EXAMPLE
 "Data/images/logos/Full"
 #+END_EXAMPLE


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] Org-mode ELPA repository package is not very updated?

2017-06-05 Thread numbch...@gmail.com
I found Org-mode ELPA released source code is old and does not include some
patches and updates.

For example, file `ob-clojure.el` I found org-mode source has the latest
source
code, but not in Org-mode ELPA package source code. The latest commit of
`ob-clojure.el` is about 3 monthes ago.

I installed both packages `org` and `org-plus-contrib` in ELPA repository.


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] Org-mode link returned path is truncated when contains space

2017-06-05 Thread numbch...@gmail.com
I checked Org-mode package version with `org-version`, get `9.0.7`, still
have this issue. I updated to latest org-mode ELPA version.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, May 31, 2017 at 10:06 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> "numbch...@gmail.com"  writes:
>
> > I have a link in org-moe file like this:
> >
> >  #+BEGIN_SRC org
> >  [[file:Data/images/logos/Full color Git logo for light backgrounds.png]]
> >  #+END_SRC
> >
> >
> >  *The file did exist.*
> >
> >  I have elisp code like this to fontify link when the file does not
> exist:
> >
> >  #+BEGIN_SRC emacs-lisp
> >  (org-link-set-parameters
> >   "file"
> >   ;; TODO: fix path contains space case.
> >   :face (lambda (path) (if (file-exists-p path) 'org-link 'org-warning)))
> >  #+END_SRC
> >
> >
> >  But it is fontied as red. I tried to debug info by print of ~path~ in
> > upper `org-link-set-parameters` lambda function.
> >
> >  It return for path:
> >
> >  #+BEGIN_EXAMPLE
> >  "Data/images/logos/Full"
> >  #+END_EXAMPLE
>
> Could you update Org to a more recent version, e.g., 9.0.7. It may have
> been fixed already.
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] Org-mode ELPA repository package is not very updated?

2017-06-08 Thread numbch...@gmail.com
Yes, I install `org` and `org-plus-contrib` from `"http://orgmode.org/elpa/
"`.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, Jun 6, 2017 at 12:58 AM, B.V. Raghav  wrote:

> "numbch...@gmail.com"  writes:
>
> > I installed both packages `org` and `org-plus-contrib` in ELPA
> repository.
> You might be looking for:
>
> #+BEGIN_SOURCE elisp
>   (require 'package)
>   (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/";) t)
>   (package-initialize)
>   (package-refresh-contents)
>   (package-install "org")
> #+END_SOURCE
>
> Or did you actually mean the same by `ELPA repository'
>
> Thanks
> r
> --
> (B.V. Raghav)
>


Re: [O] Org-mode ELPA repository package is not very updated?

2017-06-08 Thread numbch...@gmail.com
​​
If so, the latest `ob-clojure.el` commits are bug fix obviously.

#+BEGIN_EXAMPLE
7ed93eba5 * Fix incorrect argument call in ob-clojure.el
98d672de3 * Update "25.2" defcustom :version's that remain in master
0d3683f2c *   Merge branch 'maint'
  |\
713f78501 | * Update copyright years
2c466ebff * | ob-clojure: Normalize :show-process syntax
cd4186c5c * | ob-clojure: Small refactoring
56c0ce4a8 * | ob-clojure: Add :show-process
  |/
#+END_EXAMPLE

I need the latest commit bug fix `7ed93eba5 * Fix incorrect argument call
in ob-clojure.el`.



[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Jun 5, 2017 at 9:09 PM, Nick Dokos  wrote:

> "numbch...@gmail.com"  writes:
>
> > I found Org-mode ELPA released source code is old and does not include
> some
> > patches and updates.
> >
> > For example, file `ob-clojure.el` I found org-mode source has the latest
> source
> > code, but not in Org-mode ELPA package source code. The latest commit of
> > `ob-clojure.el` is about 3 monthes ago.
> >
> > I installed both packages `org` and `org-plus-contrib` in ELPA
> repository.
> >
>
> The ELPA package tracks the maintenance branch which only gets bug fixes.
>
> --
> Nick
>
>
>


Re: [O] Org-mode ELPA repository package is not very updated?

2017-06-08 Thread numbch...@gmail.com
​​
Seems currently have two solutions:

1. copy the latest `ob-clojure.el` to `.emacs.d/elpa/org-20170608/`. It
works, and I'm using this currently. But really not a good way.

2. use `(use-package org :load-path "/path/to/org-mode/source-code/" :pin
manual)`. But this has source code mixed issue, because other MELPA
packages dependent on `org`. So not sure Emacs will load which one. I use
`locate-library` found sometimes is ELPA org, sometimes is source code org.
Is there a way to fix this issue?

This is the question which I asked in IRC #emacs:

 I use package with: (use-package org [11:32]
   :load-path "~/Code/Emacs/org-mode/lisp/"
   :pin manual
   ;; :quelpa (org :fetcher git :repo
  "~/Code/Emacs/org-mode/lisp/")
   :mode (("\\.org$" . org-mode))
   :config
   ;; (load "~/Code/Emacs/org-mode/lisp/org.el")
   (use-package org-plus-contrib
 :load-path "~/Code/Emacs/org-mode/contrib/lisp/"
 :pin manual)
   ) But some MELPA packages requires `org`, I use Org-mode
ELPA
  repo (defvar elpa-org '("org"   . "http://orgmode.org/elpa/";))
.
  But I found `locate-library` "org" library files are mixed,
some
  library is from `:load-path`, some are from ELPA package. How
to
  fix this issue?



[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jun 8, 2017 at 6:54 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> "numbch...@gmail.com"  writes:
>
> > ​​ If so, the latest `ob-clojure.el` commits are bug fix obviously.
> >
> > #+BEGIN_EXAMPLE
> > 7ed93eba5 * Fix incorrect argument call in ob-clojure.el
> > 98d672de3 * Update "25.2" defcustom :version's that remain in master
> > 0d3683f2c *   Merge branch 'maint'
> >   |\
> > 713f78501 | * Update copyright years
> > 2c466ebff * | ob-clojure: Normalize :show-process syntax
> > cd4186c5c * | ob-clojure: Small refactoring
> > 56c0ce4a8 * | ob-clojure: Add :show-process
> >   |/
> > #+END_EXAMPLE
> >
> > I need the latest commit bug fix `7ed93eba5 * Fix incorrect argument call
> > in ob-clojure.el`.
>
> Apparently, this fix landed in master, so it should land in Org 9.1. It
> may be so because it sits on top of other modifications to ob-clojure
> that are not strict bug-fixes.
>
> Regards,
>
> --
> Nicolas Goaziou
>


[O] Add ob-sclang.el for sclang Org-mode babel support in contrib/

2017-06-08 Thread numbch...@gmail.com
Here is my branch
https://github.com/stardiviner/org-mode/tree/feature/ob-sclang
Merge this branch?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] Add ob-sclang.el for sclang Org-mode babel support in contrib/

2017-06-10 Thread numbch...@gmail.com
Yeah, I have used to contrib to org-mode, but need to sign FSF papers spend
my time, and I don't know how. So I decide to move code in `contrib/`.
When I back home, I will try to sign FSF papers, because I have time and
fixed location.
If I move code into `contrib/`, do I need to do more in this code?
I will add `lexical-binding`, but don't know how to write test for this.
Could org-mode team pull branch code on my github repo directory? Or should
I send a patch from `git format-patch`?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, Jun 10, 2017 at 4:17 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> "numbch...@gmail.com"  writes:
>
> > Here is my branch
> > https://github.com/stardiviner/org-mode/tree/feature/ob-sclang
> > Merge this branch?
>
> Thank you for your work.
>
> I'd like to refrain more packages to contrib, unless the intent is to
> eventually merge them into core later.
>
> However, I think this can go into core. Would you like to clean it up
> a bit, activate lexical-binding, provide some tests, and send a patch
> (using git format-patch)?
>
> You will need to sign FSF papers to do that, if you haven't done
> already. If you are willing to do this, we can also move your library to
> "contrib/" temporarily.
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] Add ob-sclang.el for sclang Org-mode babel support in contrib/

2017-06-15 Thread numbch...@gmail.com
@Bastien my SSH public key is:
```
ssh-rsa
B3NzaC1yc2EDAQABAAABAQDIXnylmZoh1WzQnEx0Cf/bpeqfuXVTLXza2jtRTDNYzIgZpRATsRhnSkdFC+t8bgkt7vTur1PiAzFgXYQKTs5BNYsiMFc3j2dnxLWzRCQfVi7DhPJ/VfgyyL4tv3LkMbx7vzOUlRJrIRWsnnxiY31rx5xaJbKiF8t9GEz5ycqgW3D5lp60TE/sYCcSTlhRvenJYTcFr1+KFFIGPps5yMayyIZQgEumqln7z7Ar+xz3wA2FKRqbkv1DtaTJj9SbE1MFSYcSel8sX7kIw6Xzze5UMTgFjIEavIMN2LMsvwGdrgI98em+dtjXUjSSA/VNEfdm0JKLRl1tEBCOOZ/all7R
/home/stardiviner/.ssh/id_rsa
```

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jun 15, 2017 at 2:21 PM, Bastien Guerry  wrote:

> Hi,
>
> if you need commit access to org-mode to add code to contrib/,
> please send me your public key (the one in ~/.ssh/id...).
>
> Best,
>
> --
>  Bastien
>


Re: [O] Add ob-sclang.el for sclang Org-mode babel support in contrib/

2017-06-15 Thread numbch...@gmail.com
Sorry, update SSH public key:
The previous message ssh public key is generated from command: `ssh-add -L`.
This one is from `cat ~/.ssh/id_rsa.pub`
```
ssh-rsa
B3NzaC1yc2EDAQABAAABAQDIXnylmZoh1WzQnEx0Cf/bpeqfuXVTLXza2jtRTDNYzIgZpRATsRhnSkdFC+t8bgkt7vTur1PiAzFgXYQKTs5BNYsiMFc3j2dnxLWzRCQfVi7DhPJ/VfgyyL4tv3LkMbx7vzOUlRJrIRWsnnxiY31rx5xaJbKiF8t9GEz5ycqgW3D5lp60TE/sYCcSTlhRvenJYTcFr1+KFFIGPps5yMayyIZQgEumqln7z7Ar+xz3wA2FKRqbkv1DtaTJj9SbE1MFSYcSel8sX7kIw6Xzze5UMTgFjIEavIMN2LMsvwGdrgI98em+dtjXUjSSA/VNEfdm0JKLRl1tEBCOOZ/all7R
stardiviner@dark
```

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jun 15, 2017 at 3:53 PM, numbch...@gmail.com 
wrote:

> @Bastien my SSH public key is:
> ```
> ssh-rsa B3NzaC1yc2EDAQABAAABAQDIXnylmZoh1WzQnEx0Cf/
> bpeqfuXVTLXza2jtRTDNYzIgZpRATsRhnSkdFC+t8bgkt7vTur1PiAzFgXYQKTs5BNYsi
> MFc3j2dnxLWzRCQfVi7DhPJ/VfgyyL4tv3LkMbx7vzOUlRJrIRWsnn
> xiY31rx5xaJbKiF8t9GEz5ycqgW3D5lp60TE/sYCcSTlhRvenJYTcFr1+
> KFFIGPps5yMayyIZQgEumqln7z7Ar+xz3wA2FKRqbkv1DtaTJj9SbE1MFSYc
> Sel8sX7kIw6Xzze5UMTgFjIEavIMN2LMsvwGdrgI98em+dtjXUjSSA/VNEfdm0JKLRl1tEBCOOZ/all7R
> /home/stardiviner/.ssh/id_rsa
> ```
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
> On Thu, Jun 15, 2017 at 2:21 PM, Bastien Guerry  wrote:
>
>> Hi,
>>
>> if you need commit access to org-mode to add code to contrib/,
>> please send me your public key (the one in ~/.ssh/id...).
>>
>> Best,
>>
>> --
>>  Bastien
>>
>
>


Re: [O] Add ob-sclang.el for sclang Org-mode babel support in contrib/

2017-06-15 Thread numbch...@gmail.com
Here is the patch

#+BEGIN_SRC diff
>From 8bea0293ae22046bd4878a0ef9add5acd074bfde Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Thu, 8 Jun 2017 18:24:53 +0800
Subject: [PATCH] add ob-sclang for sclang Org-mode babel support

---
 contrib/lisp/ob-sclang.el | 102
++
 1 file changed, 102 insertions(+)
 create mode 100644 contrib/lisp/ob-sclang.el

diff --git a/contrib/lisp/ob-sclang.el b/contrib/lisp/ob-sclang.el
new file mode 100644
index 0..763799533
--- /dev/null
+++ b/contrib/lisp/ob-sclang.el
@@ -0,0 +1,102 @@
+;;; ob-sclang.el --- SCLang support for Org-mode Babel -*-
lexical-binding: t; -*-
+;;; -*- coding: utf-8 -*-
+
+;; Copyright (C) 2011-2017 Free Software Foundation, Inc.
+
+;; Authors: stardiviner 
+;; Package-Version: 0.1
+;; Keywords: babel sclang
+
+;; This file is not part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; `ob-sclang' requires `sclang-interp' from SuperCollider.
+;; Usually SuperCollider dependencies for Emacs are at
/usr/share/emacs/site-lisp/SuperCollider/
+;; You can install SuperCollider following this article:
+;; https://github.com/supercollider/supercollider#building-the-source-code
+
+;; Usage:
+
+;; Support to evaluate sclang Org-mode src block with function
`sclang-eval-string'.
+
+;; For example:
+
+;; #+BEGIN_SRC sclang :results none
+;; "Hello World".postln;
+;; #+END_SRC
+;;
+;; *NOTE* Temporary output to org-babel result output is not supported.
+;; Because `sclang-eval-string' will send output to Sclang Post Buffer.
+;; And command line `sclang' execute will not automatically stop after
finished execution.
+;;
+;; #+BEGIN_SRC sclang :results none
+;; // modulate a sine frequency and a noise amplitude with another sine
+;; // whose frequency depends on the horizontal mouse pointer position
+;; {
+;; var x = SinOsc.ar(MouseX.kr(1, 100));
+;; SinOsc.ar(300 * x + 800, 0, 0.1)
+;; +
+;; PinkNoise.ar(0.1 * x + 0.1)
+;; }.play;
+;; #+END_SRC
+
+
+;;; Code:
+;;;

+(require 'org)
+(require 'ob)
+
+(require 'sclang-interp)
+
+(defgroup ob-sclang nil
+  "org-mode blocks for SuperCollider SCLang."
+  :group 'org)
+
+;;;###autoload
+(defun org-babel-execute:sclang (body params)
+  "Org-mode Babel sclang hook for evaluate `BODY' with `PARAMS'."
+  (unless (or (equal (buffer-name) sclang-post-buffer)
+  (sclang-get-process))
+(sclang-start))
+
+  ;; (let* ((db (or (cdr (assoc :db params))
+  ;;ob-mongo:default-db))
+  ;;(cmd (mapconcat 'identity (list "mongo" "--quiet" db) " ")))
+  ;;   (org-babel-eval cmd body))
+
+  (sclang-eval-string body t)
+
+  ;; (let ((cmd "sclang -r -s -D"))
+  ;;   (org-babel-eval cmd body))
+  )
+
+(defvar org-babel-default-header-args:sclang nil)
+
+(setq org-babel-default-header-args:sclang
+  '((:session . "*SCLang:Workspace*")
+(:output . "none")) ; TODO: temporary can't find way to let sclang
output to stdout for org-babel.
+  )
+
+;;;###autoload
+(with-eval-after-load "org"
+  (add-to-list 'org-src-lang-modes '("sclang" . sclang)))
+
+;;;

+
+(provide 'ob-sclang)
+
+;;; ob-sclang.el ends here
-- 
2.13.1
#+END_SRC

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Jun 14, 2017 at 10:02 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> "numbch...@gmail.com"  writes:
>
> > Yeah, I have used to contrib to org-mode, but need to sign FSF papers
> spend
> > my time, and I don't know how.
>
> See <http://orgmode.org/worg/org-contribute.html>, in particular
> "Copyright issues when contributing to Emacs Org mode".
>
> > So I decide to move code in `contrib/`.
> > When I back home, I will try to sign FSF papers, because I have time and
> > fixed location.
>
> > If I move code into `contrib/`, do

Re: [O] Add ob-sclang.el for sclang Org-mode babel support in contrib/

2017-06-15 Thread numbch...@gmail.com
I have resend it to your privately in email attachment. Thanks.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jun 15, 2017 at 4:26 PM, Bastien Guerry  wrote:

> "numbch...@gmail.com"  writes:
>
> > Sorry, update SSH public key:
>
> Please resend it as an attachment in a private email.
>
> Thanks,
>
> --
>  Bastien
>


[O] ob-clojure evaluate error when Org-mode buffer has ns clojure code

2017-06-16 Thread numbch...@gmail.com
When Org-mode buffer like this:

#+BEGIN_SRC clojure
(ns my.kk
  (:require '[incanter.core :as kk]))
#+END_SRC

#+BEGIN_SRC clojure
(print "hi")
(def  "hello")
#+END_SRC

#+RESULTS:

When I have `(ns ..)` namespace clojure code in buffer, the second `(print
..)` clojure result nothing. But when I remove the first src block, the
`(print ..)` clojure src block works fine.

I'm using Org-mode version from `master` with `use-package` like this:

(use-package org
  :load-path "~/Code/Emacs/org-mode/lisp/"
  :pin manual
  :mode (("\\.org$" . org-mode))
  :config
  (use-package org-plus-contrib
:load-path "~/Code/Emacs/org-mode/contrib/lisp/"
:pin manual)
  )


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] Add ob-sclang.el for sclang Org-mode babel support in contrib/

2017-06-16 Thread numbch...@gmail.com
I regenerated commit and patch by following changelog formats.

```
>From 9f0b5051bda5ae458242e37923ad18e3189663d9 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Thu, 8 Jun 2017 18:24:53 +0800
Subject: [PATCH] ob-sclang.el: add ob-sclang for sclang Org-mode babel
support

* ob-sclang.el (org-babel-execute:sclang): support evaluating sclang
  code in Org-mode Babel.

Support sclang evaluation in Org-mode Babel.

TINYCHANGE
---
 contrib/lisp/ob-sclang.el | 102
++
 1 file changed, 102 insertions(+)
 create mode 100644 contrib/lisp/ob-sclang.el

diff --git a/contrib/lisp/ob-sclang.el b/contrib/lisp/ob-sclang.el
new file mode 100644
index 0..763799533
--- /dev/null
+++ b/contrib/lisp/ob-sclang.el
@@ -0,0 +1,102 @@
+;;; ob-sclang.el --- SCLang support for Org-mode Babel -*-
lexical-binding: t; -*-
+;;; -*- coding: utf-8 -*-
+
+;; Copyright (C) 2011-2017 Free Software Foundation, Inc.
+
+;; Authors: stardiviner 
+;; Package-Version: 0.1
+;; Keywords: babel sclang
+
+;; This file is not part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; `ob-sclang' requires `sclang-interp' from SuperCollider.
+;; Usually SuperCollider dependencies for Emacs are at
/usr/share/emacs/site-lisp/SuperCollider/
+;; You can install SuperCollider following this article:
+;; https://github.com/supercollider/supercollider#building-the-source-code
+
+;; Usage:
+
+;; Support to evaluate sclang Org-mode src block with function
`sclang-eval-string'.
+
+;; For example:
+
+;; #+BEGIN_SRC sclang :results none
+;; "Hello World".postln;
+;; #+END_SRC
+;;
+;; *NOTE* Temporary output to org-babel result output is not supported.
+;; Because `sclang-eval-string' will send output to Sclang Post Buffer.
+;; And command line `sclang' execute will not automatically stop after
finished execution.
+;;
+;; #+BEGIN_SRC sclang :results none
+;; // modulate a sine frequency and a noise amplitude with another sine
+;; // whose frequency depends on the horizontal mouse pointer position
+;; {
+;; var x = SinOsc.ar(MouseX.kr(1, 100));
+;; SinOsc.ar(300 * x + 800, 0, 0.1)
+;; +
+;; PinkNoise.ar(0.1 * x + 0.1)
+;; }.play;
+;; #+END_SRC
+
+
+;;; Code:
+;;;

+(require 'org)
+(require 'ob)
+
+(require 'sclang-interp)
+
+(defgroup ob-sclang nil
+  "org-mode blocks for SuperCollider SCLang."
+  :group 'org)
+
+;;;###autoload
+(defun org-babel-execute:sclang (body params)
+  "Org-mode Babel sclang hook for evaluate `BODY' with `PARAMS'."
+  (unless (or (equal (buffer-name) sclang-post-buffer)
+  (sclang-get-process))
+(sclang-start))
+
+  ;; (let* ((db (or (cdr (assoc :db params))
+  ;;ob-mongo:default-db))
+  ;;(cmd (mapconcat 'identity (list "mongo" "--quiet" db) " ")))
+  ;;   (org-babel-eval cmd body))
+
+  (sclang-eval-string body t)
+
+  ;; (let ((cmd "sclang -r -s -D"))
+  ;;   (org-babel-eval cmd body))
+  )
+
+(defvar org-babel-default-header-args:sclang nil)
+
+(setq org-babel-default-header-args:sclang
+  '((:session . "*SCLang:Workspace*")
+(:output . "none")) ; TODO: temporary can't find way to let sclang
output to stdout for org-babel.
+  )
+
+;;;###autoload
+(with-eval-after-load "org"
+  (add-to-list 'org-src-lang-modes '("sclang" . sclang)))
+
+;;;

+
+(provide 'ob-sclang)
+
+;;; ob-sclang.el ends here
-- 
2.13.1
```

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jun 15, 2017 at 8:38 PM, Bastien Guerry  wrote:

> "numbch...@gmail.com"  writes:
>
> > Here is the patch
>
> The patch needs to have a proper changelog.  You can read
> http://orgmode.org/worg/org-contribute.html#patches carefully
> for details.
>
> Thanks!
>
> --
>  Bastien
>
From 9f0b5051bda5ae458242e37923ad18e3189663d9 Mon Sep 17 00:00:00 2001
From: stardiviner 

Re: [O] Add ob-sclang.el for sclang Org-mode babel support in contrib/

2017-06-17 Thread numbch...@gmail.com
Did my SSH public key add to org-mode repository?
After added, if I want to update my `ob-sclang.el`. Command `git push
upstream` (upstream: git://orgmode.org/org-mode.git) will allow my access?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, Jun 17, 2017 at 6:53 PM, Bastien Guerry  wrote:

> Applied, thanks!
>
> --
>  Bastien
>


Re: [O] ob-clojure evaluate error when Org-mode buffer has ns clojure code

2017-06-17 Thread numbch...@gmail.com
quire
  core.clj: 5911  clojure.core/require
   RestFn.java:  408  clojure.lang.RestFn/invoke
  REPL:1  user/eval46259/loading--auto--
  REPL:1  user/eval46259
  REPL:1  user/eval46259
 Compiler.java: 6977  clojure.lang.Compiler/eval
 Compiler.java: 6966  clojure.lang.Compiler/eval
 Compiler.java: 6940  clojure.lang.Compiler/eval
  core.clj: 3187  clojure.core/eval
  core.clj: 3183  clojure.core/eval
  main.clj:  242  clojure.main/repl/read-eval-print/fn
  main.clj:  242  clojure.main/repl/read-eval-print
  main.clj:  260  clojure.main/repl/fn
  main.clj:  260  clojure.main/repl
  main.clj:  176  clojure.main/repl
   RestFn.java: 1523  clojure.lang.RestFn/invoke
interruptible_eval.clj:   87
 clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn
  AFn.java:  152  clojure.lang.AFn/applyToHelper
  AFn.java:  144  clojure.lang.AFn/applyTo
  core.clj:  657  clojure.core/apply
  core.clj: 1963  clojure.core/with-bindings*
  core.clj: 1963  clojure.core/with-bindings*
   RestFn.java:  425  clojure.lang.RestFn/invoke
interruptible_eval.clj:   85
 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj:   55
 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj:  222
 clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
interruptible_eval.clj:  190
 clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn
  AFn.java:   22  clojure.lang.AFn/run
   ThreadPoolExecutor.java: 1142
 java.util.concurrent.ThreadPoolExecutor/runWorker
   ThreadPoolExecutor.java:  617
 java.util.concurrent.ThreadPoolExecutor$Worker/run
   Thread.java:  745  java.lang.Thread/run
```


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, Jun 17, 2017 at 9:46 AM, Tim Cross  wrote:

>
> My guess is that cider is not finding the incanter package in the
> classpath when the first block attempts to evaluate. Another issue is
> that your not using any session options, so your two blocks will be
> evaluated in separate environments - not a real problem with your
> current example, but will be an issue if you expect to access incanter
> functions from separate babel blocks.
>
> There are a number of working parts which all need to be lined up
> correctly before babel clojure support will work correctly. Getting
> things to work when your just using core clojure functions is fairly
> trivial, but getting it to work when you have to pull in other
> dependencies can be a little tricky.
>
> You might find this article useful to get started
>
> http://fgiasson.com/blog/index.php/2016/06/21/optimal-
> emacs-settings-for-org-mode-for-literate-programming/
>
> I also notice you have not set the org-babel-clojure-backend, which you
> need to do. My recommendation would be to do the following
>
> 1. Create a leinegen project to experiment with i.e.
> lein new app my-kk
>
> 2. Make sure you can edit and evaluate clojure just using clojure-mode
> and cider in emacs
>
> 3. Add the incanter package to your project.clj dependencies key
>
> 4. Modify core.clj (using clojure-mode) to include the code in your
> clojure blocks and run with cider to make sure they work as expected.
>
> 5. Create the org file you want to experiment with in the root of your
> project. This should ensure that when you try to evaluate clojure
> blocks, the cider backend will be loaded with the dependencies in the
> project.clj file.
>
> 6. Copy the code in your core.clj file into ONE babel src block and see
> if you can get it to evaluate correctly. Experiment with the block
> configuration options like :output etc.
>
> 7. Break the code up into different blocks and experiment with block
> options, especially session options.
>
> Once you get to that point, you should be across the various moving
> parts with sufficient understanding to then look at how you can tweak
> things to get exactly the behaviour and workflow you want.
>
> HTH
>
> Tim
>
> numbch...@gmail.com writes:
>
> > When Org-mode buffer like this:
> >
> > #+BEGIN_SRC clojure
> > (ns my.kk
> >   (:require '[incanter.core :as kk]))
> > #+END_SRC
> >
> > #+BEGIN_SRC clojure
> > (print "hi")
> > (def  "hello")
> > #+END_SRC
&

Re: [O] Add ob-sclang.el for sclang Org-mode babel support in contrib/

2017-06-17 Thread numbch...@gmail.com
I see, thanks very much.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, Jun 17, 2017 at 8:46 PM, Bastien Guerry  wrote:

> "numbch...@gmail.com"  writes:
>
> > Did my SSH public key add to org-mode repository?
>
> Now yes.
>
> You first need to pull org-mode again like this:
>
> ~$ git clone orgm...@orgmode.org:org-mode.git
>
> Then you will be able to push commits.
>
> Do not commit changes outside of the contrib/ repository.
>
> If you have signed the FSF copyright papers, please let me
> know under what name.
>
> Best,
>
> --
>  Bastien
>


Re: [O] ob-clojure evaluate error when Org-mode buffer has ns clojure code

2017-06-17 Thread numbch...@gmail.com
After a new evaluation. I found
```org
#+BEGIN_SRC clojure
(ns user
  (:require '[incanter.core :as mm]))
#+END_SRC

#+RESULTS:
: class clojure.lang.Compiler$CompilerExceptionclass
clojure.lang.Compiler$CompilerExceptionCompilerException
java.lang.Exception: Found lib name 'incanter.core' containing period with
prefix 'quote'.  lib names inside prefix lists must not contain periods,
compiling:(/home/stardiviner/Code/learning/Emacs/Org-mode/ob-clojure.org:1
:1)

#+BEGIN_SRC clojure :session :results output
(print "hi")
(def  "hello")
#+END_SRC

#+RESULTS:
: hi
```

Both two src blocks works. Because the first src block Clojure namespace
`(ns user ..)` is same with CIDER REPL default namespace `user`. So it
works.

But when I tried add header argument `:eval no` on first src block like
this:

```org
#+BEGIN_SRC clojure :session :eval no
(ns user.kk
  (:require '[incanter.core :as mm]))
#+END_SRC

#+RESULTS:

#+BEGIN_SRC clojure :session :results output
(print "hi")
(def  "hello")
#+END_SRC

#+RESULTS:
```

The second src block failed again. So I think `ob-clojure` will try to
evaluate the first src block even I added header argument `:eval no`. So
`ob-clojure.el` does not respect header argument `:eval no`. But I think
might because `:eval no` is not work for this purpose. I did can't evaluate
by pressing `[C-c C-c]` on first block.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, Jun 17, 2017 at 8:57 PM, numbch...@gmail.com 
wrote:

> I did configure `ob-clojure` with the following settings:
>
> ```elisp
> (require 'ob-clojure)
>
> ;; use CIDER as the Clojure execution backend
> (setq org-babel-clojure-backend 'cider)
>
> ;; Useful keybindings when using Clojure from Org
> ;; (org-defkey org-mode-map (kbd "C-x C-e") 'cider-eval-last-sexp)
> ;; (org-defkey org-mode-map (kbd "C-c C-d") 'cider-doc)
>
> ;; No timeout when executing calls on Cider via nrepl
> ;; (setq org-babel-clojure-sync-nrepl-timeout nil)
>
> ;; let `ob-clojure' babel src blocks allow evaluation.
> (add-to-list 'org-babel-default-header-args:clojure
>  '(:eval . "yes"))
> (add-to-list 'org-babel-default-header-args:clojure
>  '(:results . "output"))
> ;; (add-to-list 'org-babel-default-header-args:clojure
> ;;  '(:show-process . t))
> ```
>
> I start CIDER REPL session with `cider-jack-in` without project in Emacs.
>
> I changed namespace to `user` in src blocks like this:
>
> ```org
> #+BEGIN_SRC clojure
> (ns user
>   (:require '[incanter.core :as kk]))
> #+END_SRC
>
> #+RESULTS:
>
> #+BEGIN_SRC clojure :session :results output
> (print "hi")
> (def  "hello")
> #+END_SRC
>
> #+RESULTS:
> : hi
> ```
>
> Then it works.
>
> Seems you're right, might my first src block can't work correctly. That
> caused second src block evaluation failed.
>
> But I require `incanter` works, I have `incanter` in Leiningen
> dependencies.
> ```clojure
> (require '[incanter.core :as kk])
> ```
>
> But include `incanter` in namespace failed:
> ```clojure
> (ns user
>   (:require '[incanter.core :as kk]))
> ```
> with the following error.
> ```
>   Show: Clojure Java REPL Tooling Duplicates All  (29 frames hidden)
>
> 2. Unhandled clojure.lang.Compiler$CompilerException
>Error compiling Code/learning/Emacs/Org-mode/ob-clojure.org at (1:1)
>
>   core.clj: 5771  clojure.core/throw-if
>   core.clj: 5835  clojure.core/load-lib
>   core.clj: 5832  clojure.core/load-lib
>RestFn.java:  142  clojure.lang.RestFn/applyTo
>   core.clj:  659  clojure.core/apply
>   core.clj: 5893  clojure.core/load-libs
>   core.clj: 5873  clojure.core/load-libs
>RestFn.java:  137  clojure.lang.RestFn/applyTo
>   core.clj:  659  clojure.core/apply
>   core.clj: 5911  clojure.core/require
>   core.clj: 5911  clojure.core/require
>RestFn.java:  408  clojure.lang.RestFn/invoke
>   REPL:1  user/eval46259/loading--auto--
>   REPL:1  user/eval46259
>   REPL:1  user/eval46259
>  Compiler.java: 6977  clojure.lang.Compiler/eval
>  Compiler.java: 6966  clojure.lang.Compiler/eval
>  Compiler.java: 6940  cloj

Re: [O] ob-clojure evaluate error when Org-mode buffer has ns clojure code

2017-06-17 Thread numbch...@gmail.com
I see, thanks very much.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sun, Jun 18, 2017 at 9:10 AM, Tim Cross  wrote:

>
> It looks like you have a combination of both clojure errors and possibly
> org babel errors. You need to sort out the clojure errors before you can
> verify there are any problems with org babel clojure support.
>
> You mention that
>
> > I start CIDER REPL session with `cider-jack-in` without project in
> > Emacs.
>
> but then you say
>
> > But I require `incanter` works, I have `incanter` in Leiningen
> > dependencies.
>
> However, if you don't have a project, then you don't have a project.clj
> file and if you don't have a project.clj file, you don't have a
> :dependencies block with incanter as a specified dependency, so incanter
> is not in your classpath and therefore will not be found when you try to
> require it.
>
> Note also that you have incorrect syntax for your require
> statement. Also to be clear, (ns ... (:require ...)) does not define
> dependencies. It simply loads the library into the namespace.
>
> The correct syntax for your first block is
>
> (ns my-kk
>   (:require [incanter.core :as k]))
>
> There is no quote before the lib spec - this is also what the error
> message is telling you. If you call require as a function, then you do
> need to use the quote i.e.
>
> (require 'incanter.core :as k)
>
> You appear to have two main problems here and that is making things
> 'muddy'. I'm guessing your learning clojure as well as using org babel
> clojure support. You need to sort out the clojure problems first. Highly
> recommend you suspend using org mode to do your clojure until your
> across all the clojure specifics and have a good understanding of the
> clojure environment. You will need a good understanding of how clojure
> works to then be able to work out what you need to do to get it to work
> with org mode. Trying to do both at the same time will just cause
> confusion.
>
> HTH
>
> Tim
>
> numbch...@gmail.com writes:
>
> > I did configure `ob-clojure` with the following settings:
> >
> > ```elisp
> > (require 'ob-clojure)
> >
> > ;; use CIDER as the Clojure execution backend
> > (setq org-babel-clojure-backend 'cider)
> >
> > ;; Useful keybindings when using Clojure from Org
> > ;; (org-defkey org-mode-map (kbd "C-x C-e") 'cider-eval-last-sexp)
> > ;; (org-defkey org-mode-map (kbd "C-c C-d") 'cider-doc)
> >
> > ;; No timeout when executing calls on Cider via nrepl
> > ;; (setq org-babel-clojure-sync-nrepl-timeout nil)
> >
> > ;; let `ob-clojure' babel src blocks allow evaluation.
> > (add-to-list 'org-babel-default-header-args:clojure
> >  '(:eval . "yes"))
> > (add-to-list 'org-babel-default-header-args:clojure
> >  '(:results . "output"))
> > ;; (add-to-list 'org-babel-default-header-args:clojure
> > ;;  '(:show-process . t))
> > ```
> >
> > I start CIDER REPL session with `cider-jack-in` without project in Emacs.
> >
> > I changed namespace to `user` in src blocks like this:
> >
> > ```org
> > #+BEGIN_SRC clojure
> > (ns user
> >   (:require '[incanter.core :as kk]))
> > #+END_SRC
> >
> > #+RESULTS:
> >
> > #+BEGIN_SRC clojure :session :results output
> > (print "hi")
> > (def  "hello")
> > #+END_SRC
> >
> > #+RESULTS:
> > : hi
> > ```
> >
> > Then it works.
> >
> > Seems you're right, might my first src block can't work correctly. That
> > caused second src block evaluation failed.
> >
> > But I require `incanter` works, I have `incanter` in Leiningen
> dependencies.
> > ```clojure
> > (require '[incanter.core :as kk])
> > ```
> >
> > But include `incanter` in namespace failed:
> > ```clojure
> > (ns user
> >   (:require '[incanter.core :as kk]))
> > ```
> > with the following error.
> > ```
> >   Show: Clojure Java REPL Tooling Duplicates All  (29 frames hidden)
> >
> > 2. Unhandled clojure.lang.Compiler$CompilerException
> >Error compiling Code/learning/Emacs/Org-mode/ob-clojure.org at (1:1)
> >
> >   core.clj: 5771  clojure.core/throw-if
> >  

[O] How to auto insert inline image link for org-plot/gnuplot result plot?

2017-06-17 Thread numbch...@gmail.com
I want to auto insert inline image for `org-plot/gnuplot` result plot below
the table. Like this:

```org
#+PLOT: title:"Citas" ind:1 deps:(3) type:2d with:histograms set:"yrange
[0:]"
| Sede  | Max cites | H-index |
|---+---+-|
| Chile |257.72 |   21.39 |
| Leeds |165.77 |   19.68 |
| Sao Paolo | 71.00 |   11.50 |
| Stockholm |134.19 |   14.33 |
| Morelia   |257.56 |   17.67 |

Press =[C-c " g]= on upper table to generate gnuplot plot image (*NOTE*: the
generated plot image is in currently working directory).

#+ATTR_ORG: :width 250
#+ATTR_LATEX: :width 2.5in
#+ATTR_HTML: :width 250px
[[file:org-plot.png]]
```

I have an idea, add an advice on `org-plot/gnuplot` with a user helper
function to inser the inline image link.
This advice need to:

- locate point below the table.
- get the `org-plot/gnuplot` result plot image link.
- insert inline image link.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] How to use noweb reference with argument in other languages?

2017-06-18 Thread numbch...@gmail.com
I found noweb reference with argument `<>` issue.

This can work:

```org
#+NAME: f1
#+BEGIN_SRC emacs-lisp :var x=7 :results value
  (+ x x)
#+END_SRC

#+RESULTS: f1
: 14

#+NAME: f2
#+BEGIN_SRC emacs-lisp :var x=7 :results value
  (+ x 2)
#+END_SRC

#+RESULTS: f2
: 9

#+name: intermediate
#+call: f1(x=5)

#+RESULTS: intermediate
: 10

#+call: f2(x=intermediate)

#+RESULTS:
: 12


#+name: intermediate
#+BEGIN_SRC emacs-lisp :noweb yes :results value
<>
#+END_SRC

#+BEGIN_SRC emacs-lisp :noweb yes :results value
<>
#+END_SRC

#+RESULTS:
: 12
```

And this does not work:
```org
#+NAME: sh-print-something
#+BEGIN_SRC sh :var str=""
echo "$str"
#+END_SRC

#+BEGIN_SRC sh :results output :noweb yes
echo "hello, "
<>
#+END_SRC

#+RESULTS:
```

Why the first language `emacs-lisp` works, but second `sh` does not work?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] Asks user what to do with each tangle-file before overriding?

2017-06-18 Thread numbch...@gmail.com
I also think Org-mode table src block content to override file is dangerous.

I have another idea. Append src block content to end of file.

I have a sceniro:

File `dotfile-1.org`:
```
* SSH config 1

#+BEGIN_SRC conf :tangle "~/.ssh/config"
fragment 1
#+END_SRC
```

File `dotfile-2.org`:
```
* SSH config 2

#+BEGIN_SRC conf :tangle "~/.ssh/config"
fragment 2
#+END_SRC

```

When the tangle src blocks are in separate files, this override file way is
not suitable.
Of course I can put those src blcoks together, but when I have to organize
literate programming files in separately, the override way is not suitable
anymore. So hope Org-mode can provide `append` way with an `defcustom`
option.


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Fri, Jun 16, 2017 at 1:09 PM, Chunyang Xu  wrote:

> Hi,
>
> Currently 'C-c C-v C-t' ('org-babel-tangle') simply overrides existing
> tangle-file, I would like org to ask me what to do? such as
>
> a) yes (override)
> b) no (don't override)
> c) show the diff then ask again
>
> In addition, if there is no diff (i.e., having the same contents), user
> can choose (e.g., via a user option) to simply pass this tangle-file
> without overriding.
>
> I am asking for this feature because I am storing my dotfiles in a
> single Org file [1], and when I change my Bash configuration then
> tangle, I don't need to worry if Org is tangling other configuration
> correctly, especially ~/.ssh/id_rsa and ~/.authinfo.gpg. I would rather
> leave these unchanged files than override (even only file modification
> timestamps are updated).
>
> [1] https://raw.githubusercontent.com/xuchunyang/dotfiles/
> master/README.org
>
>
>
>


Re: [O] Add ob-sclang.el for sclang Org-mode babel support in contrib/

2017-06-19 Thread numbch...@gmail.com
After you two's discussion, I have some understanding about lexical scope
and dynamic scope. I will add lexical binding if my code use it.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Jun 19, 2017 at 6:37 PM, Bastien Guerry  wrote:

> Hi Nicolas,
>
> I'm all for lexical-binding, and it's good to have it in Org's core.
>
> The author of ob-sclang.el used "2011-2017" for the copyright years,
> which was obviously a typo and tells that the header was simply copied
> from another file (which is 100% fine btw).
>
> From that, I inferred that the "lexical-binding:t" was also copied
> without further thinking, especially since there is no binding at all
> in this file.
>
> I think Stardiviner is the one who should make the decision, but I
> don't see what "lexical-binding:t" would add to his actual code.
>
> For the more general concern: again, I'm all for lexical binding and
> I'm well aware of its numerous advantages, but I don't think we should
> rule dynamic binding from contributed Org code.  Dynamic binding has
> it's limitations, but when used carefully, it also has the advantage
> of being easier to grok for beginners.  We want to welcome beginner's
> contributions.  So I simply recommand lexical binding for Org's core,
> and what fits developers best for Org's contributions.
>
> And I agree we can move on to something else :)
>
> --
>  Bastien
>


Re: [O] How to use noweb reference with argument in other languages?

2017-06-19 Thread numbch...@gmail.com
Which Org-mode version are you using? I'm using the latest Org-mode version
from source code branch `master`.

When I use your `:noweb-ref` style like this:

```org
* noweb reference with argument

#+BEGIN_SRC sh :var str="" :noweb-ref sh-print-something
echo "$str"
#+END_SRC

#+BEGIN_SRC sh :results output :noweb yes
echo "hello, "
<>
#+END_SRC

#+RESULTS:
```

Emacs reports error:

org-babel-ref-resolve: Reference ‘sh-print-something’ not found in this
buffer.

Org-mode version: Org mode version 9.0.8 (9.0.8-elpaplus @
/home/stardiviner/Code/Emacs/org-mode/lisp/)

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Jun 19, 2017 at 6:21 PM, Kaushal Modi 
wrote:

> On Mon, Jun 19, 2017, 12:59 AM numbch...@gmail.com 
> wrote:
>
>> I found noweb reference with argument `<>` issue.
>>
>
> It has been working fine for me for org and sh source blocks.
>
> And this does not work:
>> ```org
>> #+NAME: sh-print-something
>> #+BEGIN_SRC sh :var str=""
>> echo "$str"
>> #+END_SRC
>>
>> #+BEGIN_SRC sh :results output :noweb yes
>> echo "hello, "
>> <>
>> #+END_SRC
>>
>
> You need to use :noweb-ref option  in the source blocks header args to set
> the noweb-ref code reference; #+NAME will not work.
>
> I have to have used noweb for the very first time in this recent project:
> https://raw.githubusercontent.com/kaushalmodi/eless/master/eless.org ;
> search for ":noweb-ref" in there to get an idea.
>
>> --
>
> Kaushal Modi
>


Re: [O] How to use noweb reference with argument in other languages?

2017-06-20 Thread numbch...@gmail.com
This is correct now. Thanks very much. You're right.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Jun 21, 2017 at 12:57 AM, Kaushal Modi 
wrote:

> On Mon, Jun 19, 2017 at 7:41 PM numbch...@gmail.com 
> wrote:
>
>> Which Org-mode version are you using? I'm using the latest Org-mode
>> version from source code branch `master`.
>>
>
> I am using the same.
>
>
>> When I use your `:noweb-ref` style like this:
>>
>> ```org
>> * noweb reference with argument
>>
>> #+BEGIN_SRC sh :var str="" :noweb-ref sh-print-something
>> echo "$str"
>> #+END_SRC
>>
>> #+BEGIN_SRC sh :results output :noweb yes
>> echo "hello, "
>> <>
>> #+END_SRC
>>
>> #+RESULTS:
>> ```
>>
>> Emacs reports error:
>>
>> org-babel-ref-resolve: Reference ‘sh-print-something’ not found in this
>> buffer.
>>
>> Org-mode version: Org mode version 9.0.8 (9.0.8-elpaplus @
>> /home/stardiviner/Code/Emacs/org-mode/lisp/)
>>
>
> I stand corrected; for the stuff that you are doing, I believe the code
> block name needs to go to #+NAME instead of to :noweb-ref.
>
> Below works (Hit C-c C-c in the second source block and approve evaluating
> that code block:
>
> * noweb reference with argument
>
> #+NAME: sh-print-something
> #+BEGIN_SRC shell :var str=""
> echo echo $str
> #+END_SRC
>
> #+BEGIN_SRC shell :results output :noweb yes
> echo "hello, "
> <>
> #+END_SRC
>
> #+RESULTS:
> : hello,
> : stardiviner
>
> Changes:
>
> (1) Switched back to #+NAME from :noweb-ref. Looks like if you need to
> pass args, the reference name needs to be a code block name because
> <> inserts the *results* of the code block "foo", not "foo" as
> it is.
> (2) So in the first block, you need to have code that *outputs* "echo
> $str" with $str set to your set arg.
> (3) Use shell instead of sh.
>
> To stress the point of "<> inserts the *results*", even the
> below would work the same way as we care about the results output by the
> first block, not how those results are obtained.
>
> * noweb reference with argument
>
> #+NAME: sh-print-something
> #+BEGIN_SRC python :var str="foo" :results output
> print('echo "' + str + '"')
> #+END_SRC
>
> #+RESULTS: sh-print-something
> : echo "foo"
>
> #+BEGIN_SRC shell :results output :noweb yes
> echo "hello, "
> <>
> #+END_SRC
>
> #+RESULTS:
> : hello,
> : stardiviner
>
> --
>
> Kaushal Modi
>


Re: [O] ob-clojure evaluate error when Org-mode buffer has ns clojure code

2017-06-20 Thread numbch...@gmail.com
Hi, Tim,
Excuse my obstinacy, I still think the problem is in `ob-clojure.el`
Because when I:
```org
#+BEGIN_SRC clojure :session
(ns user-kk)
#+END_SRC

#+BEGIN_SRC clojure :session :results output
(print "hi")
(def  "hello")
#+END_SRC

#+RESULTS:
```
The second block does not return result.
when I remove the first block, the second block works.
Why `ob-clojure.el` don't evaluate the first block when I press [C-c C-c]
on the second block, but still respect the first block's Clojure namespace
definition?

If it is the way `ob-clojure.el` works. I think this should have an option
to disable "respecting babel clojure namespace definition". Because I use
"Literate Programming" a lot. I will add some src blcoks with `(ns ...)` as
example in Org-mode file.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sun, Jun 18, 2017 at 1:48 PM, numbch...@gmail.com 
wrote:

> I see, thanks very much.
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
> On Sun, Jun 18, 2017 at 9:10 AM, Tim Cross  wrote:
>
>>
>> It looks like you have a combination of both clojure errors and possibly
>> org babel errors. You need to sort out the clojure errors before you can
>> verify there are any problems with org babel clojure support.
>>
>> You mention that
>>
>> > I start CIDER REPL session with `cider-jack-in` without project in
>> > Emacs.
>>
>> but then you say
>>
>> > But I require `incanter` works, I have `incanter` in Leiningen
>> > dependencies.
>>
>> However, if you don't have a project, then you don't have a project.clj
>> file and if you don't have a project.clj file, you don't have a
>> :dependencies block with incanter as a specified dependency, so incanter
>> is not in your classpath and therefore will not be found when you try to
>> require it.
>>
>> Note also that you have incorrect syntax for your require
>> statement. Also to be clear, (ns ... (:require ...)) does not define
>> dependencies. It simply loads the library into the namespace.
>>
>> The correct syntax for your first block is
>>
>> (ns my-kk
>>   (:require [incanter.core :as k]))
>>
>> There is no quote before the lib spec - this is also what the error
>> message is telling you. If you call require as a function, then you do
>> need to use the quote i.e.
>>
>> (require 'incanter.core :as k)
>>
>> You appear to have two main problems here and that is making things
>> 'muddy'. I'm guessing your learning clojure as well as using org babel
>> clojure support. You need to sort out the clojure problems first. Highly
>> recommend you suspend using org mode to do your clojure until your
>> across all the clojure specifics and have a good understanding of the
>> clojure environment. You will need a good understanding of how clojure
>> works to then be able to work out what you need to do to get it to work
>> with org mode. Trying to do both at the same time will just cause
>> confusion.
>>
>> HTH
>>
>> Tim
>>
>> numbch...@gmail.com writes:
>>
>> > I did configure `ob-clojure` with the following settings:
>> >
>> > ```elisp
>> > (require 'ob-clojure)
>> >
>> > ;; use CIDER as the Clojure execution backend
>> > (setq org-babel-clojure-backend 'cider)
>> >
>> > ;; Useful keybindings when using Clojure from Org
>> > ;; (org-defkey org-mode-map (kbd "C-x C-e") 'cider-eval-last-sexp)
>> > ;; (org-defkey org-mode-map (kbd "C-c C-d") 'cider-doc)
>> >
>> > ;; No timeout when executing calls on Cider via nrepl
>> > ;; (setq org-babel-clojure-sync-nrepl-timeout nil)
>> >
>> > ;; let `ob-clojure' babel src blocks allow evaluation.
>> > (add-to-list 'org-babel-default-header-args:clojure
>> >  '(:eval . "yes"))
>> > (add-to-list 'org-babel-default-header-args:clojure
>> >  '(:results . "output"))
>> > ;; (add-to-list 'org-babel-default-header-args:clojure
>> > ;;  '(:show-process . t))
>> > ```
>> >
>> > I start CIDER REPL session wi

[O] ob-haskell.el evaluation error.

2017-06-20 Thread numbch...@gmail.com
Confirmed with minimal Emacs config.
I'm using latest Emacs which build from source code, and latest version
Org-mode which load from source code.

Here is the steps to reproduce the issue:
1. emacs-minimal-init (command which load minimal init file)
2. [M-x run-haskell] ; load haskell inferior for `ob-haskell`.
3. press [C-c C-c] on haskell src block like this:

#+BEGIN_SRC haskell :session "*haskell*"
1 + 9
#+END_SRC

I got error:

#+BEGIN_EXAMPLE
Debugger entered--Lisp error: (error "‘org-babel-script-escape’ expects a
string")
  signal(error ("‘org-babel-script-escape’ expects a string"))
  error("`org-babel-script-escape' expects a string")
  org-babel-script-escape(nil)
  org-babel-execute:haskell("2 + 8" ((:colname-names) (:rowname-names)
(:result-params "replace") (:result-type . value) (:results . "replace")
(:exports . "code") (:session . "none") (:cache . "no") (:noweb . "no")
(:hlines . "no") (:tangle . "no") (:padlines . "no")))
  org-babel-execute-src-block(nil ("haskell" "2 + 8" ((:colname-names)
(:rowname-names) (:result-params "replace") (:result-type . value)
(:results . "replace") (:exports . "code") (:padlines . "no") (:tangle .
"no") (:hlines . "no") (:noweb . "no") (:cache . "no") (:session . "none"))
"" nil 110 "(ref:%s)"))
  org-ctrl-c-ctrl-c(nil)
  funcall-interactively(org-ctrl-c-ctrl-c nil)
  call-interactively(org-ctrl-c-ctrl-c nil nil)
  command-execute(org-ctrl-c-ctrl-c)
#+END_EXAMPLE

In ~*haskell*~ buffer:

#+BEGIN_EXAMPLE
GHCi, version 8.0.1: http://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /home/stardiviner/.ghci
λ> 2 + 8
"org-babel-haskell-eoe"
10
λ> "org-babel-haskell-eoe"
λ> 2 + 8
"org-babel-haskell-eoe"
10
λ> "org-babel-haskell-eoe"
λ>
#+END_EXAMPLE

In other way: when I start haskell inferior process with command:
[M-x haskell-interactive-bring].

The error is:

#+BEGIN_EXAMPLE
Debugger entered--Lisp error: (error "Buffer *haskell* does not exist or
has no process")
  signal(error ("Buffer *haskell* does not exist or has no process"))
  error("Buffer %s does not exist or has no process" #)
  org-babel-execute:haskell("main :: IO ()\nmain = do\n  putStrLn \"Hello,
World!\"" ((:colname-names) (:rowname-names) (:result-params "replace")
(:result-type . value) (:results . "replace") (:exports . "code") (:session
. "none") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no")
(:padlines . "no")))
  org-babel-execute-src-block(nil ("haskell" "main :: IO ()\nmain = do\n
 putStrLn \"Hello, World!\"" ((:colname-names) (:rowname-names)
(:result-params "replace") (:result-type . value) (:results . "replace")
(:exports . "code") (:padlines . "no") (:tangle . "no") (:hlines . "no")
(:noweb . "no") (:cache . "no") (:session . "none")) "" nil 53 "(ref:%s)"))
  org-ctrl-c-ctrl-c(nil)
  funcall-interactively(org-ctrl-c-ctrl-c nil)
  call-interactively(org-ctrl-c-ctrl-c nil nil)
  command-execute(org-ctrl-c-ctrl-c)
#+END_EXAMPLE

 *Problem*:

 =haskell-interactive-bring= started =*haskell*= process buffer does not
work with
 Org-mode Babel ob-haskell's session =*haskell*=.


But I have process buffer ~*haskell*~ running.

This is weird.

I used to report error at here:
https://github.com/haskell/haskell-mode/issues/1429



[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] org-git-link 's open function org-git-open does not work correctly

2017-06-23 Thread numbch...@gmail.com
When I `org-store-link` in a local git repository file buffer, I got this
link:

[[git:~/.emacs.d/init/org-mode/init-my-org-hyperlink.el::develop@
{2017-06-24}::202][git:~/.emacs.d/init/org-mode/init-my-org-hyperlink.el::develop@
{2017-06-24}::202]]

Then I insert link into Org-mode buffer.
But when I open link with `[C-c C-o]`, it open git revision:
```
"/tmp/org-git-8fd5f4cf5d17479ead7b4329024860e84b6f2453/init-my-org-hyperlink.el"
```
This is not correct.
My current `HEAD` (command: `git show HEAD`) is:
```
commit 3cc7ee1792a7d7b8ddf51897f7b968af36bae745 (HEAD -> develop)
```

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] Why ob-clojure.el does not respect :dir header argument?

2017-06-28 Thread numbch...@gmail.com
In Org-mode Info page, the header argument `:dir` is used to specify the
default directory for code block execution.
But `ob-clojure` with `cider` as backend, will always use the
`cider-jack-in` directory as default working directly. Is there a way to
change this?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] org-irc.el get IRC link port error

2017-06-28 Thread numbch...@gmail.com
Here is the steps to reproduce this issue:

Emacs version: 26.0.50 (from source code repo master branch)
Org-mode version: 9.0.8 (from source code repo master branch)

Here is the example link:
IRC: [[irc://irc.freenode.net/#nextcloud][#nextcloud]] on Freenode

I use Edebug to debug on function `org-irc-visit-erc`:

- [-] check out source code
  - [X] org-open-at-point(nil)
  - [X] org-irc-visit("//irc.freenode.net/#nextcloud")
  - [ ] org-irc-visit-erc((("irc.freenode.net") "#nextcloud"))
- [ ] (port (or (string-to-number (cadr (pop link))) erc-default-port))
  - [ ] (string-to-number (cadr (pop link)))
- [ ] (cadr (pop link)) -> (cadr ("irc.freenode.net")) -> nil

  #+BEGIN_SRC emacs-lisp
  (setq temp-link '(("irc.freenode.net") ("#clojure")))

  (pop temp-link)
  (cadr (pop temp-link))
  #+END_SRC

- [ ] (string-to-number nil)

You can see what's wrong.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] org-irc.el get IRC link port error

2017-06-28 Thread numbch...@gmail.com
confirm fixed, thanks.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Jun 28, 2017 at 8:47 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> "numbch...@gmail.com"  writes:
>
> > Here is the steps to reproduce this issue:
> >
> > Emacs version: 26.0.50 (from source code repo master branch)
> > Org-mode version: 9.0.8 (from source code repo master branch)
> >
> > Here is the example link:
> > IRC: [[irc://irc.freenode.net/#nextcloud][#nextcloud]] on Freenode
> >
> > I use Edebug to debug on function `org-irc-visit-erc`:
> >
> > - [-] check out source code
> >   - [X] org-open-at-point(nil)
> >   - [X] org-irc-visit("//irc.freenode.net/#nextcloud")
> >   - [ ] org-irc-visit-erc((("irc.freenode.net") "#nextcloud"))
> > - [ ] (port (or (string-to-number (cadr (pop link)))
> erc-default-port))
> >   - [ ] (string-to-number (cadr (pop link)))
> > - [ ] (cadr (pop link)) -> (cadr ("irc.freenode.net")) -> nil
> >
> >   #+BEGIN_SRC emacs-lisp
> >   (setq temp-link '(("irc.freenode.net") ("#clojure")))
> >
> >   (pop temp-link)
> >   (cadr (pop temp-link))
> >   #+END_SRC
> >
> > - [ ] (string-to-number nil)
>
> Fixed. Thank you.
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] Why ob-clojure.el does not respect :dir header argument?

2017-06-28 Thread numbch...@gmail.com
I will dive into source code, and try whether I can add advice on
ob-clojure.el to inject Org-mode file directory into CIDER working
directory everytime executing the clojure babel src block.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jun 29, 2017 at 10:40 AM, Tim Cross  wrote:

> ob-clojure is limited by what can be done via the interfaces offered by
> cider. Have a look at the ob-clojure.el source code - it is very simple and
> does not have options/interfaces to support the full range of possible
> source block headers. Someone may be able to implement this, but nobody
> has. Feel free to have a go at it.
>
> IMO ob-clojure is only written to do very basic clojure code evaluation.
> If you want something more complex, you have to add that hyourself.
>
>
>
> On 28 June 2017 at 21:01, numbch...@gmail.com  wrote:
>
>> In Org-mode Info page, the header argument `:dir` is used to specify the
>> default directory for code block execution.
>> But `ob-clojure` with `cider` as backend, will always use the
>> `cider-jack-in` directory as default working directly. Is there a way to
>> change this?
>>
>> [stardiviner] GPG key ID: 47C32433
>> IRC(freeenode): stardiviner Twitter:  @numbchild
>> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
>> Blog: http://stardiviner.github.io/
>>
>
>
>
> --
> regards,
>
> Tim
>
> --
> Tim Cross
>
>


[O] Org-capture templates target error in recent Org-mode source code update.

2017-06-29 Thread numbch...@gmail.com
 I got this error:

#+BEGIN_EXAMPLE
Debugger entered--Lisp error: (error "Invalid file location: nil")
  signal(error ("Invalid file location: nil"))
  error("Invalid file location: %S" nil)
  org-capture-expand-file((concat org-directory "/Contacts/Contacts.org"))
  org-capture-target-buffer((concat org-directory "/Contacts/Contacts.org"))
  org-capture-set-target-location()
  org-capture(nil)
  funcall-interactively(org-capture nil)
  call-interactively(org-capture nil nil)
  command-execute(org-capture)
#+END_EXAMPLE

I define org-capture template with this:

#+BEGIN_SRC emacs-lisp
(setq org-contacts-files '("~/Org/Contacts/Contacts.org"))

(setq org-capture-templates
  (append '(("C" "[C]ontact"
 entry (file (car org-contacts-files))
 "** %^{NAME}
:PROPERTIES:
:NICK: %^{Nick}
:AVATAR: %^{Avatar}
:END:"
 :empty-lines 1
 :jump-to-captured t
 )
)
  org-capture-templates))
#+END_SRC

I'm using Org-mode source code "master" branch. and update to latest.
(current latest commit: - 379a22c9c * master upstream/master Revert
"ox-texinfo: Move menu handling from sections to headlines") My org-capture
template works before, but now it does not work. Seems currently source
code does not support "sexp" ~(file (car org-contacts-files))~ which
returns a path to file.


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] capture templates and ^{prompt}

2017-06-30 Thread numbch...@gmail.com
Check out the docstring of variable `org-capture-templates`.
There is a doc like this:
```
%\1 ... %\N Insert the text entered at the nth %^{prompt}, where N
  is a number, starting from 1.
```
Maybe this is what you want?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Fri, Jun 30, 2017 at 5:14 PM, Jean-Christophe Helary <
jean.christophe.hel...@gmail.com> wrote:

> I'm looking for a way to use the string acquired by prompt in a second
> location in the template, like:
>
> * TODO %^{prompt} [/] :sometag:\n** TODO (value of ^{prompt} comes here)
> :someothertag:\n
>
> What's the best way to get that "value of ^{prompt}" ?
>
> Jean-Christophe
>


[O] ob-sh.el removed in master branch source code?

2017-07-12 Thread numbch...@gmail.com
RT
I checked `ORG-NEWS` and git log history. Have not found this change in
recent commits.
Can someone explain this?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] Want help for a helper function which send current link file under point to Kindle path.

2017-07-12 Thread numbch...@gmail.com
I want to write a helper function to send the link file (usually ebooks)
under the point to Kindle path like (/run/media/username/Kindle/documents/).
Hope this function can provide the following functionalities:

- check whether the source file (ebook) exist in Kindle?
- check the source file format, if not Kindle supported, then convert it
with command `ebook-convert` which is comes from program "Calibre".

I wander how to get the link actual path under the point?
For example, org link like this:

[[file:Data/Books/kk.epub][kk.epub]]
[[file+sys:/home/username/Documents/kk2.mobi][kk2.mobi]]

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] command org-clock-select-task seems does not work

2017-07-12 Thread numbch...@gmail.com
I want to clock-in recent tasks in Org-mode. but after I select first task
with by pressing "1", but it does not clock-in that task.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] ob-clojure will error result when contains comment

2017-07-12 Thread numbch...@gmail.com
Here is the examples:

#+BEGIN_SRC clojure
(+ 1 1) ;=> 2
#+END_SRC

#+RESULTS:
: class clojure.lang.LispReader$ReaderExceptionclass
java.lang.RuntimeExceptionRuntimeException EOF while reading, starting at
line 1  clojure.lang.Util.runtimeException (Util.java:221)

#+BEGIN_SRC clojure :results value
(def sum1 #(reduce + %))
(def avg1 #(/ (sum %) (count %)))

(defn stats
  [numbers]
  (map #(% numbers) [sum1 count avg1]))

(stats [3 4 10])
;; => (17 3 17/3)

(stats [80 1 44 13 6])
;; => (144 5 144/5)
#+END_SRC

#+RESULTS:
: class clojure.lang.LispReader$ReaderExceptionclass
java.lang.RuntimeExceptionRuntimeException EOF while reading, starting at
line 1  clojure.lang.Util.runtimeException (Util.java:221)


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] Org-mode ELPA repository package is not very updated?

2017-07-12 Thread numbch...@gmail.com
After some tries, I use org-mode source code `master` branch now. use
extension `use-package` to load it. It works very fine.
Thanks.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Jul 3, 2017 at 1:31 PM, Bastien  wrote:

> Hi,
>
> "numbch...@gmail.com"  writes:
>
> > I found Org-mode ELPA released source code is old and does not
> > include some patches and updates.
>
> This should be fixed now -- please confirm in a few days.
>
> --
>  Bastien
>


Re: [O] Emacs master now updated to Org 9.0.9

2017-07-12 Thread numbch...@gmail.com
Thanks for your work.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, Jul 4, 2017 at 3:54 PM, Bastien Guerry  wrote:

> Indeed, thanks to you and to everyone involved.
>
> I'm very grateful everyone has been patiently baring
> with me for this task.
>
> --
>  Bastien
>
>


Re: [O] ob-sh.el removed in master branch source code?

2017-07-12 Thread numbch...@gmail.com
Thanks, that's might because Emacs old org-mode version.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jul 13, 2017 at 8:44 AM, Kaushal Modi 
wrote:

> That's a very old incompatible change:
>
> * Version 8.2
>
> ** Incompatible changes
>
> *** =ob-sh.el= renamed to =ob-shell= This may require two changes in user
> config.
>
> 1. In =org-babel-do-load-languages=, change =(sh . t)= to =(shell . t)=.
>
> 2. Edit =local.mk= files to change the value of =BTEST_OB_LANGUAGES= to
> remove "sh" and include "shell".
> http://orgmode.org/cgit.cgi/org-mode.git/plain/etc/ORG-NEWS
>
>
> On Wed, Jul 12, 2017, 8:26 PM numbch...@gmail.com 
> wrote:
>
>> RT
>> I checked `ORG-NEWS` and git log history. Have not found this change in
>> recent commits.
>> Can someone explain this?
>>
> --
>
> Kaushal Modi
>


Re: [O] ob-clojure will error result when contains comment

2017-07-13 Thread numbch...@gmail.com
I run the both blocks fine in CIDER REPL, that's weird.
I have the following special settings for ob-clojure.
```elisp
(add-to-list 'org-babel-default-header-args:clojure
 '(:eval . "yes"))
(add-to-list 'org-babel-default-header-args:clojure
 '(:results . "value pp"))
(add-to-list 'org-babel-default-header-args:clojure ; for Clojure `dotimes'
etc.
 '(:show-process . "no"))
(add-to-list 'org-babel-default-header-args:clojure
 '(:noweb . "yes"))
```


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jul 13, 2017 at 4:48 PM, Tim Cross  wrote:

>
> I think there is something wrong with your environment and your second
> block is not legal code. If you run your second block directly in a
> clojure repl, you will get the same errors, which means it isn't an org
> issue.
>
> Executing your examples with org from master branch I get
>
> #+BEGIN_SRC clojure
> (+ 1 1) ;=> 2
> #+END_SRC
>
> #+RESULTS:
> : 2
>
> #+BEGIN_SRC clojure :results value
> (def sum1 #(reduce + %))
> (def avg1 #(/ (sum %) (count %)))
>
> (defn stats
>   [numbers]
>   (map #(% numbers) [sum1 count avg1]))
>
> (stats [3 4 10])
>
> (stats [80 1 44 13 6])
>
> #+END_SRC
>
> #+RESULTS:
> : #'user/sum1#'user/statsclass clojure.lang.Compiler$CompilerExceptionclass
> java.lang.IllegalStateExceptionclass java.lang.IllegalStateExceptionclass
> clojure.lang.Compiler$CompilerExceptionclass 
> java.lang.IllegalStateExceptionclass
> java.lang.IllegalStateExceptionCompilerException
> java.lang.RuntimeException: Unable to resolve symbol: sum in this context,
> compiling:(/tmp/form-init6637865895670060372.clj:2:15)
> : IllegalStateException Attempting to call unbound fn: #'user/avg1
> clojure.lang.Var$Unbound.throwArity (Var.java:43)
> : IllegalStateException Attempting to call unbound fn: #'user/avg1
> clojure.lang.Var$Unbound.throwArity (Var.java:43)
>
> I'm not sure why the version of ob-clojure.el is not yet in the org or
> org-plus-contrib packages - Does master only become maint after major
> version releases?
>
> Note also, there appears to be an issue with most recent versions of
> cider when you do cider-jack-in and your not inside a project. The
> issues seem to relate mainly to clj-refactor, but there could be other
> problems. Again, highly recommend running your cider inside a clojure
> project.
>
> Tim
>
> numbch...@gmail.com writes:
>
> > Here is the examples:
> >
> > #+BEGIN_SRC clojure
> > (+ 1 1) ;=> 2
> > #+END_SRC
> >
> > #+RESULTS:
> > : class clojure.lang.LispReader$ReaderExceptionclass
> > java.lang.RuntimeExceptionRuntimeException EOF while reading, starting
> at
> > line 1  clojure.lang.Util.runtimeException (Util.java:221)
> >
> > #+BEGIN_SRC clojure :results value
> > (def sum1 #(reduce + %))
> > (def avg1 #(/ (sum %) (count %)))
> >
> > (defn stats
> >   [numbers]
> >   (map #(% numbers) [sum1 count avg1]))
> >
> > (stats [3 4 10])
> > ;; => (17 3 17/3)
> >
> > (stats [80 1 44 13 6])
> > ;; => (144 5 144/5)
> > #+END_SRC
> >
> > #+RESULTS:
> > : class clojure.lang.LispReader$ReaderExceptionclass
> > java.lang.RuntimeExceptionRuntimeException EOF while reading, starting
> at
> > line 1  clojure.lang.Util.runtimeException (Util.java:221)
> >
> >
> > [stardiviner] GPG key ID: 47C32433
> > IRC(freeenode): stardiviner Twitter:  @numbchild
> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> > Blog: http://stardiviner.github.io/
>
>
> --
> Tim Cross
>


[O] [Feature Request] Provide a way to jump to noweb reference definition under point

2017-08-13 Thread numbch...@gmail.com
For example I have an Org buffer like this:

```org
#+NAME: define food-journal
#+BEGIN_SRC clojure
(def food-journal
  [{:month 1 :day 1 :human 5.3 :critter 2.3}
   {:month 1 :day 2 :human 5.1 :critter 2.0}
   {:month 2 :day 1 :human 4.9 :critter 2.1}
   {:month 2 :day 2 :human 5.0 :critter 2.5}
   {:month 3 :day 1 :human 4.2 :critter 3.3}
   {:month 3 :day 2 :human 4.0 :critter 3.8}
   {:month 4 :day 1 :human 3.7 :critter 3.9}
   {:month 4 :day 2 :human 3.7 :critter 3.6}])
#+END_SRC

#+BEGIN_SRC clojure
<>

(take-while #(< (:month %) 3) food-journal)
#+END_SRC
```

The point is at `<>`. Hope org-mode can provide and
shortcut to jump to noweb reference definition `#+NAME: define
food-journal`.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] Helm + Org-mode 9.2.5: Problem with org-set-tags

2019-08-13 Thread numbch...@gmail.com
Seems newly added a package which seems is separated from helm.el.

https://github.com/emacs-helm/helm-org

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Sun, Aug 11, 2019 at 7:33 AM Nathan Neff  wrote:

> I think I found the problem and have a fix!
>
> Long story short, I modified my helm-completing-read-handlers-alist
> and added an entry:
> (add-to-list 'helm-completing-read-handlers-alist
> `(org-set-tags-command . helm-org-completing-read-tags)
> )
>
> I have all the gory details here:
> https://github.com/emacs-helm/helm/issues/2183
>
> Thanks all for your help, hope this helps someone else too :)
> --Nate
>
>
>
> On Sat, Aug 10, 2019 at 4:01 PM Nathan Neff  wrote:
>
>>
>>
>> On Sat, Aug 10, 2019 at 3:44 PM Nathan Neff 
>> wrote:
>>
>>> Hello all,
>>>
>>> I created a VM, installed Emacs 26.2 fresh, and installed various
>>> versions
>>> of org-mode using the tar.gz files from https://orgmode.org/
>>>
>>> I replaced org-mode in /usr/share/emacs/26.2/lisp/org with various older
>>> versions until I found the version of org-mode that breaks the helm tags
>>> completion.
>>>
>>> I found that the latest version of org where the feature works is
>>> Org-mode version 9.1.9.
>>>
>>
>> Oops - my aplogies - I assumed that the org-versions stopped at 9.1.9.  I
>> tested Org 9.1.14 which (to
>> my knowledge) is the last of the 9.1.X versions, and Org 9.1.14 works
>> correctly.
>>
>> I tested Org version 9.2 and Org version 9.2 is the version that breaks
>> the tags functionality
>> from Helm.
>>
>>
>>
>>> I will spelunk around in the code to see what might have changed the
>>> behavior - if anyone has
>>> suggestions or doesn't have this problem with an older version of org,
>>> please let me know - it could
>>> easily be something that I have set incorrectly.
>>>
>>> Thanks,
>>> --Nate
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Fri, Aug 9, 2019 at 4:28 PM Nathan Neff 
>>> wrote:
>>>
 Hello all,

 I'm hitting this problem with Org-mode 9.2.5:
 https://groups.google.com/forum/#!topic/emacs-helm/tA6cn6TUdRY

 Problem synopsis:  When I use org-set-tags on a heading
 with no tags, Helm gives me the correct prompt w/a list of all my tags.
 After I have entered a single tag, then no more Helm suggestions are
 offered.  This is the bug, and it was fixed at some point.

 Helm + org-mode *work correctly* when I run emacs using
 the elpa/helm-20190726/emacs-helm.sh script which comes with Helm
 for debugging purposes.  I notice that the org-version in the *working*
 example
 is 9.1.9 (which is, I presume) the stock org-mode that comes with Emacs.

 I have reproduced this problem on both Linux and OSX.

 Can anyone suggest a next step to take?

 Thanks,
 --Nate




[O] ob-clojure can't cross source block handle :var in :noweb source block

2019-08-27 Thread numbch...@gmail.com
I have bellowing example:
```org
#+NAME: read-in-wxid
#+begin_src clojure :var cwd=(file-truename "~/Documents/WeChat/wxid/")
(require '[clojure.java.io :as io])

(def directory (io/file cwd))
(def files (filter #(.isFile %) (file-seq directory)))
#+end_src

#+RESULTS[<2019-08-28 09:12:24> 84a1210d836742ca71c776aaebba0e0224af]:
read-in-wxid
: #'user/files

#+begin_src clojure :noweb yes :results pp
<>
(take 3 files)
#+end_src

#+RESULTS[<2019-08-28 09:12:30> 9bbcd9f779f72bdd9b7bb8fb85aa36bbdfee7e3c]:
: class clojure.lang.Compiler$CompilerExceptionclass
clojure.lang.Compiler$CompilerExceptionSyntax error compiling at (*Org Src
Code.org[ clojure ]*:3:16).
: Unable to resolve symbol: cwd in this context
```

You can see it can't resole first source block's `:var` definition.

I'm using:
- GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.8) of
2019-04-13
- Org mode version 9.2.1 (release_9.2.1-274-ge3b7c3.dirty @
/home/stardiviner/Code/Emacs/org-mode/lisp/)

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] org-notify dbus send message to KDE/Plasma caused desktop suspend

2019-09-10 Thread numbch...@gmail.com
org-notify dbus send message to KDE/Plasma caused desktop suspend and high
CPU,memory resources.

Here is my config:
```elisp
(setq org-notify-audible nil)
(org-notify-add 'default
'(:time "1h" :period "1h" :duration 8
:actions (-ding -notify/window)
:audible t))
(org-notify-start (* 60 2))
```

When I have about 10 deadline tasks to be reminded at once, dbus suspend
desktop soon because send dbus message too fast?

Maybe add a sequence delay to improve this situation?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] org-notify dbus send message to KDE/Plasma caused desktop suspend

2019-09-13 Thread numbch...@gmail.com
Yes, my "suspend" means some part of the Plasma UI is freezing and causing
high CPU usage. :)

I will try to reproduce this bug with command `dbus-send`. And file a issue
report to KDE.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Thu, Sep 12, 2019 at 5:52 AM Adam Porter  wrote:

> "numbch...@gmail.com"  writes:
>
> > org-notify dbus send message to KDE/Plasma caused desktop suspend and
> high CPU,memory resources.
> >
> > Here is my config:
> > ```elisp
> > (setq org-notify-audible nil)
> > (org-notify-add 'default
> > '(:time "1h" :period "1h" :duration 8
> > :actions (-ding -notify/window)
> > :audible t))
> > (org-notify-start (* 60 2))
> > ```
> >
> > When I have about 10 deadline tasks to be reminded at once, dbus suspend
> desktop soon because send dbus message too fast?
> >
> > Maybe add a sequence delay to improve this situation?
>
> That workaround might be helpful, but it sounds like a bug somewhere
> else in the Plasma/dbus/etc. stack.  I recommend trying to reproduce it
> with e.g. the notify-send shell command; if you can, you'll know the bug
> isn't with Emacs/Org.
>
> I recommend filing a bug report with KDE, or perhaps with your Linux
> distro as a first step.
>
> By the way, I'm not sure what you mean by "desktop suspend."  The word
> "suspend" is typically used to mean putting the system into a low-power
> sleep state, but I'm guessing you mean that some part of the Plasma UI
> is freezing and causing high CPU usage.
>
>
>


Re: [PATCH] Fix ob-python.el initiate session error with py-shell

2020-02-18 Thread numbch...@gmail.com
Yes, Jack, as Bastien said, you can format my commit, because my home
network is broken, I'm using Mobile Phone's 4G network to get online. Can't
get update immediately.
And thanks for tips about `python-mode' is deprecated. I didn't know that.
I will migrate to `python.el'.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Wed, Feb 19, 2020 at 1:18 AM Jack Kamm  wrote:

> Hi stardiviner,
>
> Sorry for the noise, I have some additional comments below:
>
> When I run "make compile", I get the following message:
>
> In org-babel-python-initiate-session-by-key:
> ob-python.el:211:12:Warning: py-shell called with 9 arguments, but accepts
> only 0-1
>
> I think this is because the "(declare-function py-shell)" no longer
> matches the signature of the upstream py-shell function you're using.
>
> Also, I now see that the commit does have a changelog entry, but not a
> commit message. Unless it is standard to take the subject line as the
> commit message? I am still a little new to merging patches from email,
> and might not have all the proper tooling setup for it.
>
> When you update the patch, please mention that this is specifically for
> python-mode.el in the commit message and changelog entry.
>


Re: [O] [Feature Request] Provide a way to jump to noweb reference definition under point

2017-08-15 Thread numbch...@gmail.com
@Thanks Berry, and Nicolas.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Aug 14, 2017 at 1:02 AM, Nicolas Goaziou 
wrote:

> Hello,
>
> "Berry, Charles"  writes:
>
> > However, there is a bug in either ~org-next-block~ or
> > ~org-babel-src-block-names~ that causes failure of
> > `org-babel-src-block-names' to pick up the first block when it starts
> > in the first line of a buffer or at ~(point-min)~.
>
> Fixed. Thank you.
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] [RFC] Remove Org Struct mode

2017-08-20 Thread numbch...@gmail.com
I agree too, because the OrgStruct mode functions is so limited for basic
Org-mode viewing/editing/navigating etc.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Aug 21, 2017 at 6:06 AM, Tim Cross  wrote:

>
> One of the reasons I moved to using mu4e for email was because I was
> told I could use orgStruct mode and write my email using org structured
> editing.
>
> The reality has been somewhat disappointing. One of the main things I
> wanted was better handling of lists and this is one area of orgstruct
> mode which certainly doesn't work correctly.
>
> So, given what you say and the fact the mode isn't working as
> advertised, I tend to agree. Just adding a note to my org task list to
> look at outshine.el, which I wasn't aware of. If I really need org
> structural editing for writing an email, I'll write it in an org-mode
> file and then transfer it to a message buffer - as you point out, there
> is lots in org mode which makes no sense in an email buffer anyway!
>
> Tim
>
> Nicolas Goaziou writes:
>
> > Hello,
> >
> > I would like to remove Org Struct minor mode from Org code base. Here is
> > the rationale:
> >
> > 1. It is broken. It might look like using Org in another buffer, but it
> >is not. In particular, it just cannot cope with lists, indentation,
> >filling in, e.g., Message mode, as soon as we try something
> >non-trivial. Really, that's a poor-man's Org mode.
> >
> > 2. Its implementation is very hackish. In particular, it is not modular
> >at all. It rewrites some core functions according to the major mode
> >in use. For example `org-fill-function' tries to handle specially
> >text in a Message mode buffer, basically short-circuiting regular
> >behaviour. There no support for other major modes. If we want some,
> >we need to hard-code it.
> >
> > 3. Due to previous point, some basic Org functions are sub-optimal
> >because they preserve compatibility with Org Struct mode. For example
> >`org-forward-heading-same-level' must process every headline past the
> >current one and check their level until an appropriate one is found.
> >It would be faster to go looking for the next headline according to
> >the number of stars we want.
> >
> > 4. It is somewhat outside Org mode's scope to provide such a feature. It
> >is tempting to provide everything we can think of, but we should
> >focus on the main task: handle Org files, i.e., files written in Org
> >compatible syntax.
> >
> > 5. There are alternatives. E.g., outshine.el, outline-minor-mode, ...
> >
> > I _do_ use `orgstruct++-mode'. But it is broken beyond repair.
> > Alternatives, which do not need to pay a technical debt, are certainly
> > better, or, at least, a saner ground for improvement.
> >
> > I'm not opposed to an Org struct mode living in ELPA. But, as pointed
> > out, it is difficult to extract from code base without rewriting it
> > completely. If alternatives are serious enough, that would be
> > re-inventing the wheel, too.
> >
> > The only thing that would be missing, AFAIK, is plain list handling.
> > However, I'm quite certain it is possible to re-use most code from
> > "org-list.el", using a dumbed down `org-list-struct' function. Indeed,
> > currently, `org-list-struct' requires to know about inlinetasks,
> > drawers, blocks... i.e., most of the Org syntax. This is not an option
> > in foreign buffers. Once `org-list-struct' (and maybe `org-in-item-p')
> > are simplified, other functions in "org-list.el" can be used as is.
> >
> > I'm not talking about OrgTbl mode (yet). OrgTbl mode is different: it
> > doesn't suffer from points 1, 3 end 5. It is easier to extract it as an
> > external library, which someone should ultimately do.
> >
> > To sum it up, I offer to remove `orgstruct-mode' (and
> > `orgstruct++-mode') from the code base. I can also offer my help to
> > anyone willing to extract some `list-minor-mode' and `table-minor-mode'
> > from Org.
> >
> > WDYT?
> >
> >
> > Regards,
>
>
> --
> Tim Cross
>
>


[O] The new function org-insert-structure-template is not following option org-babel-capitalize-example-region-markers

2017-11-09 Thread numbch...@gmail.com
RT.
Hope Org-mode can fix this issue.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] function for inserting a block

2017-11-11 Thread numbch...@gmail.com
+1 I added a snippet for `  GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sun, Nov 12, 2017 at 12:35 PM, Matt Lundin  wrote:

> Carsten Dominik  writes:
>
> > I have always come down on the side of NOT breaking backward
> > compatibility unless we really HAVE TO in order to make progress. The
> > reason for this bias is because most Org users are not reading this
> > maling list and just want the system to function and to continue to
> > function the way they are used to, while it is hopefully improving. It
> > will stop them from upgrading if such breakage happens too often.
> >
> > So I would support reimplement the expansion (including
> > org-try-structure-completion for people who use that in custom code),
> > if possible of course on the back of one of the built-in expansion
> > systems in Emacs, before pushing this change out in a release. I would
> > certainly reimplement this in some way for myself, because using these
> > abbreviations is already hardcoded in my spine, I think.
>
> I agree. I support removing redundant code behind the scenes, but I also
> think we should preserve backwards compatibility in the user interface.
> A fair number of people around here have been using Org Mode for more
> than a decade, and, for better or for worse, everything about the user
> interface is now hardwired in their brains.
>
> In short, we have a time-saving expansion system that works well for
> lots of people. I support re-implementing it on top of another snippet
> engine but also leaving it in place until a suitable replacement is
> ready.
>
> Matt
>
>
>


Re: [O] Org-mode link returned path is truncated when contains space

2017-11-11 Thread numbch...@gmail.com
sorry for delay reply. I'm cleaning up my Org tasks, found this task. this
issue seems fixed.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, Jun 6, 2017 at 6:49 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> "numbch...@gmail.com"  writes:
>
> > I checked Org-mode package version with `org-version`, get `9.0.7`, still
> > have this issue. I updated to latest org-mode ELPA version.
>
> Odd. You may have better luck with Org 9.0.8 then. In particular, commit
> 2d29269bb1b9af08011e091913798b6598e4b156 should prevent path from being
> truncated.
>
> Please report back if it works better (or not).
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] function for inserting a block

2017-11-15 Thread numbch...@gmail.com
I think the function `org-insert-structure-template' also should respect
the `org-babel-uppercase-example-markers'.
Besides, your new diff does not have a condition on
`org-babel-uppercase-example-markers', you just use `upcase-initials` by
default. Then the new `tempo` snippets will be uppercase, but the
`org-insert-structure-template` inserted templates will be different.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Nov 15, 2017 at 5:36 AM, Eric Abrahamsen 
wrote:

> "Thomas S. Dye"  writes:
>
> > Eric Abrahamsen writes:
> >
> >> Rasmus  writes:
> >>
> >>> Hi Eric,
> >>>
> >>> Eric Abrahamsen  writes:
> >>>
> > Also, Eric, it seems that org-structure-template-alist only supports
> a
> > single letter for short-hands (the car of an entry in
> > org-structure-template-alist is a char).  I used to have blocks like
> " > expanding to an "abstract" special-block, which I guess isn’t
> possible
> > anymore?
> 
>  I hadn't thought of that. Really, all I ever wanted was to wrap things
>  in blocks...
> 
>  I don't see any reason why org-structure-template-alist couldn't go
> back
>  to using string keys. Then we could use read-string, and wouldn't have
>  to have special  behavior -- a string that didn't exist in the
>  alist could just be used literally to make a block.
> >>>
> >>> I’d prefer that.  For some special blocks, a few characters might
> makes it
> >>> more intuitive, e.g. "def" → "definition", "hyp" → "hypothesis" etc.
> >>
> >> Here's the simplest solution.
> >>
> >> There still remains the fact that `org-structure-template-alist' has
> >> changed format, and `org-try-structure-completion' no longer exists.
> >> That may still annoy some people who were using the internals of the
> >> process, but...
> >
> > Would something like this work?
> >
> > (defun org-try-structure-completion ()
> >   (tempo-complete-tag))
>
> Here's the newest version!
>
> It incorporates Rasmus' org-tempo.el file, with modifications, and
> Thomas' suggestion to re-instate `org-try-structure-completion', and,
> erm, stardiviner's request to honor
> `org-babel-uppercase-example-markers'.
>
> Remaining issues:
>
> 1. The "org-include" tempo template doesn't work, for reasons I don't
>understand (I've never used tempo before). Nothing happens when I hit
>.
> 2. Now it seems like there should be completion when prompting for a
>string key. Feature creep! But likely worthwhile feature creep.
> 3. I've rather rashly renamed the relevant customization options
>`org-structure-block-alist' (for blocks added via
>`org-insert-structure-template') and `org-structure-keyword-alist'
>(for keywords insertable via the tempo system). Perhaps this was a
>bad idea. If it's not a bad idea, maybe
>`org-insert-structure-template' should be renamed `org-insert-block'
>or something like that.
> 3. Docs need to be updated.
>
> Comments welcome!
>
> Eric
>
>


Re: [O] ob-haskell evaluation needs inf-haskell but it does not exist

2017-11-15 Thread numbch...@gmail.com
I required `(require 'inf-haskell)` But have not found the command
`inf-haskell` to start inferior process.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Nov 13, 2017 at 11:43 PM, Nick Dokos  wrote:

> stardiviner  writes:
>
> > When I execute the following Haskell src block:
> >
> > ```
> >
> > #+BEGIN_SRC haskell :session :tangle "Data/Code/hello_world.hs"
> > main :: IO ()
> > main = do
> >   putStrLn "Hello, World!"
> > #+END_SRC
> >
> > ```
> >
> > It reports error:
> >
> > ```
> >
> > Debugger entered--Lisp error: (file-missing "Cannot open load file" "No
> > such file or directory" "inf-haskell")
> >   require(inf-haskell)
>
> See my answer to this SO question:
>
>   https://stackoverflow.com/questions/42081379/how-to-set-
> up-org-babel-for-haskell-with-stack
>
> for some details on setting up the environment.
>
> --
> Nick
>
>
>


Re: [O] ob-haskell evaluation needs inf-haskell but it does not exist

2017-11-15 Thread numbch...@gmail.com
I checked out your answer, I have meet all your said requirements. GHCi,
inf-haskell (after I installed package haskell-mode) and setting
`haskell-program-name`, I found there is no `defcustom` variable option
named `haskell-program-name` at all.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Nov 15, 2017 at 9:17 PM, numbch...@gmail.com 
wrote:

> I required `(require 'inf-haskell)` But have not found the command
> `inf-haskell` to start inferior process.
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
> On Mon, Nov 13, 2017 at 11:43 PM, Nick Dokos  wrote:
>
>> stardiviner  writes:
>>
>> > When I execute the following Haskell src block:
>> >
>> > ```
>> >
>> > #+BEGIN_SRC haskell :session :tangle "Data/Code/hello_world.hs"
>> > main :: IO ()
>> > main = do
>> >   putStrLn "Hello, World!"
>> > #+END_SRC
>> >
>> > ```
>> >
>> > It reports error:
>> >
>> > ```
>> >
>> > Debugger entered--Lisp error: (file-missing "Cannot open load file" "No
>> > such file or directory" "inf-haskell")
>> >   require(inf-haskell)
>>
>> See my answer to this SO question:
>>
>>   https://stackoverflow.com/questions/42081379/how-to-set-up-
>> org-babel-for-haskell-with-stack
>>
>> for some details on setting up the environment.
>>
>> --
>> Nick
>>
>>
>>
>


Re: [O] ob-haskell evaluation needs inf-haskell but it does not exist

2017-11-17 Thread numbch...@gmail.com
I setted `haskell-process-type` to 'ghci.
I evaluated a simple haskell src block, but it reports I need have a
`*haskell*` inferior. Then I executed command [M-x run-haskell].
Then I get error:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  expand-file-name(nil)
  locate-dominating-file(nil "cabal.sandbox.config")
  haskell-process-type()
  haskell-program-name-with-args()
  inferior-haskell-start-process()
  inferior-haskell-process()
  run-haskell()
  funcall-interactively(run-haskell)
  call-interactively(run-haskell record nil)
  command-execute(run-haskell record)
  #f(compiled-function (cmd) #)("run-haskell")
  ivy-call()
  ivy-read("M-x " [special-lispy-clone
  
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  call-interactively(counsel-M-x nil nil)
  command-execute(counsel-M-x)

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Nov 15, 2017 at 11:35 PM, Nick Dokos  wrote:

> "numbch...@gmail.com"  writes:
>
> > I checked out your answer, I have meet all your said requirements. GHCi,
> inf-haskell (after I installed package haskell-mode) and setting
> `haskell-program-name`, I found there is no
> > `defcustom` variable option named `haskell-program-name` at all.
>
> You probably need to set haskell-process-type to ghci. If that works,
> please let me know and I'll update the answer on SO.
>
> >
> > [stardiviner] GPG key ID: 47C32433
> > IRC(freeenode): stardiviner Twitter:  @numbchild
> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> > Blog: http://stardiviner.github.io/
> >
> > On Wed, Nov 15, 2017 at 9:17 PM, numbch...@gmail.com <
> numbch...@gmail.com> wrote:
> >
> > I required `(require 'inf-haskell)` But have not found the command
> `inf-haskell` to start inferior process.
> >
> > [stardiviner] GPG key ID: 47C32433
> > IRC(freeenode): stardiviner Twitter:  @numbchild
> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> > Blog: http://stardiviner.github.io/
> >
> > On Mon, Nov 13, 2017 at 11:43 PM, Nick Dokos 
> wrote:
> >
> > stardiviner  writes:
> >
> > > When I execute the following Haskell src block:
> > >
> > > ```
> > >
> > > #+BEGIN_SRC haskell :session :tangle "Data/Code/hello_world.hs"
> > > main :: IO ()
> > > main = do
> > >   putStrLn "Hello, World!"
> > > #+END_SRC
> > >
> > > ```
> > >
> > > It reports error:
> > >
> > > ```
> > >
> > > Debugger entered--Lisp error: (file-missing "Cannot open load
> file" "No
> > > such file or directory" "inf-haskell")
> > >   require(inf-haskell)
> >
> > See my answer to this SO question:
> >
> >   https://stackoverflow.com/questions/42081379/how-to-set-
> up-org-babel-for-haskell-with-stack
> >
> > for some details on setting up the environment.
> >
> > --
> > Nick
> >
>
> --
> Nick
>
>
>


Re: [O] function for inserting a block

2017-11-17 Thread numbch...@gmail.com
Yeah, I misunderstand your code. Anyway, It should be like this:

#+BEGIN_SRC python
...
#+END_SRC

#+BEGIN_EXAMPLE
...
#+END_EXAMPLE

etc

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Nov 16, 2017 at 12:24 AM, Eric Abrahamsen 
wrote:

> "numbch...@gmail.com"  writes:
>
> > I think the function `org-insert-structure-template' also should
> respect the `org-babel-uppercase-example-markers'.
> > Besides, your new diff does not have a condition on
> `org-babel-uppercase-example-markers', you just use `upcase-initials` by
> default. Then the new `tempo` snippets
> > will be uppercase, but the `org-insert-structure-template` inserted
> templates will be different.
>
> I'm not entirely understanding you here -- it is
> `org-insert-structure-template' that respects
> `org-babel-uppercase-example-markers', not the tempo snippet (which was
> an omission). And none of the code is using `upcase-initials'.
>
> As far as I can see, the bug is that EXAMPLE is uppercased but the
> "begin" and "end" aren't, and also that the tempo snippet doesn't
> capitalize at all...
>


Re: [O] function for inserting a block

2017-11-17 Thread numbch...@gmail.com
Ok, I see, Just I have to replace all uppercased babels and example blocks
to lowercase to keep same.
I have a lot of org files. Huge for me.
I can take with the lower-case tag.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, Nov 18, 2017 at 3:14 AM, Eric Abrahamsen 
wrote:

> "numbch...@gmail.com"  writes:
>
> > Yeah, I misunderstand your code. Anyway, It should be like this:
> >
> > #+BEGIN_SRC python
> > ...
> > #+END_SRC
> >
> > #+BEGIN_EXAMPLE
> > ...
> > #+END_EXAMPLE
> >
> > etc
>
> If you look back up this (admittedly very long) thread, you'll see the
> general consensus is to move to lower-case tags. I've intentionally left
> things lowercase, and now will have to handle "example" specially, based
> on the value of `org-babel-uppercase-example-markers'.
>
>
>


Re: [O] Public TODO agendas

2017-11-20 Thread numbch...@gmail.com
I have similar function requirement. Based on your TRAMP method, I think
remote file are just can be transported through any protocols like HTTP,
for example remote file like http://example.org/test.org can be downloaded,
then append to org-agenda files list. This is just an rough idea.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Nov 20, 2017 at 3:54 AM, Eric S Fraga  wrote:

> On Sunday, 19 Nov 2017 at 11:10, David Arroyo Menendez wrote:
> > Hello Colin,
> >
> > org-secretary seems designed to manage teams. I want read agendas of
> > org-mode users, friends ... In Barcelona Supercomputing Center all
> > people is sharing the agendas to stimulate to the people to collaborate
> > in good ideas, I like this methodology, but I prefer use org-mode. Many
> > people in org-mode is connected with the science or creative
> > programming, perhaps is a good idea share the agenda between us.
>
> I guess one approach could be to make specific agenda files available on
> a remote server and use tramp syntax to add these files to the
> org-agenda-files variable?  (untested)  Of course, this would be limited
> to those access methods defined for tramp, i.e. ssh in practice, which
> might be quite limiting.
>
> A more general approach would be to export your agenda to Google's
> calendar or equivalent and share that and import any shared calendar
> using an ical access to these.  This is possible (my wife and I share our
> calendars that way) but not purely org.
>
>
> --
> : Eric S Fraga via Emacs 27.0.50, Org release_9.1.3-162-gde289d
>


Re: [O] Public TODO agendas

2017-11-21 Thread numbch...@gmail.com
Maybe just use an auto sync solution like Dropbox, WebDAV etc?
And add a hook on `after-save-hook` to auto export org file to HTML, then
sync HTML files.
Somewhere hosting those HTML files can be viewed. and editing those
original org files directly.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, Nov 21, 2017 at 5:07 AM, Tim Cross  wrote:

>
> I don't think tramp will work in this way, at least not without some
> sort of special client running on the remote http server and
> modifications to tramp to work with that client. The HTTP protocol will
> not easily fit with tramp - in fact, it is such a big 'disconnect'
> between tramp and http, you really would be trying to push a round peg
> into a square hole. It would be far easier to use other built-in bits of
> Emacs functionality along with some sort of remote http service agent to
> satisfy this use case (assuming you want bi-directional updates
> i.e. pull down an org file, update and push back up - just pulling down
> the file and appending it would be easy enough, but going the other way
> adds a lot of additional complexity).
>
> Perhaps this is more something which could fit in with mobile org
> efforts?
>
> Tim
>
>
>
> Eric S Fraga  writes:
>
> > On Monday, 20 Nov 2017 at 21:13, numbch...@gmail.com wrote:
> >> I have similar function requirement. Based on your TRAMP method, I think
> >> remote file are just can be transported through any protocols like HTTP,
> >> for example remote file like http://example.org/test.org can be
> downloaded,
> >> then append to org-agenda files list. This is just an rough idea.
> >
> > I am not sure this is possible.  If I try http: as the protocol, tramp
> > tells me that only localhost is allowed.  Maybe I do not have tramp
> > configured properly?
>
>
> --
> Tim Cross
>


Re: [O] Possible bug: Headings greater than level 2 stars not showing -- unable to navigate with normal commands

2017-11-26 Thread numbch...@gmail.com
Yes, I have same issue too.
- [ ] org-indent-mode display the 3rd level asterisk as bold
- [ ] I can't =[C-c C-f]=
And confirmed it is caused by commit ed06b159c | * Small fix to emphasis
fontification.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Nov 27, 2017 at 12:11 PM, Kyle Meyer  wrote:

> "Samuel W. Flint"  writes:
>
> >> Samuel W Flint writes:
> >
> >> Kyle Meyer writes:
> > KM> "Samuel W. Flint"  writes:
> > >>> Any idea what might be causing this?  I checked
> > >>> org-bullets-mode, but that doesn't seem to be it.
> >
> > KM> No, sorry.  Hopefully others might have a hunch.  I'd suggest
> > KM> that you first verify that you don't see the issue when you use
> > KM> Org without your configuration.  Assuming the problem depends on
> > KM> your config, you could then do a bisect-like debugging of your
> > KM> config to try to pinpoint the problematic part.
> >
> > SF> Well, hopefully it doesn't come to that (too damn large a
> > SF> config).
> >
> > And it didn't quite!  Turns out that setting org-hide-emphasis-markers
> > to a non-nil value was the problem.
>
> Nice, glad you found it.  I can reproduce the issue with 'emacs -Q' when
> I set org-hide-emphasis-markers to a non-nil value.
>
> Bisecting the repo, I think ed06b159c (Small fix to emphasis
> fontification, 2017-11-18) is to blame.  That patch resulted from the
> discussion at 
> .
>
> --
> Kyle
>
>


Re: [O] ob-shell and remote shells

2017-11-28 Thread numbch...@gmail.com
Off the topic, I'm curious what is the `:session` in `ob-shell` ?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, Nov 28, 2017 at 4:45 PM, Michael Welle  wrote:

> Hello,
>
> I want to execute shell blocks like follows:
>
> #+BEGIN_SRC shell :session n42 :dir /127.0.0.1: :shebang "#!/bin/bash"
> echo los
> echo $SHELL
> echo $BASH
> echo ready
> #+end_src
>
> The trouble is that the shebang property doesn't work in this case. The
> script is executed with the login shell of the user and fails because of
> syntax errors (for instance, if bashisms are used in the script).
>
> With my minimal and dangerous knowledge about Org's source code ;), I
> think the following might work (from ob-shell.el):
>
> (defun org-babel-sh-initiate-session (&optional session _params)
>   "Initiate a session named SESSION according to PARAMS."
>   (when (and session (not (string= session "none")))
> (save-window-excursion
>   (or (org-babel-comint-buffer-livep session)
>   (progn
> (let ((explicit-shell-file-name (xxx)))
> (shell session))
> ;; Needed for Emacs 23 since the marker is initially
> ;; undefined and the filter functions try to use it without
> ;; checking.
> (set-marker comint-last-output-start (point))
> (get-buffer (current-buffer)))
>
>
> Note the let form. Further tasks that have to be done is to add the
> shebang key to _params, which I hope is available at all places where
> o-b-s-i-s is evaluated. Further at (xxx) a regexp etc. is needed to
> transform the shebang line to a shell path suitable for e-s-f-n.
>
> Any opinions, please? Depending on the opinions I will implement the
> approach this week and see if it works as expected.
>
> Regards
> hmw
>
>


  1   2   >